summaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authornobody <>2002-06-15 12:26:33 +0000
committernobody <>2002-06-15 12:26:33 +0000
commit2c830de8f260ebb1feb0b13c17eefdf12722d9f7 (patch)
tree5d09e3d1de5fadbc55de87767b0a9eed41d4636f /gdb/testsuite
parent554e81cff7bca83fe562cd2c841cb7562a95b6db (diff)
downloadbinutils-gdb-2c830de8f260ebb1feb0b13c17eefdf12722d9f7.tar.gz
This commit was manufactured by cvs2svn to create branch
'kseitz_interps-20020528-branch'. Cherrypick from cagney_regbuf-20020515-branch 2002-06-15 12:26:32 UTC nobody 'This commit was manufactured by cvs2svn to create branch': .cvsignore COPYING COPYING.LIB COPYING.NEWLIB MAINTAINERS README README-maintainer-mode bfd/COPYING bfd/ChangeLog-0001 bfd/ChangeLog-9193 bfd/ChangeLog-9495 bfd/ChangeLog-9697 bfd/ChangeLog-9899 bfd/MAINTAINERS bfd/PORTING bfd/README bfd/TODO bfd/aix386-core.c bfd/aout-arm.c bfd/aout-cris.c bfd/aout-encap.c bfd/aout-ns32k.c bfd/aout-sparcle.c bfd/aout0.c bfd/aout32.c bfd/aout64.c bfd/aoutf1.h bfd/aoutx.h bfd/archive.c bfd/archive64.c bfd/armnetbsd.c bfd/bfd-in.h bfd/cache.c bfd/cf-i386lynx.c bfd/cf-m68klynx.c bfd/cf-sparclynx.c bfd/cisco-core.c bfd/coff-a29k.c bfd/coff-alpha.c bfd/coff-apollo.c bfd/coff-aux.c bfd/coff-go32.c bfd/coff-h8300.c bfd/coff-h8500.c bfd/coff-i386.c bfd/coff-i860.c bfd/coff-i960.c bfd/coff-ia64.c bfd/coff-m68k.c bfd/coff-m88k.c bfd/coff-mcore.c bfd/coff-mips.c bfd/coff-or32.c bfd/coff-pmac.c bfd/coff-ppc.c bfd/coff-sparc.c bfd/coff-stgo32.c bfd/coff-svm68k.c bfd/coff-tic30.c bfd/coff-tic54x.c bfd/coff-tic80.c bfd/coff-u68k.c bfd/coff-w65.c bfd/coff-we32k.c bfd/coff-z8k.c bfd/coffgen.c bfd/cofflink.c bfd/coffswap.h bfd/configure.com bfd/configure.host bfd/corefile.c bfd/cpu-a29k.c bfd/cpu-alpha.c bfd/cpu-arc.c bfd/cpu-arm.c bfd/cpu-avr.c bfd/cpu-cris.c bfd/cpu-d10v.c bfd/cpu-d30v.c bfd/cpu-fr30.c bfd/cpu-h8300.c bfd/cpu-h8500.c bfd/cpu-hppa.c bfd/cpu-i370.c bfd/cpu-i386.c bfd/cpu-i860.c bfd/cpu-i960.c bfd/cpu-ia64-opc.c bfd/cpu-ia64.c bfd/cpu-m10200.c bfd/cpu-m10300.c bfd/cpu-m32r.c bfd/cpu-m68hc11.c bfd/cpu-m68hc12.c bfd/cpu-m68k.c bfd/cpu-m88k.c bfd/cpu-mcore.c bfd/cpu-mmix.c bfd/cpu-ns32k.c bfd/cpu-openrisc.c bfd/cpu-or32.c bfd/cpu-pdp11.c bfd/cpu-pj.c bfd/cpu-powerpc.c bfd/cpu-rs6000.c bfd/cpu-s390.c bfd/cpu-sh.c bfd/cpu-sparc.c bfd/cpu-tic30.c bfd/cpu-tic54x.c bfd/cpu-tic80.c bfd/cpu-v850.c bfd/cpu-vax.c bfd/cpu-w65.c bfd/cpu-we32k.c bfd/cpu-xstormy16.c bfd/cpu-z8k.c bfd/demo64.c bfd/dep-in.sed bfd/doc/Makefile.am bfd/doc/bfd.texinfo bfd/doc/bfdint.texi bfd/doc/bfdsumm.texi bfd/doc/doc.str bfd/doc/header.sed bfd/doc/makefile.vms bfd/doc/proto.str bfd/dwarf1.c bfd/dwarf2.c bfd/ecoff.c bfd/ecofflink.c bfd/ecoffswap.h bfd/efi-app-ia32.c bfd/efi-app-ia64.c bfd/elf-hppa.h bfd/elf-m10200.c bfd/elf-m10300.c bfd/elf-strtab.c bfd/elf32-arc.c bfd/elf32-avr.c bfd/elf32-cris.c bfd/elf32-d10v.c bfd/elf32-d30v.c bfd/elf32-fr30.c bfd/elf32-gen.c bfd/elf32-h8300.c bfd/elf32-hppa.c bfd/elf32-hppa.h bfd/elf32-i370.c bfd/elf32-i386qnx.c bfd/elf32-i860.c bfd/elf32-i960.c bfd/elf32-m32r.c bfd/elf32-m68hc11.c bfd/elf32-m68hc12.c bfd/elf32-m88k.c bfd/elf32-mcore.c bfd/elf32-openrisc.c bfd/elf32-or32.c bfd/elf32-pj.c bfd/elf32-ppc.c bfd/elf32-s390.c bfd/elf32-sh-lin.c bfd/elf32-sh-nbsd.c bfd/elf32-sh.c bfd/elf32-sh64-com.c bfd/elf32-sh64-nbsd.c bfd/elf32-sh64.c bfd/elf32-sparc.c bfd/elf32-v850.c bfd/elf32-vax.c bfd/elf32-xstormy16.c bfd/elf32.c bfd/elf64-alpha.c bfd/elf64-gen.c bfd/elf64-hppa.c bfd/elf64-hppa.h bfd/elf64-mips.c bfd/elf64-mmix.c bfd/elf64-ppc.h bfd/elf64-s390.c bfd/elf64-sh64-nbsd.c bfd/elf64-sh64.c bfd/elf64-sparc.c bfd/elf64.c bfd/elfarm-nabi.c bfd/elfarm-oabi.c bfd/elfcode.h bfd/elfcore.h bfd/elflink.c bfd/elfxx-mips.h bfd/epoc-pe-arm.c bfd/epoc-pei-arm.c bfd/format.c bfd/freebsd.h bfd/gen-aout.c bfd/genlink.h bfd/go32stub.h bfd/host-aout.c bfd/hosts/alphalinux.h bfd/hosts/alphavms.h bfd/hosts/decstation.h bfd/hosts/delta68.h bfd/hosts/dpx2.h bfd/hosts/hp300bsd.h bfd/hosts/i386bsd.h bfd/hosts/i386linux.h bfd/hosts/i386mach3.h bfd/hosts/i386sco.h bfd/hosts/i860mach3.h bfd/hosts/m68kaux.h bfd/hosts/m68klinux.h bfd/hosts/m88kmach3.h bfd/hosts/mipsbsd.h bfd/hosts/mipsmach3.h bfd/hosts/news-mips.h bfd/hosts/news.h bfd/hosts/pc532mach.h bfd/hosts/riscos.h bfd/hosts/symmetry.h bfd/hosts/tahoe.h bfd/hosts/vaxbsd.h bfd/hosts/vaxult.h bfd/hosts/vaxult2.h bfd/hp300bsd.c bfd/hp300hpux.c bfd/hppabsd-core.c bfd/hpux-core.c bfd/i386aout.c bfd/i386bsd.c bfd/i386dynix.c bfd/i386freebsd.c bfd/i386linux.c bfd/i386lynx.c bfd/i386mach3.c bfd/i386netbsd.c bfd/init.c bfd/irix-core.c bfd/libaout.h bfd/libbfd.c bfd/libcoff-in.h bfd/libcoff.h bfd/libhppa.h bfd/libieee.h bfd/libnlm.h bfd/liboasys.h bfd/libpei.h bfd/libxcoff.h bfd/lynx-core.c bfd/m68k4knetbsd.c bfd/m68klinux.c bfd/m68klynx.c bfd/m68knetbsd.c bfd/m88kmach3.c bfd/makefile.vms bfd/merge.c bfd/mipsbsd.c bfd/mpw-config.in bfd/mpw-make.sed bfd/netbsd-core.c bfd/netbsd.h bfd/newsos3.c bfd/nlm.c bfd/nlm32-alpha.c bfd/nlm32-i386.c bfd/nlm32-ppc.c bfd/nlm32-sparc.c bfd/nlm32.c bfd/nlm64.c bfd/nlmcode.h bfd/nlmswap.h bfd/ns32k.h bfd/ns32knetbsd.c bfd/opncls.c bfd/osf-core.c bfd/pc532-mach.c bfd/pdp11.c bfd/pe-arm.c bfd/pe-i386.c bfd/pe-mcore.c bfd/pe-mips.c bfd/pe-ppc.c bfd/pe-sh.c bfd/pei-arm.c bfd/pei-i386.c bfd/pei-mcore.c bfd/pei-mips.c bfd/pei-ppc.c bfd/pei-sh.c bfd/peicode.h bfd/po/.cvsignore bfd/po/BLD-POTFILES.in bfd/po/Make-in bfd/po/SRC-POTFILES.in bfd/po/bfd.pot bfd/po/es.po bfd/po/fr.po bfd/po/ja.po bfd/po/sv.po bfd/po/tr.po bfd/ptrace-core.c bfd/reloc16.c bfd/riscix.c bfd/sco5-core.c bfd/som.h bfd/sparclinux.c bfd/sparclynx.c bfd/sparcnetbsd.c bfd/stab-syms.c bfd/stabs.c bfd/stamp-h.in bfd/sunos.c bfd/sysdep.h bfd/targmatch.sed bfd/trad-core.c bfd/vax1knetbsd.c bfd/vaxnetbsd.c bfd/vms-gsd.c bfd/vms-hdr.c bfd/vms-misc.c bfd/vms-tir.c bfd/vms.h bfd/xcoff-target.h bfd/xcofflink.c config.if config/mh-a68bsd config/mh-aix386 config/mh-armpic config/mh-cxux config/mh-cygwin config/mh-decstation config/mh-delta88 config/mh-djgpp config/mh-elfalphapic config/mh-hp300 config/mh-hpux config/mh-hpux8 config/mh-i370pic config/mh-ia64pic config/mh-interix config/mh-irix5 config/mh-irix6 config/mh-lynxrs6k config/mh-m68kpic config/mh-mingw32 config/mh-ncr3000 config/mh-ncrsvr43 config/mh-necv4 config/mh-openedition config/mh-papic config/mh-ppcpic config/mh-riscos config/mh-s390pic config/mh-sco config/mh-solaris config/mh-sparcpic config/mh-sysv config/mh-sysv4 config/mh-sysv5 config/mh-x86pic config/mpw-mh-mpw config/mpw/ChangeLog config/mpw/MoveIfChange config/mpw/README config/mpw/forward-include config/mpw/g-mpw-make.sed config/mpw/mpw-touch config/mpw/mpw-true config/mpw/null-command config/mpw/open-brace config/mpw/tr-7to8-src config/mpw/true config/mt-aix43 config/mt-alphaieee config/mt-d30v config/mt-linux config/mt-netware config/mt-ospace config/mt-v810 config/mt-wince djunpack.bat etc/ChangeLog etc/Makefile.in etc/add-log.el etc/add-log.vi etc/configbuild.ein etc/configbuild.fig etc/configbuild.jin etc/configbuild.tin etc/configdev.ein etc/configdev.fig etc/configdev.jin etc/configdev.tin etc/configure etc/configure.in etc/configure.texi etc/fdl.texi etc/make-stds.texi etc/standards.texi etc/texi2pod.pl gdb/29k-share/README gdb/29k-share/udi/udi2go32.c gdb/29k-share/udi/udiids.h gdb/29k-share/udi/udip2soc.c gdb/29k-share/udi/udiphcfg.h gdb/29k-share/udi/udiphunix.h gdb/29k-share/udi/udiproc.h gdb/29k-share/udi/udipt29k.h gdb/29k-share/udi/udiptcfg.h gdb/29k-share/udi/udisoc.h gdb/29k-share/udi/udr.c gdb/29k-share/udi_soc gdb/CONTRIBUTE gdb/COPYING gdb/ChangeLog-1990 gdb/ChangeLog-1991 gdb/ChangeLog-1992 gdb/ChangeLog-1993 gdb/ChangeLog-1994 gdb/ChangeLog-1995 gdb/ChangeLog-1996 gdb/ChangeLog-1997 gdb/ChangeLog-1998 gdb/ChangeLog-1999 gdb/ChangeLog-2000 gdb/ChangeLog-2001 gdb/ChangeLog-3.x gdb/README gdb/TODO gdb/a68v-nat.c gdb/abug-rom.c gdb/acconfig.h gdb/acinclude.m4 gdb/aclocal.m4 gdb/ada-exp.tab.c gdb/ada-exp.y gdb/ada-lang.h gdb/ada-lex.c gdb/ada-lex.l gdb/ada-tasks.c gdb/ada-typeprint.c gdb/ada-valprint.c gdb/alpha-nat.c gdb/alphabsd-nat.c gdb/alphabsd-tdep.c gdb/alphabsd-tdep.h gdb/annotate.c gdb/annotate.h gdb/arc-tdep.c gdb/arch-utils.c gdb/arch-utils.h gdb/arm-linux-nat.c gdb/armnbsd-nat.c gdb/avr-tdep.c gdb/ax-gdb.c gdb/ax-gdb.h gdb/ax-general.c gdb/ax.h gdb/bcache.c gdb/bcache.h gdb/breakpoint.c gdb/breakpoint.h gdb/buildsym.c gdb/buildsym.h gdb/builtin-regs.c gdb/builtin-regs.h gdb/c-typeprint.c gdb/c-valprint.c gdb/call-cmds.h gdb/ch-exp.c gdb/ch-lang.c gdb/ch-lang.h gdb/ch-typeprint.c gdb/ch-valprint.c gdb/cli-out.c gdb/cli-out.h gdb/cli/cli-cmds.c gdb/cli/cli-cmds.h gdb/cli/cli-decode.c gdb/cli/cli-decode.h gdb/cli/cli-dump.h gdb/cli/cli-script.c gdb/cli/cli-script.h gdb/cli/cli-setshow.c gdb/cli/cli-setshow.h gdb/cli/cli-utils.c gdb/cli/cli-utils.h gdb/coff-solib.c gdb/coff-solib.h gdb/coffread.c gdb/command.h gdb/complaints.c gdb/complaints.h gdb/completer.c gdb/completer.h gdb/config.in gdb/config/alpha/alpha-linux.mh gdb/config/alpha/alpha-linux.mt gdb/config/alpha/alpha-osf1.mh gdb/config/alpha/alpha-osf1.mt gdb/config/alpha/alpha-osf2.mh gdb/config/alpha/alpha-osf3.mh gdb/config/alpha/fbsd.mh gdb/config/alpha/fbsd.mt gdb/config/alpha/nbsd.mh gdb/config/alpha/nbsd.mt gdb/config/alpha/nm-fbsd.h gdb/config/alpha/nm-linux.h gdb/config/alpha/nm-osf.h gdb/config/alpha/nm-osf2.h gdb/config/alpha/nm-osf3.h gdb/config/alpha/tm-alpha.h gdb/config/alpha/tm-alphalinux.h gdb/config/alpha/tm-fbsd.h gdb/config/alpha/xm-alphalinux.h gdb/config/alpha/xm-alphaosf.h gdb/config/arc/arc.mt gdb/config/arc/tm-arc.h gdb/config/arm/embed.mt gdb/config/arm/linux.mh gdb/config/arm/linux.mt gdb/config/arm/nm-linux.h gdb/config/arm/tm-arm.h gdb/config/arm/tm-embed.h gdb/config/arm/tm-linux.h gdb/config/arm/tm-wince.h gdb/config/arm/wince.mt gdb/config/arm/xm-linux.h gdb/config/arm/xm-nbsd.h gdb/config/cris/cris.mt gdb/config/cris/tm-cris.h gdb/config/d10v/d10v.mt gdb/config/d30v/d30v.mt gdb/config/d30v/tm-d30v.h gdb/config/djgpp/README gdb/config/djgpp/config.sed gdb/config/djgpp/djcheck.sh gdb/config/djgpp/djconfig.sh gdb/config/fr30/fr30.mt gdb/config/fr30/tm-fr30.h gdb/config/h8300/h8300.mt gdb/config/h8500/h8500.mt gdb/config/h8500/tm-h8500.h gdb/config/i386/cygwin.mh gdb/config/i386/cygwin.mt gdb/config/i386/embed.mt gdb/config/i386/fbsd.mh gdb/config/i386/fbsd.mt gdb/config/i386/gdbserve.mt gdb/config/i386/go32.mh gdb/config/i386/go32.mt gdb/config/i386/i386aix.mh gdb/config/i386/i386aix.mt gdb/config/i386/i386aout.mt gdb/config/i386/i386bsd.mh gdb/config/i386/i386bsd.mt gdb/config/i386/i386dgux.mh gdb/config/i386/i386gnu.mh gdb/config/i386/i386gnu.mt gdb/config/i386/i386lynx.mh gdb/config/i386/i386lynx.mt gdb/config/i386/i386m3.mh gdb/config/i386/i386m3.mt gdb/config/i386/i386mach.mh gdb/config/i386/i386mk.mh gdb/config/i386/i386mk.mt gdb/config/i386/i386nw.mt gdb/config/i386/i386os9k.mt gdb/config/i386/i386sco.mh gdb/config/i386/i386sco4.mh gdb/config/i386/i386sco5.mh gdb/config/i386/i386sco5.mt gdb/config/i386/i386sol2.mh gdb/config/i386/i386sol2.mt gdb/config/i386/i386v.mh gdb/config/i386/i386v.mt gdb/config/i386/i386v32.mh gdb/config/i386/i386v4.mh gdb/config/i386/i386v4.mt gdb/config/i386/i386v42mp.mh gdb/config/i386/i386v42mp.mt gdb/config/i386/linux.mh gdb/config/i386/linux.mt gdb/config/i386/ncr3000.mh gdb/config/i386/ncr3000.mt gdb/config/i386/nm-fbsd.h gdb/config/i386/nm-gnu.h gdb/config/i386/nm-i386.h gdb/config/i386/nm-i386aix.h gdb/config/i386/nm-i386bsd.h gdb/config/i386/nm-i386lynx.h gdb/config/i386/nm-i386mach.h gdb/config/i386/nm-i386sco.h gdb/config/i386/nm-i386sco4.h gdb/config/i386/nm-i386sco5.h gdb/config/i386/nm-i386sol2.h gdb/config/i386/nm-i386v.h gdb/config/i386/nm-i386v4.h gdb/config/i386/nm-i386v42mp.h gdb/config/i386/nm-linux.h gdb/config/i386/nm-m3.h gdb/config/i386/nm-obsd.h gdb/config/i386/nm-ptx4.h gdb/config/i386/nm-symmetry.h gdb/config/i386/nm-x86-64.h gdb/config/i386/obsd.mh gdb/config/i386/obsd.mt gdb/config/i386/ptx.mh gdb/config/i386/ptx.mt gdb/config/i386/ptx4.mh gdb/config/i386/ptx4.mt gdb/config/i386/symmetry.mh gdb/config/i386/symmetry.mt gdb/config/i386/tm-cygwin.h gdb/config/i386/tm-fbsd.h gdb/config/i386/tm-go32.h gdb/config/i386/tm-i386.h gdb/config/i386/tm-i386aix.h gdb/config/i386/tm-i386bsd.h gdb/config/i386/tm-i386gnu.h gdb/config/i386/tm-i386lynx.h gdb/config/i386/tm-i386m3.h gdb/config/i386/tm-i386mk.h gdb/config/i386/tm-i386nw.h gdb/config/i386/tm-i386os9k.h gdb/config/i386/tm-i386sco5.h gdb/config/i386/tm-i386sol2.h gdb/config/i386/tm-i386v.h gdb/config/i386/tm-i386v4.h gdb/config/i386/tm-i386v42mp.h gdb/config/i386/tm-linux.h gdb/config/i386/tm-obsd.h gdb/config/i386/tm-ptx.h gdb/config/i386/tm-ptx4.h gdb/config/i386/tm-symmetry.h gdb/config/i386/tm-vxworks.h gdb/config/i386/vxworks.mt gdb/config/i386/x86-64linux.mh gdb/config/i386/x86-64linux.mt gdb/config/i386/xm-cygwin.h gdb/config/i386/xm-go32.h gdb/config/i386/xm-i386.h gdb/config/i386/xm-i386aix.h gdb/config/i386/xm-i386bsd.h gdb/config/i386/xm-i386gnu.h gdb/config/i386/xm-i386m3.h gdb/config/i386/xm-i386mach.h gdb/config/i386/xm-i386mk.h gdb/config/i386/xm-i386sco.h gdb/config/i386/xm-i386v.h gdb/config/i386/xm-i386v32.h gdb/config/i386/xm-i386v4.h gdb/config/i386/xm-nbsd.h gdb/config/i386/xm-ptx.h gdb/config/i386/xm-ptx4.h gdb/config/i386/xm-symmetry.h gdb/config/i960/mon960.mt gdb/config/i960/nindy960.mt gdb/config/i960/tm-i960.h gdb/config/i960/tm-mon960.h gdb/config/i960/tm-nindy960.h gdb/config/i960/tm-vx960.h gdb/config/i960/vxworks960.mt gdb/config/ia64/aix.mh gdb/config/ia64/aix.mt gdb/config/ia64/linux.mh gdb/config/ia64/linux.mt gdb/config/ia64/nm-aix.h gdb/config/ia64/nm-linux.h gdb/config/ia64/tm-aix.h gdb/config/ia64/tm-ia64.h gdb/config/ia64/tm-linux.h gdb/config/ia64/xm-aix.h gdb/config/ia64/xm-linux.h gdb/config/m32r/m32r.mt gdb/config/m32r/tm-m32r.h gdb/config/m68hc11/m68hc11.mt gdb/config/m68k/3b1.mh gdb/config/m68k/3b1.mt gdb/config/m68k/apollo68b.mh gdb/config/m68k/apollo68b.mt gdb/config/m68k/apollo68v.mh gdb/config/m68k/cisco.mt gdb/config/m68k/delta68.mh gdb/config/m68k/delta68.mt gdb/config/m68k/dpx2.mh gdb/config/m68k/dpx2.mt gdb/config/m68k/es1800.mt gdb/config/m68k/hp300bsd.mh gdb/config/m68k/hp300bsd.mt gdb/config/m68k/hp300hpux.mh gdb/config/m68k/hp300hpux.mt gdb/config/m68k/linux.mh gdb/config/m68k/linux.mt gdb/config/m68k/m68klynx.mh gdb/config/m68k/m68klynx.mt gdb/config/m68k/m68kv4.mh gdb/config/m68k/m68kv4.mt gdb/config/m68k/monitor.mt gdb/config/m68k/nm-apollo68b.h gdb/config/m68k/nm-apollo68v.h gdb/config/m68k/nm-delta68.h gdb/config/m68k/nm-dpx2.h gdb/config/m68k/nm-hp300bsd.h gdb/config/m68k/nm-hp300hpux.h gdb/config/m68k/nm-linux.h gdb/config/m68k/nm-m68klynx.h gdb/config/m68k/nm-sun2.h gdb/config/m68k/nm-sun3.h gdb/config/m68k/nm-sysv4.h gdb/config/m68k/os68k.mt gdb/config/m68k/st2000.mt gdb/config/m68k/sun2os3.mh gdb/config/m68k/sun2os3.mt gdb/config/m68k/sun2os4.mh gdb/config/m68k/sun2os4.mt gdb/config/m68k/sun3os3.mh gdb/config/m68k/sun3os3.mt gdb/config/m68k/sun3os4.mh gdb/config/m68k/sun3os4.mt gdb/config/m68k/tm-3b1.h gdb/config/m68k/tm-apollo68b.h gdb/config/m68k/tm-cisco.h gdb/config/m68k/tm-delta68.h gdb/config/m68k/tm-dpx2.h gdb/config/m68k/tm-es1800.h gdb/config/m68k/tm-hp300bsd.h gdb/config/m68k/tm-hp300hpux.h gdb/config/m68k/tm-linux.h gdb/config/m68k/tm-m68k.h gdb/config/m68k/tm-m68klynx.h gdb/config/m68k/tm-m68kv4.h gdb/config/m68k/tm-mac.h gdb/config/m68k/tm-monitor.h gdb/config/m68k/tm-os68k.h gdb/config/m68k/tm-st2000.h gdb/config/m68k/tm-sun2.h gdb/config/m68k/tm-sun2os4.h gdb/config/m68k/tm-sun3.h gdb/config/m68k/tm-sun3os4.h gdb/config/m68k/tm-vx68.h gdb/config/m68k/vxworks68.mt gdb/config/m68k/xm-3b1.h gdb/config/m68k/xm-apollo68b.h gdb/config/m68k/xm-apollo68v.h gdb/config/m68k/xm-delta68.h gdb/config/m68k/xm-dpx2.h gdb/config/m68k/xm-hp300bsd.h gdb/config/m68k/xm-hp300hpux.h gdb/config/m68k/xm-linux.h gdb/config/m68k/xm-m68k.h gdb/config/m68k/xm-m68kv4.h gdb/config/m68k/xm-nbsd.h gdb/config/m68k/xm-sun2.h gdb/config/m68k/xm-sun3.h gdb/config/m68k/xm-sun3os4.h gdb/config/m88k/delta88.mh gdb/config/m88k/delta88.mt gdb/config/m88k/delta88v4.mh gdb/config/m88k/delta88v4.mt gdb/config/m88k/m88k.mh gdb/config/m88k/m88k.mt gdb/config/m88k/nm-delta88v4.h gdb/config/m88k/nm-m88k.h gdb/config/m88k/tm-delta88.h gdb/config/m88k/tm-delta88v4.h gdb/config/m88k/tm-m88k.h gdb/config/m88k/xm-delta88.h gdb/config/m88k/xm-delta88v4.h gdb/config/m88k/xm-dgux.h gdb/config/mcore/mcore.mt gdb/config/mcore/tm-mcore.h gdb/config/mips/bigmips.mt gdb/config/mips/bigmips64.mt gdb/config/mips/decstation.mh gdb/config/mips/decstation.mt gdb/config/mips/embed.mt gdb/config/mips/embed64.mt gdb/config/mips/embedl.mt gdb/config/mips/embedl64.mt gdb/config/mips/irix3.mh gdb/config/mips/irix3.mt gdb/config/mips/irix4.mh gdb/config/mips/irix5.mh gdb/config/mips/irix5.mt gdb/config/mips/irix6.mh gdb/config/mips/irix6.mt gdb/config/mips/linux.mh gdb/config/mips/linux.mt gdb/config/mips/littlemips.mh gdb/config/mips/littlemips.mt gdb/config/mips/mipsm3.mh gdb/config/mips/mipsm3.mt gdb/config/mips/mipsv4.mh gdb/config/mips/mipsv4.mt gdb/config/mips/news-mips.mh gdb/config/mips/nm-irix3.h gdb/config/mips/nm-irix4.h gdb/config/mips/nm-irix5.h gdb/config/mips/nm-irix6.h gdb/config/mips/nm-linux.h gdb/config/mips/nm-mips.h gdb/config/mips/nm-news-mips.h gdb/config/mips/nm-riscos.h gdb/config/mips/riscos.mh gdb/config/mips/tm-bigmips.h gdb/config/mips/tm-bigmips64.h gdb/config/mips/tm-embed.h gdb/config/mips/tm-embed64.h gdb/config/mips/tm-embedl.h gdb/config/mips/tm-embedl64.h gdb/config/mips/tm-irix3.h gdb/config/mips/tm-irix5.h gdb/config/mips/tm-irix6.h gdb/config/mips/tm-linux.h gdb/config/mips/tm-mips.h gdb/config/mips/tm-mips64.h gdb/config/mips/tm-mipsm3.h gdb/config/mips/tm-mipsv4.h gdb/config/mips/tm-tx39.h gdb/config/mips/tm-tx39l.h gdb/config/mips/tm-vr4100.h gdb/config/mips/tm-vr4300.h gdb/config/mips/tm-vr4300el.h gdb/config/mips/tm-vr4xxx.h gdb/config/mips/tm-vr4xxxel.h gdb/config/mips/tm-vr5000.h gdb/config/mips/tm-vr5000el.h gdb/config/mips/tm-vxmips.h gdb/config/mips/tm-wince.h gdb/config/mips/tx39.mt gdb/config/mips/tx39l.mt gdb/config/mips/vr4100.mt gdb/config/mips/vr4300.mt gdb/config/mips/vr4300el.mt gdb/config/mips/vr4xxx.mt gdb/config/mips/vr4xxxel.mt gdb/config/mips/vr5000.mt gdb/config/mips/vr5000el.mt gdb/config/mips/vxmips.mt gdb/config/mips/wince.mt gdb/config/mips/xm-irix3.h gdb/config/mips/xm-irix4.h gdb/config/mips/xm-irix5.h gdb/config/mips/xm-irix6.h gdb/config/mips/xm-linux.h gdb/config/mips/xm-mips.h gdb/config/mips/xm-mipsm3.h gdb/config/mips/xm-mipsv4.h gdb/config/mips/xm-riscos.h gdb/config/mn10200/mn10200.mt gdb/config/mn10200/tm-mn10200.h gdb/config/mn10300/mn10300.mt gdb/config/nm-gnu.h gdb/config/nm-linux.h gdb/config/nm-lynx.h gdb/config/nm-m3.h gdb/config/nm-sysv4.h gdb/config/none/nm-none.h gdb/config/none/none.mh gdb/config/none/none.mt gdb/config/none/tm-none.h gdb/config/none/xm-none.h gdb/config/ns32k/xm-nbsd.h gdb/config/pa/hppa64.mt gdb/config/pa/hppabsd.mh gdb/config/pa/hppabsd.mt gdb/config/pa/hppahpux.mh gdb/config/pa/hppahpux.mt gdb/config/pa/hppaosf.mh gdb/config/pa/hppaosf.mt gdb/config/pa/hppapro.mt gdb/config/pa/hpux1020.mh gdb/config/pa/hpux1020.mt gdb/config/pa/hpux11.mh gdb/config/pa/hpux11.mt gdb/config/pa/hpux11w.mt gdb/config/pa/nm-hppab.h gdb/config/pa/nm-hppah.h gdb/config/pa/nm-hppah11.h gdb/config/pa/nm-hppao.h gdb/config/pa/tm-hppa.h gdb/config/pa/tm-hppa64.h gdb/config/pa/tm-hppab.h gdb/config/pa/tm-hppah.h gdb/config/pa/tm-hppao.h gdb/config/pa/tm-pro.h gdb/config/pa/xm-hppab.h gdb/config/pa/xm-hppah.h gdb/config/pa/xm-pa.h gdb/config/powerpc/aix.mh gdb/config/powerpc/aix.mt gdb/config/powerpc/gdbserve.mt gdb/config/powerpc/linux.mh gdb/config/powerpc/linux.mt gdb/config/powerpc/nm-aix.h gdb/config/powerpc/nm-linux.h gdb/config/powerpc/ppc-eabi.mt gdb/config/powerpc/ppc-sim.mt gdb/config/powerpc/ppcle-eabi.mt gdb/config/powerpc/ppcle-sim.mt gdb/config/powerpc/tm-linux.h gdb/config/powerpc/tm-ppc-aix.h gdb/config/powerpc/tm-ppc-eabi.h gdb/config/powerpc/tm-ppc-sim.h gdb/config/powerpc/tm-ppcle-eabi.h gdb/config/powerpc/tm-ppcle-sim.h gdb/config/powerpc/tm-vxworks.h gdb/config/powerpc/vxworks.mt gdb/config/powerpc/xm-aix.h gdb/config/powerpc/xm-linux.h gdb/config/romp/rtbsd.mh gdb/config/romp/xm-rtbsd.h gdb/config/rs6000/aix4.mh gdb/config/rs6000/aix4.mt gdb/config/rs6000/nm-rs6000.h gdb/config/rs6000/nm-rs6000ly.h gdb/config/rs6000/rs6000.mh gdb/config/rs6000/rs6000.mt gdb/config/rs6000/rs6000lynx.mh gdb/config/rs6000/rs6000lynx.mt gdb/config/rs6000/tm-rs6000-aix4.h gdb/config/rs6000/tm-rs6000.h gdb/config/rs6000/tm-rs6000ly.h gdb/config/rs6000/xm-aix4.h gdb/config/rs6000/xm-rs6000.h gdb/config/s390/nm-linux.h gdb/config/s390/s390.mh gdb/config/s390/s390.mt gdb/config/s390/s390x.mt gdb/config/s390/tm-linux.h gdb/config/s390/tm-s390.h gdb/config/s390/xm-linux.h gdb/config/sh/embed.mt gdb/config/sh/linux.mt gdb/config/sh/nbsd.mh gdb/config/sh/nbsd.mt gdb/config/sh/nm-nbsd.h gdb/config/sh/tm-linux.h gdb/config/sh/tm-nbsd.h gdb/config/sh/tm-wince.h gdb/config/sh/wince.mt gdb/config/sparc/fbsd.mh gdb/config/sparc/fbsd.mt gdb/config/sparc/linux.mh gdb/config/sparc/linux.mt gdb/config/sparc/nbsd64.mh gdb/config/sparc/nbsd64.mt gdb/config/sparc/nm-fbsd.h gdb/config/sparc/nm-linux.h gdb/config/sparc/nm-nbsd.h gdb/config/sparc/nm-sparclynx.h gdb/config/sparc/nm-sun4os4.h gdb/config/sparc/nm-sun4sol2.h gdb/config/sparc/sp64.mt gdb/config/sparc/sp64linux.mt gdb/config/sparc/sp64sim.mt gdb/config/sparc/sp64sol2.mt gdb/config/sparc/sparc-em.mt gdb/config/sparc/sparclet.mt gdb/config/sparc/sparclite.mt gdb/config/sparc/sparclynx.mh gdb/config/sparc/sparclynx.mt gdb/config/sparc/sun4os4.mh gdb/config/sparc/sun4os4.mt gdb/config/sparc/sun4sol2.mh gdb/config/sparc/sun4sol2.mt gdb/config/sparc/tm-fbsd.h gdb/config/sparc/tm-linux.h gdb/config/sparc/tm-nbsd64.h gdb/config/sparc/tm-sp64.h gdb/config/sparc/tm-sp64linux.h gdb/config/sparc/tm-sp64sim.h gdb/config/sparc/tm-sparc.h gdb/config/sparc/tm-sparclet.h gdb/config/sparc/tm-sparclite.h gdb/config/sparc/tm-sparclynx.h gdb/config/sparc/tm-spc-em.h gdb/config/sparc/tm-sun4os4.h gdb/config/sparc/tm-sun4sol2.h gdb/config/sparc/tm-vxsparc.h gdb/config/sparc/vxsparc.mt gdb/config/sparc/xm-linux.h gdb/config/sparc/xm-nbsd.h gdb/config/sparc/xm-sun4sol2.h gdb/config/tm-linux.h gdb/config/tm-lynx.h gdb/config/tm-sunos.h gdb/config/tm-sysv4.h gdb/config/tm-vxworks.h gdb/config/vax/nm-vax.h gdb/config/vax/tm-vax.h gdb/config/vax/vax.mt gdb/config/vax/vaxbsd.mh gdb/config/vax/vaxult.mh gdb/config/vax/vaxult2.mh gdb/config/vax/xm-vax.h gdb/config/vax/xm-vaxbsd.h gdb/config/vax/xm-vaxult.h gdb/config/vax/xm-vaxult2.h gdb/config/xm-aix4.h gdb/config/xm-nbsd.h gdb/config/xm-sysv4.h gdb/config/xstormy16/xstormy16.mt gdb/config/z8k/tm-z8k.h gdb/config/z8k/z8k.mt gdb/configure gdb/configure.in gdb/copying.awk gdb/copying.c gdb/core-aout.c gdb/core-regset.c gdb/core-sol2.c gdb/corefile.c gdb/cp-abi.c gdb/cp-abi.h gdb/cp-valprint.c gdb/cpu32bug-rom.c gdb/cris-tdep.c gdb/cxux-nat.c gdb/d30v-tdep.c gdb/dbug-rom.c gdb/dbxread.c gdb/dcache.c gdb/dcache.h gdb/delta68-nat.c gdb/demangle.c gdb/dink32-rom.c gdb/doc/LRS gdb/doc/Makefile.in gdb/doc/a4rc.sed gdb/doc/agentexpr.texi gdb/doc/all-cfg.texi gdb/doc/annotate.texi gdb/doc/configure gdb/doc/configure.in gdb/doc/fdl.texi gdb/doc/gpl.texi gdb/doc/lpsrc.sed gdb/doc/psrc.sed gdb/doc/refcard.tex gdb/doc/stabs.texinfo gdb/doublest.c gdb/doublest.h gdb/dpx2-nat.c gdb/dsrec.c gdb/dst.h gdb/dstread.c gdb/dve3900-rom.c gdb/dwarf2cfi.h gdb/dwarfread.c gdb/elfread.c gdb/environ.c gdb/environ.h gdb/eval.c gdb/event-loop.h gdb/exc_request.defs gdb/exec.c gdb/expprint.c gdb/expression.h gdb/f-exp.y gdb/f-lang.c gdb/f-lang.h gdb/f-typeprint.c gdb/f-valprint.c gdb/fbsd-proc.c gdb/findvar.c gdb/fork-child.c gdb/fr30-tdep.c gdb/frame.c gdb/gcore.c gdb/gdb-events.c gdb/gdb-events.h gdb/gdb-events.sh gdb/gdb-stabs.h gdb/gdb.1 gdb/gdb.gdb gdb/gdb.h gdb/gdb_assert.h gdb/gdb_dirent.h gdb/gdb_proc_service.h gdb/gdb_regex.h gdb/gdb_stat.h gdb/gdb_string.h gdb/gdb_thread_db.h gdb/gdb_vfork.h gdb/gdb_wait.h gdb/gdbcmd.h gdb/gdbcore.h gdb/gdbinit.in gdb/gdbserver/Makefile.in gdb/gdbserver/README gdb/gdbserver/acconfig.h gdb/gdbserver/acinclude.m4 gdb/gdbserver/aclocal.m4 gdb/gdbserver/config.in gdb/gdbserver/configure gdb/gdbserver/configure.in gdb/gdbserver/configure.srv gdb/gdbserver/gdbreplay.c gdb/gdbserver/gdbserver.1 gdb/gdbserver/i387-fp.c gdb/gdbserver/i387-fp.h gdb/gdbserver/inferiors.c gdb/gdbserver/linux-arm-low.c gdb/gdbserver/linux-i386-low.c gdb/gdbserver/linux-ia64-low.c gdb/gdbserver/linux-low.c gdb/gdbserver/linux-low.h gdb/gdbserver/linux-m68k-low.c gdb/gdbserver/linux-mips-low.c gdb/gdbserver/linux-ppc-low.c gdb/gdbserver/linux-s390-low.c gdb/gdbserver/linux-sh-low.c gdb/gdbserver/linux-x86-64-low.c gdb/gdbserver/low-hppabsd.c gdb/gdbserver/low-lynx.c gdb/gdbserver/low-nbsd.c gdb/gdbserver/low-sim.c gdb/gdbserver/low-sparc.c gdb/gdbserver/low-sun3.c gdb/gdbserver/mem-break.c gdb/gdbserver/mem-break.h gdb/gdbserver/proc-service.c gdb/gdbserver/regcache.c gdb/gdbserver/regcache.h gdb/gdbserver/remote-utils.c gdb/gdbserver/server.h gdb/gdbserver/target.c gdb/gdbserver/target.h gdb/gdbserver/terminal.h gdb/gdbserver/thread-db.c gdb/gdbserver/utils.c gdb/gdbthread.h gdb/gnu-nat.c gdb/gnu-nat.h gdb/gnu-v2-abi.c gdb/gnu-v3-abi.c gdb/go32-nat.c gdb/gregset.h gdb/h8500-tdep.c gdb/hp300ux-nat.c gdb/hpacc-abi.c gdb/hppa-tdep.c gdb/hppab-nat.c gdb/hppah-nat.c gdb/hppam3-nat.c gdb/hpux-thread.c gdb/i386-linux-nat.c gdb/i386-linux-tdep.c gdb/i386-linux-tdep.h gdb/i386-nat.c gdb/i386-stub.c gdb/i386-tdep.h gdb/i386aix-nat.c gdb/i386b-nat.c gdb/i386bsd-nat.c gdb/i386bsd-tdep.c gdb/i386fbsd-nat.c gdb/i386gnu-nat.c gdb/i386ly-tdep.c gdb/i386m3-nat.c gdb/i386mach-nat.c gdb/i386nbsd-tdep.c gdb/i386v-nat.c gdb/i386v4-nat.c gdb/i387-tdep.c gdb/i387-tdep.h gdb/i960-tdep.c gdb/ia64-aix-nat.c gdb/ia64-aix-tdep.c gdb/ia64-linux-nat.c gdb/ia64-linux-tdep.c gdb/ia64-tdep.c gdb/inf-loop.c gdb/inf-loop.h gdb/inflow.c gdb/infptrace.c gdb/inftarg.c gdb/infttrace.c gdb/irix4-nat.c gdb/irix5-nat.c gdb/jv-exp.y gdb/jv-lang.c gdb/jv-lang.h gdb/jv-typeprint.c gdb/jv-valprint.c gdb/kod-cisco.c gdb/kod.c gdb/kod.h gdb/language.c gdb/language.h gdb/lin-lwp.c gdb/linespec.c gdb/linespec.h gdb/linux-proc.c gdb/lynx-nat.c gdb/m2-exp.y gdb/m2-lang.c gdb/m2-lang.h gdb/m2-typeprint.c gdb/m2-valprint.c gdb/m3-nat.c gdb/m32r-rom.c gdb/m32r-stub.c gdb/m32r-tdep.c gdb/m68hc11-tdep.c gdb/m68k-stub.c gdb/m68k-tdep.c gdb/m68klinux-nat.c gdb/m68knbsd-nat.c gdb/m68knbsd-tdep.c gdb/m88k-nat.c gdb/m88k-tdep.c gdb/macroexp.c gdb/macroexp.h gdb/macrotab.h gdb/maint.c gdb/mcore-rom.c gdb/mcore-tdep.c gdb/mdebugread.c gdb/mem-break.c gdb/memattr.c gdb/memattr.h gdb/mi/gdbmi.texinfo gdb/mi/mi-cmd-break.c gdb/mi/mi-cmd-disas.c gdb/mi/mi-cmd-stack.c gdb/mi/mi-cmd-var.c gdb/mi/mi-console.c gdb/mi/mi-console.h gdb/mi/mi-getopt.c gdb/mi/mi-getopt.h gdb/mi/mi-out.c gdb/mi/mi-out.h gdb/mi/mi-parse.c gdb/mi/mi-parse.h gdb/minimon.h gdb/minsyms.c gdb/mips-linux-nat.c gdb/mips-linux-tdep.c gdb/mips-nat.c gdb/mipsm3-nat.c gdb/mipsread.c gdb/mipsv4-nat.c gdb/mn10200-tdep.c gdb/mn10300-tdep.c gdb/mon960-rom.c gdb/monitor.c gdb/monitor.h gdb/msg.defs gdb/msg_reply.defs gdb/nbsd-tdep.c gdb/nbsd-tdep.h gdb/nindy-share/Makefile gdb/nindy-share/Onindy.c gdb/nindy-share/README gdb/nindy-share/VERSION gdb/nindy-share/b.out.h gdb/nindy-share/block_io.h gdb/nindy-share/coff.h gdb/nindy-share/env.h gdb/nindy-share/nindy.c gdb/nindy-share/stop.h gdb/nindy-share/ttyflush.c gdb/nindy-tdep.c gdb/nlm/Makefile.in gdb/nlm/configure gdb/nlm/configure.in gdb/nlm/gdbserve.c gdb/nlm/gdbserve.def gdb/nlm/i386.c gdb/nlm/i386.h gdb/nlm/ppc.c gdb/nlm/ppc.h gdb/nlm/prelude.c gdb/nlmread.c gdb/notify.defs gdb/ns32knbsd-nat.c gdb/objfiles.c gdb/objfiles.h gdb/ocd.c gdb/ocd.h gdb/op50-rom.c gdb/os9kread.c gdb/osf-share/AT386/cma_thread_io.h gdb/osf-share/HP800/cma_thread_io.h gdb/osf-share/README gdb/osf-share/RIOS/cma_thread_io.h gdb/osf-share/cma_attr.h gdb/osf-share/cma_deb_core.h gdb/osf-share/cma_debug_client.h gdb/osf-share/cma_errors.h gdb/osf-share/cma_handle.h gdb/osf-share/cma_init.h gdb/osf-share/cma_list.h gdb/osf-share/cma_mutex.h gdb/osf-share/cma_sched.h gdb/osf-share/cma_semaphore_defs.h gdb/osf-share/cma_sequence.h gdb/osf-share/cma_stack.h gdb/osf-share/cma_stack_int.h gdb/osf-share/cma_tcb_defs.h gdb/osf-share/cma_util.h gdb/osfsolib.c gdb/p-lang.c gdb/p-lang.h gdb/p-typeprint.c gdb/p-valprint.c gdb/pa64solib.c gdb/pa64solib.h gdb/ppc-bdm.c gdb/ppc-linux-nat.c gdb/ppc-linux-tdep.c gdb/ppc-sysv-tdep.c gdb/ppc-tdep.h gdb/ppcbug-rom.c gdb/printcmd.c gdb/proc-api.c gdb/proc-events.c gdb/proc-flags.c gdb/proc-service.c gdb/proc-utils.h gdb/proc-why.c gdb/process_reply.defs gdb/procfs.c gdb/ptx4-nat.c gdb/rdi-share/Makefile.am gdb/rdi-share/Makefile.in gdb/rdi-share/README.CYGNUS gdb/rdi-share/aclocal.m4 gdb/rdi-share/adp.h gdb/rdi-share/adperr.h gdb/rdi-share/angel.h gdb/rdi-share/angel_bytesex.c gdb/rdi-share/angel_bytesex.h gdb/rdi-share/angel_endian.h gdb/rdi-share/ardi.c gdb/rdi-share/ardi.h gdb/rdi-share/armdbg.h gdb/rdi-share/buffers.h gdb/rdi-share/chandefs.h gdb/rdi-share/channels.h gdb/rdi-share/chanpriv.h gdb/rdi-share/configure gdb/rdi-share/configure.in gdb/rdi-share/crc.c gdb/rdi-share/crc.h gdb/rdi-share/dbg_conf.h gdb/rdi-share/dbg_cp.h gdb/rdi-share/dbg_hif.h gdb/rdi-share/dbg_rdi.h gdb/rdi-share/devclnt.h gdb/rdi-share/devices.h gdb/rdi-share/devsw.c gdb/rdi-share/devsw.h gdb/rdi-share/drivers.c gdb/rdi-share/drivers.h gdb/rdi-share/etherdrv.c gdb/rdi-share/ethernet.h gdb/rdi-share/host.h gdb/rdi-share/hostchan.c gdb/rdi-share/hostchan.h gdb/rdi-share/hsys.c gdb/rdi-share/hsys.h gdb/rdi-share/logging.c gdb/rdi-share/logging.h gdb/rdi-share/msgbuild.c gdb/rdi-share/msgbuild.h gdb/rdi-share/params.c gdb/rdi-share/params.h gdb/rdi-share/rx.c gdb/rdi-share/rxtx.h gdb/rdi-share/serdrv.c gdb/rdi-share/serpardr.c gdb/rdi-share/sys.h gdb/rdi-share/tx.c gdb/rdi-share/unixcomm.c gdb/rdi-share/unixcomm.h gdb/regformats/reg-arm.dat gdb/regformats/reg-i386-linux.dat gdb/regformats/reg-i386.dat gdb/regformats/reg-ia64.dat gdb/regformats/reg-m68k.dat gdb/regformats/reg-mips.dat gdb/regformats/reg-ppc.dat gdb/regformats/reg-s390.dat gdb/regformats/reg-s390x.dat gdb/regformats/reg-sh.dat gdb/regformats/reg-x86-64.dat gdb/regformats/regdat.sh gdb/regformats/regdef.h gdb/remote-array.c gdb/remote-bug.c gdb/remote-e7000.c gdb/remote-es.c gdb/remote-est.c gdb/remote-hms.c gdb/remote-mips.c gdb/remote-nindy.c gdb/remote-nrom.c gdb/remote-os9k.c gdb/remote-rdi.c gdb/remote-rdp.c gdb/remote-sds.c gdb/remote-sim.c gdb/remote-st.c gdb/remote-utils.c gdb/remote-utils.h gdb/remote-vx.c gdb/remote-vx29k.c gdb/remote-vx68.c gdb/remote-vx960.c gdb/remote-vxmips.c gdb/remote-vxsparc.c gdb/remote.h gdb/reply_mig_hack.awk gdb/rom68k-rom.c gdb/rs6000-nat.c gdb/s390-nat.c gdb/s390-tdep.c gdb/saber.suppress gdb/scm-exp.c gdb/scm-lang.c gdb/scm-lang.h gdb/scm-tags.h gdb/scm-valprint.c gdb/ser-e7kpc.c gdb/ser-go32.c gdb/ser-pipe.c gdb/ser-unix.c gdb/ser-unix.h gdb/serial.c gdb/serial.h gdb/sh-stub.c gdb/shnbsd-nat.c gdb/shnbsd-tdep.h gdb/signals/signals.c gdb/sim-regno.h gdb/sol-thread.c gdb/solib-aix5.c gdb/solib-legacy.c gdb/solib-osf.c gdb/solib-sunos.c gdb/solib-svr4.c gdb/solib-svr4.h gdb/solib.c gdb/solib.h gdb/solist.h gdb/somread.c gdb/somsolib.c gdb/somsolib.h gdb/source.c gdb/source.h gdb/sparc-linux-nat.c gdb/sparc-nat.c gdb/sparc-stub.c gdb/sparc-tdep.c gdb/sparc64nbsd-nat.c gdb/sparcl-stub.c gdb/sparcl-tdep.c gdb/sparclet-rom.c gdb/sparclet-stub.c gdb/sparcnbsd-nat.c gdb/sparcnbsd-tdep.c gdb/sparcnbsd-tdep.h gdb/srec.h gdb/stabsread.c gdb/stabsread.h gdb/stack.c gdb/standalone.c gdb/std-regs.c gdb/stop-gdb.c gdb/sun3-nat.c gdb/symfile.c gdb/symfile.h gdb/symm-nat.c gdb/symm-tdep.c gdb/symmisc.c gdb/symtab.c gdb/symtab.h gdb/target.c gdb/target.h gdb/terminal.h gdb/testsuite/.gdbinit gdb/testsuite/Makefile.in gdb/testsuite/TODO gdb/testsuite/aclocal.m4 gdb/testsuite/config/abug.exp gdb/testsuite/config/arm-ice.exp gdb/testsuite/config/cfdbug.exp gdb/testsuite/config/cpu32bug.exp gdb/testsuite/config/cygmon.exp gdb/testsuite/config/d10v.exp gdb/testsuite/config/dve.exp gdb/testsuite/config/est.exp gdb/testsuite/config/gdbserver.exp gdb/testsuite/config/h8300.exp gdb/testsuite/config/hmsirom.exp gdb/testsuite/config/hppro.exp gdb/testsuite/config/i386-bozo.exp gdb/testsuite/config/i960.exp gdb/testsuite/config/m32r-stub.exp gdb/testsuite/config/m32r.exp gdb/testsuite/config/m68k-emc.exp gdb/testsuite/config/mips-idt.exp gdb/testsuite/config/mips.exp gdb/testsuite/config/mn10300-eval.exp gdb/testsuite/config/monitor.exp gdb/testsuite/config/netware.exp gdb/testsuite/config/nind.exp gdb/testsuite/config/proelf.exp gdb/testsuite/config/rom68k.exp gdb/testsuite/config/sh.exp gdb/testsuite/config/sid.exp gdb/testsuite/config/sim.exp gdb/testsuite/config/slite.exp gdb/testsuite/config/sparclet.exp gdb/testsuite/config/udi.exp gdb/testsuite/config/unix.exp gdb/testsuite/config/unknown.exp gdb/testsuite/config/vr4300.exp gdb/testsuite/config/vr5000.exp gdb/testsuite/config/vx.exp gdb/testsuite/config/vxworks.exp gdb/testsuite/config/vxworks29k.exp gdb/testsuite/gdb.asm/Makefile.in gdb/testsuite/gdb.asm/arm.inc gdb/testsuite/gdb.asm/asm-source.exp gdb/testsuite/gdb.asm/asmsrc1.s gdb/testsuite/gdb.asm/asmsrc2.s gdb/testsuite/gdb.asm/common.inc gdb/testsuite/gdb.asm/configure gdb/testsuite/gdb.asm/configure.in gdb/testsuite/gdb.asm/d10v.inc gdb/testsuite/gdb.asm/i386.inc gdb/testsuite/gdb.asm/m32r.inc gdb/testsuite/gdb.asm/powerpc.inc gdb/testsuite/gdb.asm/s390.inc gdb/testsuite/gdb.asm/sparc.inc gdb/testsuite/gdb.asm/sparc64.inc gdb/testsuite/gdb.asm/v850.inc gdb/testsuite/gdb.asm/x86_64.inc gdb/testsuite/gdb.asm/xstormy16.inc gdb/testsuite/gdb.base/Makefile.in gdb/testsuite/gdb.base/a2-run.exp gdb/testsuite/gdb.base/all-types.c gdb/testsuite/gdb.base/annota1.c gdb/testsuite/gdb.base/annota1.exp gdb/testsuite/gdb.base/arithmet.exp gdb/testsuite/gdb.base/assign.exp gdb/testsuite/gdb.base/async.c gdb/testsuite/gdb.base/async.exp gdb/testsuite/gdb.base/attach.c gdb/testsuite/gdb.base/attach.exp gdb/testsuite/gdb.base/attach2.c gdb/testsuite/gdb.base/average.c gdb/testsuite/gdb.base/bar.c gdb/testsuite/gdb.base/baz.c gdb/testsuite/gdb.base/bitfields.c gdb/testsuite/gdb.base/bitfields.exp gdb/testsuite/gdb.base/bitops.exp gdb/testsuite/gdb.base/branches.c gdb/testsuite/gdb.base/break.c gdb/testsuite/gdb.base/break.exp gdb/testsuite/gdb.base/call-ar-st.c gdb/testsuite/gdb.base/call-ar-st.exp gdb/testsuite/gdb.base/call-rt-st.c gdb/testsuite/gdb.base/call-strs.c gdb/testsuite/gdb.base/call-strs.exp gdb/testsuite/gdb.base/callfuncs.c gdb/testsuite/gdb.base/callfuncs.exp gdb/testsuite/gdb.base/code-expr.exp gdb/testsuite/gdb.base/commands.exp gdb/testsuite/gdb.base/cond-expr.exp gdb/testsuite/gdb.base/condbreak.exp gdb/testsuite/gdb.base/configure gdb/testsuite/gdb.base/configure.in gdb/testsuite/gdb.base/consecutive.c gdb/testsuite/gdb.base/consecutive.exp gdb/testsuite/gdb.base/constvars.c gdb/testsuite/gdb.base/constvars.exp gdb/testsuite/gdb.base/corefile.exp gdb/testsuite/gdb.base/coremaker.c gdb/testsuite/gdb.base/coremaker2.c gdb/testsuite/gdb.base/cvexpr.c gdb/testsuite/gdb.base/cvexpr.exp gdb/testsuite/gdb.base/d10v.ld gdb/testsuite/gdb.base/d10vovly.c gdb/testsuite/gdb.base/dbx.exp gdb/testsuite/gdb.base/default.exp gdb/testsuite/gdb.base/define.exp gdb/testsuite/gdb.base/display.c gdb/testsuite/gdb.base/display.exp gdb/testsuite/gdb.base/dump.c gdb/testsuite/gdb.base/dump.exp gdb/testsuite/gdb.base/echo.exp gdb/testsuite/gdb.base/ena-dis-br.exp gdb/testsuite/gdb.base/ending-run.c gdb/testsuite/gdb.base/ending-run.exp gdb/testsuite/gdb.base/environ.exp gdb/testsuite/gdb.base/eval-skip.exp gdb/testsuite/gdb.base/execd-prog.c gdb/testsuite/gdb.base/exprs.c gdb/testsuite/gdb.base/exprs.exp gdb/testsuite/gdb.base/finish.exp gdb/testsuite/gdb.base/foll-exec.c gdb/testsuite/gdb.base/foll-exec.exp gdb/testsuite/gdb.base/foll-fork.c gdb/testsuite/gdb.base/foll-fork.exp gdb/testsuite/gdb.base/foll-vfork.c gdb/testsuite/gdb.base/foll-vfork.exp gdb/testsuite/gdb.base/foo.c gdb/testsuite/gdb.base/funcargs.c gdb/testsuite/gdb.base/funcargs.exp gdb/testsuite/gdb.base/gcore.c gdb/testsuite/gdb.base/gcore.exp gdb/testsuite/gdb.base/gdbvars.exp gdb/testsuite/gdb.base/grbx.c gdb/testsuite/gdb.base/help.exp gdb/testsuite/gdb.base/huge.c gdb/testsuite/gdb.base/huge.exp gdb/testsuite/gdb.base/info-proc.exp gdb/testsuite/gdb.base/int-type.c gdb/testsuite/gdb.base/interrupt.c gdb/testsuite/gdb.base/interrupt.exp gdb/testsuite/gdb.base/jump.c gdb/testsuite/gdb.base/jump.exp gdb/testsuite/gdb.base/langs.exp gdb/testsuite/gdb.base/langs0.c gdb/testsuite/gdb.base/langs1.c gdb/testsuite/gdb.base/langs1.f gdb/testsuite/gdb.base/langs2.c gdb/testsuite/gdb.base/langs2.cxx gdb/testsuite/gdb.base/list.exp gdb/testsuite/gdb.base/list0.c gdb/testsuite/gdb.base/list0.h gdb/testsuite/gdb.base/list1.c gdb/testsuite/gdb.base/logical.exp gdb/testsuite/gdb.base/long_long.c gdb/testsuite/gdb.base/long_long.exp gdb/testsuite/gdb.base/m32r.ld gdb/testsuite/gdb.base/m32rovly.c gdb/testsuite/gdb.base/macscp.exp gdb/testsuite/gdb.base/macscp1.c gdb/testsuite/gdb.base/macscp2.h gdb/testsuite/gdb.base/macscp3.h gdb/testsuite/gdb.base/macscp4.h gdb/testsuite/gdb.base/maint.exp gdb/testsuite/gdb.base/mips_pro.c gdb/testsuite/gdb.base/mips_pro.exp gdb/testsuite/gdb.base/miscexprs.c gdb/testsuite/gdb.base/miscexprs.exp gdb/testsuite/gdb.base/nodebug.c gdb/testsuite/gdb.base/nodebug.exp gdb/testsuite/gdb.base/opaque.exp gdb/testsuite/gdb.base/opaque0.c gdb/testsuite/gdb.base/opaque1.c gdb/testsuite/gdb.base/overlays.c gdb/testsuite/gdb.base/overlays.exp gdb/testsuite/gdb.base/ovlymgr.c gdb/testsuite/gdb.base/ovlymgr.h gdb/testsuite/gdb.base/page.exp gdb/testsuite/gdb.base/pointers.c gdb/testsuite/gdb.base/pointers.exp gdb/testsuite/gdb.base/printcmds.c gdb/testsuite/gdb.base/printcmds.exp gdb/testsuite/gdb.base/ptype.c gdb/testsuite/gdb.base/ptype.exp gdb/testsuite/gdb.base/radix.exp gdb/testsuite/gdb.base/recurse.c gdb/testsuite/gdb.base/recurse.exp gdb/testsuite/gdb.base/regs.exp gdb/testsuite/gdb.base/relational.exp gdb/testsuite/gdb.base/relocate.c gdb/testsuite/gdb.base/relocate.exp gdb/testsuite/gdb.base/remote.c gdb/testsuite/gdb.base/remote.exp gdb/testsuite/gdb.base/reread.exp gdb/testsuite/gdb.base/reread1.c gdb/testsuite/gdb.base/reread2.c gdb/testsuite/gdb.base/restore.c gdb/testsuite/gdb.base/restore.exp gdb/testsuite/gdb.base/return.c gdb/testsuite/gdb.base/return.exp gdb/testsuite/gdb.base/return2.c gdb/testsuite/gdb.base/return2.exp gdb/testsuite/gdb.base/run.c gdb/testsuite/gdb.base/scope.exp gdb/testsuite/gdb.base/scope0.c gdb/testsuite/gdb.base/scope1.c gdb/testsuite/gdb.base/sect-cmd.exp gdb/testsuite/gdb.base/selftest.exp gdb/testsuite/gdb.base/setshow.c gdb/testsuite/gdb.base/setshow.exp gdb/testsuite/gdb.base/setvar.c gdb/testsuite/gdb.base/setvar.exp gdb/testsuite/gdb.base/shlib-call.exp gdb/testsuite/gdb.base/shmain.c gdb/testsuite/gdb.base/shr1.c gdb/testsuite/gdb.base/shr2.c gdb/testsuite/gdb.base/sigall.c gdb/testsuite/gdb.base/sigall.exp gdb/testsuite/gdb.base/signals.c gdb/testsuite/gdb.base/signals.exp gdb/testsuite/gdb.base/sizeof.c gdb/testsuite/gdb.base/sizeof.exp gdb/testsuite/gdb.base/so-impl-ld.c gdb/testsuite/gdb.base/so-impl-ld.exp gdb/testsuite/gdb.base/so-indr-cl.c gdb/testsuite/gdb.base/so-indr-cl.exp gdb/testsuite/gdb.base/solib.c gdb/testsuite/gdb.base/solib.exp gdb/testsuite/gdb.base/solib1.c gdb/testsuite/gdb.base/solib2.c gdb/testsuite/gdb.base/ss.h gdb/testsuite/gdb.base/step-line.c gdb/testsuite/gdb.base/step-line.exp gdb/testsuite/gdb.base/step-line.inp gdb/testsuite/gdb.base/step-test.c gdb/testsuite/gdb.base/step-test.exp gdb/testsuite/gdb.base/structs.c gdb/testsuite/gdb.base/structs.exp gdb/testsuite/gdb.base/structs2.c gdb/testsuite/gdb.base/structs2.exp gdb/testsuite/gdb.base/sum.c gdb/testsuite/gdb.base/term.exp gdb/testsuite/gdb.base/twice.c gdb/testsuite/gdb.base/twice.exp gdb/testsuite/gdb.base/varargs.c gdb/testsuite/gdb.base/varargs.exp gdb/testsuite/gdb.base/vforked-prog.c gdb/testsuite/gdb.base/volatile.exp gdb/testsuite/gdb.base/watchpoint.c gdb/testsuite/gdb.base/watchpoint.exp gdb/testsuite/gdb.base/whatis-exp.exp gdb/testsuite/gdb.base/whatis.c gdb/testsuite/gdb.base/whatis.exp gdb/testsuite/gdb.c++/Makefile.in gdb/testsuite/gdb.c++/ambiguous.cc gdb/testsuite/gdb.c++/ambiguous.exp gdb/testsuite/gdb.c++/annota2.cc gdb/testsuite/gdb.c++/annota2.exp gdb/testsuite/gdb.c++/anon-union.cc gdb/testsuite/gdb.c++/anon-union.exp gdb/testsuite/gdb.c++/classes.exp gdb/testsuite/gdb.c++/configure gdb/testsuite/gdb.c++/configure.in gdb/testsuite/gdb.c++/cplusfuncs.cc gdb/testsuite/gdb.c++/cplusfuncs.exp gdb/testsuite/gdb.c++/ctti.exp gdb/testsuite/gdb.c++/cttiadd.cc gdb/testsuite/gdb.c++/cttiadd1.cc gdb/testsuite/gdb.c++/cttiadd2.cc gdb/testsuite/gdb.c++/cttiadd3.cc gdb/testsuite/gdb.c++/demangle.exp gdb/testsuite/gdb.c++/derivation.cc gdb/testsuite/gdb.c++/derivation.exp gdb/testsuite/gdb.c++/hang.H gdb/testsuite/gdb.c++/hang.exp gdb/testsuite/gdb.c++/hang1.C gdb/testsuite/gdb.c++/hang2.C gdb/testsuite/gdb.c++/hang3.C gdb/testsuite/gdb.c++/local.cc gdb/testsuite/gdb.c++/m-static.cc gdb/testsuite/gdb.c++/m-static.exp gdb/testsuite/gdb.c++/member-ptr.cc gdb/testsuite/gdb.c++/member-ptr.exp gdb/testsuite/gdb.c++/method.cc gdb/testsuite/gdb.c++/method.exp gdb/testsuite/gdb.c++/misc.cc gdb/testsuite/gdb.c++/misc.exp gdb/testsuite/gdb.c++/namespace.cc gdb/testsuite/gdb.c++/namespace.exp gdb/testsuite/gdb.c++/overload.cc gdb/testsuite/gdb.c++/overload.exp gdb/testsuite/gdb.c++/ovldbreak.cc gdb/testsuite/gdb.c++/ovldbreak.exp gdb/testsuite/gdb.c++/ref-types.cc gdb/testsuite/gdb.c++/ref-types.exp gdb/testsuite/gdb.c++/templates.cc gdb/testsuite/gdb.c++/templates.exp gdb/testsuite/gdb.c++/userdef.cc gdb/testsuite/gdb.c++/userdef.exp gdb/testsuite/gdb.c++/virtfunc.cc gdb/testsuite/gdb.c++/virtfunc.exp gdb/testsuite/gdb.chill/ChangeLog gdb/testsuite/gdb.chill/Makefile.in gdb/testsuite/gdb.chill/builtins.ch gdb/testsuite/gdb.chill/builtins.exp gdb/testsuite/gdb.chill/callch.ch gdb/testsuite/gdb.chill/callch.exp gdb/testsuite/gdb.chill/chexp.exp gdb/testsuite/gdb.chill/chillvars.ch gdb/testsuite/gdb.chill/chillvars.exp gdb/testsuite/gdb.chill/configure gdb/testsuite/gdb.chill/configure.in gdb/testsuite/gdb.chill/enum.ch gdb/testsuite/gdb.chill/enum.exp gdb/testsuite/gdb.chill/func1.ch gdb/testsuite/gdb.chill/gch1041.ch gdb/testsuite/gdb.chill/gch1041.exp gdb/testsuite/gdb.chill/gch1272.ch gdb/testsuite/gdb.chill/gch1272.exp gdb/testsuite/gdb.chill/gch1280.ch gdb/testsuite/gdb.chill/gch1280.exp gdb/testsuite/gdb.chill/gch922.ch gdb/testsuite/gdb.chill/gch922.exp gdb/testsuite/gdb.chill/gch981.ch gdb/testsuite/gdb.chill/gch981.exp gdb/testsuite/gdb.chill/misc.ch gdb/testsuite/gdb.chill/misc.exp gdb/testsuite/gdb.chill/powerset.ch gdb/testsuite/gdb.chill/powerset.exp gdb/testsuite/gdb.chill/pr-4975-grt.ch gdb/testsuite/gdb.chill/pr-4975.ch gdb/testsuite/gdb.chill/pr-4975.exp gdb/testsuite/gdb.chill/pr-5016.ch gdb/testsuite/gdb.chill/pr-5016.exp gdb/testsuite/gdb.chill/pr-5020.ch gdb/testsuite/gdb.chill/pr-5020.exp gdb/testsuite/gdb.chill/pr-5022.ch gdb/testsuite/gdb.chill/pr-5022.exp gdb/testsuite/gdb.chill/pr-5646-grt.ch gdb/testsuite/gdb.chill/pr-5646.ch gdb/testsuite/gdb.chill/pr-5646.exp gdb/testsuite/gdb.chill/pr-5984.ch gdb/testsuite/gdb.chill/pr-5984.exp gdb/testsuite/gdb.chill/pr-6292.ch gdb/testsuite/gdb.chill/pr-6292.exp gdb/testsuite/gdb.chill/pr-6632-grt.ch gdb/testsuite/gdb.chill/pr-6632.ch gdb/testsuite/gdb.chill/pr-6632.exp gdb/testsuite/gdb.chill/pr-8134.exp gdb/testsuite/gdb.chill/pr-8136.ch gdb/testsuite/gdb.chill/pr-8136.exp gdb/testsuite/gdb.chill/pr-8405.ch gdb/testsuite/gdb.chill/pr-8405.exp gdb/testsuite/gdb.chill/pr-8742.ch gdb/testsuite/gdb.chill/pr-8742.exp gdb/testsuite/gdb.chill/pr-8894-grt.ch gdb/testsuite/gdb.chill/pr-8894.ch gdb/testsuite/gdb.chill/pr-8894.exp gdb/testsuite/gdb.chill/pr-9095.ch gdb/testsuite/gdb.chill/pr-9095.exp gdb/testsuite/gdb.chill/pr-9946.ch gdb/testsuite/gdb.chill/pr-9946.exp gdb/testsuite/gdb.chill/result.ch gdb/testsuite/gdb.chill/result.exp gdb/testsuite/gdb.chill/string.ch gdb/testsuite/gdb.chill/string.exp gdb/testsuite/gdb.chill/tests1.ch gdb/testsuite/gdb.chill/tests1.exp gdb/testsuite/gdb.chill/tests2.ch gdb/testsuite/gdb.chill/tests2.exp gdb/testsuite/gdb.chill/tuples.ch gdb/testsuite/gdb.chill/tuples.exp gdb/testsuite/gdb.chill/xstruct-grt.ch gdb/testsuite/gdb.chill/xstruct.ch gdb/testsuite/gdb.chill/xstruct.exp gdb/testsuite/gdb.disasm/Makefile.in gdb/testsuite/gdb.disasm/am33.exp gdb/testsuite/gdb.disasm/am33.s gdb/testsuite/gdb.disasm/configure gdb/testsuite/gdb.disasm/configure.in gdb/testsuite/gdb.disasm/h8300s.exp gdb/testsuite/gdb.disasm/h8300s.s gdb/testsuite/gdb.disasm/hppa.exp gdb/testsuite/gdb.disasm/hppa.s gdb/testsuite/gdb.disasm/mn10200.exp gdb/testsuite/gdb.disasm/mn10200.s gdb/testsuite/gdb.disasm/mn10300.exp gdb/testsuite/gdb.disasm/mn10300.s gdb/testsuite/gdb.disasm/sh3.exp gdb/testsuite/gdb.disasm/sh3.s gdb/testsuite/gdb.fortran/exprs.exp gdb/testsuite/gdb.fortran/types.exp gdb/testsuite/gdb.gdb/xfullpath.exp gdb/testsuite/gdb.hp/Makefile.in gdb/testsuite/gdb.hp/configure gdb/testsuite/gdb.hp/configure.in gdb/testsuite/gdb.hp/gdb.aCC/Makefile.in gdb/testsuite/gdb.hp/gdb.aCC/configure gdb/testsuite/gdb.hp/gdb.aCC/configure.in gdb/testsuite/gdb.hp/gdb.aCC/exception.cc gdb/testsuite/gdb.hp/gdb.aCC/exception.exp gdb/testsuite/gdb.hp/gdb.aCC/optimize.c gdb/testsuite/gdb.hp/gdb.aCC/optimize.exp gdb/testsuite/gdb.hp/gdb.aCC/run.c gdb/testsuite/gdb.hp/gdb.aCC/watch-cmd.exp gdb/testsuite/gdb.hp/gdb.base-hp/Makefile.in gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.exp gdb/testsuite/gdb.hp/gdb.base-hp/configure gdb/testsuite/gdb.hp/gdb.base-hp/configure.in gdb/testsuite/gdb.hp/gdb.base-hp/dollar.c gdb/testsuite/gdb.hp/gdb.base-hp/dollar.exp gdb/testsuite/gdb.hp/gdb.base-hp/genso-thresh.c gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.c gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.exp gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.c gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.exp gdb/testsuite/gdb.hp/gdb.base-hp/reg-pa64.exp gdb/testsuite/gdb.hp/gdb.base-hp/reg-pa64.s gdb/testsuite/gdb.hp/gdb.base-hp/reg.exp gdb/testsuite/gdb.hp/gdb.base-hp/reg.s gdb/testsuite/gdb.hp/gdb.base-hp/sized-enum.c gdb/testsuite/gdb.hp/gdb.base-hp/sized-enum.exp gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.exp gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.mk gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.sh gdb/testsuite/gdb.hp/gdb.compat/Makefile.in gdb/testsuite/gdb.hp/gdb.compat/average.c gdb/testsuite/gdb.hp/gdb.compat/configure gdb/testsuite/gdb.hp/gdb.compat/configure.in gdb/testsuite/gdb.hp/gdb.compat/sum.c gdb/testsuite/gdb.hp/gdb.compat/xdb.c gdb/testsuite/gdb.hp/gdb.compat/xdb0.c gdb/testsuite/gdb.hp/gdb.compat/xdb0.h gdb/testsuite/gdb.hp/gdb.compat/xdb1.c gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp gdb/testsuite/gdb.hp/gdb.compat/xdb2.exp gdb/testsuite/gdb.hp/gdb.compat/xdb3.exp gdb/testsuite/gdb.hp/gdb.defects/Makefile.in gdb/testsuite/gdb.hp/gdb.defects/bs14602.c gdb/testsuite/gdb.hp/gdb.defects/bs14602.exp gdb/testsuite/gdb.hp/gdb.defects/bs15503.cc gdb/testsuite/gdb.hp/gdb.defects/bs15503.exp gdb/testsuite/gdb.hp/gdb.defects/configure gdb/testsuite/gdb.hp/gdb.defects/configure.in gdb/testsuite/gdb.hp/gdb.defects/solib-d.c gdb/testsuite/gdb.hp/gdb.defects/solib-d.exp gdb/testsuite/gdb.hp/gdb.defects/solib-d1.c gdb/testsuite/gdb.hp/gdb.defects/solib-d2.c gdb/testsuite/gdb.hp/gdb.objdbg/Makefile.in gdb/testsuite/gdb.hp/gdb.objdbg/configure gdb/testsuite/gdb.hp/gdb.objdbg/configure.in gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01.exp gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x1.cc gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x2.cc gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x3.cc gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x3.h gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02.exp gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x1.cc gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x2.cc gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x3.cc gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03.exp gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x1.cc gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x2.cc gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x3.cc gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04.exp gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x.h gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x1.cc gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x2.cc gdb/testsuite/gdb.hp/gdb.objdbg/tools/symaddr gdb/testsuite/gdb.hp/gdb.objdbg/tools/symaddr.pa64 gdb/testsuite/gdb.hp/gdb.objdbg/tools/test-objdbg.cc gdb/testsuite/gdb.hp/gdb.threads-hp/Makefile.in gdb/testsuite/gdb.hp/gdb.threads-hp/configure gdb/testsuite/gdb.hp/gdb.threads-hp/configure.in gdb/testsuite/gdb.hp/tools/odump gdb/testsuite/gdb.java/Makefile.in gdb/testsuite/gdb.java/configure gdb/testsuite/gdb.java/configure.in gdb/testsuite/gdb.java/jmisc.exp gdb/testsuite/gdb.java/jmisc.java gdb/testsuite/gdb.java/jmisc1.exp gdb/testsuite/gdb.java/jmisc2.exp gdb/testsuite/gdb.java/jv-exp.exp gdb/testsuite/gdb.java/jv-print.exp gdb/testsuite/gdb.mi/ChangeLog gdb/testsuite/gdb.mi/Makefile.in gdb/testsuite/gdb.mi/basics.c gdb/testsuite/gdb.mi/configure gdb/testsuite/gdb.mi/configure.in gdb/testsuite/gdb.mi/mi-basics.exp gdb/testsuite/gdb.mi/mi-break.exp gdb/testsuite/gdb.mi/mi-console.c gdb/testsuite/gdb.mi/mi-console.exp gdb/testsuite/gdb.mi/mi-disassemble.exp gdb/testsuite/gdb.mi/mi-eval.exp gdb/testsuite/gdb.mi/mi-hack-cli.exp gdb/testsuite/gdb.mi/mi-read-memory.c gdb/testsuite/gdb.mi/mi-read-memory.exp gdb/testsuite/gdb.mi/mi-regs.exp gdb/testsuite/gdb.mi/mi-return.exp gdb/testsuite/gdb.mi/mi-simplerun.exp gdb/testsuite/gdb.mi/mi-stack.exp gdb/testsuite/gdb.mi/mi-stepi.exp gdb/testsuite/gdb.mi/mi-until.exp gdb/testsuite/gdb.mi/mi-var-block.exp gdb/testsuite/gdb.mi/mi-var-child.exp gdb/testsuite/gdb.mi/mi-var-cmd.exp gdb/testsuite/gdb.mi/mi-var-display.exp gdb/testsuite/gdb.mi/mi-watch.exp gdb/testsuite/gdb.mi/mi0-basics.exp gdb/testsuite/gdb.mi/mi0-break.exp gdb/testsuite/gdb.mi/mi0-console.exp gdb/testsuite/gdb.mi/mi0-disassemble.exp gdb/testsuite/gdb.mi/mi0-eval.exp gdb/testsuite/gdb.mi/mi0-hack-cli.exp gdb/testsuite/gdb.mi/mi0-read-memory.exp gdb/testsuite/gdb.mi/mi0-regs.exp gdb/testsuite/gdb.mi/mi0-return.exp gdb/testsuite/gdb.mi/mi0-simplerun.exp gdb/testsuite/gdb.mi/mi0-stack.exp gdb/testsuite/gdb.mi/mi0-stepi.exp gdb/testsuite/gdb.mi/mi0-until.exp gdb/testsuite/gdb.mi/mi0-var-block.exp gdb/testsuite/gdb.mi/mi0-var-child.exp gdb/testsuite/gdb.mi/mi0-var-cmd.exp gdb/testsuite/gdb.mi/mi0-var-display.exp gdb/testsuite/gdb.mi/mi0-watch.exp gdb/testsuite/gdb.mi/testcmds gdb/testsuite/gdb.mi/until.c gdb/testsuite/gdb.mi/var-cmd.c gdb/testsuite/gdb.stabs/Makefile.in gdb/testsuite/gdb.stabs/aout.sed gdb/testsuite/gdb.stabs/configure gdb/testsuite/gdb.stabs/configure.in gdb/testsuite/gdb.stabs/ecoff.sed gdb/testsuite/gdb.stabs/hppa.sed gdb/testsuite/gdb.stabs/weird.def gdb/testsuite/gdb.stabs/weird.exp gdb/testsuite/gdb.stabs/xcoff.sed gdb/testsuite/gdb.threads/Makefile.in gdb/testsuite/gdb.threads/config.in gdb/testsuite/gdb.threads/configure gdb/testsuite/gdb.threads/configure.in gdb/testsuite/gdb.threads/gcore-thread.exp gdb/testsuite/gdb.threads/linux-dp.c gdb/testsuite/gdb.threads/linux-dp.exp gdb/testsuite/gdb.threads/pthreads.c gdb/testsuite/gdb.threads/pthreads.exp gdb/testsuite/gdb.threads/step.c gdb/testsuite/gdb.threads/step.exp gdb/testsuite/gdb.threads/step2.exp gdb/testsuite/gdb.trace/Makefile.in gdb/testsuite/gdb.trace/actions.c gdb/testsuite/gdb.trace/actions.exp gdb/testsuite/gdb.trace/backtrace.exp gdb/testsuite/gdb.trace/circ.c gdb/testsuite/gdb.trace/circ.exp gdb/testsuite/gdb.trace/collection.c gdb/testsuite/gdb.trace/collection.exp gdb/testsuite/gdb.trace/configure gdb/testsuite/gdb.trace/configure.in gdb/testsuite/gdb.trace/deltrace.exp gdb/testsuite/gdb.trace/gdb_c_test.c gdb/testsuite/gdb.trace/infotrace.exp gdb/testsuite/gdb.trace/limits.c gdb/testsuite/gdb.trace/limits.exp gdb/testsuite/gdb.trace/packetlen.exp gdb/testsuite/gdb.trace/passc-dyn.exp gdb/testsuite/gdb.trace/passcount.exp gdb/testsuite/gdb.trace/report.exp gdb/testsuite/gdb.trace/save-trace.exp gdb/testsuite/gdb.trace/tfind.exp gdb/testsuite/gdb.trace/tracecmd.exp gdb/testsuite/gdb.trace/while-dyn.exp gdb/testsuite/gdb.trace/while-stepping.exp gdb/testsuite/lib/compiler.c gdb/testsuite/lib/compiler.cc gdb/testsuite/lib/emc-support.exp gdb/testsuite/lib/insight-support.exp gdb/testsuite/lib/java.exp gdb/testsuite/lib/mi-support.exp gdb/testsuite/lib/trace-support.exp gdb/thread-db.c gdb/thread.c gdb/top.h gdb/tracepoint.c gdb/tracepoint.h gdb/tui/ChangeLog gdb/tui/tui-file.c gdb/tui/tui-file.h gdb/tui/tui-hooks.c gdb/tui/tui-out.c gdb/tui/tui.c gdb/tui/tui.h gdb/tui/tuiCommand.c gdb/tui/tuiCommand.h gdb/tui/tuiData.c gdb/tui/tuiData.h gdb/tui/tuiDataWin.c gdb/tui/tuiDataWin.h gdb/tui/tuiDisassem.c gdb/tui/tuiDisassem.h gdb/tui/tuiGeneralWin.c gdb/tui/tuiGeneralWin.h gdb/tui/tuiIO.c gdb/tui/tuiIO.h gdb/tui/tuiLayout.c gdb/tui/tuiLayout.h gdb/tui/tuiRegs.c gdb/tui/tuiRegs.h gdb/tui/tuiSource.c gdb/tui/tuiSource.h gdb/tui/tuiSourceWin.c gdb/tui/tuiSourceWin.h gdb/tui/tuiStack.c gdb/tui/tuiStack.h gdb/tui/tuiWin.c gdb/tui/tuiWin.h gdb/typeprint.c gdb/typeprint.h gdb/ui-file.c gdb/ui-file.h gdb/ui-out.c gdb/ui-out.h gdb/utils.c gdb/uw-thread.c gdb/v850ice.c gdb/valarith.c gdb/valprint.c gdb/valprint.h gdb/varobj.c gdb/varobj.h gdb/vax-tdep.c gdb/vax-tdep.h gdb/version.h gdb/vx-share/README gdb/vx-share/dbgRpcLib.h gdb/vx-share/ptrace.h gdb/vx-share/regPacket.h gdb/vx-share/vxTypes.h gdb/vx-share/vxWorks.h gdb/vx-share/wait.h gdb/vx-share/xdr_ld.c gdb/vx-share/xdr_ld.h gdb/vx-share/xdr_ptrace.c gdb/vx-share/xdr_ptrace.h gdb/vx-share/xdr_rdb.c gdb/vx-share/xdr_rdb.h gdb/w89k-rom.c gdb/win32-nat.c gdb/wince-stub.c gdb/wince-stub.h gdb/wince.c gdb/x86-64-linux-nat.c gdb/x86-64-linux-tdep.c gdb/x86-64-tdep.h gdb/xcoffread.c gdb/xcoffsolib.c gdb/xcoffsolib.h gdb/xmodem.c gdb/xmodem.h gdb/xstormy16-tdep.c gdb/z8k-tdep.c gettext.m4 include/COPYING include/MAINTAINERS include/alloca-conf.h include/ansidecl.h include/aout/ChangeLog include/aout/adobe.h include/aout/aout64.h include/aout/ar.h include/aout/dynix3.h include/aout/encap.h include/aout/host.h include/aout/hp.h include/aout/hp300hpux.h include/aout/hppa.h include/aout/ranlib.h include/aout/reloc.h include/aout/stab.def include/aout/stab_gnu.h include/aout/sun4.h include/bin-bugs.h include/bout.h include/callback.h include/coff/ChangeLog include/coff/a29k.h include/coff/alpha.h include/coff/apollo.h include/coff/arm.h include/coff/aux-coff.h include/coff/ecoff.h include/coff/external.h include/coff/go32exe.h include/coff/h8300.h include/coff/h8500.h include/coff/i386.h include/coff/i860.h include/coff/i960.h include/coff/ia64.h include/coff/internal.h include/coff/m68k.h include/coff/m88k.h include/coff/mcore.h include/coff/mips.h include/coff/mipspe.h include/coff/or32.h include/coff/pe.h include/coff/powerpc.h include/coff/rs6000.h include/coff/rs6k64.h include/coff/sh.h include/coff/sparc.h include/coff/sym.h include/coff/symconst.h include/coff/ti.h include/coff/tic30.h include/coff/tic54x.h include/coff/tic80.h include/coff/w65.h include/coff/we32k.h include/coff/xcoff.h include/coff/z8k.h include/demangle.h include/dyn-string.h include/elf/alpha.h include/elf/arc.h include/elf/arm.h include/elf/avr.h include/elf/cris.h include/elf/d10v.h include/elf/d30v.h include/elf/dwarf.h include/elf/dwarf2.h include/elf/external.h include/elf/fr30.h include/elf/h8.h include/elf/hppa.h include/elf/i370.h include/elf/i860.h include/elf/i960.h include/elf/internal.h include/elf/m32r.h include/elf/m68hc11.h include/elf/m68k.h include/elf/mcore.h include/elf/mips.h include/elf/mmix.h include/elf/mn10200.h include/elf/mn10300.h include/elf/openrisc.h include/elf/or32.h include/elf/pj.h include/elf/ppc.h include/elf/reloc-macros.h include/elf/s390.h include/elf/sh.h include/elf/sparc.h include/elf/v850.h include/elf/vax.h include/elf/x86-64.h include/elf/xstormy16.h include/fibheap.h include/filenames.h include/floatformat.h include/fnmatch.h include/fopen-bin.h include/fopen-same.h include/fopen-vms.h include/gdb/callback.h include/gdb/remote-sim.h include/gdb/signals.h include/gdb/sim-sh.h include/gdbm.h include/getopt.h include/hashtab.h include/hp-symtab.h include/ieee.h include/libiberty.h include/md5.h include/mpw/ChangeLog include/mpw/README include/mpw/dir.h include/mpw/dirent.h include/mpw/fcntl.h include/mpw/grp.h include/mpw/mpw.h include/mpw/pwd.h include/mpw/spin.h include/mpw/stat.h include/mpw/sys/file.h include/mpw/sys/param.h include/mpw/sys/resource.h include/mpw/sys/stat.h include/mpw/sys/time.h include/mpw/sys/types.h include/mpw/utime.h include/mpw/varargs.h include/nlm/ChangeLog include/nlm/alpha-ext.h include/nlm/common.h include/nlm/external.h include/nlm/i386-ext.h include/nlm/internal.h include/nlm/ppc-ext.h include/nlm/sparc32-ext.h include/oasys.h include/objalloc.h include/obstack.h include/opcode/a29k.h include/opcode/alpha.h include/opcode/arc.h include/opcode/arm.h include/opcode/avr.h include/opcode/cgen.h include/opcode/convex.h include/opcode/cris.h include/opcode/d10v.h include/opcode/d30v.h include/opcode/hppa.h include/opcode/i370.h include/opcode/i386.h include/opcode/i860.h include/opcode/i960.h include/opcode/m68hc11.h include/opcode/m68k.h include/opcode/m88k.h include/opcode/mmix.h include/opcode/mn10200.h include/opcode/mn10300.h include/opcode/np1.h include/opcode/ns32k.h include/opcode/or32.h include/opcode/pdp11.h include/opcode/pj.h include/opcode/pn.h include/opcode/ppc.h include/opcode/pyr.h include/opcode/s390.h include/opcode/tahoe.h include/opcode/tic30.h include/opcode/tic54x.h include/opcode/tic80.h include/opcode/v850.h include/opcode/vax.h include/os9k.h include/partition.h include/progress.h include/regs/ChangeLog include/remote-sim.h include/safe-ctype.h include/sort.h include/splay-tree.h include/symcat.h include/ternary.h include/xregex.h include/xregex2.h install-sh intl/ChangeLog intl/Makefile.in intl/acconfig.h intl/aclocal.m4 intl/bindtextdom.c intl/cat-compat.c intl/config.in intl/configure intl/configure.in intl/dcgettext.c intl/dgettext.c intl/explodename.c intl/finddomain.c intl/gettext.c intl/gettext.h intl/gettextP.h intl/hash-string.h intl/intl-compat.c intl/intlh.inst.in intl/l10nflist.c intl/libgettext.h intl/libintl.glibc intl/linux-msg.sed intl/loadinfo.h intl/loadmsgcat.c intl/localealias.c intl/po2tbl.sed.in intl/textdomain.c intl/xopen-msg.sed libiberty/COPYING.LIB libiberty/Makefile.in libiberty/README libiberty/_doprnt.c libiberty/aclocal.m4 libiberty/alloca.c libiberty/argv.c libiberty/asprintf.c libiberty/atexit.c libiberty/basename.c libiberty/bcmp.c libiberty/bcopy.c libiberty/bsearch.c libiberty/bzero.c libiberty/calloc.c libiberty/choose-temp.c libiberty/clock.c libiberty/concat.c libiberty/config.h-vms libiberty/config.in libiberty/config/mh-aix libiberty/config/mh-cxux7 libiberty/config/mh-fbsd21 libiberty/config/mh-openedition libiberty/config/mh-windows libiberty/configure libiberty/configure.in libiberty/copying-lib.texi libiberty/copysign.c libiberty/cp-demangle.c libiberty/cplus-dem.c libiberty/dyn-string.c libiberty/fdmatch.c libiberty/ffs.c libiberty/fibheap.c libiberty/floatformat.c libiberty/fnmatch.c libiberty/fnmatch.txh libiberty/functions.texi libiberty/gather-docs libiberty/getcwd.c libiberty/getopt.c libiberty/getopt1.c libiberty/getpagesize.c libiberty/getpwd.c libiberty/getruntime.c libiberty/hashtab.c libiberty/hex.c libiberty/index.c libiberty/insque.c libiberty/lbasename.c libiberty/libiberty.texi libiberty/maint-tool libiberty/make-temp-file.c libiberty/makefile.vms libiberty/md5.c libiberty/memchr.c libiberty/memcmp.c libiberty/memcpy.c libiberty/memmove.c libiberty/memset.c libiberty/mkstemps.c libiberty/mpw-config.in libiberty/mpw-make.sed libiberty/mpw.c libiberty/msdos.c libiberty/objalloc.c libiberty/obstack.c libiberty/obstacks.texi libiberty/partition.c libiberty/pexecute.c libiberty/putenv.c libiberty/random.c libiberty/regex.c libiberty/rename.c libiberty/rindex.c libiberty/safe-ctype.c libiberty/setenv.c libiberty/sigsetmask.c libiberty/sort.c libiberty/spaces.c libiberty/splay-tree.c libiberty/strcasecmp.c libiberty/strchr.c libiberty/strdup.c libiberty/strerror.c libiberty/strncasecmp.c libiberty/strncmp.c libiberty/strrchr.c libiberty/strsignal.c libiberty/strstr.c libiberty/strtod.c libiberty/strtol.c libiberty/strtoul.c libiberty/ternary.c libiberty/testsuite/Makefile.in libiberty/testsuite/demangle-expected libiberty/testsuite/regress-demangle libiberty/tmpnam.c libiberty/vasprintf.c libiberty/vfork.c libiberty/vfprintf.c libiberty/vmsbuild.com libiberty/vprintf.c libiberty/vsprintf.c libiberty/waitpid.c libiberty/xatexit.c libiberty/xexit.c libiberty/xmalloc.c libiberty/xmemdup.c libiberty/xstrdup.c libiberty/xstrerror.c libtool.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh ltconfig ltmain.sh makefile.vms missing mkdep mkinstalldirs mmalloc/COPYING.LIB mmalloc/ChangeLog mmalloc/MAINTAINERS mmalloc/Makefile.in mmalloc/TODO mmalloc/acinclude.m4 mmalloc/aclocal.m4 mmalloc/attach.c mmalloc/configure mmalloc/configure.in mmalloc/detach.c mmalloc/keys.c mmalloc/mcalloc.c mmalloc/mfree.c mmalloc/mm.c mmalloc/mmalloc.c mmalloc/mmalloc.h mmalloc/mmalloc.texi mmalloc/mmap-sup.c mmalloc/mmcheck.c mmalloc/mmemalign.c mmalloc/mmprivate.h mmalloc/mmstats.c mmalloc/mmtrace.awk mmalloc/mmtrace.c mmalloc/mrealloc.c mmalloc/mvalloc.c mmalloc/sbrk-sup.c move-if-change mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install opcodes/ChangeLog-9297 opcodes/ChangeLog-9899 opcodes/MAINTAINERS opcodes/a29k-dis.c opcodes/alpha-dis.c opcodes/alpha-opc.c opcodes/arc-dis.h opcodes/arc-ext.c opcodes/arc-ext.h opcodes/arc-opc.c opcodes/arm-opc.h opcodes/avr-dis.c opcodes/cgen-asm.c opcodes/cgen-asm.in opcodes/cgen-dis.c opcodes/cgen-dis.in opcodes/cgen-ibld.in opcodes/cgen-opc.c opcodes/cgen.sh opcodes/config.in opcodes/cris-dis.c opcodes/cris-opc.c opcodes/d10v-dis.c opcodes/d10v-opc.c opcodes/d30v-dis.c opcodes/d30v-opc.c opcodes/dep-in.sed opcodes/dis-buf.c opcodes/fr30-desc.h opcodes/fr30-ibld.c opcodes/fr30-opc.c opcodes/fr30-opc.h opcodes/h8300-dis.c opcodes/h8500-dis.c opcodes/h8500-opc.h opcodes/hppa-dis.c opcodes/i370-dis.c opcodes/i370-opc.c opcodes/i386-dis.c opcodes/i860-dis.c opcodes/i960-dis.c opcodes/ia64-asmtab.c opcodes/ia64-asmtab.h opcodes/ia64-dis.c opcodes/ia64-gen.c opcodes/ia64-ic.tbl opcodes/ia64-opc-a.c opcodes/ia64-opc-b.c opcodes/ia64-opc-d.c opcodes/ia64-opc-f.c opcodes/ia64-opc-i.c opcodes/ia64-opc-m.c opcodes/ia64-opc-x.c opcodes/ia64-opc.c opcodes/ia64-opc.h opcodes/ia64-raw.tbl opcodes/ia64-war.tbl opcodes/ia64-waw.tbl opcodes/m10200-dis.c opcodes/m10200-opc.c opcodes/m10300-dis.c opcodes/m10300-opc.c opcodes/m32r-desc.h opcodes/m32r-ibld.c opcodes/m32r-opc.c opcodes/m32r-opc.h opcodes/m32r-opinst.c opcodes/m68hc11-dis.c opcodes/m68hc11-opc.c opcodes/m68k-opc.c opcodes/m88k-dis.c opcodes/makefile.vms opcodes/mcore-dis.c opcodes/mcore-opc.h opcodes/mips16-opc.c opcodes/mmix-dis.c opcodes/mmix-opc.c opcodes/mpw-config.in opcodes/mpw-make.sed opcodes/ns32k-dis.c opcodes/openrisc-desc.h opcodes/openrisc-ibld.c opcodes/openrisc-opc.c opcodes/openrisc-opc.h opcodes/opintl.h opcodes/or32-dis.c opcodes/or32-opc.c opcodes/pdp11-dis.c opcodes/pdp11-opc.c opcodes/pj-dis.c opcodes/pj-opc.c opcodes/po/.cvsignore opcodes/po/Make-in opcodes/po/POTFILES.in opcodes/po/da.po opcodes/po/de.po opcodes/po/es.po opcodes/po/fr.po opcodes/po/id.po opcodes/po/opcodes.pot opcodes/po/sv.po opcodes/po/tr.po opcodes/ppc-dis.c opcodes/ppc-opc.c opcodes/s390-dis.c opcodes/s390-mkopc.c opcodes/s390-opc.c opcodes/s390-opc.txt opcodes/sh-opc.h opcodes/sh64-opc.c opcodes/sh64-opc.h opcodes/sparc-dis.c opcodes/sparc-opc.c opcodes/stamp-h.in opcodes/sysdep.h opcodes/tic30-dis.c opcodes/tic54x-dis.c opcodes/tic54x-opc.c opcodes/tic80-dis.c opcodes/tic80-opc.c opcodes/v850-dis.c opcodes/v850-opc.c opcodes/vax-dis.c opcodes/w65-dis.c opcodes/w65-opc.h opcodes/xstormy16-desc.h opcodes/xstormy16-ibld.c opcodes/xstormy16-opc.c opcodes/xstormy16-opc.h opcodes/z8k-dis.c opcodes/z8k-opc.h opcodes/z8kgen.c readline/CHANGELOG readline/CHANGES readline/COPYING readline/ChangeLog.gdb readline/INSTALL readline/MANIFEST readline/Makefile.in readline/README readline/USAGE readline/acconfig.h readline/aclocal.m4 readline/ansi_stdlib.h readline/bind.c readline/callback.c readline/chardefs.h readline/complete.c readline/config.h.bot readline/config.h.in readline/configure readline/configure.in readline/cross-build/cygwin.cache readline/display.c readline/doc/ChangeLog.gdb readline/doc/Makefile.in readline/doc/hist.texinfo readline/doc/hstech.texinfo readline/doc/hsuser.texinfo readline/doc/inc-hist.texinfo readline/doc/manvers.texinfo readline/doc/readline.3 readline/doc/rlman.texinfo readline/doc/rltech.texinfo readline/doc/rluser.texinfo readline/doc/rluserman.texinfo readline/doc/texi2dvi readline/doc/texi2html readline/emacs_keymap.c readline/examples/ChangeLog.gdb readline/examples/Inputrc readline/examples/Makefile.in readline/examples/excallback.c readline/examples/fileman.c readline/examples/histexamp.c readline/examples/manexamp.c readline/examples/rl.c readline/examples/rlfe.c readline/examples/rltest.c readline/examples/rlversion.c readline/funmap.c readline/histexpand.c readline/histfile.c readline/histlib.h readline/history.c readline/history.h readline/histsearch.c readline/input.c readline/isearch.c readline/keymaps.c readline/keymaps.h readline/kill.c readline/macro.c readline/nls.c readline/parens.c readline/posixdir.h readline/posixjmp.h readline/posixstat.h readline/readline.c readline/readline.h readline/rlconf.h readline/rldefs.h readline/rlprivate.h readline/rlshell.h readline/rlstdc.h readline/rltty.c readline/rltty.h readline/rlwinsize.h readline/savestring.c readline/search.c readline/shell.c readline/shlib/Makefile.in readline/signals.c readline/support/config.guess readline/support/config.sub readline/support/install.sh readline/support/mkdirs readline/support/mkdist readline/support/shlib-install readline/support/shobj-conf readline/tcap.h readline/terminal.c readline/tilde.c readline/tilde.h readline/undo.c readline/util.c readline/vi_keymap.c readline/vi_mode.c readline/xmalloc.c readline/xmalloc.h setup.com sim/Makefile.in sim/README-HACKING sim/arm/COPYING sim/arm/README.Cygnus sim/arm/acconfig.h sim/arm/armdefs.h sim/arm/armemu.h sim/arm/armfpe.h sim/arm/arminit.c sim/arm/armopts.h sim/arm/armos.h sim/arm/armrdi.c sim/arm/bag.c sim/arm/bag.h sim/arm/communicate.c sim/arm/communicate.h sim/arm/config.in sim/arm/configure sim/arm/configure.in sim/arm/dbg_conf.h sim/arm/dbg_cp.h sim/arm/dbg_hif.h sim/arm/gdbhost.c sim/arm/gdbhost.h sim/arm/kid.c sim/arm/main.c sim/arm/parent.c sim/arm/tconfig.in sim/common/Make-common.in sim/common/Makefile.in sim/common/acconfig.h sim/common/aclocal.m4 sim/common/callback.c sim/common/cgen-accfp.c sim/common/cgen-cpu.h sim/common/cgen-defs.h sim/common/cgen-engine.h sim/common/cgen-fpu.c sim/common/cgen-fpu.h sim/common/cgen-mem.h sim/common/cgen-ops.h sim/common/cgen-par.c sim/common/cgen-par.h sim/common/cgen-run.c sim/common/cgen-scache.c sim/common/cgen-scache.h sim/common/cgen-sim.h sim/common/cgen-trace.c sim/common/cgen-trace.h sim/common/cgen-types.h sim/common/cgen-utils.c sim/common/cgen.sh sim/common/config.in sim/common/configure sim/common/configure.in sim/common/dv-core.c sim/common/dv-glue.c sim/common/dv-pal.c sim/common/dv-sockser.c sim/common/dv-sockser.h sim/common/gdbinit.in sim/common/genmloop.sh sim/common/gennltvals.sh sim/common/gentmap.c sim/common/gentvals.sh sim/common/hw-alloc.c sim/common/hw-alloc.h sim/common/hw-base.c sim/common/hw-base.h sim/common/hw-device.c sim/common/hw-device.h sim/common/hw-events.c sim/common/hw-events.h sim/common/hw-handles.c sim/common/hw-handles.h sim/common/hw-instances.c sim/common/hw-instances.h sim/common/hw-main.h sim/common/hw-ports.c sim/common/hw-ports.h sim/common/hw-properties.c sim/common/hw-properties.h sim/common/hw-tree.c sim/common/hw-tree.h sim/common/nltvals.def sim/common/nrun.c sim/common/run.1 sim/common/sim-abort.c sim/common/sim-alu.h sim/common/sim-arange.c sim/common/sim-arange.h sim/common/sim-assert.h sim/common/sim-base.h sim/common/sim-basics.h sim/common/sim-bits.c sim/common/sim-bits.h sim/common/sim-break.c sim/common/sim-break.h sim/common/sim-config.c sim/common/sim-config.h sim/common/sim-core.c sim/common/sim-core.h sim/common/sim-cpu.c sim/common/sim-cpu.h sim/common/sim-endian.c sim/common/sim-endian.h sim/common/sim-engine.c sim/common/sim-engine.h sim/common/sim-events.c sim/common/sim-events.h sim/common/sim-fpu.c sim/common/sim-fpu.h sim/common/sim-hload.c sim/common/sim-hrw.c sim/common/sim-hw.c sim/common/sim-hw.h sim/common/sim-info.c sim/common/sim-inline.c sim/common/sim-inline.h sim/common/sim-io.c sim/common/sim-io.h sim/common/sim-load.c sim/common/sim-memopt.c sim/common/sim-memopt.h sim/common/sim-model.c sim/common/sim-model.h sim/common/sim-module.c sim/common/sim-module.h sim/common/sim-n-bits.h sim/common/sim-n-core.h sim/common/sim-n-endian.h sim/common/sim-options.h sim/common/sim-profile.c sim/common/sim-profile.h sim/common/sim-reason.c sim/common/sim-reg.c sim/common/sim-resume.c sim/common/sim-run.c sim/common/sim-signal.c sim/common/sim-signal.h sim/common/sim-stop.c sim/common/sim-trace.c sim/common/sim-trace.h sim/common/sim-types.h sim/common/sim-utils.c sim/common/sim-utils.h sim/common/sim-watch.c sim/common/sim-watch.h sim/common/syscall.c sim/common/tconfig.in sim/configure sim/configure.in sim/d10v/acconfig.h sim/d10v/config.in sim/d10v/configure sim/d10v/configure.in sim/d10v/d10v_sim.h sim/d10v/endian.c sim/d10v/gencode.c sim/d30v/ChangeLog sim/d30v/Makefile.in sim/d30v/acconfig.h sim/d30v/alu.h sim/d30v/config.in sim/d30v/configure sim/d30v/configure.in sim/d30v/cpu.c sim/d30v/cpu.h sim/d30v/d30v-insns sim/d30v/dc-short sim/d30v/engine.c sim/d30v/ic-d30v sim/d30v/sim-calls.c sim/d30v/sim-main.h sim/d30v/tconfig.in sim/erc32/ChangeLog sim/erc32/Makefile.in sim/erc32/NEWS sim/erc32/README.erc32 sim/erc32/README.gdb sim/erc32/README.sis sim/erc32/acconfig.h sim/erc32/config.in sim/erc32/configure sim/erc32/configure.in sim/erc32/end.c sim/erc32/erc32.c sim/erc32/exec.c sim/erc32/float.c sim/erc32/func.c sim/erc32/help.c sim/erc32/interf.c sim/erc32/sis.c sim/erc32/sis.h sim/erc32/startsim sim/fr30/ChangeLog sim/fr30/Makefile.in sim/fr30/README sim/fr30/TODO sim/fr30/arch.c sim/fr30/arch.h sim/fr30/config.in sim/fr30/configure sim/fr30/configure.in sim/fr30/cpu.c sim/fr30/cpu.h sim/fr30/cpuall.h sim/fr30/decode.c sim/fr30/decode.h sim/fr30/devices.c sim/fr30/fr30-sim.h sim/fr30/fr30.c sim/fr30/mloop.in sim/fr30/model.c sim/fr30/sem-switch.c sim/fr30/sem.c sim/fr30/sim-if.c sim/fr30/sim-main.h sim/fr30/tconfig.in sim/fr30/traps.c sim/h8300/Makefile.in sim/h8300/acconfig.h sim/h8300/config.in sim/h8300/configure sim/h8300/configure.in sim/h8300/tconfig.in sim/h8300/writecode.c sim/h8500/ChangeLog sim/h8500/Makefile.in sim/h8500/acconfig.h sim/h8500/compile.c sim/h8500/config.in sim/h8500/configure sim/h8500/configure.in sim/h8500/inst.h sim/h8500/tconfig.in sim/i960/ChangeLog sim/i960/Makefile.in sim/i960/README sim/i960/TODO sim/i960/acconfig.h sim/i960/arch.c sim/i960/arch.h sim/i960/config.in sim/i960/configure sim/i960/configure.in sim/i960/cpu.c sim/i960/cpu.h sim/i960/cpuall.h sim/i960/decode.c sim/i960/decode.h sim/i960/devices.c sim/i960/i960-desc.c sim/i960/i960-desc.h sim/i960/i960-opc.h sim/i960/i960-sim.h sim/i960/i960.c sim/i960/mloop.in sim/i960/model.c sim/i960/sem-switch.c sim/i960/sem.c sim/i960/sim-if.c sim/i960/sim-main.h sim/i960/tconfig.in sim/i960/traps.c sim/igen/ChangeLog sim/igen/Makefile.in sim/igen/acconfig.h sim/igen/config.in sim/igen/configure sim/igen/configure.in sim/igen/filter.c sim/igen/filter.h sim/igen/filter_host.c sim/igen/filter_host.h sim/igen/gen-engine.c sim/igen/gen-engine.h sim/igen/gen-icache.c sim/igen/gen-icache.h sim/igen/gen-idecode.c sim/igen/gen-idecode.h sim/igen/gen-itable.c sim/igen/gen-itable.h sim/igen/gen-model.c sim/igen/gen-model.h sim/igen/gen-semantics.c sim/igen/gen-semantics.h sim/igen/gen-support.c sim/igen/gen-support.h sim/igen/gen.c sim/igen/gen.h sim/igen/igen.c sim/igen/igen.h sim/igen/ld-cache.c sim/igen/ld-cache.h sim/igen/ld-decode.c sim/igen/ld-decode.h sim/igen/ld-insn.c sim/igen/ld-insn.h sim/igen/lf.c sim/igen/lf.h sim/igen/misc.c sim/igen/misc.h sim/igen/table.c sim/igen/table.h sim/m32r/ChangeLog sim/m32r/Makefile.in sim/m32r/README sim/m32r/TODO sim/m32r/acconfig.h sim/m32r/arch.c sim/m32r/arch.h sim/m32r/config.in sim/m32r/configure sim/m32r/configure.in sim/m32r/cpu.c sim/m32r/cpu.h sim/m32r/cpuall.h sim/m32r/cpux.c sim/m32r/cpux.h sim/m32r/decode.c sim/m32r/decode.h sim/m32r/decodex.c sim/m32r/decodex.h sim/m32r/devices.c sim/m32r/m32r-sim.h sim/m32r/m32r.c sim/m32r/m32rx.c sim/m32r/mloop.in sim/m32r/mloopx.in sim/m32r/model.c sim/m32r/modelx.c sim/m32r/sem-switch.c sim/m32r/sem.c sim/m32r/semx-switch.c sim/m32r/sim-if.c sim/m32r/sim-main.h sim/m32r/tconfig.in sim/m32r/traps.c sim/m68hc11/ChangeLog sim/m68hc11/Makefile.in sim/m68hc11/config.in sim/m68hc11/configure sim/m68hc11/configure.in sim/m68hc11/dv-m68hc11.c sim/m68hc11/dv-m68hc11eepr.c sim/m68hc11/dv-m68hc11sio.c sim/m68hc11/dv-m68hc11spi.c sim/m68hc11/dv-m68hc11tim.c sim/m68hc11/dv-nvram.c sim/m68hc11/emulos.c sim/m68hc11/gencode.c sim/m68hc11/interp.c sim/m68hc11/interrupts.c sim/m68hc11/interrupts.h sim/m68hc11/m68hc11_sim.c sim/m68hc11/sim-main.h sim/mcore/ChangeLog sim/mcore/Makefile.in sim/mcore/config.in sim/mcore/configure sim/mcore/configure.in sim/mcore/interp.c sim/mcore/sysdep.h sim/mips/ChangeLog sim/mips/Makefile.in sim/mips/acconfig.h sim/mips/config.in sim/mips/configure sim/mips/configure.in sim/mips/cp1.c sim/mips/cp1.h sim/mips/dv-tx3904cpu.c sim/mips/dv-tx3904irc.c sim/mips/dv-tx3904sio.c sim/mips/dv-tx3904tmr.c sim/mips/interp.c sim/mips/m16.dc sim/mips/m16.igen sim/mips/m16run.c sim/mips/mdmx.igen sim/mips/mips.dc sim/mips/mips.igen sim/mips/mips3d.igen sim/mips/sb1.igen sim/mips/sim-main.c sim/mips/sim-main.h sim/mips/tconfig.in sim/mips/tx.igen sim/mips/vr.igen sim/mn10200/ChangeLog sim/mn10200/Makefile.in sim/mn10200/acconfig.h sim/mn10200/config.in sim/mn10200/configure sim/mn10200/configure.in sim/mn10200/gencode.c sim/mn10200/interp.c sim/mn10200/mn10200_sim.h sim/mn10200/simops.c sim/mn10300/ChangeLog sim/mn10300/Makefile.in sim/mn10300/acconfig.h sim/mn10300/am33.igen sim/mn10300/config.in sim/mn10300/configure sim/mn10300/configure.in sim/mn10300/dv-mn103cpu.c sim/mn10300/dv-mn103int.c sim/mn10300/dv-mn103iop.c sim/mn10300/dv-mn103ser.c sim/mn10300/dv-mn103tim.c sim/mn10300/gencode.c sim/mn10300/interp.c sim/mn10300/mn10300.dc sim/mn10300/mn10300.igen sim/mn10300/mn10300_sim.h sim/mn10300/op_utils.c sim/mn10300/sim-main.c sim/mn10300/sim-main.h sim/mn10300/simops.c sim/mn10300/tconfig.in sim/ppc/.gdbinit sim/ppc/BUGS sim/ppc/COPYING sim/ppc/COPYING.LIB sim/ppc/ChangeLog sim/ppc/ChangeLog.00 sim/ppc/INSTALL sim/ppc/Makefile.in sim/ppc/README sim/ppc/RUN sim/ppc/acconfig.h sim/ppc/aclocal.m4 sim/ppc/basics.h sim/ppc/bits.c sim/ppc/bits.h sim/ppc/cap.c sim/ppc/cap.h sim/ppc/config.in sim/ppc/configure sim/ppc/configure.in sim/ppc/corefile-n.h sim/ppc/corefile.c sim/ppc/corefile.h sim/ppc/cpu.c sim/ppc/cpu.h sim/ppc/dc-complex sim/ppc/dc-simple sim/ppc/dc-stupid sim/ppc/dc-test.01 sim/ppc/dc-test.02 sim/ppc/debug.c sim/ppc/debug.h sim/ppc/device.c sim/ppc/device.h sim/ppc/device_table.c sim/ppc/device_table.h sim/ppc/dgen.c sim/ppc/double.c sim/ppc/dp-bit.c sim/ppc/emul_bugapi.c sim/ppc/emul_bugapi.h sim/ppc/emul_chirp.c sim/ppc/emul_chirp.h sim/ppc/emul_generic.c sim/ppc/emul_generic.h sim/ppc/emul_netbsd.c sim/ppc/emul_netbsd.h sim/ppc/emul_unix.c sim/ppc/emul_unix.h sim/ppc/events.c sim/ppc/events.h sim/ppc/filter.c sim/ppc/filter.h sim/ppc/filter_filename.c sim/ppc/filter_filename.h sim/ppc/gen-icache.c sim/ppc/gen-icache.h sim/ppc/gen-idecode.c sim/ppc/gen-idecode.h sim/ppc/gen-itable.c sim/ppc/gen-itable.h sim/ppc/gen-model.c sim/ppc/gen-model.h sim/ppc/gen-semantics.c sim/ppc/gen-semantics.h sim/ppc/gen-support.c sim/ppc/gen-support.h sim/ppc/hw_com.c sim/ppc/hw_core.c sim/ppc/hw_cpu.c sim/ppc/hw_cpu.h sim/ppc/hw_disk.c sim/ppc/hw_eeprom.c sim/ppc/hw_glue.c sim/ppc/hw_htab.c sim/ppc/hw_ide.c sim/ppc/hw_init.c sim/ppc/hw_iobus.c sim/ppc/hw_memory.c sim/ppc/hw_nvram.c sim/ppc/hw_opic.c sim/ppc/hw_pal.c sim/ppc/hw_phb.c sim/ppc/hw_phb.h sim/ppc/hw_register.c sim/ppc/hw_trace.c sim/ppc/hw_vm.c sim/ppc/idecode_branch.h sim/ppc/idecode_expression.h sim/ppc/idecode_fields.h sim/ppc/igen.c sim/ppc/igen.h sim/ppc/inline.c sim/ppc/inline.h sim/ppc/interrupts.c sim/ppc/interrupts.h sim/ppc/ld-cache.c sim/ppc/ld-cache.h sim/ppc/ld-decode.c sim/ppc/ld-decode.h sim/ppc/ld-insn.c sim/ppc/ld-insn.h sim/ppc/lf.c sim/ppc/lf.h sim/ppc/main.c sim/ppc/misc.c sim/ppc/misc.h sim/ppc/mon.c sim/ppc/mon.h sim/ppc/options.c sim/ppc/options.h sim/ppc/os_emul.c sim/ppc/os_emul.h sim/ppc/pk_disklabel.c sim/ppc/ppc-cache-rules sim/ppc/ppc-instructions sim/ppc/ppc-spr-table sim/ppc/ppc.mt sim/ppc/psim.c sim/ppc/psim.h sim/ppc/psim.texinfo sim/ppc/registers.c sim/ppc/registers.h sim/ppc/sim-endian-n.h sim/ppc/sim-endian.c sim/ppc/sim-endian.h sim/ppc/sim-main.h sim/ppc/sim_callbacks.h sim/ppc/sim_calls.c sim/ppc/std-config.h sim/ppc/table.c sim/ppc/table.h sim/ppc/tree.c sim/ppc/tree.h sim/ppc/vm.c sim/ppc/vm.h sim/ppc/vm_n.h sim/ppc/words.h sim/sh/ChangeLog sim/sh/Makefile.in sim/sh/acconfig.h sim/sh/config.in sim/sh/configure sim/sh/configure.in sim/sh/gencode.c sim/sh/interp.c sim/sh/syscall.h sim/sh/tconfig.in sim/testsuite/ChangeLog sim/testsuite/Makefile.in sim/testsuite/common/Make-common.in sim/testsuite/common/Makefile.in sim/testsuite/common/alu-n-tst.h sim/testsuite/common/alu-tst.c sim/testsuite/common/bits-gen.c sim/testsuite/common/bits-tst.c sim/testsuite/common/fpu-tst.c sim/testsuite/config/default.exp sim/testsuite/configure sim/testsuite/configure.in sim/testsuite/d10v-elf/ChangeLog sim/testsuite/d10v-elf/Makefile.in sim/testsuite/d10v-elf/configure sim/testsuite/d10v-elf/configure.in sim/testsuite/d10v-elf/exit47.s sim/testsuite/d10v-elf/hello.s sim/testsuite/d10v-elf/loop.s sim/testsuite/d10v-elf/t-ae-ld-d.s sim/testsuite/d10v-elf/t-ae-ld-i.s sim/testsuite/d10v-elf/t-ae-ld-id.s sim/testsuite/d10v-elf/t-ae-ld-im.s sim/testsuite/d10v-elf/t-ae-ld-ip.s sim/testsuite/d10v-elf/t-ae-ld2w-d.s sim/testsuite/d10v-elf/t-ae-ld2w-i.s sim/testsuite/d10v-elf/t-ae-ld2w-id.s sim/testsuite/d10v-elf/t-ae-ld2w-im.s sim/testsuite/d10v-elf/t-ae-ld2w-ip.s sim/testsuite/d10v-elf/t-ae-st-d.s sim/testsuite/d10v-elf/t-ae-st-i.s sim/testsuite/d10v-elf/t-ae-st-id.s sim/testsuite/d10v-elf/t-ae-st-im.s sim/testsuite/d10v-elf/t-ae-st-ip.s sim/testsuite/d10v-elf/t-ae-st-is.s sim/testsuite/d10v-elf/t-ae-st2w-d.s sim/testsuite/d10v-elf/t-ae-st2w-i.s sim/testsuite/d10v-elf/t-ae-st2w-id.s sim/testsuite/d10v-elf/t-ae-st2w-im.s sim/testsuite/d10v-elf/t-ae-st2w-ip.s sim/testsuite/d10v-elf/t-ae-st2w-is.s sim/testsuite/d10v-elf/t-dbt.s sim/testsuite/d10v-elf/t-ld-st.s sim/testsuite/d10v-elf/t-mac.s sim/testsuite/d10v-elf/t-macros.i sim/testsuite/d10v-elf/t-mod-ld-pre.s sim/testsuite/d10v-elf/t-msbu.s sim/testsuite/d10v-elf/t-mulxu.s sim/testsuite/d10v-elf/t-mvtac.s sim/testsuite/d10v-elf/t-mvtc.s sim/testsuite/d10v-elf/t-rac.s sim/testsuite/d10v-elf/t-rachi.s sim/testsuite/d10v-elf/t-rdt.s sim/testsuite/d10v-elf/t-rep.s sim/testsuite/d10v-elf/t-rie-xx.s sim/testsuite/d10v-elf/t-rte.s sim/testsuite/d10v-elf/t-sac.s sim/testsuite/d10v-elf/t-sachi.s sim/testsuite/d10v-elf/t-sadd.s sim/testsuite/d10v-elf/t-slae.s sim/testsuite/d10v-elf/t-sp.s sim/testsuite/d10v-elf/t-sub.s sim/testsuite/d10v-elf/t-sub2w.s sim/testsuite/d10v-elf/t-subi.s sim/testsuite/d10v-elf/t-trap.s sim/testsuite/d30v-elf/ChangeLog sim/testsuite/d30v-elf/Makefile.in sim/testsuite/d30v-elf/br-bra.S sim/testsuite/d30v-elf/br-bratnz.S sim/testsuite/d30v-elf/br-bratzr.S sim/testsuite/d30v-elf/br-bsr.S sim/testsuite/d30v-elf/br-dbra.S sim/testsuite/d30v-elf/br-djmp.S sim/testsuite/d30v-elf/br-djsr.S sim/testsuite/d30v-elf/configure sim/testsuite/d30v-elf/configure.in sim/testsuite/d30v-elf/do-2wordops.S sim/testsuite/d30v-elf/do-flags.S sim/testsuite/d30v-elf/do-shifts.S sim/testsuite/d30v-elf/em-e0.S sim/testsuite/d30v-elf/em-e47.S sim/testsuite/d30v-elf/em-pchr.S sim/testsuite/d30v-elf/em-pstr.S sim/testsuite/d30v-elf/exit47.s sim/testsuite/d30v-elf/hello.s sim/testsuite/d30v-elf/loop.s sim/testsuite/d30v-elf/ls-ld2h.S sim/testsuite/d30v-elf/ls-ld2w.S sim/testsuite/d30v-elf/ls-ld4bh.S sim/testsuite/d30v-elf/ls-ld4bhu.S sim/testsuite/d30v-elf/ls-ldb.S sim/testsuite/d30v-elf/ls-ldbu.S sim/testsuite/d30v-elf/ls-ldh.S sim/testsuite/d30v-elf/ls-ldhh.S sim/testsuite/d30v-elf/ls-ldhu.S sim/testsuite/d30v-elf/ls-ldw.S sim/testsuite/d30v-elf/ls-modaddr.S sim/testsuite/d30v-elf/ls-moddec.S sim/testsuite/d30v-elf/ls-modinc.S sim/testsuite/d30v-elf/ls-st2h.S sim/testsuite/d30v-elf/ls-st2w.S sim/testsuite/d30v-elf/ls-st4hb.S sim/testsuite/d30v-elf/ls-stb.S sim/testsuite/d30v-elf/ls-sth.S sim/testsuite/d30v-elf/ls-sthh.S sim/testsuite/d30v-elf/ls-stw.S sim/testsuite/d30v-elf/os-dbt.S sim/testsuite/d30v-elf/tick.s sim/testsuite/d30v-elf/trap.S sim/testsuite/fr30-elf/ChangeLog sim/testsuite/fr30-elf/Makefile.in sim/testsuite/fr30-elf/configure sim/testsuite/fr30-elf/configure.in sim/testsuite/fr30-elf/exit47.s sim/testsuite/fr30-elf/hello.s sim/testsuite/fr30-elf/loop.s sim/testsuite/lib/sim-defs.exp sim/testsuite/m32r-elf/ChangeLog sim/testsuite/m32r-elf/Makefile.in sim/testsuite/m32r-elf/configure sim/testsuite/m32r-elf/configure.in sim/testsuite/m32r-elf/exit47.s sim/testsuite/m32r-elf/hello.s sim/testsuite/m32r-elf/loop.s sim/testsuite/mips64el-elf/ChangeLog sim/testsuite/mips64el-elf/Makefile.in sim/testsuite/mips64el-elf/configure sim/testsuite/mips64el-elf/configure.in sim/testsuite/sim/fr30/add.cgs sim/testsuite/sim/fr30/add.ms sim/testsuite/sim/fr30/add2.cgs sim/testsuite/sim/fr30/addc.cgs sim/testsuite/sim/fr30/addn.cgs sim/testsuite/sim/fr30/addn2.cgs sim/testsuite/sim/fr30/addsp.cgs sim/testsuite/sim/fr30/allinsn.exp sim/testsuite/sim/fr30/and.cgs sim/testsuite/sim/fr30/andb.cgs sim/testsuite/sim/fr30/andccr.cgs sim/testsuite/sim/fr30/andh.cgs sim/testsuite/sim/fr30/asr.cgs sim/testsuite/sim/fr30/asr2.cgs sim/testsuite/sim/fr30/bandh.cgs sim/testsuite/sim/fr30/bandl.cgs sim/testsuite/sim/fr30/bc.cgs sim/testsuite/sim/fr30/beorh.cgs sim/testsuite/sim/fr30/beorl.cgs sim/testsuite/sim/fr30/beq.cgs sim/testsuite/sim/fr30/bge.cgs sim/testsuite/sim/fr30/bgt.cgs sim/testsuite/sim/fr30/bhi.cgs sim/testsuite/sim/fr30/ble.cgs sim/testsuite/sim/fr30/bls.cgs sim/testsuite/sim/fr30/blt.cgs sim/testsuite/sim/fr30/bn.cgs sim/testsuite/sim/fr30/bnc.cgs sim/testsuite/sim/fr30/bne.cgs sim/testsuite/sim/fr30/bno.cgs sim/testsuite/sim/fr30/bnv.cgs sim/testsuite/sim/fr30/borh.cgs sim/testsuite/sim/fr30/borl.cgs sim/testsuite/sim/fr30/bp.cgs sim/testsuite/sim/fr30/bra.cgs sim/testsuite/sim/fr30/btsth.cgs sim/testsuite/sim/fr30/btstl.cgs sim/testsuite/sim/fr30/bv.cgs sim/testsuite/sim/fr30/call.cgs sim/testsuite/sim/fr30/cmp.cgs sim/testsuite/sim/fr30/cmp2.cgs sim/testsuite/sim/fr30/copld.cgs sim/testsuite/sim/fr30/copop.cgs sim/testsuite/sim/fr30/copst.cgs sim/testsuite/sim/fr30/copsv.cgs sim/testsuite/sim/fr30/div.ms sim/testsuite/sim/fr30/div0s.cgs sim/testsuite/sim/fr30/div0u.cgs sim/testsuite/sim/fr30/div1.cgs sim/testsuite/sim/fr30/div2.cgs sim/testsuite/sim/fr30/div3.cgs sim/testsuite/sim/fr30/div4s.cgs sim/testsuite/sim/fr30/dmov.cgs sim/testsuite/sim/fr30/dmovb.cgs sim/testsuite/sim/fr30/dmovh.cgs sim/testsuite/sim/fr30/enter.cgs sim/testsuite/sim/fr30/eor.cgs sim/testsuite/sim/fr30/eorb.cgs sim/testsuite/sim/fr30/eorh.cgs sim/testsuite/sim/fr30/extsb.cgs sim/testsuite/sim/fr30/extsh.cgs sim/testsuite/sim/fr30/extub.cgs sim/testsuite/sim/fr30/extuh.cgs sim/testsuite/sim/fr30/hello.ms sim/testsuite/sim/fr30/int.cgs sim/testsuite/sim/fr30/inte.cgs sim/testsuite/sim/fr30/jmp.cgs sim/testsuite/sim/fr30/ld.cgs sim/testsuite/sim/fr30/ldi20.cgs sim/testsuite/sim/fr30/ldi32.cgs sim/testsuite/sim/fr30/ldi8.cgs sim/testsuite/sim/fr30/ldm0.cgs sim/testsuite/sim/fr30/ldm1.cgs sim/testsuite/sim/fr30/ldres.cgs sim/testsuite/sim/fr30/ldub.cgs sim/testsuite/sim/fr30/lduh.cgs sim/testsuite/sim/fr30/leave.cgs sim/testsuite/sim/fr30/lsl.cgs sim/testsuite/sim/fr30/lsl2.cgs sim/testsuite/sim/fr30/lsr.cgs sim/testsuite/sim/fr30/lsr2.cgs sim/testsuite/sim/fr30/misc.exp sim/testsuite/sim/fr30/mov.cgs sim/testsuite/sim/fr30/mul.cgs sim/testsuite/sim/fr30/mulh.cgs sim/testsuite/sim/fr30/mulu.cgs sim/testsuite/sim/fr30/muluh.cgs sim/testsuite/sim/fr30/nop.cgs sim/testsuite/sim/fr30/or.cgs sim/testsuite/sim/fr30/orb.cgs sim/testsuite/sim/fr30/orccr.cgs sim/testsuite/sim/fr30/orh.cgs sim/testsuite/sim/fr30/ret.cgs sim/testsuite/sim/fr30/reti.cgs sim/testsuite/sim/fr30/st.cgs sim/testsuite/sim/fr30/stb.cgs sim/testsuite/sim/fr30/sth.cgs sim/testsuite/sim/fr30/stilm.cgs sim/testsuite/sim/fr30/stm0.cgs sim/testsuite/sim/fr30/stm1.cgs sim/testsuite/sim/fr30/stres.cgs sim/testsuite/sim/fr30/sub.cgs sim/testsuite/sim/fr30/subc.cgs sim/testsuite/sim/fr30/subn.cgs sim/testsuite/sim/fr30/testutils.inc sim/testsuite/sim/fr30/xchb.cgs sim/testsuite/sim/m32r/add.cgs sim/testsuite/sim/m32r/add3.cgs sim/testsuite/sim/m32r/addi.cgs sim/testsuite/sim/m32r/addv.cgs sim/testsuite/sim/m32r/addv3.cgs sim/testsuite/sim/m32r/addx.cgs sim/testsuite/sim/m32r/allinsn.exp sim/testsuite/sim/m32r/and.cgs sim/testsuite/sim/m32r/and3.cgs sim/testsuite/sim/m32r/bc24.cgs sim/testsuite/sim/m32r/bc8.cgs sim/testsuite/sim/m32r/beq.cgs sim/testsuite/sim/m32r/beqz.cgs sim/testsuite/sim/m32r/bgez.cgs sim/testsuite/sim/m32r/bgtz.cgs sim/testsuite/sim/m32r/bl24.cgs sim/testsuite/sim/m32r/bl8.cgs sim/testsuite/sim/m32r/blez.cgs sim/testsuite/sim/m32r/bltz.cgs sim/testsuite/sim/m32r/bnc24.cgs sim/testsuite/sim/m32r/bnc8.cgs sim/testsuite/sim/m32r/bne.cgs sim/testsuite/sim/m32r/bnez.cgs sim/testsuite/sim/m32r/bra24.cgs sim/testsuite/sim/m32r/bra8.cgs sim/testsuite/sim/m32r/cmp.cgs sim/testsuite/sim/m32r/cmpi.cgs sim/testsuite/sim/m32r/cmpu.cgs sim/testsuite/sim/m32r/cmpui.cgs sim/testsuite/sim/m32r/div.cgs sim/testsuite/sim/m32r/divu.cgs sim/testsuite/sim/m32r/hello.ms sim/testsuite/sim/m32r/hw-trap.ms sim/testsuite/sim/m32r/jl.cgs sim/testsuite/sim/m32r/jmp.cgs sim/testsuite/sim/m32r/ld-d.cgs sim/testsuite/sim/m32r/ld-plus.cgs sim/testsuite/sim/m32r/ld.cgs sim/testsuite/sim/m32r/ld24.cgs sim/testsuite/sim/m32r/ldb-d.cgs sim/testsuite/sim/m32r/ldb.cgs sim/testsuite/sim/m32r/ldh-d.cgs sim/testsuite/sim/m32r/ldh.cgs sim/testsuite/sim/m32r/ldi16.cgs sim/testsuite/sim/m32r/ldi8.cgs sim/testsuite/sim/m32r/ldub-d.cgs sim/testsuite/sim/m32r/ldub.cgs sim/testsuite/sim/m32r/lduh-d.cgs sim/testsuite/sim/m32r/lduh.cgs sim/testsuite/sim/m32r/lock.cgs sim/testsuite/sim/m32r/machi.cgs sim/testsuite/sim/m32r/maclo.cgs sim/testsuite/sim/m32r/macwhi.cgs sim/testsuite/sim/m32r/macwlo.cgs sim/testsuite/sim/m32r/misc.exp sim/testsuite/sim/m32r/mul.cgs sim/testsuite/sim/m32r/mulhi.cgs sim/testsuite/sim/m32r/mullo.cgs sim/testsuite/sim/m32r/mulwhi.cgs sim/testsuite/sim/m32r/mulwlo.cgs sim/testsuite/sim/m32r/mv.cgs sim/testsuite/sim/m32r/mvfachi.cgs sim/testsuite/sim/m32r/mvfaclo.cgs sim/testsuite/sim/m32r/mvfacmi.cgs sim/testsuite/sim/m32r/mvfc.cgs sim/testsuite/sim/m32r/mvtachi.cgs sim/testsuite/sim/m32r/mvtaclo.cgs sim/testsuite/sim/m32r/mvtc.cgs sim/testsuite/sim/m32r/neg.cgs sim/testsuite/sim/m32r/nop.cgs sim/testsuite/sim/m32r/not.cgs sim/testsuite/sim/m32r/or.cgs sim/testsuite/sim/m32r/or3.cgs sim/testsuite/sim/m32r/rac.cgs sim/testsuite/sim/m32r/rach.cgs sim/testsuite/sim/m32r/rem.cgs sim/testsuite/sim/m32r/remu.cgs sim/testsuite/sim/m32r/rte.cgs sim/testsuite/sim/m32r/seth.cgs sim/testsuite/sim/m32r/sll.cgs sim/testsuite/sim/m32r/sll3.cgs sim/testsuite/sim/m32r/slli.cgs sim/testsuite/sim/m32r/sra.cgs sim/testsuite/sim/m32r/sra3.cgs sim/testsuite/sim/m32r/srai.cgs sim/testsuite/sim/m32r/srl.cgs sim/testsuite/sim/m32r/srl3.cgs sim/testsuite/sim/m32r/srli.cgs sim/testsuite/sim/m32r/st-d.cgs sim/testsuite/sim/m32r/st-minus.cgs sim/testsuite/sim/m32r/st-plus.cgs sim/testsuite/sim/m32r/st.cgs sim/testsuite/sim/m32r/stb-d.cgs sim/testsuite/sim/m32r/stb.cgs sim/testsuite/sim/m32r/sth-d.cgs sim/testsuite/sim/m32r/sth.cgs sim/testsuite/sim/m32r/sub.cgs sim/testsuite/sim/m32r/subv.cgs sim/testsuite/sim/m32r/subx.cgs sim/testsuite/sim/m32r/testutils.inc sim/testsuite/sim/m32r/trap.cgs sim/testsuite/sim/m32r/unlock.cgs sim/testsuite/sim/m32r/uread16.ms sim/testsuite/sim/m32r/uread32.ms sim/testsuite/sim/m32r/uwrite16.ms sim/testsuite/sim/m32r/uwrite32.ms sim/testsuite/sim/m32r/xor.cgs sim/testsuite/sim/m32r/xor3.cgs sim/tic80/ChangeLog sim/tic80/Makefile.in sim/tic80/acconfig.h sim/tic80/alu.h sim/tic80/config.in sim/tic80/configure sim/tic80/configure.in sim/tic80/cpu.h sim/tic80/interp.c sim/tic80/misc.c sim/tic80/sim-calls.c sim/tic80/sim-main.h sim/tic80/tic80.dc sim/tic80/tic80.ic sim/tic80/tic80.igen sim/v850/ChangeLog sim/v850/Makefile.in sim/v850/acconfig.h sim/v850/config.in sim/v850/configure sim/v850/configure.in sim/v850/interp.c sim/v850/sim-main.h sim/v850/simops.c sim/v850/simops.h sim/v850/v850-dc sim/v850/v850.igen sim/v850/v850_sim.h sim/w65/ChangeLog sim/w65/Makefile.in sim/w65/acconfig.h sim/w65/config.in sim/w65/configure sim/w65/configure.in sim/w65/gencode.c sim/w65/interp.c sim/w65/interp.h sim/w65/run.c sim/z8k/ChangeLog sim/z8k/Makefile.in sim/z8k/acconfig.h sim/z8k/comped1.c sim/z8k/comped2.c sim/z8k/comped3.c sim/z8k/compedb3.c sim/z8k/config.in sim/z8k/configure sim/z8k/configure.in sim/z8k/iface.c sim/z8k/inlines.h sim/z8k/list.c sim/z8k/mem.c sim/z8k/mem.h sim/z8k/quick.c sim/z8k/sim.h sim/z8k/support.c sim/z8k/syscall.h sim/z8k/tconfig.in sim/z8k/tm.h sim/z8k/writecode.c symlink-tree texinfo/texinfo.tex ylwrap Cherrypick from cagney_regbuf-20020515-branch 2002-05-15 21:19:22 UTC nobody 'This commit was manufactured by cvs2svn to create branch': gdb/blockframe.c gdb/frame.h gdb/gdbarch.c gdb/gdbarch.h gdb/gdbarch.sh gdb/infcmd.c gdb/inferior.h gdb/infrun.c gdb/regcache.c gdb/regcache.h gdb/valops.c gdb/value.h gdb/values.c Cherrypick from master 2002-05-28 20:06:27 UTC Marek Michalkiewicz <marekm@amelek.gda.pl> '2002-05-28 Marek Michalkiewicz <marekm@amelek.gda.pl>': ChangeLog Makefile.in bfd/ChangeLog bfd/Makefile.am bfd/Makefile.in bfd/acinclude.m4 bfd/aclocal.m4 bfd/aix5ppc-core.c bfd/aout-adobe.c bfd/aout-target.h bfd/aout-tic30.c bfd/archures.c bfd/bfd-in2.h bfd/bfd.c bfd/binary.c bfd/bout.c bfd/coff-arm.c bfd/coff-rs6000.c bfd/coff-sh.c bfd/coff64-rs6000.c bfd/coffcode.h bfd/config.bfd bfd/config.in bfd/configure bfd/configure.in bfd/cpu-dlx.c bfd/cpu-mips.c bfd/doc/ChangeLog bfd/doc/Makefile.in bfd/doc/chew.c bfd/elf-bfd.h bfd/elf-eh-frame.c bfd/elf.c bfd/elf32-arm.h bfd/elf32-dlx.c bfd/elf32-i386.c bfd/elf32-m68k.c bfd/elf32-mips.c bfd/elf64-ppc.c bfd/elf64-x86-64.c bfd/elflink.h bfd/elfxx-ia64.c bfd/elfxx-mips.c bfd/elfxx-target.h bfd/hash.c bfd/i386msdos.c bfd/i386os9k.c bfd/ieee.c bfd/ihex.c bfd/libbfd-in.h bfd/libbfd.h bfd/libecoff.h bfd/linker.c bfd/mmo.c bfd/nlm-target.h bfd/oasys.c bfd/peXXigen.c bfd/ppcboot.c bfd/reloc.c bfd/rs6000-core.c bfd/section.c bfd/som.c bfd/srec.c bfd/syms.c bfd/targets.c bfd/tekhex.c bfd/versados.c bfd/version.h bfd/vms.c config-ml.in config.guess config.sub config/ChangeLog config/acinclude.m4 config/mh-apollo68 config/mh-dgux config/mh-dgux386 configure configure.in gdb/MAINTAINERS gdb/NEWS gdb/PROBLEMS gdb/alpha-linux-tdep.c gdb/alpha-osf1-tdep.c gdb/alpha-tdep.c gdb/alpha-tdep.h gdb/alphafbsd-tdep.c gdb/alphanbsd-tdep.c gdb/arm-linux-tdep.c gdb/arm-tdep.c gdb/arm-tdep.h gdb/armnbsd-tdep.c gdb/c-exp.y gdb/c-lang.c gdb/c-lang.h gdb/cli/cli-dump.c gdb/config/alpha/nm-nbsd.h gdb/config/alpha/tm-nbsd.h gdb/config/arm/nbsd.mt gdb/config/arm/nbsdaout.mh gdb/config/arm/nbsdelf.mh gdb/config/arm/nm-nbsd.h gdb/config/arm/nm-nbsdaout.h gdb/config/avr/avr.mt gdb/config/djgpp/fnchange.lst gdb/config/h8300/tm-h8300.h gdb/config/i386/nbsdaout.mh gdb/config/i386/nbsdaout.mt gdb/config/i386/nbsdelf.mh gdb/config/i386/nbsdelf.mt gdb/config/i386/nm-cygwin.h gdb/config/i386/nm-go32.h gdb/config/i386/nm-nbsd.h gdb/config/i386/nm-nbsdaout.h gdb/config/i386/tm-nbsd.h gdb/config/i386/tm-nbsdaout.h gdb/config/m68k/nbsdaout.mh gdb/config/m68k/nbsdaout.mt gdb/config/m68k/nm-nbsd.h gdb/config/m68k/nm-nbsdaout.h gdb/config/m68k/tm-nbsd.h gdb/config/mips/nbsd.mh gdb/config/mips/nbsd.mt gdb/config/mips/nm-nbsd.h gdb/config/mips/tm-nbsd.h gdb/config/nm-nbsd.h gdb/config/nm-nbsdaout.h gdb/config/ns32k/nbsdaout.mh gdb/config/ns32k/nbsdaout.mt gdb/config/ns32k/nm-nbsd.h gdb/config/ns32k/nm-nbsdaout.h gdb/config/ns32k/tm-nbsd.h gdb/config/ns32k/tm-ns32k.h gdb/config/pa/hpux11w.mh gdb/config/powerpc/nbsd.mh gdb/config/powerpc/nbsd.mt gdb/config/powerpc/nm-nbsd.h gdb/config/powerpc/tm-nbsd.h gdb/config/sh/tm-sh.h gdb/config/sparc/nbsdaout.mh gdb/config/sparc/nbsdaout.mt gdb/config/sparc/nbsdelf.mh gdb/config/sparc/nbsdelf.mt gdb/config/sparc/nm-nbsdaout.h gdb/config/sparc/tm-nbsd.h gdb/config/sparc/tm-nbsdaout.h gdb/config/v850/v850.mt gdb/configure.host gdb/configure.tgt gdb/corelow.c gdb/d10v-tdep.c gdb/doc/ChangeLog gdb/doc/gdb.texinfo gdb/doc/gdbint.texinfo gdb/dwarf2cfi.c gdb/dwarf2read.c gdb/gdb_indent.sh gdb/gdbserver/server.c gdb/gdbtypes.c gdb/gdbtypes.h gdb/h8300-tdep.c gdb/hpread.c gdb/i386-tdep.c gdb/macrocmd.c gdb/macroscope.c gdb/macroscope.h gdb/macrotab.c gdb/mi/ChangeLog gdb/mips-tdep.c gdb/mipsnbsd-nat.c gdb/mipsnbsd-tdep.c gdb/mipsnbsd-tdep.h gdb/ns32k-tdep.c gdb/ns32k-tdep.h gdb/ns32knbsd-tdep.c gdb/osabi.c gdb/osabi.h gdb/p-exp.y gdb/parse.c gdb/parser-defs.h gdb/ppcnbsd-nat.c gdb/ppcnbsd-tdep.c gdb/ppcnbsd-tdep.h gdb/remote.c gdb/rs6000-tdep.c gdb/ser-tcp.c gdb/sh-tdep.c gdb/sh-tdep.h gdb/sh3-rom.c gdb/shnbsd-tdep.c gdb/testsuite/ChangeLog gdb/testsuite/configure gdb/testsuite/configure.in gdb/testsuite/gdb.arch/Makefile.in gdb/testsuite/gdb.arch/altivec-abi.c gdb/testsuite/gdb.arch/altivec-abi.exp gdb/testsuite/gdb.arch/altivec-regs.c gdb/testsuite/gdb.arch/altivec-regs.exp gdb/testsuite/gdb.arch/configure gdb/testsuite/gdb.arch/configure.in gdb/testsuite/gdb.base/all-bin.exp gdb/testsuite/gdb.base/call-rt-st.exp gdb/testsuite/gdb.base/completion.exp gdb/testsuite/gdb.c++/inherit.exp gdb/testsuite/gdb.c++/local.exp gdb/testsuite/gdb.c++/m-data.cc gdb/testsuite/gdb.c++/m-data.exp gdb/testsuite/gdb.c++/try_catch.cc gdb/testsuite/gdb.c++/try_catch.exp gdb/testsuite/lib/gdb.exp gdb/v850-tdep.c gdb/version.in gdb/x86-64-tdep.c include/ChangeLog include/bfdlink.h include/dis-asm.h include/elf/ChangeLog include/elf/common.h include/elf/dlx.h include/elf/i386.h include/elf/ia64.h include/gdb/ChangeLog include/gdb/sim-d10v.h include/opcode/ChangeLog include/opcode/dlx.h include/opcode/h8300.h include/opcode/ia64.h include/opcode/mips.h include/opcode/sparc.h libiberty/ChangeLog libiberty/config.table opcodes/ChangeLog opcodes/Makefile.am opcodes/Makefile.in opcodes/acinclude.m4 opcodes/aclocal.m4 opcodes/arc-dis.c opcodes/arm-dis.c opcodes/configure opcodes/configure.in opcodes/disassemble.c opcodes/dlx-dis.c opcodes/fr30-asm.c opcodes/fr30-desc.c opcodes/fr30-dis.c opcodes/m32r-asm.c opcodes/m32r-desc.c opcodes/m32r-dis.c opcodes/m68k-dis.c opcodes/mips-dis.c opcodes/mips-opc.c opcodes/openrisc-asm.c opcodes/openrisc-desc.c opcodes/openrisc-dis.c opcodes/sh-dis.c opcodes/sh64-dis.c opcodes/xstormy16-asm.c opcodes/xstormy16-desc.c opcodes/xstormy16-dis.c sim/ChangeLog sim/MAINTAINERS sim/arm/ChangeLog sim/arm/Makefile.in sim/arm/armcopro.c sim/arm/armemu.c sim/arm/armos.c sim/arm/armsupp.c sim/arm/armvirt.c sim/arm/dbg_rdi.h sim/arm/thumbemu.c sim/arm/wrapper.c sim/common/ChangeLog sim/common/run-sim.h sim/common/run.c sim/common/sim-options.c sim/d10v/ChangeLog sim/d10v/Makefile.in sim/d10v/interp.c sim/d10v/simops.c sim/h8300/ChangeLog sim/h8300/compile.c sim/h8300/inst.h
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/.gdbinit1
-rw-r--r--gdb/testsuite/ChangeLog9078
-rw-r--r--gdb/testsuite/Makefile.in192
-rw-r--r--gdb/testsuite/TODO202
-rw-r--r--gdb/testsuite/aclocal.m4583
-rw-r--r--gdb/testsuite/config/abug.exp20
-rw-r--r--gdb/testsuite/config/arm-ice.exp1
-rw-r--r--gdb/testsuite/config/cfdbug.exp20
-rw-r--r--gdb/testsuite/config/cpu32bug.exp20
-rw-r--r--gdb/testsuite/config/cygmon.exp1
-rw-r--r--gdb/testsuite/config/d10v.exp20
-rw-r--r--gdb/testsuite/config/dve.exp23
-rw-r--r--gdb/testsuite/config/est.exp20
-rw-r--r--gdb/testsuite/config/gdbserver.exp212
-rw-r--r--gdb/testsuite/config/h8300.exp1
-rw-r--r--gdb/testsuite/config/hmsirom.exp22
-rw-r--r--gdb/testsuite/config/hppro.exp24
-rw-r--r--gdb/testsuite/config/i386-bozo.exp1
-rw-r--r--gdb/testsuite/config/i960.exp20
-rw-r--r--gdb/testsuite/config/m32r-stub.exp1
-rw-r--r--gdb/testsuite/config/m32r.exp23
-rw-r--r--gdb/testsuite/config/m68k-emc.exp17
-rw-r--r--gdb/testsuite/config/mips-idt.exp22
-rw-r--r--gdb/testsuite/config/mips.exp22
-rw-r--r--gdb/testsuite/config/mn10300-eval.exp23
-rw-r--r--gdb/testsuite/config/monitor.exp271
-rw-r--r--gdb/testsuite/config/netware.exp218
-rw-r--r--gdb/testsuite/config/nind.exp49
-rw-r--r--gdb/testsuite/config/proelf.exp20
-rw-r--r--gdb/testsuite/config/rom68k.exp20
-rw-r--r--gdb/testsuite/config/sh.exp20
-rw-r--r--gdb/testsuite/config/sid.exp216
-rw-r--r--gdb/testsuite/config/sim.exp85
-rw-r--r--gdb/testsuite/config/slite.exp183
-rw-r--r--gdb/testsuite/config/sparclet.exp391
-rw-r--r--gdb/testsuite/config/udi.exp113
-rw-r--r--gdb/testsuite/config/unix.exp29
-rw-r--r--gdb/testsuite/config/unknown.exp21
-rw-r--r--gdb/testsuite/config/vr4300.exp20
-rw-r--r--gdb/testsuite/config/vr5000.exp20
-rw-r--r--gdb/testsuite/config/vx.exp131
-rw-r--r--gdb/testsuite/config/vxworks.exp20
-rw-r--r--gdb/testsuite/config/vxworks29k.exp27
-rwxr-xr-xgdb/testsuite/configure1214
-rw-r--r--gdb/testsuite/configure.in117
-rw-r--r--gdb/testsuite/gdb.arch/Makefile.in31
-rw-r--r--gdb/testsuite/gdb.arch/altivec-abi.c141
-rw-r--r--gdb/testsuite/gdb.arch/altivec-abi.exp113
-rw-r--r--gdb/testsuite/gdb.arch/altivec-regs.c41
-rw-r--r--gdb/testsuite/gdb.arch/altivec-regs.exp220
-rwxr-xr-xgdb/testsuite/gdb.arch/configure913
-rw-r--r--gdb/testsuite/gdb.arch/configure.in15
-rw-r--r--gdb/testsuite/gdb.asm/Makefile.in36
-rw-r--r--gdb/testsuite/gdb.asm/arm.inc34
-rw-r--r--gdb/testsuite/gdb.asm/asm-source.exp288
-rw-r--r--gdb/testsuite/gdb.asm/asmsrc1.s63
-rw-r--r--gdb/testsuite/gdb.asm/asmsrc2.s17
-rw-r--r--gdb/testsuite/gdb.asm/common.inc28
-rwxr-xr-xgdb/testsuite/gdb.asm/configure913
-rw-r--r--gdb/testsuite/gdb.asm/configure.in15
-rw-r--r--gdb/testsuite/gdb.asm/d10v.inc55
-rw-r--r--gdb/testsuite/gdb.asm/i386.inc39
-rw-r--r--gdb/testsuite/gdb.asm/m32r.inc35
-rw-r--r--gdb/testsuite/gdb.asm/powerpc.inc46
-rw-r--r--gdb/testsuite/gdb.asm/s390.inc75
-rw-r--r--gdb/testsuite/gdb.asm/sparc.inc34
-rw-r--r--gdb/testsuite/gdb.asm/sparc64.inc34
-rw-r--r--gdb/testsuite/gdb.asm/v850.inc41
-rw-r--r--gdb/testsuite/gdb.asm/x86_64.inc39
-rw-r--r--gdb/testsuite/gdb.asm/xstormy16.inc34
-rw-r--r--gdb/testsuite/gdb.base/Makefile.in43
-rw-r--r--gdb/testsuite/gdb.base/a2-run.exp257
-rw-r--r--gdb/testsuite/gdb.base/all-bin.exp471
-rw-r--r--gdb/testsuite/gdb.base/all-types.c62
-rw-r--r--gdb/testsuite/gdb.base/annota1.c51
-rw-r--r--gdb/testsuite/gdb.base/annota1.exp463
-rw-r--r--gdb/testsuite/gdb.base/arithmet.exp117
-rw-r--r--gdb/testsuite/gdb.base/assign.exp446
-rw-r--r--gdb/testsuite/gdb.base/async.c48
-rw-r--r--gdb/testsuite/gdb.base/async.exp153
-rw-r--r--gdb/testsuite/gdb.base/attach.c20
-rw-r--r--gdb/testsuite/gdb.base/attach.exp432
-rw-r--r--gdb/testsuite/gdb.base/attach2.c24
-rw-r--r--gdb/testsuite/gdb.base/average.c46
-rw-r--r--gdb/testsuite/gdb.base/bar.c9
-rw-r--r--gdb/testsuite/gdb.base/baz.c9
-rw-r--r--gdb/testsuite/gdb.base/bitfields.c194
-rw-r--r--gdb/testsuite/gdb.base/bitfields.exp268
-rw-r--r--gdb/testsuite/gdb.base/bitops.exp365
-rw-r--r--gdb/testsuite/gdb.base/branches.c113
-rw-r--r--gdb/testsuite/gdb.base/break.c131
-rw-r--r--gdb/testsuite/gdb.base/break.exp949
-rw-r--r--gdb/testsuite/gdb.base/call-ar-st.c1339
-rw-r--r--gdb/testsuite/gdb.base/call-ar-st.exp705
-rw-r--r--gdb/testsuite/gdb.base/call-rt-st.c633
-rw-r--r--gdb/testsuite/gdb.base/call-rt-st.exp213
-rw-r--r--gdb/testsuite/gdb.base/call-strs.c78
-rw-r--r--gdb/testsuite/gdb.base/call-strs.exp268
-rw-r--r--gdb/testsuite/gdb.base/callfuncs.c371
-rw-r--r--gdb/testsuite/gdb.base/callfuncs.exp441
-rw-r--r--gdb/testsuite/gdb.base/code-expr.exp395
-rw-r--r--gdb/testsuite/gdb.base/commands.exp456
-rw-r--r--gdb/testsuite/gdb.base/completion.exp749
-rw-r--r--gdb/testsuite/gdb.base/cond-expr.exp122
-rw-r--r--gdb/testsuite/gdb.base/condbreak.exp207
-rw-r--r--gdb/testsuite/gdb.base/configure902
-rw-r--r--gdb/testsuite/gdb.base/configure.in15
-rw-r--r--gdb/testsuite/gdb.base/consecutive.c20
-rw-r--r--gdb/testsuite/gdb.base/consecutive.exp111
-rw-r--r--gdb/testsuite/gdb.base/constvars.c183
-rw-r--r--gdb/testsuite/gdb.base/constvars.exp283
-rw-r--r--gdb/testsuite/gdb.base/corefile.exp232
-rw-r--r--gdb/testsuite/gdb.base/coremaker.c122
-rw-r--r--gdb/testsuite/gdb.base/coremaker2.c58
-rw-r--r--gdb/testsuite/gdb.base/cvexpr.c434
-rw-r--r--gdb/testsuite/gdb.base/cvexpr.exp510
-rw-r--r--gdb/testsuite/gdb.base/d10v.ld155
-rw-r--r--gdb/testsuite/gdb.base/d10vovly.c225
-rw-r--r--gdb/testsuite/gdb.base/dbx.exp340
-rw-r--r--gdb/testsuite/gdb.base/default.exp818
-rw-r--r--gdb/testsuite/gdb.base/define.exp304
-rw-r--r--gdb/testsuite/gdb.base/display.c52
-rw-r--r--gdb/testsuite/gdb.base/display.exp215
-rw-r--r--gdb/testsuite/gdb.base/dump.c44
-rw-r--r--gdb/testsuite/gdb.base/dump.exp442
-rw-r--r--gdb/testsuite/gdb.base/echo.exp44
-rw-r--r--gdb/testsuite/gdb.base/ena-dis-br.exp493
-rw-r--r--gdb/testsuite/gdb.base/ending-run.c33
-rw-r--r--gdb/testsuite/gdb.base/ending-run.exp289
-rw-r--r--gdb/testsuite/gdb.base/environ.exp329
-rw-r--r--gdb/testsuite/gdb.base/eval-skip.exp352
-rw-r--r--gdb/testsuite/gdb.base/execd-prog.c34
-rw-r--r--gdb/testsuite/gdb.base/exprs.c254
-rw-r--r--gdb/testsuite/gdb.base/exprs.exp259
-rw-r--r--gdb/testsuite/gdb.base/finish.exp125
-rw-r--r--gdb/testsuite/gdb.base/foll-exec.c43
-rw-r--r--gdb/testsuite/gdb.base/foll-exec.exp400
-rw-r--r--gdb/testsuite/gdb.base/foll-fork.c34
-rw-r--r--gdb/testsuite/gdb.base/foll-fork.exp367
-rw-r--r--gdb/testsuite/gdb.base/foll-vfork.c20
-rw-r--r--gdb/testsuite/gdb.base/foll-vfork.exp369
-rw-r--r--gdb/testsuite/gdb.base/foo.c9
-rw-r--r--gdb/testsuite/gdb.base/funcargs.c792
-rw-r--r--gdb/testsuite/gdb.base/funcargs.exp1262
-rw-r--r--gdb/testsuite/gdb.base/gcore.c52
-rw-r--r--gdb/testsuite/gdb.base/gcore.exp220
-rw-r--r--gdb/testsuite/gdb.base/gdbvars.exp117
-rw-r--r--gdb/testsuite/gdb.base/grbx.c10
-rw-r--r--gdb/testsuite/gdb.base/help.exp597
-rw-r--r--gdb/testsuite/gdb.base/huge.c17
-rw-r--r--gdb/testsuite/gdb.base/huge.exp57
-rw-r--r--gdb/testsuite/gdb.base/info-proc.exp75
-rw-r--r--gdb/testsuite/gdb.base/int-type.c25
-rw-r--r--gdb/testsuite/gdb.base/interrupt.c40
-rw-r--r--gdb/testsuite/gdb.base/interrupt.exp185
-rw-r--r--gdb/testsuite/gdb.base/jump.c24
-rw-r--r--gdb/testsuite/gdb.base/jump.exp187
-rw-r--r--gdb/testsuite/gdb.base/langs.exp149
-rw-r--r--gdb/testsuite/gdb.base/langs0.c34
-rw-r--r--gdb/testsuite/gdb.base/langs1.c41
-rw-r--r--gdb/testsuite/gdb.base/langs1.f7
-rw-r--r--gdb/testsuite/gdb.base/langs2.c32
-rw-r--r--gdb/testsuite/gdb.base/langs2.cxx13
-rw-r--r--gdb/testsuite/gdb.base/list.exp559
-rw-r--r--gdb/testsuite/gdb.base/list0.c43
-rw-r--r--gdb/testsuite/gdb.base/list0.h37
-rw-r--r--gdb/testsuite/gdb.base/list1.c39
-rw-r--r--gdb/testsuite/gdb.base/logical.exp577
-rw-r--r--gdb/testsuite/gdb.base/long_long.c61
-rw-r--r--gdb/testsuite/gdb.base/long_long.exp304
-rw-r--r--gdb/testsuite/gdb.base/m32r.ld160
-rw-r--r--gdb/testsuite/gdb.base/m32rovly.c225
-rw-r--r--gdb/testsuite/gdb.base/macscp.exp403
-rw-r--r--gdb/testsuite/gdb.base/macscp1.c80
-rw-r--r--gdb/testsuite/gdb.base/macscp2.h25
-rw-r--r--gdb/testsuite/gdb.base/macscp3.h25
-rw-r--r--gdb/testsuite/gdb.base/macscp4.h44
-rw-r--r--gdb/testsuite/gdb.base/maint.exp678
-rw-r--r--gdb/testsuite/gdb.base/mips_pro.c57
-rw-r--r--gdb/testsuite/gdb.base/mips_pro.exp67
-rw-r--r--gdb/testsuite/gdb.base/miscexprs.c49
-rw-r--r--gdb/testsuite/gdb.base/miscexprs.exp311
-rw-r--r--gdb/testsuite/gdb.base/nodebug.c81
-rw-r--r--gdb/testsuite/gdb.base/nodebug.exp181
-rw-r--r--gdb/testsuite/gdb.base/opaque.exp267
-rw-r--r--gdb/testsuite/gdb.base/opaque0.c23
-rw-r--r--gdb/testsuite/gdb.base/opaque1.c18
-rw-r--r--gdb/testsuite/gdb.base/overlays.c34
-rw-r--r--gdb/testsuite/gdb.base/overlays.exp282
-rw-r--r--gdb/testsuite/gdb.base/ovlymgr.c233
-rw-r--r--gdb/testsuite/gdb.base/ovlymgr.h17
-rw-r--r--gdb/testsuite/gdb.base/page.exp40
-rw-r--r--gdb/testsuite/gdb.base/pointers.c216
-rw-r--r--gdb/testsuite/gdb.base/pointers.exp596
-rw-r--r--gdb/testsuite/gdb.base/printcmds.c107
-rw-r--r--gdb/testsuite/gdb.base/printcmds.exp715
-rw-r--r--gdb/testsuite/gdb.base/ptype.c346
-rw-r--r--gdb/testsuite/gdb.base/ptype.exp609
-rw-r--r--gdb/testsuite/gdb.base/radix.exp201
-rw-r--r--gdb/testsuite/gdb.base/recurse.c31
-rw-r--r--gdb/testsuite/gdb.base/recurse.exp168
-rw-r--r--gdb/testsuite/gdb.base/regs.exp86
-rw-r--r--gdb/testsuite/gdb.base/relational.exp484
-rw-r--r--gdb/testsuite/gdb.base/relocate.c17
-rw-r--r--gdb/testsuite/gdb.base/relocate.exp108
-rw-r--r--gdb/testsuite/gdb.base/remote.c6194
-rw-r--r--gdb/testsuite/gdb.base/remote.exp195
-rw-r--r--gdb/testsuite/gdb.base/reread.exp189
-rw-r--r--gdb/testsuite/gdb.base/reread1.c26
-rw-r--r--gdb/testsuite/gdb.base/reread2.c21
-rw-r--r--gdb/testsuite/gdb.base/restore.c260
-rw-r--r--gdb/testsuite/gdb.base/restore.exp113
-rw-r--r--gdb/testsuite/gdb.base/return.c36
-rw-r--r--gdb/testsuite/gdb.base/return.exp129
-rw-r--r--gdb/testsuite/gdb.base/return2.c110
-rw-r--r--gdb/testsuite/gdb.base/return2.exp129
-rw-r--r--gdb/testsuite/gdb.base/run.c82
-rw-r--r--gdb/testsuite/gdb.base/scope.exp608
-rw-r--r--gdb/testsuite/gdb.base/scope0.c208
-rw-r--r--gdb/testsuite/gdb.base/scope1.c54
-rw-r--r--gdb/testsuite/gdb.base/sect-cmd.exp125
-rw-r--r--gdb/testsuite/gdb.base/selftest.exp446
-rw-r--r--gdb/testsuite/gdb.base/setshow.c27
-rw-r--r--gdb/testsuite/gdb.base/setshow.exp243
-rw-r--r--gdb/testsuite/gdb.base/setvar.c278
-rw-r--r--gdb/testsuite/gdb.base/setvar.exp434
-rw-r--r--gdb/testsuite/gdb.base/shlib-call.exp296
-rw-r--r--gdb/testsuite/gdb.base/shmain.c56
-rw-r--r--gdb/testsuite/gdb.base/shr1.c63
-rw-r--r--gdb/testsuite/gdb.base/shr2.c17
-rw-r--r--gdb/testsuite/gdb.base/sigall.c1810
-rw-r--r--gdb/testsuite/gdb.base/sigall.exp210
-rw-r--r--gdb/testsuite/gdb.base/signals.c59
-rw-r--r--gdb/testsuite/gdb.base/signals.exp639
-rw-r--r--gdb/testsuite/gdb.base/sizeof.c122
-rw-r--r--gdb/testsuite/gdb.base/sizeof.exp208
-rw-r--r--gdb/testsuite/gdb.base/so-impl-ld.c23
-rw-r--r--gdb/testsuite/gdb.base/so-impl-ld.exp172
-rw-r--r--gdb/testsuite/gdb.base/so-indr-cl.c30
-rw-r--r--gdb/testsuite/gdb.base/so-indr-cl.exp139
-rw-r--r--gdb/testsuite/gdb.base/solib.c60
-rw-r--r--gdb/testsuite/gdb.base/solib.exp360
-rw-r--r--gdb/testsuite/gdb.base/solib1.c18
-rw-r--r--gdb/testsuite/gdb.base/solib2.c19
-rw-r--r--gdb/testsuite/gdb.base/ss.h4
-rw-r--r--gdb/testsuite/gdb.base/step-line.c84
-rw-r--r--gdb/testsuite/gdb.base/step-line.exp95
-rw-r--r--gdb/testsuite/gdb.base/step-line.inp41
-rw-r--r--gdb/testsuite/gdb.base/step-test.c61
-rw-r--r--gdb/testsuite/gdb.base/step-test.exp241
-rw-r--r--gdb/testsuite/gdb.base/structs.c263
-rw-r--r--gdb/testsuite/gdb.base/structs.exp167
-rw-r--r--gdb/testsuite/gdb.base/structs2.c38
-rw-r--r--gdb/testsuite/gdb.base/structs2.exp79
-rw-r--r--gdb/testsuite/gdb.base/sum.c15
-rw-r--r--gdb/testsuite/gdb.base/term.exp76
-rw-r--r--gdb/testsuite/gdb.base/twice.c21
-rw-r--r--gdb/testsuite/gdb.base/twice.exp64
-rw-r--r--gdb/testsuite/gdb.base/varargs.c111
-rw-r--r--gdb/testsuite/gdb.base/varargs.exp148
-rw-r--r--gdb/testsuite/gdb.base/vforked-prog.c11
-rw-r--r--gdb/testsuite/gdb.base/volatile.exp268
-rw-r--r--gdb/testsuite/gdb.base/watchpoint.c174
-rw-r--r--gdb/testsuite/gdb.base/watchpoint.exp806
-rw-r--r--gdb/testsuite/gdb.base/whatis-exp.exp217
-rw-r--r--gdb/testsuite/gdb.base/whatis.c269
-rw-r--r--gdb/testsuite/gdb.base/whatis.exp419
-rw-r--r--gdb/testsuite/gdb.c++/Makefile.in27
-rw-r--r--gdb/testsuite/gdb.c++/ambiguous.cc110
-rw-r--r--gdb/testsuite/gdb.c++/ambiguous.exp237
-rw-r--r--gdb/testsuite/gdb.c++/annota2.cc28
-rw-r--r--gdb/testsuite/gdb.c++/annota2.exp231
-rw-r--r--gdb/testsuite/gdb.c++/anon-union.cc55
-rw-r--r--gdb/testsuite/gdb.c++/anon-union.exp347
-rw-r--r--gdb/testsuite/gdb.c++/classes.exp929
-rw-r--r--gdb/testsuite/gdb.c++/configure899
-rw-r--r--gdb/testsuite/gdb.c++/configure.in15
-rw-r--r--gdb/testsuite/gdb.c++/cplusfuncs.cc196
-rw-r--r--gdb/testsuite/gdb.c++/cplusfuncs.exp542
-rw-r--r--gdb/testsuite/gdb.c++/ctti.exp269
-rw-r--r--gdb/testsuite/gdb.c++/cttiadd.cc29
-rw-r--r--gdb/testsuite/gdb.c++/cttiadd1.cc16
-rw-r--r--gdb/testsuite/gdb.c++/cttiadd2.cc22
-rw-r--r--gdb/testsuite/gdb.c++/cttiadd3.cc33
-rw-r--r--gdb/testsuite/gdb.c++/demangle.exp1579
-rw-r--r--gdb/testsuite/gdb.c++/derivation.cc240
-rw-r--r--gdb/testsuite/gdb.c++/derivation.exp319
-rw-r--r--gdb/testsuite/gdb.c++/hang.H12
-rw-r--r--gdb/testsuite/gdb.c++/hang.exp128
-rw-r--r--gdb/testsuite/gdb.c++/hang1.C3
-rw-r--r--gdb/testsuite/gdb.c++/hang2.C8
-rw-r--r--gdb/testsuite/gdb.c++/hang3.C4
-rw-r--r--gdb/testsuite/gdb.c++/inherit.exp1062
-rw-r--r--gdb/testsuite/gdb.c++/local.cc61
-rw-r--r--gdb/testsuite/gdb.c++/local.exp199
-rw-r--r--gdb/testsuite/gdb.c++/m-data.cc53
-rw-r--r--gdb/testsuite/gdb.c++/m-data.exp112
-rw-r--r--gdb/testsuite/gdb.c++/m-static.cc72
-rw-r--r--gdb/testsuite/gdb.c++/m-static.exp112
-rw-r--r--gdb/testsuite/gdb.c++/member-ptr.cc106
-rw-r--r--gdb/testsuite/gdb.c++/member-ptr.exp549
-rw-r--r--gdb/testsuite/gdb.c++/method.cc80
-rw-r--r--gdb/testsuite/gdb.c++/method.exp194
-rw-r--r--gdb/testsuite/gdb.c++/misc.cc587
-rw-r--r--gdb/testsuite/gdb.c++/misc.exp159
-rw-r--r--gdb/testsuite/gdb.c++/namespace.cc103
-rw-r--r--gdb/testsuite/gdb.c++/namespace.exp188
-rw-r--r--gdb/testsuite/gdb.c++/overload.cc161
-rw-r--r--gdb/testsuite/gdb.c++/overload.exp393
-rw-r--r--gdb/testsuite/gdb.c++/ovldbreak.cc177
-rw-r--r--gdb/testsuite/gdb.c++/ovldbreak.exp349
-rw-r--r--gdb/testsuite/gdb.c++/ref-types.cc79
-rw-r--r--gdb/testsuite/gdb.c++/ref-types.exp663
-rw-r--r--gdb/testsuite/gdb.c++/templates.cc785
-rw-r--r--gdb/testsuite/gdb.c++/templates.exp455
-rw-r--r--gdb/testsuite/gdb.c++/try_catch.cc126
-rw-r--r--gdb/testsuite/gdb.c++/try_catch.exp84
-rw-r--r--gdb/testsuite/gdb.c++/userdef.cc341
-rw-r--r--gdb/testsuite/gdb.c++/userdef.exp131
-rw-r--r--gdb/testsuite/gdb.c++/virtfunc.cc201
-rw-r--r--gdb/testsuite/gdb.c++/virtfunc.exp967
-rw-r--r--gdb/testsuite/gdb.chill/ChangeLog331
-rw-r--r--gdb/testsuite/gdb.chill/Makefile.in26
-rw-r--r--gdb/testsuite/gdb.chill/builtins.ch83
-rw-r--r--gdb/testsuite/gdb.chill/builtins.exp441
-rw-r--r--gdb/testsuite/gdb.chill/callch.ch50
-rw-r--r--gdb/testsuite/gdb.chill/callch.exp69
-rw-r--r--gdb/testsuite/gdb.chill/chexp.exp450
-rw-r--r--gdb/testsuite/gdb.chill/chillvars.ch204
-rw-r--r--gdb/testsuite/gdb.chill/chillvars.exp316
-rwxr-xr-xgdb/testsuite/gdb.chill/configure899
-rw-r--r--gdb/testsuite/gdb.chill/configure.in11
-rw-r--r--gdb/testsuite/gdb.chill/enum.ch9
-rw-r--r--gdb/testsuite/gdb.chill/enum.exp85
-rw-r--r--gdb/testsuite/gdb.chill/func1.ch9
-rw-r--r--gdb/testsuite/gdb.chill/gch1041.ch17
-rw-r--r--gdb/testsuite/gdb.chill/gch1041.exp76
-rw-r--r--gdb/testsuite/gdb.chill/gch1272.ch21
-rw-r--r--gdb/testsuite/gdb.chill/gch1272.exp86
-rw-r--r--gdb/testsuite/gdb.chill/gch1280.ch13
-rw-r--r--gdb/testsuite/gdb.chill/gch1280.exp76
-rw-r--r--gdb/testsuite/gdb.chill/gch922.ch23
-rw-r--r--gdb/testsuite/gdb.chill/gch922.exp183
-rw-r--r--gdb/testsuite/gdb.chill/gch981.ch60
-rw-r--r--gdb/testsuite/gdb.chill/gch981.exp249
-rw-r--r--gdb/testsuite/gdb.chill/misc.ch12
-rw-r--r--gdb/testsuite/gdb.chill/misc.exp100
-rw-r--r--gdb/testsuite/gdb.chill/powerset.ch33
-rw-r--r--gdb/testsuite/gdb.chill/powerset.exp187
-rw-r--r--gdb/testsuite/gdb.chill/pr-4975-grt.ch13
-rw-r--r--gdb/testsuite/gdb.chill/pr-4975.ch43
-rw-r--r--gdb/testsuite/gdb.chill/pr-4975.exp67
-rw-r--r--gdb/testsuite/gdb.chill/pr-5016.ch24
-rw-r--r--gdb/testsuite/gdb.chill/pr-5016.exp62
-rw-r--r--gdb/testsuite/gdb.chill/pr-5020.ch19
-rw-r--r--gdb/testsuite/gdb.chill/pr-5020.exp85
-rw-r--r--gdb/testsuite/gdb.chill/pr-5022.ch12
-rw-r--r--gdb/testsuite/gdb.chill/pr-5022.exp70
-rw-r--r--gdb/testsuite/gdb.chill/pr-5646-grt.ch5
-rw-r--r--gdb/testsuite/gdb.chill/pr-5646.ch15
-rw-r--r--gdb/testsuite/gdb.chill/pr-5646.exp64
-rw-r--r--gdb/testsuite/gdb.chill/pr-5984.ch8
-rw-r--r--gdb/testsuite/gdb.chill/pr-5984.exp57
-rw-r--r--gdb/testsuite/gdb.chill/pr-6292.ch17
-rw-r--r--gdb/testsuite/gdb.chill/pr-6292.exp58
-rw-r--r--gdb/testsuite/gdb.chill/pr-6632-grt.ch34
-rw-r--r--gdb/testsuite/gdb.chill/pr-6632.ch31
-rw-r--r--gdb/testsuite/gdb.chill/pr-6632.exp66
-rw-r--r--gdb/testsuite/gdb.chill/pr-8134.exp65
-rw-r--r--gdb/testsuite/gdb.chill/pr-8136.ch34
-rw-r--r--gdb/testsuite/gdb.chill/pr-8136.exp63
-rw-r--r--gdb/testsuite/gdb.chill/pr-8405.ch19
-rw-r--r--gdb/testsuite/gdb.chill/pr-8405.exp61
-rw-r--r--gdb/testsuite/gdb.chill/pr-8742.ch32
-rw-r--r--gdb/testsuite/gdb.chill/pr-8742.exp64
-rw-r--r--gdb/testsuite/gdb.chill/pr-8894-grt.ch6
-rw-r--r--gdb/testsuite/gdb.chill/pr-8894.ch12
-rw-r--r--gdb/testsuite/gdb.chill/pr-8894.exp61
-rw-r--r--gdb/testsuite/gdb.chill/pr-9095.ch13
-rw-r--r--gdb/testsuite/gdb.chill/pr-9095.exp62
-rw-r--r--gdb/testsuite/gdb.chill/pr-9946.ch10
-rw-r--r--gdb/testsuite/gdb.chill/pr-9946.exp79
-rw-r--r--gdb/testsuite/gdb.chill/result.ch29
-rw-r--r--gdb/testsuite/gdb.chill/result.exp77
-rw-r--r--gdb/testsuite/gdb.chill/string.ch24
-rw-r--r--gdb/testsuite/gdb.chill/string.exp73
-rw-r--r--gdb/testsuite/gdb.chill/tests1.ch240
-rw-r--r--gdb/testsuite/gdb.chill/tests1.exp822
-rw-r--r--gdb/testsuite/gdb.chill/tests2.ch193
-rw-r--r--gdb/testsuite/gdb.chill/tests2.exp271
-rw-r--r--gdb/testsuite/gdb.chill/tuples.ch86
-rw-r--r--gdb/testsuite/gdb.chill/tuples.exp161
-rw-r--r--gdb/testsuite/gdb.chill/xstruct-grt.ch12
-rw-r--r--gdb/testsuite/gdb.chill/xstruct.ch16
-rw-r--r--gdb/testsuite/gdb.chill/xstruct.exp66
-rw-r--r--gdb/testsuite/gdb.disasm/Makefile.in18
-rw-r--r--gdb/testsuite/gdb.disasm/am33.exp838
-rw-r--r--gdb/testsuite/gdb.disasm/am33.s524
-rw-r--r--gdb/testsuite/gdb.disasm/configure899
-rw-r--r--gdb/testsuite/gdb.disasm/configure.in15
-rw-r--r--gdb/testsuite/gdb.disasm/h8300s.exp698
-rw-r--r--gdb/testsuite/gdb.disasm/h8300s.s356
-rw-r--r--gdb/testsuite/gdb.disasm/hppa.exp1404
-rw-r--r--gdb/testsuite/gdb.disasm/hppa.s1738
-rw-r--r--gdb/testsuite/gdb.disasm/mn10200.exp478
-rw-r--r--gdb/testsuite/gdb.disasm/mn10200.s217
-rw-r--r--gdb/testsuite/gdb.disasm/mn10300.exp569
-rw-r--r--gdb/testsuite/gdb.disasm/mn10300.s300
-rw-r--r--gdb/testsuite/gdb.disasm/sh3.exp123
-rw-r--r--gdb/testsuite/gdb.disasm/sh3.s54
-rw-r--r--gdb/testsuite/gdb.fortran/exprs.exp273
-rw-r--r--gdb/testsuite/gdb.fortran/types.exp114
-rw-r--r--gdb/testsuite/gdb.gdb/xfullpath.exp198
-rw-r--r--gdb/testsuite/gdb.hp/Makefile.in44
-rwxr-xr-xgdb/testsuite/gdb.hp/configure1008
-rw-r--r--gdb/testsuite/gdb.hp/configure.in17
-rw-r--r--gdb/testsuite/gdb.hp/gdb.aCC/Makefile.in27
-rwxr-xr-xgdb/testsuite/gdb.hp/gdb.aCC/configure899
-rw-r--r--gdb/testsuite/gdb.hp/gdb.aCC/configure.in15
-rw-r--r--gdb/testsuite/gdb.hp/gdb.aCC/exception.cc48
-rw-r--r--gdb/testsuite/gdb.hp/gdb.aCC/exception.exp439
-rw-r--r--gdb/testsuite/gdb.hp/gdb.aCC/optimize.c76
-rw-r--r--gdb/testsuite/gdb.hp/gdb.aCC/optimize.exp149
-rw-r--r--gdb/testsuite/gdb.hp/gdb.aCC/run.c72
-rw-r--r--gdb/testsuite/gdb.hp/gdb.aCC/watch-cmd.exp157
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/Makefile.in32
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c362
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.exp346
-rwxr-xr-xgdb/testsuite/gdb.hp/gdb.base-hp/configure899
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/configure.in15
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/dollar.c10
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/dollar.exp155
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/genso-thresh.c229
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.c9
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.exp83
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.c37
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.exp128
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/reg-pa64.exp189
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/reg-pa64.s104
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/reg.exp192
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/reg.s96
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/sized-enum.c43
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/sized-enum.exp165
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.exp341
-rw-r--r--gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.mk74
-rwxr-xr-xgdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.sh34
-rw-r--r--gdb/testsuite/gdb.hp/gdb.compat/Makefile.in27
-rw-r--r--gdb/testsuite/gdb.hp/gdb.compat/average.c46
-rwxr-xr-xgdb/testsuite/gdb.hp/gdb.compat/configure899
-rw-r--r--gdb/testsuite/gdb.hp/gdb.compat/configure.in15
-rw-r--r--gdb/testsuite/gdb.hp/gdb.compat/sum.c15
-rw-r--r--gdb/testsuite/gdb.hp/gdb.compat/xdb.c20
-rw-r--r--gdb/testsuite/gdb.hp/gdb.compat/xdb0.c42
-rw-r--r--gdb/testsuite/gdb.hp/gdb.compat/xdb0.h36
-rw-r--r--gdb/testsuite/gdb.hp/gdb.compat/xdb1.c33
-rw-r--r--gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp78
-rw-r--r--gdb/testsuite/gdb.hp/gdb.compat/xdb2.exp105
-rw-r--r--gdb/testsuite/gdb.hp/gdb.compat/xdb3.exp321
-rw-r--r--gdb/testsuite/gdb.hp/gdb.defects/Makefile.in27
-rw-r--r--gdb/testsuite/gdb.hp/gdb.defects/bs14602.c9
-rw-r--r--gdb/testsuite/gdb.hp/gdb.defects/bs14602.exp117
-rw-r--r--gdb/testsuite/gdb.hp/gdb.defects/bs15503.cc52
-rw-r--r--gdb/testsuite/gdb.hp/gdb.defects/bs15503.exp88
-rwxr-xr-xgdb/testsuite/gdb.hp/gdb.defects/configure899
-rw-r--r--gdb/testsuite/gdb.hp/gdb.defects/configure.in15
-rw-r--r--gdb/testsuite/gdb.hp/gdb.defects/solib-d.c6
-rw-r--r--gdb/testsuite/gdb.hp/gdb.defects/solib-d.exp278
-rw-r--r--gdb/testsuite/gdb.hp/gdb.defects/solib-d1.c12
-rw-r--r--gdb/testsuite/gdb.hp/gdb.defects/solib-d2.c11
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/Makefile.in28
-rwxr-xr-xgdb/testsuite/gdb.hp/gdb.objdbg/configure992
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/configure.in16
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01.exp222
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x1.cc25
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x2.cc14
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x3.cc7
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x3.h22
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02.exp85
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x1.cc16
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x2.cc17
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x3.cc6
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03.exp164
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x1.cc15
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x2.cc7
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x3.cc21
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04.exp65
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x.h30
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x1.cc15
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x2.cc3
-rwxr-xr-xgdb/testsuite/gdb.hp/gdb.objdbg/tools/symaddr8
-rwxr-xr-xgdb/testsuite/gdb.hp/gdb.objdbg/tools/symaddr.pa648
-rw-r--r--gdb/testsuite/gdb.hp/gdb.objdbg/tools/test-objdbg.cc4
-rw-r--r--gdb/testsuite/gdb.hp/gdb.threads-hp/Makefile.in27
-rwxr-xr-xgdb/testsuite/gdb.hp/gdb.threads-hp/configure899
-rw-r--r--gdb/testsuite/gdb.hp/gdb.threads-hp/configure.in15
-rwxr-xr-xgdb/testsuite/gdb.hp/tools/odump7
-rw-r--r--gdb/testsuite/gdb.java/Makefile.in26
-rwxr-xr-xgdb/testsuite/gdb.java/configure913
-rw-r--r--gdb/testsuite/gdb.java/configure.in11
-rw-r--r--gdb/testsuite/gdb.java/jmisc.exp91
-rw-r--r--gdb/testsuite/gdb.java/jmisc.java7
-rw-r--r--gdb/testsuite/gdb.java/jmisc1.exp91
-rw-r--r--gdb/testsuite/gdb.java/jmisc2.exp91
-rw-r--r--gdb/testsuite/gdb.java/jv-exp.exp66
-rw-r--r--gdb/testsuite/gdb.java/jv-print.exp141
-rw-r--r--gdb/testsuite/gdb.mi/ChangeLog624
-rw-r--r--gdb/testsuite/gdb.mi/Makefile.in24
-rw-r--r--gdb/testsuite/gdb.mi/basics.c45
-rwxr-xr-xgdb/testsuite/gdb.mi/configure902
-rw-r--r--gdb/testsuite/gdb.mi/configure.in15
-rw-r--r--gdb/testsuite/gdb.mi/mi-basics.exp174
-rw-r--r--gdb/testsuite/gdb.mi/mi-break.exp138
-rw-r--r--gdb/testsuite/gdb.mi/mi-console.c20
-rw-r--r--gdb/testsuite/gdb.mi/mi-console.exp112
-rw-r--r--gdb/testsuite/gdb.mi/mi-disassemble.exp224
-rw-r--r--gdb/testsuite/gdb.mi/mi-eval.exp101
-rw-r--r--gdb/testsuite/gdb.mi/mi-hack-cli.exp40
-rw-r--r--gdb/testsuite/gdb.mi/mi-read-memory.c20
-rw-r--r--gdb/testsuite/gdb.mi/mi-read-memory.exp100
-rw-r--r--gdb/testsuite/gdb.mi/mi-regs.exp175
-rw-r--r--gdb/testsuite/gdb.mi/mi-return.exp94
-rw-r--r--gdb/testsuite/gdb.mi/mi-simplerun.exp199
-rw-r--r--gdb/testsuite/gdb.mi/mi-stack.exp218
-rw-r--r--gdb/testsuite/gdb.mi/mi-stepi.exp109
-rw-r--r--gdb/testsuite/gdb.mi/mi-until.exp127
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-block.exp228
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-child.exp1333
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-cmd.exp523
-rw-r--r--gdb/testsuite/gdb.mi/mi-var-display.exp627
-rw-r--r--gdb/testsuite/gdb.mi/mi-watch.exp191
-rw-r--r--gdb/testsuite/gdb.mi/mi0-basics.exp174
-rw-r--r--gdb/testsuite/gdb.mi/mi0-break.exp138
-rw-r--r--gdb/testsuite/gdb.mi/mi0-console.exp112
-rw-r--r--gdb/testsuite/gdb.mi/mi0-disassemble.exp224
-rw-r--r--gdb/testsuite/gdb.mi/mi0-eval.exp101
-rw-r--r--gdb/testsuite/gdb.mi/mi0-hack-cli.exp40
-rw-r--r--gdb/testsuite/gdb.mi/mi0-read-memory.exp100
-rw-r--r--gdb/testsuite/gdb.mi/mi0-regs.exp177
-rw-r--r--gdb/testsuite/gdb.mi/mi0-return.exp94
-rw-r--r--gdb/testsuite/gdb.mi/mi0-simplerun.exp201
-rw-r--r--gdb/testsuite/gdb.mi/mi0-stack.exp218
-rw-r--r--gdb/testsuite/gdb.mi/mi0-stepi.exp109
-rw-r--r--gdb/testsuite/gdb.mi/mi0-until.exp127
-rw-r--r--gdb/testsuite/gdb.mi/mi0-var-block.exp228
-rw-r--r--gdb/testsuite/gdb.mi/mi0-var-child.exp1333
-rw-r--r--gdb/testsuite/gdb.mi/mi0-var-cmd.exp523
-rw-r--r--gdb/testsuite/gdb.mi/mi0-var-display.exp627
-rw-r--r--gdb/testsuite/gdb.mi/mi0-watch.exp191
-rw-r--r--gdb/testsuite/gdb.mi/testcmds25
-rw-r--r--gdb/testsuite/gdb.mi/until.c26
-rw-r--r--gdb/testsuite/gdb.mi/var-cmd.c296
-rw-r--r--gdb/testsuite/gdb.stabs/Makefile.in16
-rw-r--r--gdb/testsuite/gdb.stabs/aout.sed16
-rwxr-xr-xgdb/testsuite/gdb.stabs/configure899
-rw-r--r--gdb/testsuite/gdb.stabs/configure.in15
-rw-r--r--gdb/testsuite/gdb.stabs/ecoff.sed17
-rw-r--r--gdb/testsuite/gdb.stabs/hppa.sed20
-rw-r--r--gdb/testsuite/gdb.stabs/weird.def882
-rw-r--r--gdb/testsuite/gdb.stabs/weird.exp328
-rw-r--r--gdb/testsuite/gdb.stabs/xcoff.sed17
-rw-r--r--gdb/testsuite/gdb.threads/Makefile.in31
-rw-r--r--gdb/testsuite/gdb.threads/config.in4
-rwxr-xr-xgdb/testsuite/gdb.threads/configure1098
-rw-r--r--gdb/testsuite/gdb.threads/configure.in18
-rw-r--r--gdb/testsuite/gdb.threads/gcore-thread.exp186
-rw-r--r--gdb/testsuite/gdb.threads/linux-dp.c207
-rw-r--r--gdb/testsuite/gdb.threads/linux-dp.exp229
-rw-r--r--gdb/testsuite/gdb.threads/pthreads.c171
-rw-r--r--gdb/testsuite/gdb.threads/pthreads.exp358
-rw-r--r--gdb/testsuite/gdb.threads/step.c221
-rw-r--r--gdb/testsuite/gdb.threads/step.exp200
-rw-r--r--gdb/testsuite/gdb.threads/step2.exp150
-rw-r--r--gdb/testsuite/gdb.trace/Makefile.in21
-rw-r--r--gdb/testsuite/gdb.trace/actions.c134
-rw-r--r--gdb/testsuite/gdb.trace/actions.exp207
-rw-r--r--gdb/testsuite/gdb.trace/backtrace.exp376
-rw-r--r--gdb/testsuite/gdb.trace/circ.c90
-rw-r--r--gdb/testsuite/gdb.trace/circ.exp215
-rw-r--r--gdb/testsuite/gdb.trace/collection.c280
-rw-r--r--gdb/testsuite/gdb.trace/collection.exp623
-rwxr-xr-xgdb/testsuite/gdb.trace/configure899
-rw-r--r--gdb/testsuite/gdb.trace/configure.in15
-rw-r--r--gdb/testsuite/gdb.trace/deltrace.exp269
-rw-r--r--gdb/testsuite/gdb.trace/gdb_c_test.c3792
-rw-r--r--gdb/testsuite/gdb.trace/infotrace.exp99
-rw-r--r--gdb/testsuite/gdb.trace/limits.c51
-rw-r--r--gdb/testsuite/gdb.trace/limits.exp316
-rw-r--r--gdb/testsuite/gdb.trace/packetlen.exp100
-rw-r--r--gdb/testsuite/gdb.trace/passc-dyn.exp181
-rw-r--r--gdb/testsuite/gdb.trace/passcount.exp178
-rw-r--r--gdb/testsuite/gdb.trace/report.exp421
-rw-r--r--gdb/testsuite/gdb.trace/save-trace.exp171
-rw-r--r--gdb/testsuite/gdb.trace/tfind.exp405
-rw-r--r--gdb/testsuite/gdb.trace/tracecmd.exp269
-rw-r--r--gdb/testsuite/gdb.trace/while-dyn.exp124
-rw-r--r--gdb/testsuite/gdb.trace/while-stepping.exp116
-rw-r--r--gdb/testsuite/lib/compiler.c31
-rw-r--r--gdb/testsuite/lib/compiler.cc34
-rw-r--r--gdb/testsuite/lib/emc-support.exp223
-rw-r--r--gdb/testsuite/lib/gdb.exp1684
-rw-r--r--gdb/testsuite/lib/insight-support.exp310
-rw-r--r--gdb/testsuite/lib/java.exp105
-rw-r--r--gdb/testsuite/lib/mi-support.exp788
-rw-r--r--gdb/testsuite/lib/trace-support.exp307
604 files changed, 141368 insertions, 0 deletions
diff --git a/gdb/testsuite/.gdbinit b/gdb/testsuite/.gdbinit
new file mode 100644
index 00000000000..62bcb743093
--- /dev/null
+++ b/gdb/testsuite/.gdbinit
@@ -0,0 +1 @@
+set height 400
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
new file mode 100644
index 00000000000..c033fa374fe
--- /dev/null
+++ b/gdb/testsuite/ChangeLog
@@ -0,0 +1,9078 @@
+2002-05-27 Michael Chastain <mec@shout.net>
+From Benjamin Kosnik <bkoz@redhat.com>
+
+ * gdb.c++/m-data.cc: New file.
+ * gdb.c++/m-data.exp: New file.
+
+2002-05-27 Michael Chastain <mec@shout.net>
+From Benjamin Kosnik <bkoz@redhat.com>
+
+ * gdb.c++/try_catch.cc: New file.
+ * gdb.c++/try_catch.exp: New file.
+
+2002-05-27 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/local.exp: Accept more nested types in output.
+
+2002-05-26 Michael Chastain <mec@shout.net>
+
+ * gdb.base/call-rt-st.exp: Fix typo in brace quoting.
+
+2002-05-15 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * lib/gdb.exp (gdb_wrapper_init): Just because
+ gdb_wrapper_file exists, this does not mean that the file
+ should not be rebuilt. That is what gdb_wrapper_initialized
+ is for.
+ (default_gdb_init): Reset gdb_wrapper_initialized.
+
+2002-05-23 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/all-bin.exp: Revise previous patch by just reducing
+ the precision of the floating point test results.
+ * gdb.base/call-rt-st.exp: Ditto.
+
+ * gdb.base/all-bin.exp: Allow for reduced floating point precision.
+ * gdb.base/call-rt-st.exp: Ditto.
+
+2002-05-19 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/inherit.exp: Accept "VTT for ..." in output strings.
+
+2002-05-19 Elena Zannoni <ezannoni@redhat.com>
+
+ * configure.in (configdirs): Add gdb.arch.
+ * configure: Regenerate.
+
+2002-05-17 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/completion.exp: Recognize the more detailed error
+ messages produced by the macro expander's lexical analyzer.
+
+2002-05-14 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.arch/altivec-abi.c: New file.
+ * gdb.arch/altivec-abi.exp: New file.
+ * gdb.arch/altivec-regs.c: New file.
+ * gdb.arch/altivec-regs.exp: New file.
+
+2002-05-14 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/maint.exp (maint print type): Update for new type
+ structure.
+
+2002-05-14 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.arch: New directory.
+ * gdb.arch/configure.in: New file.
+ * gdb.arch/configure: New file.
+ * gdb.arch/Makefile.in: New file.
+
+2002-05-13 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.asm/asm-source.exp: Add v850 as supported target.
+ * gdb.asm/v850.inc: New file.
+
+2002-05-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.c++/annota2.exp (annotate-quit): Add comment.
+
+2002-05-12 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/break.exp: Check 'break "marker2"'.
+
+2002-05-10 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/long_long.exp: Fix typo.
+
+2002-05-10 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/printcmds.exp: Don't xfail the ptype command. This is
+ a bug.
+
+ * gdb.base/printcmds.exp (test_integer_literals_rejected):
+ Recognize more detailed error message produced by the macro
+ expander's lexical analyzer.
+ * lib/gdb.exp (test_print_reject): Same.
+
+2002-05-09 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.c++/method.exp: Fix typo.
+
+2002-05-08 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.mi/mi-var-child.exp: Accept (void) as well as ().
+ * gdb.mi/mi0-var-child.exp: Accept (void) as well as ().
+ * gdb.base/default.exp: Merge clauses for arm, strongarm, xscale.
+ * gdb.base/long_long.exp: Merge clauses for arm and xscale.
+ Add iftarget clause for strongarm.
+
+2002-05-06 Michael Snyder <msnyder@redhat.com>
+
+ * lib/gdb.exp (gdb_test): Add case to allow for status wrapper.
+ (gdb_continue_to_end): Accept output from status wrapper.
+ * gdb.base/ending-run.exp: Add case for output from status wrapper.
+ Clean up fail messages to match pass messages.
+
+ Enable the "needs_status_wrapper" testsuite feature.
+ * lib/gdb.exp (gdb_wrapper_init): New procedure.
+ (gdb_compile): Conditionally call gdb_wrapper_init.
+ * gdb.base/a2-run.exp: Recognize output from status wrapper.
+ * gdb.c++/method.exp: Recognize output from status wrapper.
+
+2002-05-06 Ben Elliston <bje@redhat.com>
+From Graydon Hoare <graydon@redhat.com>
+
+ * config/sid.exp: Include support for "rawsid" protocol.
+
+2002-05-03 Jim Blandy <jimb@redhat.com>
+
+ * gdb.c++/hang.exp: Check for corruption of the cv_type chain.
+ * gdb.c++/hang3.C: New file.
+
+2002-05-04 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.base/default.exp: Remove obsolete code.
+ * gdb.c++/misc.exp: Ditto. Update copyright.
+ * gdb.c++/cplusfuncs.exp: Ditto. Update copyright.
+ * gdb.base/whatis.exp: Ditto. Update copyright.
+ * gdb.base/scope.exp: Ditto. Update copyright.
+ * gdb.base/ptype.exp: Ditto. Update copyright.
+ * gdb.base/printcmds.exp: Ditto. Update copyright.
+ * gdb.base/opaque.exp: Ditto. Update copyright.
+ * gdb.base/list.exp: Ditto.
+ * gdb.base/funcargs.exp: Ditto. Update copyright.
+ * gdb.hp/gdb.threads-hp/usrthbasic.c: Delete.
+ * gdb.hp/gdb.threads-hp/usrthbasic.exp: Delete.
+ * gdb.hp/gdb.threads-hp/usrthcore.c: Delete.
+ * gdb.hp/gdb.threads-hp/usrthcore.exp: Delete.
+ * gdb.hp/gdb.threads-hp/usrthfork.c: Delete.
+ * gdb.hp/gdb.threads-hp/usrthfork.exp: Delete.
+
+2002-05-02 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/watchpoint.exp: Add xscale target.
+ * gdb.base/long_long.exp: Add xscale target.
+ * gdb.base/default.exp: Add xscale target.
+
+2002-05-01 Jim Blandy <jimb@redhat.com>
+
+ * gdb.c++/hang1.C, gdb.c++/hang2.C, gdb.c++/hang.H,
+ gdb.c++/hang.exp: New test.
+
+2002-05-01 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/completion.exp: Handle completions of "./Make" for
+ more than one completion possibility, as is the case when we
+ build and test in the source tree.
+
+2002-04-29 Anthony Green <green@redhat.com>
+
+ * gdb.java/jmisc1.exp: New file.
+ * gdb.java/jmisc2.exp: New file.
+
+2002-04-24 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.threads/linux-dp.exp: Use 'unset' instead of 'array unset'.
+
+2002-04-23 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.base/help.exp: Change 'help status' to allow for target
+ dependent output differences.
+
+2002-04-22 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/local.exp: Add PR numbers: gdb/482, gdb/483.
+
+2002-04-22 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/method.exp: Fix syntax of reference to gdb/277.
+
+2002-04-17 David S. Miller <davem@redhat.com>
+
+ * gdb.asm/sparc64.inc: New file.
+ * gdb.asm/asm-source.exp: Handle sparc64-*-*.
+
+2002-04-19 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.asm/asm-source.exp: Don't use a symlink, just copy the
+ instruction file directly into the build tree. Clean up at end of
+ test.
+
+2002-04-18 David S. Miller <davem@redhat.com>
+
+ * gdb.base/annota1.exp: Expect addresses as $hex + whitespace to
+ handle 64-bit platforms correctly.
+ * gdb.base/maint.exp: Likewise.
+
+2002-04-18 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/shlib-call.exp (additional_flags): AIX doesn't need
+ ``-fpic'' when compiling files comprising a shared library, but
+ it does need additional linker flags in order to find shared
+ libraries at run time.
+
+2002-04-18 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/cvexpr.c (use): New function.
+ (main): Invoke use() on all global variables to prevent
+ some linkers from deleting these otherwise unused symbols.
+
+2002-04-17 Michael Chastain <mec@shout.net>
+From David S. Miller <davem@redhat.com>
+
+ * gdb.c++/ovldbreak.exp: Expect addresses as $hex + whitespace to
+ handle 64-bit platforms correctly.
+
+2002-04-12 Michael Snyder <msnyder@redhat.com>
+From Jim Blandy <jimb@redhat.com>
+ * gdb.base/foo.c (foox): Remove section attribute; the linker
+ script can handle this instead.
+ * gdb.base/bar.c (barx): Same.
+ * gdb.base/baz.c (bazx): Same.
+ * gdb.base/grbx.c (grbxx): Same.
+
+ * gdb.base/overlays.exp: New test: check that GDB's manual overlay
+ manager doesn't automatically unmap overlays unnecessarily.
+
+2002-04-10 Martin M. Hunt <hunt@redhat.com>
+
+ * gdb.base/ending-run.exp: Fix pattern for Mips targets
+ stepping out of main.
+
+2002-04-09 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/local.cc (main): Move call to marker1() inside nested
+ scope so that the nested scope tests will make sense.
+ * gdb.c++/local.exp: Write patterns that actually work with gcc
+ (the HP patterns "were never known to work with gcc").
+ Keep the old aCC patterns too.
+
+2002-04-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/attach.exp: Correct target board test.
+
+2002-04-08 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/method.exp: Require "const ... A * ..." for "ptype this"
+ in a const method. Add some xfail and fail cases for configurations
+ that do not emit the "const ...".
+
+2002-04-07 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/method.exp: Use gdb_test instead of send_gdb/gdb_expect.
+ Accept "A * const" and "const A * const" as type of "this".
+ Fix spelling of getFunky throughout. Make messages uniform.
+
+2002-04-07 Elena Zannoni <ezannoni@redhat.com>
+
+ Work around for PR gdb/285:
+ * gdb.asm/asm-source.exp: Bail out if multilibs are detected.
+
+2002-04-07 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.asm/asm-source.exp: Build symbolic link to arch specific
+ instructions file at run time instead of configure time.
+ Sometimes we run the test in a directory that is not the one we
+ configured in.
+ * gdb.asm/configure.in: Delete creation of symlink.
+ * gdb.asm/configure: Regenerate.
+
+2002-04-05 J. Brobecker <brobecker@gnat.com>
+
+ * gdb.gdb/xfullpath.exp: New test, to exercise the new
+ xfullpath () function.
+
+2002-04-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.asm/Makefile.in: Correct dependencies.
+
+ * gdb.asm/powerpc.inc: New file.
+ * gdb.asm/asm-source.exp: Add PowerPC.
+ * gdb.asm/configure.in: Likewise.
+ * gdb.asm/configure: Regenerated.
+
+2002-04-04 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/relocate.exp: New file.
+ * gdb.base/relocate.c: New file.
+
+2002-04-04 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/step-test.exp: Update comment regarding stopping in
+ memcpy/bcopy calls inserted as part of the compiler runtime.
+
+2002-04-04 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/ovlymgr.c: Add overlay event breakpoint support.
+
+2002-04-03 Daniel Jacobowitz <drow@mvista.com>
+
+ * lib/gdb.exp (gdb_test): Move -notransfer inside of gdb_expect.
+ (gdb_expect): Remove $notransfer hack.
+
+2002-04-02 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.c++/classes.exp ("calling method for small class"): Match
+ updated register output.
+
+2002-03-30 Daniel Jacobowitz <drow@mvista.com>
+
+ Fix PR gdb/452
+ * gdb.base/dbx.exp: Restore old definition of gdb_file_cmd
+ when finished. Make gdb_file_cmd send "exec-file" when
+ appropriate.
+
+2002-03-30 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/attach.exp: Remove extra setup_xfail.
+
+2002-03-26 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/default.exp: Add tests for dump, append, and restore.
+ * gdb.base/help.exp: Add tests for dump, append, and restore.
+ * gdb.base/dump.exp: New file, test dump, append and restore.
+ * gdb.base/dump.c: New file.
+
+2002-03-27 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/help.exp: Modify expect strings to reflect
+ clean-ups in help messages.
+
+2002-03-26 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/step-test.exp: Accept stopping in memcpy/bcopy when we
+ have debugging info for those functions and the compiler uses them
+ internally to copy structs around.
+
+2002-03-26 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/list.exp: Revert the change made yesterday and add note
+ about why we don't list the default lines for remote targets.
+
+2002-03-25 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/help.exp: Clean up unnecessary wild cards in regexps.
+
+2002-03-25 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/list.exp: This test works on remote targets so remove
+ the short circuit for remote targets. Update copyright.
+
+2002-03-25 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/attach.exp: Fix logic error that was suppressing this
+ test for all non hppa*-*-hpux* targets, instead of the hp target.
+ Move comments closer to the suppression point. Also now need to
+ check that we are running natively.
+
+2002-03-22 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/default.exp: Add test for gcore. Update copyright.
+ * gdb.base/help.exp: Add test for gcore. Update copyright.
+
+2002-03-06 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/funcargs.c: Remove extraneous ';' character.
+ * gdb.trace/gdb_c_test.c: Remove extraneous ';' character.
+
+2002-03-04 Michael Chastain <mec@shout.net>
+
+ * gdb.mi/mi-var-cmd.exp: In test "create local variable func",
+ accommodate gcc v3 function signature.
+ * gdb.mi/mi0-var-cmd-exp: Ditto.
+
+2002-02-24 Andrew Cagney <ac131313@redhat.com>
+
+ * testsuite/gdb.base/huge.c: Replace ``Linux'' with either
+ ``GNU/Linux'' or ``Linux kernel''
+ * testsuite/gdb.threads/pthreads.c: Ditto.
+
+2002-02-24 Michael Chastain <mec@shout.net>
+
+ * gdb.threads/pthreads.c (thread1): Add a return statement.
+ (thread2): Likewise.
+ (foo): Likewise.
+
+2002-02-23 Michael Chastain <mec@shout.net>
+
+ * gdb.threads/linux-dp.c (philosopher): Add a return statement
+ to placate gcc.
+
+2002-02-23 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/templates.exp: Remove setup_xfail_format "stabs" on
+ test "ptype bint". The test passes on all my stabs configurations.
+
+2002-02-21 Jim Blandy <jimb@redhat.com>
+
+ * gdb.asm/asm-source.exp: Parse the output from `info sources' one
+ filename at a time, and watch for the ones we want to see.
+
+ * gdb.base/ptype.exp, gdb.base/ptype.c: Add tests for printing
+ types of pointers to prototyped functions.
+
+2002-02-20 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.base/sizeof.c (main): Call fill_structs. Print value of
+ signed, unsigned and straight char.
+ (padding_char, padding_short, padding_int, padding_long,
+ padding_long_long, padding_float, padding_double,
+ padding_long_double): New global variables.
+ (fill, fill_structs): New functions.
+
+ * gdb.base/sizeof.exp: Check for signed and unsigned char. Check
+ for correctly sized writes. Update copyright.
+ (get_valueof): New procedure.
+ (get_sizeof): Call get_valueof.
+ (check_valueof): New procedure.
+ (check_padding): New procedure.
+
+2002-02-20 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/virtfunc.exp (test_virtual_calls): Remove obsolete calls
+ to setup_xfail. Document some of the remaining calls.
+
+2002-02-18 Michael Chastain <mec@shout.net>
+
+ * gdb.c++/userdef.exp: Update copyright year.
+
+2002-02-18 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.c++/userdef.exp: Test overloaded operators properly.
+ Remove xfails.
+
+2002-02-14 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/gcore.exp: Relax recognition of function breakpoint.
+
+2002-02-14 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/a2-run.exp: Check for a remote target properly.
+ * gdb.base/annota1.exp: Likewise.
+ * gdb.base/list.exp: Likewise.
+ * gdb.base/reread.exp: Likewise.
+ * gdb.base/scope.exp: Likewise.
+ * gdb.base/shlib-call.exp: Likewise.
+ * gdb.base/term.exp: Likewise.
+ * gdb.c++/annota2.exp: Likewise.
+
+2002-02-13 Richard Earnshaw <rearnsha@arm.com>
+
+ * gdb.base/watchpoint.exp: Restore previous timeout at end of test.
+
+2002-02-10 Michael Chastain <mec@shout.net>
+
+ * gdb.base/funcargs.c (localvars_after_alloca): Fix return type.
+ (call_after_alloca): Ditto.
+
+2002-02-10 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/ending-run.exp: Guard "cont" test with
+ gdb_skip_stdio_test.
+
+2002-02-06 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/callfwmall.c, gdb.base/callfwmall.exp: Move these tests
+ from here...
+ * gdb.hp/gdb.base-hp/callfwmall.c, gdb.hp/gdb.base-hp/callfwmall.exp:
+ To here. Disable this test on non-HP platforms. Add big comment.
+
+2002-02-04 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/ovlymgr.c (ovly_copy): Generalize for targets
+ other than d10v and m32r.
+
+2002-02-02 Richard Earnshaw <rearnsha@arm.com>
+
+ * gdb.base/default.exp: Rewrite test patterns to reduce time
+ taken to match them.
+
+2002-01-30 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/annota1.exp (backtrace from shlibrary): Fix spelling.
+ Allow a start function above main.
+ * gdb.threads/linux-dp.exp: Fix copyright date.
+
+2002-01-30 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.threads/linux-dp.exp: Use 'array unset', not 'array set'.
+ (check_philosopher_stack): Check for manager thread before checking
+ for a just-starting thread.
+
+2002-01-30 Daniel Jacobowitz <drow@mvista.com>
+
+ From Neil Booth <neil@daikokuya.demon.co.uk>:
+ * gdb.base/bitfields.c: Correct assignments to bitfields to avoid
+ warnings.
+
+2002-01-21 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/restore.exp (restore_tests): Fix obvious typo, callee
+ not caller.
+
+2002-01-21 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/reread.exp: Check that GDB properly re-reads the
+ executable file when it changes while no inferior is running.
+
+2002-01-21 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/maint.exp: Simplify the "maint info breakpoints" test to
+ optionally accept the "shlib events" variation.
+
+2002-01-21 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/ending-run.c (main): Avoid messing with setvbuf; just
+ call `fflush' after every `printf', so that the output is produced
+ at predictable points, regardless of whatever buffering does (or
+ doesn't) take place.
+ * gdb.base/ending-run.exp: Adjust tests to expect output to appear
+ at different points.
+
+2002-01-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.c++/inherit.exp: Update copyright years.
+ * gdb.c++/method.exp: Likewise.
+
+2002-01-20 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.c++/classes.exp: Update for improved v3 support and skipping
+ artificial methods/arguments.
+ * gdb.c++/derivation.exp: Likewise.
+ * gdb.c++/inherit.exp: Likewise.
+ * gdb.c++/method.exp: Likewise.
+ * gdb.c++/virtfunc.exp: Likewise.
+
+2002-01-18 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.hp/gdb.threads-hp/usrthfork.exp: Mark as obsolete.
+ * gdb.hp/gdb.threads-hp/usrthcore.exp: Ditto.
+ * gdb.hp/gdb.threads-hp/usrthbasic.exp: Ditto.
+ * gdb.hp/gdb.threads-hp/usrthfork.c: Ditto.
+ * gdb.hp/gdb.threads-hp/usrthbasic.c: Ditto.
+ * gdb.hp/gdb.threads-hp/usrthcore.c: Ditto.
+
+2002-01-17 Jim Blandy <jimb@redhat.com>
+
+ * gdb.asm/asm-source.exp (info symbol): Take another shot at
+ anchoring the pattern matching the entry point symbol's name.
+
+2002-01-17 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.base/maint.exp: Update ``maint internal-error'' to match
+ continue/quit query. Update copyright.
+
+2002-01-14 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/gcore.exp: Remove extra debugging output.
+
+2002-01-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.c++/demangle.exp: Accept slightly dubious v2 demangler result
+ for slightly dubious v2 mangled string.
+
+2002-01-13 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/completion.exp: Expand ${srcdir} to an absolute path.
+
+2002-01-10 Jason Merrill <jason@redhat.com>
+
+ * gdb.c++/namespace.exp: Accept trailing const for 'this'.
+
+ * gdb.c++/classes.exp: Accept 'A const' or 'const A' in copy
+ constructors.
+ * gdb.c++/derivation.exp: Likewise.
+ * gdb.c++/templates.exp: Likewise.
+ * gdb.c++/virtfunc.exp: Likewise.
+
+2002-01-10 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.c++/namespace.exp: Accept both '\0' and '\000'.
+
+2002-01-08 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/gcore.exp: New test for generate-core-file command.
+ * gdb.base/gcore.c: Testcase for above.
+ * gdb.threads/gcore-thread.exp: New test for gcore (threaded).
+
+2002-01-08 Jason Merrill <jason@redhat.com>
+
+ * gdb.c++/userdef.cc: Use <iostream> instead of <iostream.h>.
+
+2002-01-07 Fred Fish <fnf@redhat.com>
+
+ * gdb.c++/overload.exp: Remove unconditional xfails for:
+ print foo_instance1.overloadargs(1)
+ print foo_instance1.overloadargs(1, 2)
+ print foo_instance1.overloadargs(1, 2, 3)
+ print foo_instance1.overloadargs(1, 2, 3, 4)
+ print foo_instance1.overloadargs(1, 2, 3, 4, 5)
+ print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6)
+ print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7)
+ print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8)
+ print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9)
+ print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
+ print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
+ print foo_instance1.overload1arg()
+ print foo_instance1.overload1arg((char)arg2)
+ print foo_instance1.overload1arg((signed char)arg3)
+ print foo_instance1.overload1arg((unsigned char)arg4)
+ print foo_instance1.overload1arg((int)arg7)
+ print foo_instance1.overload1arg((unsigned int)arg8)
+ print foo_instance1.overload1arg((float)arg11)
+ print foo_instance1.overload1arg((double)arg12)
+
+2002-01-07 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/huge.exp: New test. Print a very large target data object.
+ (skip_huge_test): New test variable. Define if you want to skip this
+ test. The test reads an 8 megabyte data object from the target, so it
+ might be very time consuming on remote targets with a slow connection.
+ * gdb.base/huge.c: New file. Test case for above.
+
+2002-01-07 Fred Fish <fnf@redhat.com>
+
+ * gdb.c++/derivation.exp: Remove gcc xfails for g_instance.afoo,
+ g_instance.bfoo, and g_instance.cfoo.
+
+Mon Jan 7 12:22:18 2002 Jeffrey A Law (law@redhat.com)
+
+ * gdb.base/break.c (multi_line_if_conditional): New function.
+ (multi_ilne_while_conditional): Likewise.
+ * gdb.base/break.exp: Verify that a breakpoint on a multi-line
+ IF or WHILE condition puts the breakpoint at the start of
+ the condition.
+
+ * gdb.base/selftest.exp (backtrace through signal handler): Remove
+ hppa*-*-hpux* expected failure.
+ * gdb.base/structs.exp (do_function_calls): Similarly.
+
+ * gdb.c++/annota2.exp (watch triggered on a.x): Handle hardware
+ watchpoints.
+
+2002-01-06 Andrew Cagney <ac131313@redhat.com>
+
+ Fix PR gdb/66.
+ * gdb.base/structs.exp: Replace skip for a29k with skip for
+ gdb,cannot_call_functions.
+ * gdb.base/call-ar-st.exp: Remove references to a29k in comments.
+ * gdb.base/callfuncs.exp: Ditto.
+ * gdb.base/call-rt-st.exp: Ditto.
+ * gdb.base/call-strs.exp: Ditto.
+ * gdb.base/callfwmall.exp: Ditto.
+ * gdb.base/scope.exp: Obsolete xfail a29k.
+ * gdb.c++/misc.exp: Ditto.
+ * gdb.c++/cplusfuncs.exp: Ditto.
+ * gdb.base/ptype.exp: Ditto.
+ * gdb.base/printcmds.exp: Ditto.
+ * gdb.base/opaque.exp: Ditto.
+ * gdb.base/list.exp: Ditto.
+ * gdb.base/funcargs.exp: Ditto.
+ * gdb.base/default.exp: Ditto.
+
+2002-01-04 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/info-proc.exp: New file, test for "info proc" cmd.
+ * gdb.base/maint.exp: Add tests for maint info sections options.
+
+Fri Dec 21 09:42:11 2001 Jeffrey A Law (law@redhat.com)
+
+ * gdb.base/default.exp: Remove bogus hppa*-hp-hpux* xfails.
+
+2001-12-20 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.asm/arm.inc: New file.
+ * gdb.asm/asm-source.exp: Add arm targets.
+ * gdb.asm/configure.in: Ditto.
+ * gdb.asm/configure: Recreated from configure.in.
+
+Thu Dec 20 09:54:36 2001 Jeffrey A Law (law@redhat.com)
+
+ * gdb.hp/gdb.defects/bs15503.exp: Only run this test if compiling
+ with HP's compiler.
+ * gdb.hp/gdb.objdbg/objdbg01.exp: Likewise.
+ * gdb.hp/gdb.objdbg/objdbg02.exp: Likewise.
+ * gdb.hp/gdb.objdbg/objdbg03.exp: Likewise.
+ * gdb.hp/gdb.objdbg/objdbg04.exp: Likewise.
+
+ * gdb.hp/gdb.defects/solib-d.exp: Update to handle building with
+ either HP's compilers or GCC.
+
+ * gdb.hp/gdb.base-hp/hwwatchbus.exp: Allow inferior to get either
+ a SIGBUS or SIGSEGV.
+
+ * gdb.hp/gdb.base-hp/so-thresh.exp: Remove useless send_user command.
+
+ * gdb.hp/gdb.defects/bs14602.exp: Revamp slightly so that test
+ can be compiled with either HP's compiler or GCC.
+
+ * gdb.hp/gdb.threads-hp/usrthbasic.exp: Disable completely.
+ * gdb.hp/gdb.threads-hp/usrthcore.exp: Disable completely.
+ * gdb.hp/gdb.threads-hp/usrthfork.exp: Disable completely.
+
+ * gdb.hp/gdb.base-hp/so-thresh.exp: Update text in expect strings
+ to match current gdb output. Update due to using auto-solib-limit
+ for limiting instead of overloading auto-solib-add.
+ * gdb.hp/gdb.base-hp/so-thresh.mk: Always use "cc" to build the
+ test program.
+
+ * gdb.c++/templates.exp: Use "hppa64-*-*", not "hppa2.0w-*-*"
+ * gdb.hp/gdb.base-hp/dollar.exp: Likewise
+ * gdb.hp/gdb.base-hp/pxdb.exp: Likewise.
+ * gdb.hp/gdb.base-hp/reg-pa64.exp: Likewise.
+ * gdb.hp/gdb.base-hp/reg.exp: Likewise.
+ * gdb.hp/gdb.compat/xdb3.exp: Likewise.
+ * gdb.hp/gdb.defects/bs15503.exp: Likewise.
+ * gdb.hp/gdb.objdbg/objdbg01.exp: Likewise
+ * gdb.hp/gdb.objdbg/objdbg02.exp: Likewise
+ * gdb.hp/gdb.objdbg/objdbg03.exp: Likewise
+ * gdb.hp/gdb.threads-hp/usrthbasic.exp: Likewise.
+ * gdb.hp/gdb.threads-hp/usrthcore.exp: Likewise.
+ * gdb.hp/gdb.threads-hp/usrthfork.exp: Likewise.
+
+ * gdb.base/annota1.exp: Expect failure for hpux11 when posting
+ a SIGTRAP to the inferior.
+
+2001-12-19 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.asm/asm-source.exp: Drop setting link-flags for xstormy16.
+ Substitute call to target_link by call to gdb_compile.
+
+Wed Dec 19 14:10:57 2001 Jeffrey A Law (law@redhat.com)
+
+ * gdb.base/break.exp: Fix HP specific search string when testing
+ backtracing in a called function.
+
+ * gdb.base/constvars.exp: Only set lang to C++ if we're
+ compiling the test with HP's compilers.
+ * gdb.base/volatile.exp: Similarly.
+
+2001-12-19 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/printcmds.exp: Expect the null character to be printed
+ as '\0', and the '\013' to be printed as '\v'.
+ * gdb.base/callfuncs.exp ("backtrace at nested call level 4"): Same.
+ * gdb.base/setvar.exp: Same.
+
+2001-12-17 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/completion.exp: Rather than completing very long
+ filenames, which can make the readline library produce output we
+ don't recognize, cd to the directory first, and then complete
+ using nice, short relative paths.
+
+ * gdb.base/completion.exp: On some systems, there is, in fact, a
+ variable named `b' in scope, since GDB treats all static
+ variables as being in scope. So use `no_var_named_this'
+ instead of `b'.
+
+ * gdb.base/corefile.exp: Recognize the message saying that GDB
+ can't find the core file's registers as a failure.
+
+2001-12-13 Jackie Smith Cashion <jsmith@redhat.com>
+
+ * gdb.base/commands.exp (user_defined_command_test): Make "show user"
+ test expect string more specific.
+
+2001-12-13 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.asm/asm-source.exp: Add support for xstormy16.
+ * gdb.asm/configure.in: Ditto.
+ * gdb.asm/configure: Rebuild.
+ * gdb.asm/xstormy16.inc: New file.
+
+2001-12-10 Fred Fish <fnf@redhat.com>
+
+ * gdb.base/maint.exp: Update to match changes in type dumping code.
+
+2001-12-10 Jim Blandy <jimb@redhat.com>
+
+ * gdb.asm/asm-source.exp (info symbol): Anchor the pattern
+ matching the entry point symbol's name at the beginning of the
+ line.
+
+2001-12-07 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.c++/classes.exp, gdb.c++/derivation.exp,
+ gdb.c++/inherit.exp, gdb.c++/method.exp,
+ gdb.c++/namespace.exp, gdb.c++/templates.exp,
+ gdb.c++/userdef.exp, gdb.c++/virtfunc.exp: Updates for v3 demangler
+ and class layout support.
+
+2001-12-07 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.c++/classes.exp: Add test for static member function.
+ * gdb.c++/misc.cc: Add class with static member function.
+
+2001-12-07 Jim Blandy <jimb@redhat.com>
+
+ If GDB says it can't find the struct the function returned, report
+ those tests as `unsupported'.
+ * gdb.base/call-rt-st.exp (print_struct_call): New function.
+ Rewrite subsequent tests to use it.
+
+ If GDB says it can't find the struct the function returned, report
+ those tests as `unsupported'.
+ * gdb.base/structs.exp (call_struct_func): New function.
+ (do_function_calls): Use call_struct_func to call the functions
+ returning structs.
+
+ * gdb.base/callfuncs.exp: The stabs generated by GCC don't tell us
+ whether functions are prototyped or not, so we can't possibly pass
+ arguments to t_float_values2 properly.
+
+ * gdb.base/break.exp: (test_next_with_recursion): Don't change the
+ value of `timeout' for targets other than the mips*tx39-*.
+
+2001-12-06 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.asm/asm-source.exp: Add tests for info target, info symbol,
+ and detect whether the start symbol has a leading underscore.
+
+2001-12-04 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/completion.exp: Clarify indentation.
+
+2001-12-03 Jim Blandy <jimb@redhat.com>
+
+ * gdb.asm/s390.inc (gdbasm_datavar): Use `.long' to create `int'
+ variables on the S/390, not `.word'.
+
+2001-11-30 Jim Blandy <jimb@redhat.com>
+
+ Add assembly-source tests for s390-ibm-linux.
+ * gdb.asm/s390.inc: New file.
+ * gdb.asm/configure.in, gdb.asm/asm-source.exp: Add clauses for
+ the S/390 architecture.
+ * gdb.asm/configure: Regenerated.
+
+2001-11-30 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.asm/asm-source.exp: Add tests for list, search, finish, return,
+ next, info source, info sources, info line, global and static
+ variables, and static functions.
+ * gdb.asm/common.inc: New macro gdbasm_datavar (default definition).
+ * gdb.asm/i386.inc: Override default definition of gdbasm_datavar.
+ * gdb.asm/asmsrc1.s: Add a static function and some variables.
+ * gdb.asm/asmsrc2.s: Make foo2 call foo3 twice (to test 'next').
+ * gdb.asm/d10v.inc (gdbasm_enter): Set up frame pointer.
+ (gdbasm_leave): Restore frame pointer.
+ (gdbasm_startup): Copy stack set-up from crt0.S.
+
+2001-11-26 Fernando Nasser <fnasser@redhat.com>
+
+ From 2001-11-12 Jackie Smith Cashion <jsmith@redhat.com>:
+ * gdb.base/callfuncs.c (t_structs_a): Do not return a pointer
+ to a local (non-static) variable. Copy tstruct.a to a static buffer
+ and return a pointer to that buffer.
+ * gdb.base/callfwmall.c (t_structs_a): Ditto.
+
+2001-11-24 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.asm/configure.in: Fix recognition of ix86 target.
+ * gdb.asm/configure: Regenerate.
+
+2001-11-21 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.asm/sparc.inc: New file.
+ * gdb.asm/asm-source.exp: Recognize sparc target.
+ * gdb.asm/configure.in: Recognize sparc target.
+ * gdb.asm/configure: Regenerate.
+
+2001-11-21 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.asm/m32r.inc: New file.
+ * gdb.asm/asm-source.exp: Recognize m32r target.
+ * gdb.asm/configure.in: Recognize m32r target.
+ * gdb.asm/configure: Regenerate.
+
+2001-11-20 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.asm/i386.inc: New file.
+ * gdb.asm/asm-source.exp: Recognize ix86 target.
+ * gdb.asm/configure.in: Recognize ix86 target.
+ * gdb.asm/configure: Regenerate.
+
+ * gdb.c++/namespace.exp: Fix quotes in output messages.
+
+2001-11-14 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/code-expr.exp: New file. Tests use of the "@code"
+ qualifier in a type cast expression, to designate an address
+ in the instruction space (Harvard architecture).
+
+2001-11-13 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/cvexpr.c, gdb.base/cvexpr.exp: New files.
+ Tests for expressions using 'const' and 'volatile'.
+
+2001-11-13 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.asm/asm-sources.exp: Allow defining linker flags.
+
+2001-11-12 Daniel Jacobowitz <drow@mvista.com>
+
+ * lib/mi-support.exp (mi_run_to_helper): Move comments
+ outside of gdb_expect.
+
+2001-11-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * lib/mi-support.exp: (mi_run_to_helper, mi_run_to,
+ mi_step_to, mi_next_to, mi_continue_to, mi_finish_to,
+ mi0_step_to, mi0_next_to, mi0_continue_to, mi0_finish_to,
+ mi0_run_to): New functions.
+ * gdb.mi/mi-simplerun.exp: Use them.
+ * gdb.mi/mi0-simplerun.exp: Likewise.
+ * gdb.mi/mi-var-cmd.exp: Likewise.
+ * gdb.mi/mi0-var-cmd.exp: Likewise.
+
+2001-11-10 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.asm/asmsrc1.s: Add ``gdbasm_'' prefix to all macros.
+ * gdb.asm/asmsrc2.s, gdb.asm/d10v.inc: Update.
+
+2001-11-09 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.base/restore.exp: Include $expected value in restored test
+ message.
+
+2001-11-09 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.asm/asm-source.exp: Supress file, instead of skip, when not
+ implemented.
+
+2001-11-08 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/callfuncs.exp: Add tests for nested call dummies.
+ Add pass/fail message for stop at breakpoint in call dummy function.
+
+2001-11-07 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.c++/templates.exp (test_template_breakpoints):
+ If we get an overload menu, but it does not match what
+ we expect, we still need to issue the "cancel" command.
+ * gdb.c++/templates.exp: Replace "void \\*" with "void ?\\*",
+ making the whitespace optional. Argument for "new" may be
+ "unsigned" as well as "unsigned int/long".
+ * gdb.c++/templates.exp: Replace "const &" with "const ?&",
+ making the whitespace optional. Also replace "(void) with
+ "((void|)), making the keyword "void" optional.
+ * gdb.c++/virtfunc.exp: Replace "const &" with "const ?&",
+ making the whitespace optional. Also replace "(void) with
+ "((void|)), making the keyword "void" optional.
+ * gdb.base/callfuncs.c (t_float_values): This function must
+ _not_ be prototyped, and the following function (t_float_values2)
+ must be prototyped (if the compiler supports it), so that GDB
+ can be tested against both cases. Usually one case involves
+ promotion of float to double, while the other does not.
+ * gdb.base/callfwmall.c: Ditto.
+ * gdb.asm/asm-source.exp (bt ALL in foo2): Accept a backtrace that
+ includes a stack frame for "start".
+
+2001-11-05 Jim Blandy <jimb@redhat.com>
+
+ * gdb.stabs/weird.exp: Delete "p v_comb" test. It assumes that
+ pointers are 32 bits long, and that offsets of relocs are always
+ stored in the data (REL-style), and not in the reloc entry itself
+ (RELA-style).
+ * gdb.stabs/weird.def (v_comb, v_comb_shared): Remove symbols and
+ stabs.
+
+2001-11-01 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.c++/cplusfuncs.exp: Fix conflicts between operator names
+ and regular expression operators by using quoting.
+
+2001-10-31 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.c++/overload.exp: Select overloadfnarg(void) or overloadfnarg(),
+ depending on what the symbol table contains.
+ * gdb.c++/derivation.exp: Accept both "foo(void)" and "foo()" in
+ the output of the ptype command. Similarly, accept both "const &"
+ and "const&".
+
+2001-10-31 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.base/miscexprs.c (main): Add usage of preprocessor
+ symbol `STORAGE' to allow to choose the storage class of
+ the local datastructures.
+ * gdb.base/miscexprs.exp: Handle setting a `-DSTORAGE=...'
+ compiler directive.
+
+2001-10-30 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/jump.exp: Allow it to run for all targets.
+
+2001-10-29 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.base/call-ar-st.c (print_double_array): Match for loop
+ with new double_array size.
+ (main): Change storage class of all local variables to static.
+ Reduce size of double_array to 9.
+ * gdb.base/call-ar-st.exp: Increase timeout value.
+ Change expected output for double array to match new size in
+ call-ar-st.c.
+
+2001-10-29 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.base/ending-run.exp: Create identical output when passing
+ `step to end of run' case. Add regular expression branch satisfying
+ Stormy16 target.
+
+2001-10-28 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.base/interrupt.exp: Treat SIGILL similar to SIGSEGV such
+ that we catch the expected failure under Linux/x86.
+
+2001-10-29 Orjan Friberg <orjanf@axis.com>
+
+ * gdb.base/setvar.exp: Escape curly braces.
+ * gdb.stabs/weird.exp: Ditto.
+
+2001-10-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.mi/mi-hack-cli.exp: Remove excess newlines from test strings.
+ * gdm.mi/mi0-hack-cli.exp: Likewise.
+
+2001-10-25 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.stabs/weird.exp: Unify ``variable VAR printed properly''
+ messages.
+
+2001-10-21 Andrew Cagney <ac131313@redhat.com>
+
+ * lib/mi-support.exp (mi_gdb_start): Don't require MI_OUT when
+ checking MI enabled.
+
+2001-10-09 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.base/maint.exp: Treat $EXEEXT as optional in output.
+
+2001-10-04 Frank Ch. Eigler <fche@redhat.com>
+
+ * lib/insight-support.exp (gdbtk_start): Don't exit dejagnu
+ if gdb child process crashes, just signal an error.
+
+2001-10-02 Jim Blandy <jimb@redhat.com>
+
+ * lib/gdb.exp (test_xfail_format): Simplify.
+
+ * lib/gdb.exp (setup_xfail_format): Don't forget to put a `$' in
+ front of the variable name `format'. Simplify `if'.
+
+2001-10-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.threads/pthreads.exp: Wait for output and delay
+ before sending ^C.
+
+2001-10-01 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.mi/mi-var-display.exp (continue to incr_a): Recognize
+ some incorrect output instead of timing out.
+ * gdb.mi/mi-var-display.exp (continue to incr_a): Likewise.
+
+2001-09-28 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.base/volatile.exp (local_compiler_xfail_check): Change qux2
+ check to allow additional `int'.
+
+2001-09-27 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdb.base/completion.exp: Remove incorrect 'p "a' test.
+ Add tests for 'p "break' (pass) and 'p "break.' (xfail).
+
+2001-09-27 Michael Snyder <msnyder@redhat.com>
+
+ * lib/gdb.exp (test_debug_format): New proc.
+ (setup_xfail_format): Use new proc test_debug_format.
+ * gdb.base/constvars.exp (local_compiler_xfail_check): New
+ proc; use new service proc test_debug_format.
+ Replace all other "gcc_compiled" tests with this test.
+ * gdb.base/volatile.exp (local_compiler_xfail_check): New
+ proc; use new service proc test_debug_format.
+ Replace all other "gcc_compiled" tests with this test.
+
+2001-09-27 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/cvexpr.exp: New file.
+ * gdb.base/cvexpr.c: New file
+ Test for expressions using const and volatile keywords.
+
+2001-09-26 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.base/constvars.exp: Check for different orders of keywords
+ and additional "int" strings in output.
+
+2001-09-22 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.base/maint.exp: Add "maintenance set/show" to list of valid
+ responses from "help maint".
+
+2001-09-19 Frank Ch. Eigler <fche@redhat.com>
+
+ * lib/insight-support.exp (_gdbtk_xvfb_init): Set DISPLAY
+ to localhost:NNN instead of :NNN, in case Xvfb is listening
+ only on TCP.
+
+2001-09-19 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.base/recurse.exp: When checking leaving the watchpoint
+ scope, recognize when gdb is in function's epilogue and pass.
+
+2001-09-18 Keith Seitz <keiths@redhat.com>
+
+ * lib/insight-support.exp (_gdbtk_export_target_info): Add
+ support for running tests against sid targets.
+ (gdbtk_done): Ditto.
+
+2001-09-18 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.base/ending-run.c (main): Set stdout buffersize
+ to the same reasonable value for any target.
+ * gdb.base/ending-run.exp: Add a regular expression
+ to make testsuite happy on Sanyo Stormy16 target.
+
+2001-09-17 Corinna Vinschen <vinschen@redhat.com>
+
+ * gdb.base/display.c (do_loops): Add float variable `f'.
+ Increment f in loop.
+ * gdb.base/display.exp: Increment timeout by 60 seconds.
+ Change float display test to use variable `f'.
+
+2001-09-17 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/restore.exp: Use temporary breakpoints, to avoid
+ overflowing the limited breakpoint tables on some ROM monitors
+ (like the ROM68K).
+
+2001-09-15 Frank Ch. Eigler <fche@redhat.com>
+
+ * lib/insight-support.exp (_gdbtk_xvfb_init): Start Xvfb with
+ the "-ac" (disable access control) flag.
+
+2001-08-30 Jeff Holcomb <jeffh@redhat.com>
+
+ * gdb.base/remote.c: Use a small buffer for targets with 16-bit
+ ints.
+
+2001-08-30 Keith Seitz <keiths@redhat.com>
+
+ * lib/gdb.exp: Move all insight-related functionality into
+ separate file.
+ * lib/insight-support.exp: New file.
+
+2001-08-29 Frank Ch. Eigler <fche@redhat.com>
+
+ * config/sid.exp (sid_start): Never set sid verbosity; disable
+ expect_background {} that consumed its stdout; tolerate </dev/null.
+ Attempt to set endianness override in "sid" protocol mode. Cleanup.
+
+2001-08-18 Andrew Cagney <ac131313@redhat.com>
+
+ * lib/mi-support.exp (mi_gdb_start): If a remote target, use the
+ CLI jump command to start it.
+ (mi_run_to_main): Fail immediatly when unexpected output.
+
+2001-08-18 Andrew Cagney <ac131313@redhat.com>
+
+ * lib/mi-support.exp (mi_gdb_start): Move call to sid_start to
+ beginning of function. Fix PR gdb/191.
+
+2001-08-16 Frank Ch. Eigler <fche@redhat.com>
+
+ * config/sid.exp (sid_start): Don't warn if we cannot figure out
+ what to force sid endianness to.
+
+2001-08-15 Keith Seitz <keiths@redhat.com>
+
+ * lib/gdb.exp (gdbtk_start): Don't set environment
+ variables for TCL_LIBRARY and friends. Insight will
+ now figure these out for itself.
+
+2001-08-02 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/completion.exp: Remove the symbol "a64l" from
+ the expect string; this is target-specific, and not related
+ to what is being tested.
+
+2001-08-02 Dave Brolley <brolley@redhat.com>
+
+ * config/sid.exp: Rename gdb-socket to cpu-gdb-socket.
+
+2001-07-25 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/consecutive.exp: New file. Test stepping over
+ breakpoints on consecutive instructions.
+ * gdb.base/consecutive.c: New file.
+
+ * gdb.base/call-rt-st.exp: Use double-backslash to quote
+ curly braces in regular expressions.
+
+2001-07-25 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/ending-run.exp: Accept "Program exited normally" as
+ legitimate output from stepping out of main.
+
+2001-07-22 Keith Seitz <keiths@redhat.com>
+
+ * lib/gdb.exp (_gdbtk_xvfb_init): If GDB_DISPLAY is
+ the empty string, do not run the tests.
+
+2001-07-17 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * gdb.base/long_long.exp: Detect size of pointer. Take into
+ account 2-byte pointers when testing for p/a results.
+
+2001-07-17 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * gdb.base/remote.c (RANDOM_DATA_SIZE): New define, defaults to 48K
+ and defined to 1K for m68hc11.
+ (random_data): Reduce table to 1K for embedded platforms (68hc11).
+ * gdb.base/remote.exp (get_sizeof): New function from sizeof.exp.
+ (sizeof_random_data): New variable to tell the size of the data table;
+ don't test past this size; always run to main.
+
+2001-07-16 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * gdb.base/return2.exp: return of long long and double fails for
+ 68HC11; don't execute these tests on that platform.
+ * gdb.base/return.exp: Return of a double fails for 68hc11.
+
+2001-07-16 Stephane Carrez <Stephane.Carrez@worldnet.fr>
+
+ * call-ar-st.exp: Use gdb_skip_float_test to avoid executing
+ tests that print a float.
+ * call-rt-st.exp: Likewise.
+
+2001-07-12 Mark Kettenis <kettenis@gnu.org>
+
+ * gdb.base/so-impl-ld.exp: Remove stray space that prevented
+ running this test on Linux.
+
+2001-06-24 Michael Chastain <chastain@redhat.com>
+
+ * gdb.base/arithmet.exp: Remove some tests to make all test names
+ unique.
+
+2001-07-03 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.c++/classes.exp: Accept both "foo(void)" and "foo()" in
+ the output of the ptype command.
+
+2001-07-02 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/completion.exp: Don't assume that break.c is the only
+ source file that may contain functions named "marker".
+ * gdb.base/corefile.exp: Quote the curly braces in regexp.
+
+2001-06-28 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.disasm/Makefile.in (clean mostlyclean): Add h8300s to list
+ of files to delete.
+
+ From 2000-06-15 Kazu Hirata <kazu@hxi.com>:
+ * gdb.disasm/h8300s.exp: New file.
+ gdb.disasm/h8300s.s: Likewise.
+
+2001-06-27 Andrew Cagney <ac131313@redhat.com>
+
+ * lib/mi-support.exp (mi_delete_breakpoints): Accept mi1 format
+ empty breakpoint tables.
+
+2001-06-25 Andrew Cagney <ac131313@redhat.com>
+
+ * lib/mi-support.exp: Update args=... part of stop-reason
+ patterns. Accept either a list or a tuple.
+
+2001-06-23 Andrew Cagney <ac131313@redhat.com>
+
+ * lib/mi-support.exp: Remove local emacs variable defining
+ change-log-default-name.
+
+2001-06-22 Michael Chastain <chastain@redhat.com>
+
+ * gdb.base/arithmet.exp: Use gdb_test instead of send_gdb/gdb_expect.
+ This is operationally compatible with the previous version.
+
+2001-06-13 Jim Blandy <jimb@redhat.com>
+
+ * lib/gdb.exp (gdb_test): Doc fix.
+
+2001-06-10 Michael Chastain <chastain@redhat.com>
+
+ * gdb.base/exprs.exp: Remove a duplicate test.
+
+2001-06-06 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/return2.exp (main): Use values to test float and double
+ returns that are not NaN's, to avoid being confused by IEEE
+ comparison rules.
+
+2001-06-04 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.threads/pthreads.exp (check_control_c): Return 0 for success,
+ non-zero if control_c fails. Terminate the test on failure,
+ rather than wait for 12 more tests to time out.
+
+2001-06-06 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/exprs.exp ("sizeof (long long) > sizeof (long) (true)"):
+ Don't forget to match the GDB prompt.
+
+ * gdb.trace/gdb_c_test.c, actions.c: Fix misspellings.
+
+2001-06-04 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/help.exp: Update pattern to exclude `print-load-map'
+ command.
+
+2001-05-31 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/annota1.exp (info break): Match four or more spaces
+ after "Address".
+
+2001-05-31 Michael Chastain <chastain@redhat.com>
+
+ * gdb.c++/cplusfuncs.cc (dm_type_char_star): Remove superfluous cast.
+ (dm_type_int_star): Likewise.
+ (dm_type_long_star): Likewise.
+ (dm_type_void_star): Likewise.
+
+2001-05-29 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/completion.exp (INPUTRC): Set this environment variable
+ to a known value in order to get consistent results regardless
+ of the setting of INPUTRC or the presence or contents of .inputrc.
+
+2001-05-24 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.threads/linux-dp.exp: Remove assumptions about thread ordering.
+ Don't require that the main thread and the manager thread are the
+ first in the list.
+
+ * gdb.threads/pthreads.exp (test_startup): Relax test for thread
+ debugging. If test fails, issue an "unsupported" not a "fail".
+
+2001-05-24 Jim Blandy <jimb@redhat.com>
+
+ Don't assume that short is shorter than int.
+ * gdb.base/exprs.exp ("print unsigned short == (~0)"): Don't
+ assume that shorts are smaller than ints. On a 16-bit machine,
+ this isn't true.
+ ("print unsigned char == (~0)"): Add test that verifies that ~0,
+ an int, is not equal to ~0 stored in an unsigned char. This tests
+ the same thing that the previous test meant to, but works on
+ 16-bit machines, too.
+ ("print unsigned char != (~0)"): Same test, complemented.
+
+2001-05-24 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.threads/pthreads.exp (all_threads_running): Add an explicit
+ test for (full_coverage == 0). This makes the test run faster,
+ and prevents dejagnu getting out of step.
+
+2001-05-23 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/finish.exp (finish_void): Revise pattern for
+ stopping on the call statement to not permit stopping at
+ the start of the instructions comprising the call sequence.
+
+2001-05-19 Michael Chastain <chastain@redhat.com>
+
+ * gdb.base/callfuncs.exp: Make all test names unique.
+ * gdb.base/commands.exp: Make all test names unique.
+ * gdb.base/condbreak.exp: Make all test names unique.
+ * gdb.base/dbx.exp: Make all test names unique.
+ * gdb.base/default.exp: Make all test names unique.
+ * gdb.base/define.exp: Make all test names unique. Conform some FAIL
+ and TIMEOUT messages to their corresponding PASS message.
+ * gdb.base/ending-run.exp: Make all test names unique.
+ * gdb.base/long_long.exp: Remove duplicate test.
+
+2001-05-21 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/finish.exp (finish_void): Allow "finish" command to
+ stop on the call statement as well as the statement after the
+ call.
+
+2001-05-21 Michael Snyder <msnyder@redhat.com>
+
+ * gdb.base/long_long.exp: Allow for targets with 4-byte short.
+
+2001-05-10 Elena Zannoni <ezannoni@redhat.com>
+
+ * gdb.base/completion.exp: Revamp test. Make it execute on all
+ platforms.
+
+2001-05-10 Elena Zannoni <ezannoni@redhat.com>
+
+ * config/gdbserver.exp (gdb_load): Handle the case
+ in which the arguments to gdbserver are given in the
+ baseboard configuration file.
+ Also handle the case in which the server needs to do a
+ load.
+
+2001-05-07 Keith Seitz <keiths@cygnus.com>
+
+ * lib/gdb.exp (gdbtk_initialize_display): New proc which will
+ set up the display for testing.
+ (gdbtk_start): Convert all paths to paths that tcl will like.
+ Export target information to environment.
+ (_gdbtk_xvfb_init): New proc to start Xvfb if available and
+ necessary.
+ (_gdbtk_xvfb_exit): New proc to kill Xvfb if necessary.
+ (to_tcl_path): New proc to convert a given pathname into
+ a path acceptible as an argument to a tcl command.
+ (_gdbtk_export_target_info): New proc to export target info
+ into the environment for gdbtk testing.
+ (gdbtk_done): New proc to signal end-of-test.
+
+2001-05-06 Jim Blandy <jimb@redhat.com>
+
+ * restore.c: Make the code of caller0 correspond to its comment.
+
+2001-05-03 Michael Snyder <msnyder@redhat.com>
+
+ * config/sid.exp (gdb_target_sid): Check for error messages.
+ On error or timeout, don't make expect exit (which will terminate
+ all subsequent tests); instead just make gdb exit.
+ (gdb_load): Check for error messages. On error or timeout,
+ return a negative value.
+
+2001-04-24 Jim Blandy <jimb@redhat.com>
+
+ * gdb.c++/templates.exp: If we see the prompt for the overload
+ list, but we haven't recognized any of the longer patterns,
+ arrange for this test to fail, not hang.
+
+ * gdb.c++/classes.exp (ptype class A): Tolerate whitespace
+ variations.
+
+2001-04-22 Michael Chastain <chastain@redhat.com>
+
+ * gdb.c++/local.exp: Use the 'runto' library function.
+ * gdb.c++/namespace.exp: Likewise.
+ * gdb.c++/overload.exp: Likewise.
+
+2001-03-26 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/Makefile.in (EXECUTABLES): Add step-line.
+ * gdb.base/step-line.exp: New file. Test step/next in presence of
+ #line directives.
+ * gdb.base/step-line.c: New file. Test program for the above.
+ * gdb.base/step-line.inp: New file. We pretend that this file has
+ been transformed by some other tool into step-line.c.
+
+2001-03-21 Jim Blandy <jimb@redhat.com>
+
+ * gdb.c++/userdef.exp: Check that GDB tolerates whitespace in
+ unmangled operator names.
+
+2001-03-20 Jim Blandy <jimb@redhat.com>
+
+ * gdb.threads/linux-dp.exp: Recognize an additional message
+ generated by GDB when it doesn't understand how to debug threads
+ on the target system.
+
+2001-03-19 Andrew Cagney <ac131313@redhat.com>
+
+ * gdb.mi/mi-console.exp: Document ``Hello'' as a known bug.
+
+2001-03-12 Michael Chastain <chastain@redhat.com>
+
+ * gdb.c++/derivation.exp: Use the 'runto' library function.
+
+2001-03-12 Michael Chastain <chastain@redhat.com>
+
+ * gdb.c++/annota2.exp: Fix regular expression for "post-query".
+
+2001-02-24 Michael Chastain <chastain@redhat.com>
+
+ * gdb.c++/ref-types.exp: Change handwritten code to library
+ function 'runto'.
+
+2001-03-16 Orjan Friberg <orjanf@axis.com>
+
+ * gdb.base/signals.exp: Set count to 0 explicitly.
+
+2001-03-15 Mark Salter <msalter@redhat.com>
+
+ * config/monitor.exp (gdb_target_cmd): Add explicit error return.
+ (gdb_target_monitor): Add check of gdb_target_cmd return value.
+ (gdb_load): Add support for additional target_info: gdb_download_size
+ and gdb_load_timeout.
+
+Thu Mar 8 16:06:00 2001 David Taylor <taylor@redhat.com>
+
+ * gdb.base/annota1.exp: Move test of isnative to earlier in the
+ file -- to prevent failing when the compile fails but we have no
+ intention of running the tests anyway.
+
+ * gdb.base/long_long.exp: Test target_info for no_long_long, skip
+ tests if set.
+
+ * gdb.base/maint.exp: Support 2 byte integers as well as 4 byte
+ integers.
+
+ * gdb.c++/ctti.exp: Skip tests if skip_cplus_tests returns true.
+ * gdb.c++/namespace.exp: Ditto.
+
+2001-03-07 Orjan Friberg <orjanf@axis.com>
+
+ * gdb.base/pointers.c: Don't assume doubles are >= 8 bytes.
+ * gdb.base/pointers.exp: Relax pattern match of decimals.
+
+2001-03-06 Kevin Buettner <kevinb@redhat.com>
+
+ * Makefile.in, config/abug.exp, config/cfdbug.exp,
+ config/cpu32bug.exp, config/dve.exp, config/est.exp,
+ config/gdbserver.exp, config/hmsirom.exp, config/hppro.exp,
+ config/i960.exp, config/m32r.exp, config/mn10300-eval.exp,
+ config/monitor.exp, config/proelf.exp, config/rom68k.exp,
+ config/sh.exp, config/sid.exp, config/slite.exp,
+ config/sparclet.exp, config/udi.exp, config/unknown.exp,
+ config/vr4300.exp, config/vr5000.exp, config/vx.exp,
+ config/vxworks.exp, config/vxworks29k.exp,
+ gdb.asm/asm-source.exp, gdb.base/a2-run.exp,
+ gdb.base/all-bin.exp, gdb.base/annota1.exp,
+ gdb.base/arithmet.exp, gdb.base/assign.exp,
+ gdb.base/async.exp, gdb.base/attach.exp,
+ gdb.base/bitfields.exp, gdb.base/bitops.exp,
+ gdb.base/break.exp, gdb.base/call-ar-st.exp,
+ gdb.base/call-rt-st.exp, gdb.base/call-strs.exp,
+ gdb.base/callfuncs.exp, gdb.base/callfwmall.exp,
+ gdb.base/commands.exp, gdb.base/completion.exp,
+ gdb.base/cond-expr.exp, gdb.base/condbreak.exp,
+ gdb.base/constvars.exp, gdb.base/corefile.exp,
+ gdb.base/dbx.exp, gdb.base/default.exp, gdb.base/define.exp,
+ gdb.base/display.exp, gdb.base/ena-dis-br.exp,
+ gdb.base/ending-run.exp, gdb.base/environ.exp,
+ gdb.base/eval-skip.exp, gdb.base/exprs.exp,
+ gdb.base/finish.exp, gdb.base/foll-exec.exp,
+ gdb.base/foll-fork.exp, gdb.base/foll-vfork.exp,
+ gdb.base/funcargs.exp, gdb.base/help.exp,
+ gdb.base/interrupt.exp, gdb.base/jump.exp, gdb.base/list.exp,
+ gdb.base/logical.exp, gdb.base/long_long.exp,
+ gdb.base/maint.exp, gdb.base/mips_pro.exp,
+ gdb.base/miscexprs.exp, gdb.base/nodebug.exp,
+ gdb.base/opaque.exp, gdb.base/overlays.exp, gdb.base/page.exp,
+ gdb.base/pointers.exp, gdb.base/printcmds.exp,
+ gdb.base/ptype.exp, gdb.base/radix.exp, gdb.base/recurse.exp,
+ gdb.base/regs.exp, gdb.base/relational.exp,
+ gdb.base/remote.exp, gdb.base/reread.exp,
+ gdb.base/restore.exp, gdb.base/return2.exp,
+ gdb.base/scope.exp, gdb.base/sect-cmd.exp,
+ gdb.base/selftest.exp, gdb.base/setshow.exp,
+ gdb.base/setvar.exp, gdb.base/shlib-call.exp,
+ gdb.base/sigall.exp, gdb.base/signals.exp,
+ gdb.base/sizeof.exp, gdb.base/so-impl-ld.exp,
+ gdb.base/so-indr-cl.exp, gdb.base/solib.exp,
+ gdb.base/step-test.exp, gdb.base/structs.c,
+ gdb.base/structs.exp, gdb.base/structs2.exp,
+ gdb.base/term.exp, gdb.base/twice.exp, gdb.base/varargs.exp,
+ gdb.base/volatile.exp, gdb.base/watchpoint.exp,
+ gdb.base/whatis-exp.exp, gdb.base/whatis.exp,
+ gdb.c++/ambiguous.exp, gdb.c++/annota2.exp,
+ gdb.c++/anon-union.exp, gdb.c++/classes.exp, gdb.c++/ctti.exp,
+ gdb.c++/derivation.exp, gdb.c++/inherit.exp,
+ gdb.c++/local.exp, gdb.c++/member-ptr.exp, gdb.c++/method.exp,
+ gdb.c++/misc.exp, gdb.c++/namespace.exp, gdb.c++/overload.exp,
+ gdb.c++/ref-types.exp, gdb.c++/templates.exp,
+ gdb.c++/userdef.exp, gdb.c++/virtfunc.exp,
+ gdb.disasm/am33.exp, gdb.disasm/hppa.exp,
+ gdb.disasm/mn10200.exp, gdb.disasm/mn10300.exp,
+ gdb.fortran/types.exp, gdb.java/jmisc.exp,
+ gdb.java/jv-exp.exp, gdb.java/jv-print.exp,
+ gdb.stabs/weird.exp, gdb.threads/linux-dp.exp,
+ gdb.trace/actions.exp, gdb.trace/backtrace.exp,
+ gdb.trace/circ.exp, gdb.trace/collection.exp,
+ gdb.trace/deltrace.exp, gdb.trace/infotrace.exp,
+ gdb.trace/limits.exp, gdb.trace/packetlen.exp,
+ gdb.trace/passc-dyn.exp, gdb.trace/passcount.exp,
+ gdb.trace/report.exp, gdb.trace/save-trace.exp,
+ gdb.trace/tfind.exp, gdb.trace/tracecmd.exp,
+ gdb.trace/while-dyn.exp, gdb.trace/while-stepping.exp,
+ lib/gdb.exp, lib/mi-support.exp: Update/correct copyright
+ notices.
+
+2001-02-27 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/varargs.c (find_max_double): Fix printf format string:
+ first arg is int not float.
+
+2001-02-22 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/reread.exp: Unsupported for non-native targets;
+ doesn't work for remote debugging.
+
+2001-02-19 Fernando Nasser <fnasser@redhat.com>
+
+ From Drew Moseley <dmoseley@redhat.com>
+ * gdb.base/ending-run.exp: Properly handle the BSP state when
+ stepping past the end of main.
+
+2001-02-19 John Moore <jmoore@redhat.com>
+
+ * gdb.base/commands.exp (infrun_breakpoint_command_test):
+ Converted HPUX fix for non-expected items following multiple
+ step commands into general solution for all platforms.
+
+2001-02-18 Michael Chastain <chastain@redhat.com>
+
+ * gdb.c++/classes.exp (do_tests): Change runto statements
+ from "runto 'foo(void)'" to "runto 'foo'". This makes the
+ statements demangler agnostic.
+ * gdb.c++/virtfunc.exp (do_tests): Likewise.
+ (gdb_virtfunc_restart): Likewise.
+
+2001-02-14 Michael Chastain <chastain@redhat.com>
+
+ * gdb.c++/inherit.exp (do_tests): Change runto statements
+ from "runto 'foo(void)'" to "runto 'foo'". This makes the
+ statements demangler agnostic.
+
+Sun Feb 4 17:32:21 2001 Andrew Cagney <cagney@redhat.com>
+
+ * gdb.threads/pthreads.exp: Unify pass/fail messages for
+ ``continue to bkpt at common_routine in thread 2'' and ``stopped
+ before calling common_routine 15 times'' tests.
+
+2001-02-11 Michael Chastain <chastain@redhat.com>
+
+ * gdb.c++/cplusfuncs.cc (dm_type_char_star): New function.
+ Helps the test script figure out which demangler is in use.
+ (dm_type_foo_ref): Ditto.
+ (dm_type_int_star): Ditto.
+ (dm_type_long_star): Ditto.
+ (dm_type_unsigned_int): Ditto.
+ (dm_type_void): Ditto.
+ (dm_type_void_star): Ditto.
+ * gdb.base/cplusfuncs.exp (probe_demangler): New function.
+ Probe the gdb demangler and set variables to accommodate
+ formatting differences.
+ (info_func_regexp): New function. Same as info_func, but
+ matches against a regexp.
+ (info_func): Match against a literal string.
+ (print_addr_2): New function. Match against a literal string,
+ which can be different from the input to gdb.
+ (print_addr): Simply call print_addr_2 with the same argument twice.
+ (test_lookup_operator_functions): Use demangler formatting variables.
+ Blow away the xfails and workarounds for gnats gdb bug gdb/18. Sort
+ the tests in the same order as the C++ class declaration.
+ (test_paddr_operator_functions): Ditto.
+ (test_paddr_overloaded_functions): Ditto.
+ (test_paddr_hairy_functions): Use demangler formatting variables.
+ Add reference to gdb/19 for related tests.
+ (do_tests): Call probe_demangler.
+
+2001-01-30 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.c++/templates.cc (printf): Remove unused function definition.
+
+2001-01-26 Felix Lee <flee@redhat.com>
+
+ * sid.exp (sid_exit): Pass host, not target, to remote_close.
+
+2001-01-25 matthew green <mrg@redhat.com>
+
+ * config/sid.exp (sid_start): Call `remote_push_conn' after firing
+ up sid.
+ (sid_exit): Call `remote_pop_conn' after GDB is gone.
+
+2001-01-25 matthew green <mrg@redhat.com>
+
+ * config/sid.exp (sid_start): Use `remote_spawn' instead of `spawn.'
+ Deprecate $sid_spawn_id.
+ (sid_exit): Remove code necessary only for `spawn.'
+
+2001-01-25 matthew green <mrg@redhat.com>
+
+ * config/sid.exp (sid_start): Handle sim,protocol of `sid.'
+
+2001-01-28 Michael Chastain <chastain@redhat.com>
+
+ * gdb.c++/ovldbreak.exp (take_gdb_out_of_choice_menu): New proc
+ to call when tests fail. It takes gdb out of the overloaded
+ function choice menu back to the main prompt, so that the test
+ program stays synchronized.
+ (set_bp_overloaded): New proc to collect all the common
+ code for setting a breakpoint on an overloaded name. Calls
+ take_gdb_out_of_choice_menu when needed.
+ (menu_overload1arg): New variable to collect the repeated
+ instances of the expected menu for an overloaded name. Change
+ the regular expression to handle changes in g++ type encoding:
+ "void" can be either "void" or "", and "unsigned int" can be
+ either "unsigned int" or "unsigned".
+ (continue_to_bp_overloaded): Change regular expressions to handle
+ changes in g++ type encoding.
+ (no proc): Call take_gdb_out_of_choice_menu when needed.
+ Remove redundant calls to "info break". Accept either "canceled"
+ or "cancelled". Change regular expressions in "info break"
+ calls to handle changes in g++ type encoding. Give all tests
+ unique strings.
+
+2001-01-17 Ben Elliston <bje@redhat.com>
+
+ * config/sid.exp: New file.
+
+Fri Jan 12 18:29:01 2001 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/callfuncs.exp: Add space after ``Value returned is''.
+
+2000-12-21 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/finish.exp: Accept '1' instead of \001 from char_func.
+ Add a RE to accept a non-ascii char if one is ever presented.
+
+2000-12-20 Fernando Nasser <fnasser@redhat.com>
+
+ * lib/mi-support.exp (mi_gdb_start): Test for MI_OUT, not UI_OUT.
+
+2000-12-18 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/setvar.exp: Use double '\\' to quote curly braces
+ in regexp. One '\' does not suffice on Linux.
+
+2000-12-09 Michael Chastain <chastain@redhat.com>
+
+ * gdb.base/break.exp (test_clear_command): Use a marker function
+ rather than 'main' for the test function. Also move this
+ test to an execution point where the marker function names are
+ guaranteed to be bound to functions. (Executing tests after a
+ 'finish' from main runs into name conflicts with local names
+ in __libc_start_main).
+
+2000-12-07 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/finish.exp: New test for gdb's "finish" command.
+ * gdb.base/return2.exp: New test for gdb's "return" command.
+ * gdb.base/return2.c: New source file for above.
+
+2000-12-05 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/constvars.exp: Add a "pass" message if "up" succeeds.
+ * gdb.base/miscexprs.exp: Ditto.
+ * gdb.base/pointers.exp: Ditto.
+ * gdb.c++/derivation.exp: Ditto.
+ * gdb.c++/local.exp: Ditto.
+ * gdb.c++/namespace.exp: Ditto.
+ * gdb.c++/overload.exp: Ditto.
+ * gdb.c++/ref-types.exp: Ditto.
+
+2000-12-05 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/constvars.exp: Test result of "up" command.
+ * gdb.base/miscexprs.exp: Ditto.
+ * gdb.base/pointers.exp: Ditto.
+ * gdb.base/scope.exp: Ditto.
+ * gdb.c++/derivation.exp: Ditto.
+ * gdb.c++/local.exp: Ditto.
+ * gdb.c++/namespace.exp: Ditto.
+ * gdb.c++/overload.exp: Ditto.
+ * gdb.c++/ref-types.exp: Ditto.
+
+2000-11-22 Michael Chastain <chastain@redhat.com>
+
+ * mips_pro.exp: Accept either "middle -> top -> main" or
+ "middle -> main" in the backtrace, because gcc can optimize
+ tail calls to jumps. Remove setup_xfail for the hppa case.
+ Add a comment with the original warning messages from PR 3016,
+ which was filed in 1993, to preserve them for posterity.
+
+2000-11-17 Nick Duffek <nsd@redhat.com>
+
+ * lib/gdb.exp (gdb_test): Override timeout with board info.
+
+2000-11-17 Nick Duffek <nsd@redhat.com>
+
+ * gdb.base/display.exp: Don't kill running stub. Add "again" to
+ the second kill and detach messages.
+
+2000-11-17 Nick Duffek <nsd@redhat.com>
+
+ * configure.in: Add AC_EXEEXT.
+ * configure: Regenerate.
+ * Makefile.in (just-check): Export EXEEXT.
+ * lib/gdb.exp ($EXEEXT): Import from environment.
+ * gdb.base/maint.exp: Expect $EXEEXT in executable name. Don't
+ expect "maint dump-me" on Cygwin.
+ * gdb.base/reread.exp ($binfile, $binfile1, $binfile2): Append
+ $EXEEXT.
+
+2000-11-17 Nick Duffek <nsd@redhat.com>
+
+ * gdb.base/break.exp: Test backtrace and finish from called
+ function on all platforms, not just HP-UX.
+
+2000-11-03 Michael Snyder <msnyder@cygnus.com>
+
+ * config/monitor.exp (gdb_target_cmd): Abstracts some of the
+ code from gdb_target_monitor, so it can be used independantly
+ for gdbserver. Also comment out an unnecessary PUTS.
+
+2000-11-03 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/a2-run.exp: Use gdb_skip_stdio_test.
+ * gdb.base/corefile.exp: Expect the message "Program is being
+ debugged already" when we send the "corefile" command, since
+ the preceeding gdb_load may have connected gdb to a remote target.
+ * gdb.base/display.exp: Disable hardware watchpoints if new
+ board info variable "no_hardware_watchpoints" is true.
+ Replace single-letter commands with more readable ones.
+ * gdb.base/recurse.exp (recurse_tests): Disable hardware watchpoints
+ if new board info variable "no_hardware_watchpoints" is true.
+ * gdb.base/restore.exp (restore_tests): Call gdb_skip_stdio_tests
+ to see if stdio (printf) testing is possible.
+ * gdb.base/watchpoint.exp: Disable hardware watchpoints if new
+ board info variable "no_hardware_watchpoints" is true. Use new
+ proc "gdb_skip_stdio_tests" to see if printf tests are possible.
+
+2000-11-13 Fernando Nasser <fnasser@redhat.com>
+
+ From Orjan Friberg <orjanf@axis.com>:
+ * gdb.base/printcmds.exp: Escape curly braces followed by a number
+ in array print pattern match.
+
+2000-11-09 Fernando Nasser <fnasser@redhat.com>
+
+ * gdb.c++/templates.exp (test_template_breakpoints): Change Britsh
+ spelling "cancelled" to U.S. spelling "canceled" to match changes
+ made to gdb.
+ * gdb.c++/ovldbreak.exp: Ditto.
+
+2000-11-06 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * gdb.base/callfuncs.c (main): Moved to end of file, call
+ t_double_values to initialize the FPU before inferior calls are made.
+ * gdb.base/callfuncs.exp: Test for register preservation after calling
+ inferior functions. Add tests for continuining, finishing and
+ returning from a stop in a call dummy.
+
+2000-10-24 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/commands.exp: Break up long lines, and re-indent.
+
+2000-10-19 Michael Snyder <msnyder@cygnus.com>
+
+ * config/gdbserver.exp: Rewritten from the ground up, to make it
+ compatible with the current dejagnu tree, and to make it work with
+ the new "gdbserver" in libremote.
+
+2000-10-16 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/sizeof.exp (check_sizeof): Skip if no printf support.
+ * gdb.base/varargs.exp: Skip entire test if no printf support.
+ * gdb.base/ending-run.exp (Step to return): Skip if no printf supt.
+ * gdb.base/shlib-call.exp: Skip several tests if no printf support.
+
+2000-10-13 Michael Snyder <msnyder@cygnus.com>
+
+ * lib/gdb.exp (gdb_skip_float_test): New proc. Skip test if
+ no floating point support.
+ (gdb_skip_stdio_test): New proc. Skip test if no stdio support.
+ * gdb.base/call-ar-st.exp: Use above procs to skip tests.
+ * gdb.base/call-rt-st.exp: Ditto.
+ * gdb.base/call-strs.exp: Ditto.
+
+2000-08-02 Jimmy Guo <guo@hpcleara.cup.hp.com>
+
+ * gdb.base/sizeof.c: include <stdio.h>.
+
+ * gdb.c++/classes.exp: Use gdb_test instead of send_gdb to
+ 'finish', otherwise uncaptured gdb_prompt would potentially
+ throw remaining test points out of sync.
+
+2000-07-26 Scott Bambrough <scottb@netwinder.org>
+
+ * gdb.base/recurse.exp: Run tests for all targets.
+ * gdb.base/so-impl-ld.exp: Added wildcard to handle the
+ gnu-oldld case on ARM.
+ * gdb.base/watchpoint.exp (test_stepping): Clear xfail
+ for ARM targets.
+
+Mon Jul 24 07:46:02 CDT 2000 Clinton Popetz <cpopetz@cygnus.com>
+
+ * gdb.java/configure.in (AC_INIT): Use jmisc.exp.
+ * gdb.java/configure: Rebuild.
+
+Sun Jul 23 21:42:34 2000 Anthony Green <green@redhat.com>
+
+ * gdb.java/jv-exp.exp: New file.
+
+Sun Jul 23 21:02:42 2000 Anthony Green <green@redhat.com>
+
+ * configure: Rebuilt.
+ * configure.in (configdirs): Add gdb.java.
+ * gdb.java/jmisc.java: New file.
+ * gdb.java/jmisc.exp: New file.
+ * gdb.java/Makefile.in: New file.
+ * gdb.java/configure: Rebuilt.
+ * gdb.java/configure.in: New file.
+ * lib/java.exp: New file.
+
+Wed Jul 12 18:14:29 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/exprs.exp: Test casts to a pointer including over and
+ underflow.
+
+Thu Jul 13 11:52:53 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/sizeof.exp, gdb.base/sizeof.c: New files. Compare GDB
+ and the compilers sizes.
+
+2000-07-09 Nick Duffek <nsd@redhat.com>
+
+ * gdb.c++/misc.cc (class ClassParam, class_param): Define.
+ (use_methods): New function.
+ (main): Call use_methods().
+ * gdb.c++/classes.exp (test_method_param_class): New procedure.
+ (do_tests): Call test_method_param_class.
+
+2000-07-09 Nick Duffek <nsd@redhat.com>
+
+ * gdb.c++/classes.exp (test_nonexistant_members): Fix name
+ spelling.
+ (test_enums): New procedure. Move enum tests from end of script
+ to here. Set breakpoint on function name instead of line number.
+ * gdb.c++/misc.cc (ClassWithEnum): Move past Foo definitions.
+ (enums2): New marker function.
+ (enums1): New function.
+ (main): Call enums1(). Move enum tests to enums1().
+
+Tue Jul 4 03:43:49 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.asm/asm-source.exp: Use raw AS/LD instead of CC to
+ compile/link program. Update line numbers.
+ * gdb.asm/d10v.inc: Define ``startup''.
+ * gdb.asm/asmsrc1.s: Add definition of _start.
+
+Fri Jun 23 17:45:52 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/call-ar-st.exp: More rewrites of multi-line patterns.
+
+2000-06-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/maint.exp: Add 'maint print architecture' item to output
+ of 'help maint print' command.
+
+Fri Jun 16 18:22:05 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/call-ar-st.exp: Rewrite all multi-line patterns so that
+ they use gdb_expect_list.
+
+Wed Jun 7 13:02:40 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/commands.exp: Use ``set remote
+ memory-read-packet-size'' instead of ``set endian big'' to test
+ long commands.
+
+2000-06-03 Daniel Berlin <dan@cgsoftware.com>
+
+ * gdb.c++/templates.exp (do_tests): Make all of these work under
+ g++, and stop skipping them.
+
+ * gdb.c++/namespace.exp: Move from gdb.hp/gdb.aCC to here, make it
+ work under g++.
+
+ * gdb.c++/misc.cc: Fix ambiguous initialization with correct
+ initialization.
+
+2000-06-02 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/annota1.exp (run until main breakpoint): Loosen up
+ the regular expression: accept an (almost) arbitrary sequence of
+ "frames-invalid" and "breakpoints-invalid" messages both before
+ and after the "starting" message.
+
+2000-06-02 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.c++/local.exp: This test has never been known to work with g++.
+
+2000-05-18 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/annota1.exp (annotate-signal-handler-caller):
+ Relax the regular expression a little, make it pass on Solaris 8.
+
+2000-05-12 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/step-test.exp: On IA-64 targets, when stepping out of
+ a call, do not require that gdb stop on the line after the call.
+ Instead, it is permissible for gdb to stop on the line of the
+ call itself.
+
+2000-05-12 Michael Snyder <msnyder@.cygnus.com>
+
+ * gdb.base/break.exp (bp on small function, optimized file):
+ Add a second pass pattern. The behavior differs here between stabs
+ and dwarf for one-line functions. Stabs preserves two line symbols
+ (one before the prologue and one after) with the same line number,
+ but dwarf regards these as duplicates and discards one of them.
+ Therefore the address after the prologue (where the breakpoint is)
+ has no exactly matching line symbol, and GDB reports the breakpoint
+ as if it were in the middle of a line rather than at the beginning.
+
+2000-05-08 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/interrupt.exp: Make "pass" message say "send"
+ rather than "send_gdb" (for consistancy).
+
+Mon May 1 15:37:58 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From 2000-04-28 Andreas Jaeger <aj@suse.de>:
+ * gdb.c++/templates.cc: Properly check for GCC version number.
+ * lib/compiler.cc: Likewise
+
+2000-04-28 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/break.exp: When compiled with -O2 optimization,
+ gdb may not stop at the first line of main, due to code motion.
+
+2000-04-26 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/call-ar-st.exp: Bail out if target is sparclet.
+ This test depends on parsing the printf output from the target.
+ Since the sparclet stub doesn't do stdio, this will never work.
+ * gdb.base/call-rt-st.exp: ditto.
+ * gdb.base/call-strs: ditto.
+
+2000-04-24 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/miscexprs.exp: make sizeof long array test portable.
+
+ * gdb.base/ending-run.exp: After connecting to a remote target,
+ but before running, the target will appear to be in a random
+ location. Specify both a file and a line for breakpoints.
+ Also, the function that calls main may be called 'init'
+ rather than 'start'.
+
+2000-04-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/help.exp: Update output for add-symbol-file command.
+
+2000-04-10 Fernando Nasser <fnasser@cygnus.com>
+
+ From Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+ * gdb.base/structs2.c: Support platforms defaulting to a unsigned char.
+
+2000-04-07 J.T. Conklin <jtc@redback.com>
+
+ * gdb.base/call-ar-st.exp: Relax patterns matching tab characters.
+
+ * gdb.base/funcargs.exp: Relax patterns matching pointers to char.
+
+Thu Mar 30 13:26:19 2000 Philippe De Muyter <phdm@macqel.be>
+
+ * gdb.base/call-ar-st.c (init_small_structs, main): Use floating-point
+ values that can be represented exactly.
+ * gdb.base/call-ar-st.exp (print print_small_structs): Fixed to match
+ above change, and to not check against the directory part of the source
+ file name.
+ (step into print_long_arg_list): Likewise.
+ (print print_small_structs from print_long_arg_list): Likewise.
+ (print print_long_arg_list): Likewise.
+
+2000-03-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/printcmds.c: Terminate char array ctable2 with 0.
+
+Mon Mar 27 14:46:37 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * ChangeLog, gdb.base/commands.exp: Revert whitespace changes.
+
+2000-03-25 Daniel Berlin <dan@cgsoftware.com>
+
+ * gdb.base/commands.exp (deprecated_command_test): Add test for
+ deprecate with no arguments.
+
+2000-03-24 Jonathan Larmour <jlarmour@redhat.co.uk>
+
+ * gdb.base/break.exp: Add new test for setting breakpoints on
+ optimized code so we can test breakpoints work even when function
+ prologues may be optimized away
+
+2000-03-23 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ From David Whedon <dwhedon@gordian.com>
+ * gdb.base/commands.exp : Added command deprecator tests.
+
+2000-03-22 Daniel Berlin <dan@cgsoftware.com>
+
+ * gdb.base/help.exp: Added test for new apropos command.
+
+2000-03-21 Kevin Buettner <kevinb@redhat.com>
+
+ * gdb.base/pointers.c (usevar): New function.
+ (main): Make sure that global variables v_int_pointer2, rptr,
+ and y are all referenced someplace in the program by calling
+ usevar() on them. [Some linkers delete symbols which are
+ never referenced. The space remains, but there's no way to
+ get a (symbolic) handle on the variable from the debugger.]
+
+2000-03-14 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/printcmds.c: Add typedeffed arrays.
+
+ * gdb.base/printcmds.exp (test_print_typedef_arrays): New
+ procedure to test arrays that are typedef'd.
+
+2000-03-13 James Ingham <jingham@leda.cygnus.com>
+
+ * lib/gdb.exp: Fix the gdbtk_start routine to correctly find all
+ the library directories.
+
+Mon Feb 21 13:05:36 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * configure.in (configdirs): Add sub directory gdb.mi.
+ * configure: Re-generate.
+
+ * gdb.mi: New directory.
+
+2000-02-25 Scott Bambrough <scottb@netwinder.org>
+
+ * gdb.base/long_long.exp: Correct test suite failure when printing
+ a long long value as a double on ARM platforms.
+
+2000-02-16 Jim Blandy <jimb@redhat.com>
+
+ * gdb.base/break.exp ("breakpoint line number"): Make sure the
+ default source file is set properly before running this test.
+
+2000-02-14 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * lib/gdb.exp: Tell the testsuite that now gdbtk is in the
+ gdbtk/library directory, not in gdbtcl2.
+
+2000-02-04 Jim Blandy <jimb@redhat.com>
+
+ * gdb.c++/templates.exp: ("ptype T5<int>"): Remove extraneous
+ backslash from regexp pattern.
+
+ * gdb.c++/ovldbreak.exp (continue_to_bp_overloaded): New
+ procedure. Use it to run all the "continue to bp overloaded"
+ tests. Note that this changes the names of the tests slightly.
+ If the breakpoint hit message includes a hex PC value, because
+ GCC's Dwarf 2 line info doesn't help us distinguish the prologue
+ from the real source code, still consider that a pass.
+
+ * gdb.base/condbreak.exp ("run until breakpoint at marker2"):
+ XFAIL here if the breakpoint message contains a hex address. Note
+ similar change on 1999-11-02.
+
+ * gdb.base/step-test.exp: Comment Fernando's change of 2000-02-02.
+
+ * gdb.base/ptype.exp: Establish a default source file before
+ calling get_debug_format.
+
+2000-02-03 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.base/watchpoint.exp: Remove duplication of test messages.
+
+2000-02-02 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.base/step-test.exp: Fix the steps to enter a callee by means
+ of successive stepi commands -- while in the prologue we should see
+ the function entry bracket.
+
+2000-02-02 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.base/ending-run.exp: Add ARM in thumb mode case, where we
+ reach __change_mode() when stepping through the end of main().
+
+2000-01-17 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.base/default.exp: Fix expected pattern.
+ * gdb.base/help.exp: Same.
+
+2000-01-10 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/so-indr-cl.exp: Don't execute the test if not on HPUX.
+ Don't use xfail's because that affects only the following test.
+
+ * gdb.base/so-impl-ld.exp: Don't execute the tests if not on hpux,
+ solaris or linux.
+
+ * gdb.base/selftest.exp: Update to reflect changes to main.c.
+
+2000-01-07 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/display.exp: Some yacc parsers like to say
+ "A syntax error" rather than "A parse error". Accept both.
+
+2000-01-06 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.base/default.exp: Remove OS dependent string from "target
+ remote" test.
+ * gdb.base/help.exp: Same for "help target remote" test.
+
+2000-01-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ From Jim Kingdon <kingdon@redhat.com>:
+
+ * gdb.c++/annota2.exp: Fix "delete bps" test to wait for the
+ prompt (cleanup rather than necessity, but still might keep output
+ from spilling to next test).
+
+2000-01-02 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/ptype.c (FALSE, TRUE): #undef these to avoid clash on
+ AIX, which defines them in <sys/types.h>.
+
+1999-12-16 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/default.exp: Match arm* etc instead of arm in "info
+ float" test.
+
+1999-12-13 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.base/watchpoint.exp: Add missing "(timeout)" to test message.
+
+ * gdb.base/break.exp: Add missing anchor to reg exp on "finish from
+ outermost frame disallowed".
+
+1999-12-09 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.base/setvar.exp: New tests for setting the value of a struct
+ with a constant list.
+
+1999-12-08 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.base/setvar.exp: Remove pair os tests that expected gdb to
+ require the user to type a cast before setting the value of a struct.
+
+1999-12-06 Jim Blandy <jimb@cygnus.com>
+
+ * gdb.base/default.exp: Expect the new 'info float' command on
+ all i386 platforms.
+
+ * gdb.threads/linux-dp.exp: Expand our ability to recognize
+ LinuxThreads libraries that don't support debugging.
+
+Sat Dec 4 15:21:18 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/remote.c: Fill the buffer with truely random data.
+ Change the buffer type to ``unsigned char'' to simplify size
+ arithmetic.
+
+ * gdb.base/remote.exp: Reduce download numbers by one. Typical
+ stub only handles 400-1 byte packets. Verify that the download
+ worked.
+
+1999-11-30 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * lib/gdb.exp (gdb_expect_list): FAIL only once on multiple pattern
+ tests, using UNRESOLVED for the untested cases. Also, does not wait
+ for a timeout if the prompt was received before a recognizable pattern.
+
+1999-11-29 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * lib/gdb.exp (gdb_expect_list): Fix spelling.
+
+1999-11-29 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/watchpoint.exp: Add tests cases for the hit count of
+ watchpoints.
+
+1999-11-24 Jason Merrill <jason@casey.cygnus.com>
+
+ * gdb.base/condbreak.exp: Add missing '$gdb_prompt $'.
+
+ * gdb.c++/local.exp: Be more flexible in recognizing local class
+ name mangling. Don't allow horribly truncated method names.
+ * gdb.c++/derivation.exp: Expect protected inheritance.
+ * gdb.c++/inherit.exp: Be more flexible in recognizing vbase pointers.
+ * gdb.c++/virtfunc.exp: Likewise.
+ * gdb.c++/classes.exp: Likewise. Don't require the enclosing scope
+ when printing a nested enum.
+
+1999-11-22 Jim Blandy <jimb@cygnus.com>
+
+ * gdb.base/step-test.exp: Properly await GDB's response to setting
+ a breakpoint on the call to large_struct_by_value.
+
+ * gdb.base/ending-run.exp ("step to end of run 1"): Don't fail
+ just because we have debug info for the `start' function.
+
+1999-11-19 Jim Blandy <jimb@zenia.red-bean.com>
+
+ * gdb.threads/linux-dp.exp ("create philosopher"): Recognize the
+ "Unknown signal" messages, which indicate (on LinuxThreads) that
+ GDB doesn't know how to debug threads on this system. This is
+ better than hanging while philosopher 0 dumps chatter into gdb.log.
+
+1999-11-18 Tom Tromey <tromey@cygnus.com>
+
+ * gdb.trace/deltrace.exp: Updated test to reflect new error text.
+
+1999-11-18 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/coremaker2.c: Add sample program for generating
+ cores that is more self contained than coremaker.c. Eventually
+ I'll add more code to this and tie it into the testsuite.
+
+1999-11-12 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/dollar.exp: Remove, now in gdb.hp.
+
+1999-11-10 Jimmy Guo <guo@cup.hp.com>
+
+ * gdb.exp (get_compiler_info): pick up compiler.c and compiler.cc
+ from $srcdir/lib/.
+ * lib/compiler.c, lib/compiler.cc: New files, moved from gdb.base/
+ and gdb.c++/.
+
+ * gdb.c++/derivation.exp: remove redundant get compiler info code.
+
+ * gdb.base/commands.exp: add '$gdb_prompt $' anchor to
+ 'continue with watch' test point.
+
+1999-11-08 Jim Blandy <jimb@zenia.red-bean.com>
+
+ Merged from p2linux-990323-branch:
+
+ * lib/gdb.exp (gdb_continue_to_breakpoint): New function.
+
+Mon Nov 8 23:07:09 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * gdb.base/remote.exp: Test ``set remote memory-write-packet-sized
+ {limit,fixed}''. Test ``set download-write-size''.
+
+Sun Nov 7 17:37:01 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/funcargs.exp: Rewrite stack traceback checks using
+ gdb_expect_list.
+
+Fri Nov 5 18:40:52 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * lib/gdb.exp (gdb_expect_list): Return a success/fail indication.
+
+1999-11-03 Mark Salter <msalter@cygnus.com>
+
+ * gdb.base/break.exp: Fix "stub continue" pattern.
+
+1999-11-03 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.base/shlib-call.exp ("next to shr1"): Fix test name.
+
+1999-11-02 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.base/display.exp ("finish"): Add timeout clause.
+
+ * gdb.base/condbreak.exp ("run until breakpoint at marker1"): Add
+ plain prompt clause, so this doesn't have to time out in order to
+ fail.
+
+ * gdb.base/condbreak.exp, gdb.base/ena-dis-br.exp: XFAIL if the
+ breakpoint hit messages include an address.
+
+ * gdb.base/display.exp: Don't forget to escape parens in regular
+ expressions. Unix regexp notatation sucks.
+
+1999-11-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/annota1.exp: Test for annotate-signalled: change output
+ order for 'signalled' message.
+
+1999-11-01 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Jimmy Guo <guo@cup.hp.com>:
+ * gdb.base/annota1.exp: Add tests for annotate ignore count change.
+ * gdb.base/annota1.c: Add code for tests to work with.
+
+1999-10-26 Frank Ch. Eigler <fche@cygnus.com>
+
+ * gdb.base/remote.exp: New test for remote downloading settings.
+ * gdb.base/remote.c: New file with large .data.
+
+1999-10-18 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.threads/linux-dp.c, gdb.threads/linux-dp.exp: New test suite
+ for LinuxThreads support, merged from the Code Fusion branch.
+
+Mon Oct 11 13:57:21 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * lib/gdb.exp (gdb_run_cmd): Break complicated gdb_expect
+ containing exp_continue into a while within an expect. Don't
+ attempt a start more than three times. Check return value from
+ gdb_load.
+
+Wed Oct 6 12:05:58 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/watchpoint.exp: Match fail ``finish from marker1'' with
+ a pass case.
+
+1999-10-01 Kevin Buettner <kevinb@cygnus.com>
+
+ * gdb.base/break.c (main): Added a statement that we can step
+ off of.
+ * gdb.base/break.exp: Added tests for setting a breakpoint
+ at an offset and stepping onto a breakpoint.
+
+1999-10-01 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/help.exp (help add-symbol-file): Update to match current
+ gdb output.
+
+1999-09-18 Jim Blandy <jimb@cris.red-bean.com>
+
+ * gdb.base/break.exp: Code locations are in hex, don't forget!
+ (For HP-UX.)
+
+1999-09-17 Stan Shebs <shebs@andros.cygnus.com>
+
+ * condbreak.exp: Use break.c as test program.
+ * condbreak.c: Remove, redundant with break.c.
+
+1999-09-15 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/monitor.exp (gdb_target_monitor): Disable X- and
+ Z-packets if the target needs it.
+
+1999-09-13 James Ingham <jingham@leda.cygnus.com>
+
+ * gdb.c++/overload.exp: Added tests for listing overloaded
+ functions with function pointers in the arg, explicitly calling
+ out the version you want.
+
+1999-09-09 Stan Shebs <shebs@andros.cygnus.com>
+
+ * long_long.exp: Add variations of test cases that work for
+ targets with 16-bit ints and 32-bit doubles.
+
+1999-09-08 Stan Shebs <shebs@andros.cygnus.com>
+
+ * break.c (main): Compare a possibly-uninitialized argc with an
+ unlikely value that fits in 16 bits.
+
+1999-09-07 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/restore.c, gdb.base/restore.exp: Use 0x7eeb instead of
+ 0xfeeb, don't want negative numbers if ints are 16 bits.
+
+ * lib/gdb.exp (skip_cplus_tests): New proc.
+ * gdb.c++/ambiguous.exp, gdb.c++/annota2.exp,
+ gdb.c++/anon-union.exp, gdb.c++/classes.exp,
+ gdb.c++/cplusfuncs.exp, gdb.c++/ctti.exp, gdb.c++/demangle.exp,
+ gdb.c++/derivation.exp, gdb.c++/inherit.exp, gdb.c++/local.exp,
+ gdb.c++/member-ptr.exp, gdb.c++/method.exp, gdb.c++/misc.exp,
+ gdb.c++/overload.exp, gdb.c++/ovldbreak.exp,
+ gdb.c++/ref-types.exp, gdb.c++/templates.exp, gdb.c++/userdef.exp,
+ gdb.c++/virtfunc.exp: Use it to skip over C++ tests.
+
+ * gdb.c++/cplusfuncs.exp: Use get_compiler_info consistently.
+
+Fri Sep 3 15:37:12 1999 Kevin Buettner <kevinb@cygnus.com>
+
+ * gdb.base/corefile.exp (up): Allow a parameter to appear
+ in the frame that we're going up to.
+
+ From Jim Blandy <jimb@cygnus.com>:
+
+ * gdb.base/default.exp (info float): Expect some output now.
+
+ * gdb.base/callfuncs.exp (do_function_calls): We no longer expect
+ returning floating-point values to fail on the x86.
+ * gdb.base/callfwmall.exp (do_function_calls): Same.
+
+ * gdb.base/list.exp (test_listsize): Correct expectations for
+ listing line 1 with listsize 2. Also, listing a single line
+ works now, as does listing three lines. [Kevin's note: There
+ were a number of other cases fixed too where the expectations
+ differed...]
+
+1999-09-02 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/selftest.exp: Add case for when version prints as
+ constant string instead of char pointer.
+
+1999-08-25 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/ending-run.exp: Add Solaris case for what happens when
+ stepping out of main.
+
+ * gdb.c++/derivation.exp: XFAIL inf fn calls for all configs, if
+ G++ used.
+
+ * gdb.c++/local.exp: Expect ptype NestedInnerLocal to succeed
+ always, expect ptype InnerLocal::NestedInnerLocal to fail always.
+
+ * gdb.c++/ovldbreak.exp: Update match string in test that
+ includes a warning of multiple breakpoints.
+
+1999-08-24 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/display.exp: Improve precision of step-after-finish
+ added yesterday.
+
+ * gdb.base/signals.exp: Add extra wildcard to "handle all print"
+ test.
+
+ * gdb.c++/classes.exp: XFAIL HP-compiler-only tests for all
+ configs when using G++, not just hppa*.
+
+1999-08-24 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/async.c: New file.
+ * gdb.base/async.exp: New file.
+
+Tue Aug 24 03:24:53 1999 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/break.exp: Tweak PA specific tests to properly handle
+ PA64.
+
+Mon Aug 23 10:25:20 1999 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/display.exp: "finish" can leave us mid-line on many
+ targets, deal with it. Add a small constant to main, instead of
+ 1000 since main+1000 may not be a valid address in the target.
+
+ * gdb.base/dollar.exp: Do not run for PA processors in wide mode
+ on hpux11.
+
+ * gdb.base/attach.exp: Handle another hpux11 error message variant
+ when attaching to a process that does not exist.
+
+1999-08-19 J.T. Conklin <jtc@redback.com>
+
+ * gdb.base/call-ar-exp.exp: Fix pattern matching whitespace
+ characters in 'continue to 1241' test.
+
+1999-08-17 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/call-ar-st.exp: Add a shorter match case for the
+ stop in print_long_arg_list, define and use a whitespace
+ variable in print_small_structs test, add an XFAIL for Solaris.
+ * gdb.base/dbx.exp: XFAIL func commands until somebody is
+ interested enough to fix.
+
+1999-08-13 Keith Seitz <keiths@cygnus.com>
+
+ * gdb.base/dbx.exp (dbx_gdb_file_cmd): Rename to gdb_file_cmd.
+ (dbx_gdb_load): Remove. Use gdb_load instead, since that
+ proc knows about targets other than the natives.
+ (test_assign): Use "gdb_run_cmd" to "run" the target.
+ Check that we've actually hit the breakpoint at main.
+ When we attempt to assign a value to a local variable, check
+ that the variable is in the current scope, i.e., don't use
+ a test with an empty result.
+
+Tue Aug 10 15:25:16 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/maint.exp: Add test of ``maintenance internal-error''
+ command.
+
+1999-08-09 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Jimmy Guo <guo@cup.hp.com> and others at HP:
+ gdb.hp: Move tests into subdirectories gdb.aCC, gdb.base-hp,
+ gdb.compat, gdb.threads-hp.
+ gdb.hp/configure, gdb.hp/configure.in: New files.
+ gdb.hp/Makefile.in: Recurse into new subdirs.
+ gdb.hp/gdb.defects: New directory, tests for HP bug reports.
+ gdb.hp/gdb.objdbg: New directory, tests for debugging info
+ in object files.
+ gdb.hp/tools: New directory, aux tools for HP-specific tests.
+
+1999-08-05 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/display.exp: Help expect by putting a newline in the
+ funky printf, remove a bogus p/a test.
+
+1999-08-05 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/display.exp: Make sure that when we say 'run', we are
+ connected to the target. This is necessary when running not
+ natively.
+
+1999-08-03 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/step-test.exp: Removed some extraneous messages.
+
+ * gdb.base/long_long.exp: Don't run memory examination tests
+ on little-endian targets (they will need a different set of
+ results to match).
+
+1999-08-02 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.c++/virtfunc.exp: Expect to fail the virtual call tests
+ until somebody decides to fix GDB.
+
+ * gdb.base/long_long.c: Stop compiler complaint by specifying long
+ constant as "ULL".
+ * gdb.base/long_long.exp: Loosen x/c test, add partial result
+ matches for a couple x/2 commands.
+
+1999-07-30 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.c++/ref-types.cc, gdb.c++/ref-types.exp: Appease doschk
+ by merging in ref-types2 tests.
+ * gdb.c++/ref-types2.cc, gdb.c++/ref-types2.exp: Remove.
+
+ From Jimmy Guo <guo@cup.hp.com> and others at HP:
+ * gdb.c++/Makefile.in: Add standard actions.
+ (EXECUTABLES): Rename from PROGS, update list.
+ * gdb.c++/ambiguous.cc, gdb.c++/ambiguous.exp: Move to here
+ from gdb.hp.
+ * gdb.c++/anon-union.cc: Don't use anonymous struct, make
+ foo and bar locals.
+ * gdb.c++/anon-union.exp: Fix tests to match.
+ * gdb.c++/classes.exp: Run if HP compiler used, add extra
+ expect matches to handle output variations.
+ * gdb.c++/cplusfuncs.cc: Make operator -> return foo *.
+ * gdb.c++/cplusfuncs.exp: Update to match, allow word "class" in
+ output, add HP alternatives for new and delete prints.
+ * gdb.c++/ctti.exp, gdb.c++/cttiadd.cc, gdb.c++/cttiadd1.cc,
+ gdb.c++/cttiadd2.cc, gdb.c++/cttiadd3.cc: Move here from gdb.hp.
+ * gdb.c++/demangle.exp: Use $style when reporting failure.
+ * gdb.c++/derivation.exp: Add some xfails if GCC-compiled.
+ * gdb.c++/inherit.exp: Run if HP compiler used, add some
+ match alternatives.
+ * gdb.c++/local.exp: Add match alternatives or xfails for HP
+ compilers.
+ * gdb.c++/member-ptr.exp: Add xfails for hppa*-*-*.
+ * gdb.c++/method.exp: Add match alternatives.
+ * gdb.c++/misc.cc: Add bool types.
+ * gdb.c++/misc.exp: Add tests for bool types.
+ * gdb.c++/overload.exp: Add xfails.
+ * gdb.c++/templates.cc: Remove bogus arglist init, init fvpchar.
+ * gdb.c++/templates.exp: Run if HP compiler used, add some xfails,
+ add some more template parameter tests (only for HP currently).
+ * gdb.c++/userdef.exp: Add xfails for hppa*-*-*.
+ * gdb.c++/virtfunc.cc: Add return type and value for main.
+ * gdb.c++/virtfunc.exp: Run if HP compiler used, add some
+ match alternatives.
+
+1999-07-30 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/display.exp: Fix output of 'p/a &&j' test.
+
+1999-07-29 Jim Blandy <jimb@savonarola.red-bean.com>
+
+ * gdb.base/signals.exp: Don't expect getting a backtrace from
+ within a signal handler to fail on Linux.
+
+1999-07-29 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Jimmy Guo <guo@cup.hp.com> and others at HP:
+ * lib/gdb.exp: Remove some gratuitious semicolons.
+ (delete_breakpoints): Increase timeout.
+ (gdb_expect): Add -notransfer option.
+ (gdb_test): Use -notransfer option.
+ (get_compiler_info): Add f77 case.
+ (get_compiler): New proc, split out from gdb_preprocess, add f77
+ case.
+ (gdb_preprocess): Call get_compiler.
+
+ * gdb.base/Makefile.in (EXECUTABLES): Update the list.
+ * gdb.base/attach.exp, gdb.base/display.exp,
+ gdb.base/ending-run.exp, gdb.base/gdbvars.exp,
+ gdb.base/long_long.exp, gdb.base/printcmds.exp,
+ gdb.base/structs.exp, gdb.base/structs2.exp: Remove or fill in
+ third arg to gdb_test.
+ * gdb.base/call-ar-st.exp: Add HP-UX xfail for >10-arg functions.
+ * gdb.base/callfuncs.exp, gdb.base/callfwmall.exp: Remove some
+ HP-UX xfails, add others.
+ * gdb.base/completion.exp: Reflect name change of self-test.
+ * gdb.base/condbreak.exp, gdb.base/corefile.exp,
+ gdb.base/foll-exec.exp, gdb.base/interrupt.exp,
+ gdb.base/ptype.exp, gdb.base/scope.exp, gdb.base/setvar.exp: Note
+ HP failure number.
+ * gdb.base/foll-vfork.exp: Loosen matches slightly, remove
+ useless HP-UX 10.30 references.
+ * gdb.base/maint.exp: Loosen matches.
+ * gdb.base/pointers.c (main): Declare more_code.
+ * gdb.base/pointers.exp: Match on output of a `next'.
+ * gdb.base/structs.c: Add prototypes.
+ * gdb.base/watchpoint.exp: Remove HP-UX 10.30 reference.
+ * gdb.base/whatis.exp: Fail for both HP-UX 10.20 and 11.
+
+1999-07-29 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/list.exp: Add tests for repeating 'list <linenum>'
+ command.
+
+1999-07-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.c++/annota2.exp: Fix delete breakpoint query testcase.
+ Fix run to main failures. Watchpoint can be hardware watchpoint.
+
+ * gdb.base/annota1.exp: Clean up some more, in case printf has
+ debug info. Deal with lack of signal hanlder info in stack.
+
+ From Jim Kingdon <kingdon@redhat.com>:
+ * gdb.base/annota1.exp: If printf has debug info, deal with it.
+
+1999-07-19 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/foll-exec.exp, gdb.base/foll-fork.exp,
+ gdb.base/foll-vfork.exp: Don't run for crosses.
+
+Tue Jul 13 23:37:18 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/configure.in: Check for gdbvars.exp instead of
+ a1-selftest.exp.
+ * gdb.base/configure: Re-generate.
+
+1999-07-12 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/selftest.exp: Rename from a1-selftest.exp, no point
+ in trying to run first and name is too long.
+
+ * gdb.base/pointers.c, gdb.base/pointers.exp: Add contents of
+ pointers2.c and pointers2.exp, respectively.
+ * gdb.base/pointers2.c, gdb.base/pointers2.exp: Remove, makes
+ doschk happier.
+
+1999-07-08 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/callfwmall.c, gdb.base/callfwmall.exp: Renamed from
+ callfuncs2.c and callfuncs2.exp.
+
+ * gdb.base/list.exp: Remove mistaken xfails.
+ * gdb.base/list0.h: Add optional prototypes.
+
+Wed Jul 7 00:27:35 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * gdb.base/setvar.exp: Increase the time-out on tests indirectly
+ calling malloc.
+ * nodebug.exp, printcmds.exp, ptype.exp, setvar.exp: Ditto.
+ * ptype.exp: Move test for get_debug_format to before its first
+ use.
+
+1999-07-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/Makefile.in (EXECUTABLES): Remove annota2 executable.
+ * gdb.base/annota2.cc, annota2.exp: Move from here.
+ * gdb.c++/annota2.cc, annota2.exp: To here.
+ * gdb.c++/Makefile.in (PROGS): Add annota2 executable.
+
+Tue Jun 29 11:56:06 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * lib/gdb.exp (gdb_expect_list): Output one message per pattern in
+ a consistent format.
+
+1999-06-25 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Jimmy Guo <guo@cup.hp.com> and others at HP:
+ * lib/gdb.exp (get_compiler_info): Add detection for assorted
+ HP compilers, also set the globals $true and $false.
+
+ * gdb.base/annota1.c, bitfields.c, break.c, call-ar-st.c,
+ call-rt-st.c, call-strs.c, callfuncs.c, callfuncs2.c, condbreak.c,
+ coremaker.c, ending-run.c, exprs.c, funcargs.c, interrupt.c,
+ jump.c, langs0.c, langs1.c, langs2.c, list0.c, list1.c,
+ long_long.c, mips_pro.c, nodebug.c, opaque0.c, opaque1.c,
+ printcmds.c, ptype.c, recurse.c, restore.c, return.c, run.c,
+ scope0.c, scope1.c, setshow.c, setvar.c, shmain.c, shr1.c, shr2.c,
+ sigall.c, signals.c, so-impl-ld.c, so-indr-cl.c, solib.c,
+ solib1.c, solib2.c, step-test.c, twice.c, varargs.c, watchpoint.c,
+ whatis.c} Add C++ compatible function definitions and return
+ types, add includes for library functions.
+ * gdb.base/ptype.c (my_false, my_true): Use instead of false/true.
+ * gdb.base/step-test.c (myglob): Rename from glob.
+ * gdb.base/attach.c, attach2.c, average.c, execd-prog.c,
+ foll-exec.c, foll-fork.c, foll-vfork.c, sum.c, vforked-prog.c: New
+ files, move here from gdb.hp.
+ * gdb.base/annota1.exp, break.exp, call-ar-st.exp, call-rt-st.exp,
+ commands.exp, condbreak.exp, define.exp, ena-dis-br.exp,
+ ending-run.exp, jump.exp. list.exp, long_long.exp, so-impl-ld.exp:
+ Adjust line numbers in regexps.
+
+ * gdb.base/all-bin.exp, eval-skip.exp, exprs.exp, logical.exp,
+ miscexprs.exp, pointers.exp, relational.exp: Use $true and $false
+ instead of 0/1.
+
+ * gdb.base/attach.exp, dbx.exp, foll-exec.exp, foll-fork.exp,
+ foll-vfork.exp: New files, move here from gdb.hp.
+ * gdb.base/page.exp: New file, test of pagination command.
+
+ * gdb.base/watchpoint.c (recurser): New function, for watchpoint
+ recursion test.
+ * gdb.base/watchpoint.exp: Add more test cases for watchpoints.
+
+ * gdb.base/so-impl-ld.exp, gdb.base/so-indr-cl.exp,
+ gdb.base/solib.exp: Fix compiler invocation process.
+
+ * gdb.base/callfuncs.exp, gdb.base/callfuncs2.exp: Don't xfail for
+ HP-UX 11, turn off overload resolution explicitly.
+ * gdb.base/commands.exp: Set argument list explicitly, add
+ watchpoint test.
+ * gdb.base/completion.exp: Enable if HP-UX, tweak tests to make
+ them work.
+ * gdb.base/constvars.exp, gdb.base/volatile.exp: Escape the
+ expressions properly.
+ * gdb.base/corefile.exp: Loosen the match slightly.
+ * gdb.base/default.exp: Allow "Error accessing memory" message
+ also.
+ * gdb.base/display.exp: Skip over x/0 j if PA64.
+ * gdb.base/funcargs.exp: Add xfails for HP-UX.
+ * gdb.base/interrupt.exp: Ditto.
+ * gdb.base/langs.exp: Add symbolic matches governed by compiler
+ in use.
+ * gdb.base/list.exp: Add xfails for HP-UX.
+ * gdb.base/long_long.exp: Refine some of the numeric matches.
+ * gdb.base/mips_pro.exp: Xfail on HP-UX.
+ * gdb.base/miscexprs.exp: Add PA2.0 case for array size test.
+ * gdb.base/nodebug.exp: Succeed on more varieties of output.
+ * gdb.base/opaque.exp: Remove some HP-UX xfails.
+ * gdb.base/ptype.exp: Succeed on more varieties of output.
+ * gdb.base/scope.exp: Add xfails for HP-UX.
+ * gdb.base/sect-cmd.exp: Add more cases.
+ * gdb.base/setvar.exp: Add xfails for HP-UX.
+ * gdb.base/shlib-call.exp: Loosen some matches slightly.
+ * gdb.base/signals.exp: Match on void symbolically.
+ * gdb.base/step-test.exp: Add case for PA64.
+ * gdb.base/term.exp: Add exit and restart.
+ * gdb.base/twice.exp: Clean up after self.
+ * gdb.base/varargs.exp: Disable overload resolution explicitly.
+ * gdb.base/whatis.exp: Allow more ways to pass tests.
+
+ * gdb.base/smoke.exp, gdb.base/smoke.c, gdb.base/smoke.cc: Remove,
+ no longer useful.
+
+Fri Jun 25 19:27:28 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * lib/gdb.exp (proc gdb_expect_list): New procedure. Matches a
+ list of patterns.
+ * gdb.base/call-ar-st.exp: Use gdb_expect_list in "print
+ print_double_array(double_array)", "continuing to breakpoint
+ 1018", "print print_double_array(array_d)" and "continuing to
+ 1034" tests.
+
+1999-06-24 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * Makefile.in: Add empty html and install-html targets.
+
+1999-06-24 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/mt-*: Remove, these haven't been used since 1996.
+
+1999-06-22 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/call-strs.c, gdb.base/ending-run.c,
+ gdb.base/step-test.c: Include stdlib.h and string.h as needed.
+ * gdb.c++/member-ptr.exp: Skip over these tests if using G++.
+
+1999-06-18 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.c++/overload.exp: XFAIL everything if using G++, add a
+ simpler match case for the ptype of the big class.
+
+1999-06-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.exp: Fix test for gdb_prompt existence.
+
+1999-06-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.exp (gdb_test): Add fail after calls to perror.
+
+1999-06-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.exp (gdb_test): Accept variations of Undefined command messages.
+
+1999-06-16 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.exp (gdb_test): Fix anchors on gdb_expect statement.
+
+Fri Jun 11 12:56:50 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/call-strs.c (link_malloc): New function. Ensure that
+ malloc() is linked in.
+
+1999-06-08 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.base/ending-run.exp: Make sure we fail and do not timeout at
+ step at end.
+
+ * gdb.base/annota1.exp: Increase match_max to prevent timeout.
+
+1999-06-08 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.java/jv-print.exp: New file. (Our first Java test!)
+
+Fri Jun 4 10:47:46 1999 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/a1-selftest.exp: Remove bogus hppa xfail.
+ * gdb.base/mips_pro.exp: Likewise.
+
+1999-06-02 Keith Seitz <keiths@cygnus.com>
+
+ * gdb.c++/templates.cc: Change all "new" operators to throw
+ an exception.
+ * gdb.c++/cplusfuncs.cc: Likewise.
+
+ * gdb.base/Makefile.in (EXECUTABLES): Add smoke1, annota1, and annota2.
+
+Wed Jun 2 17:37:05 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/condbreak.exp: Use rerun_to_main to start the program.
+ * gdb.base/ending-run.exp: When stepping out of main, accept a
+ step into an arbitrary assembler file.
+
+1999-05-20 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/annota1.exp: Allow any number of "frames-invalid" and
+ "breakpoint-invalid" to be printed.
+ * gdb.base/annota2.exp: Revise line number for main breakpoint. Allow any
+ number of "frames-invalid" and "breakpoint-invalid" to be printed.
+ * gdb.base/annota2.cc: Initialize a.x to 0.
+
+1999-05-17 Keith Seitz <keiths@cygnus.com>
+
+ * gdb.base/call-ar-st.exp: Skip "print print_double_array (double_array)"
+ when "skip_float_tests" set.
+ Ditto for "print print_double_array(array_d)", "print print_small_structs",
+ "print print_ten_doubles", and "step into print_long_arg_list".
+ Don't assume we can step into "print_long_arg_list": we could step into memcpy.
+ * gdb.base/call-rt-st.exp: Don't run float-related tests when "skip_float_tests"
+ is set: "print print_one_double(*d1)" and "print print_two_floats(*f3)".
+ * gdb.base/funcargs.exp: Don't run "float_and_integral_args" when
+ "skip_float_tests" is set.
+ * gdb.base/varargs.exp: Skip "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)"
+ when "skip_float_tests" set.
+
+1999-05-06 Keith Seitz <keiths@cygnus.com>
+
+ * gdb.base/annota2.cc: Include stdio.h.
+
+Wed May 5 17:44:31 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/crossload.exp: Remove, this has been disabled ever
+ since BFD stopped including all targets, and cross-GDB gets
+ plenty of testing anyway.
+ * gdb.base/i486-elf.u, gdb.base/m68k-aout.u, gdb.base/m68k-elf.u,
+ gdb.base/sparc-aout.u, gdb.base/i860-elf.u, gdb.base/m68k-aout2.u,
+ gdb.base/mips-ecoff.u, gdb.base/sparc-elf.u: Remove.
+ * gdb.base/README: Remove, was doc for this.
+ * gdb.base/Makefile.in (CROSS_EXECUTABLES): Remove, no longer
+ needed.
+
+1999-05-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/call-ar-st.exp: Fix one regular expression in test
+ output.
+
+ * gdb.base/annota1.exp: New file. Annotation level 2 tests.
+ * gdb.base/annota2.exp: New file. More annotation tests.
+ * gdb.base/annota1.c: New file. Source file for annota1.exp.
+ * gdb.base/annota2.cc: New file. Source file for annota2.exp.
+
+1999-04-23 Angela Marie Thomas <angela@cygnus.com>
+
+ * config/cfdbug.exp: New file.
+
+1999-04-20 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.c++/demangle.exp (test_gnu_style_demangling): Add tests for
+ Marcus Daniel's and Dale Hawkins's demangler crashes.
+
+ * gdb.c++/demangle.exp (test_gnu_style_demangling,
+ test_lucid_style_demangling, test_arm_style_demangling,
+ test_hp_style_demangling): Try Tom Tromey's core-dumping
+ identifier under each demangling style.
+
+1999-04-07 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.c++/demangle.exp: Include the current demangling style
+ in all test names.
+ (current_demangling_style): New global variable.
+ (set_demangling_style, test_demangling_core, test_demangling,
+ test_demangling_exact): New functions.
+ (test_gnu_style_demangling, test_lucid_style_demangling,
+ test_arm_style_demangling, test_hp_style_demangling): Use those,
+ instead of calling gdb_test and gdb_test_exact directly.
+ (catch_demangling_errors): New function, which reports errors
+ signalled by the demangling test functions in an orderly way.
+ (do_tests): Use catch_demangling_errors.
+
+1999-04-06 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.base/signals.exp (test_handle_all_print): Use () for
+ grouping in expressions, not {}.
+
+ * gdb.base/smoke.exp: Test value of x, not y. The latter isn't
+ initialized yet.
+
+1999-04-01 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.c++/derivation.exp: Pass ptype tests if synthesized methods
+ are listed.
+
+1999-03-26 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.stabs/weird.exp: Test for CC being defined before
+ looking at its value.
+
+1999-03-25 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/call-ar-st.exp: Remove stray '#'.
+ * gdb.base/miscexprs.exp: Allow "short" and "long" as well as
+ "short int" and "long int".
+ * gdb.c++/overload.cc: Cast the string added in the previous
+ change, to mollify finicky HP compiler.
+ * gdb.hp/reg-test.exp (testfile): Fix file name.
+ * gdb.stabs/weird.exp: Don't try to run if HP compiler in use.
+
+ * gdb.c++/misc.cc (main): Initialize obj_with_enum.
+ * gdb.c++/classes.exp: Fix test of obj_with_enum values, allow
+ alternate form of enum ptype.
+
+1999-03-23 Stan Shebs <shebs@andros.cygnus.com>
+
+ * lib/gdb.exp (skip_hp_tests): Remove gcc_used argument.
+ * gdb.hp/*.exp: Change all to run compiler probe only after
+ passing skip_hp_tests, so as not to waste time on guaranteed
+ failure.
+
+ * gdb.c++/overload.cc: Pass string instead of char addr, always
+ init ccpfoo.
+ * gdb.c++/templates.cc: Fix syntax error.
+
+Tue Mar 23 14:56:36 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.base/commands.exp: Add test for correct position of '>'
+ when issuing the 'commands' command after a 'while' or 'if'
+ command.
+
+1999-03-18 James Ingham <jingham@cygnus.com>
+
+ * gdb.c++/ovldbreak.exp: Use gdb_continue_to_end
+
+ * gdb.c++/method.exp: It was testing an uninitialized int on the
+ stack and assuming it was positive.
+
+ * gdb.base/watchpoint.exp: Use gdb_continue_to_end.
+
+ * gdb.base/step-test.exp: Catch a case where finish is broken and
+ keep it from killing the rest of the tests.
+ Use gdb_continue_to_end.
+
+ * gdb.base/sigall.exp: use gdb_continue_to_end.
+
+ * gdb.base/ena-dis-br.exp: use gdb_continue_to_end.
+
+ * gdb.base/display.exp: use runto_main, not run.
+
+ * gdb.base/default.exp: Check for the current error message in the
+ r abbreviation test.
+ Add strongarm to the targets that know info float.
+
+ * gdb.base/condbreak.exp: Use the gdb_run command rather than just
+ run which doesn't work with monitors.
+
+ * gdb.base/call-ar-st.exp: fixed bogus regexp in continuing to 1034 test.
+
+ * gdb.base/break.exp: use the gdb_continue_to_end proc.
+
+ * lib/gdb.exp: I had added gdb_continue_to_end used to run to the end of a
+ program. Traps the case (in Cygmon) when the program never really
+ exits. Same as Mark's continue_to_exit, but I had put it in a lot
+ more places, so I used my name. Sorry Mark...
+
+ * config/monitor.exp (gdb_target_monitor): added another
+ target_info parameter: remotebinarydownload. This will set the
+ remotebinarydownload flag if this is causing some boards trouble.
+
+1999-03-18 Mark Salter <msalter@cygnus.com>
+
+ * lib/gdb.exp (continue_to_exit): New function.
+
+ * gdb.base/ena-dis-br.exp: Clean up for remote targets.
+ * gdb.base/ending-run.exp: Ditto.
+ * gdb.base/step-test.exp: Ditto.
+
+1999-03-16 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/miscexprs.c: Clean up file, clear cbig.c[0] explicitly
+ (suggested by Art Haas <ahaas@neosoft.com>).
+
+1999-03-16 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.base/signals.exp: Filter out *-*-linux* before matching *-*-gnu*.
+
+Fri Mar 12 18:06:21 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.c++/ref-types.exp, ref-types2.exp: Allow alternate
+ descriptions of types (short unsigned int vs unsigned short, etc).
+
+1999-03-12 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.base/call-strs.exp: Don't assume that `step' will step over
+ a call to strlen; sometimes we do have sources.
+
+1999-03-08 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.base/call-ar-st.c (main): Terminate char_array with a null
+ character, so GDB won't print garbage after its end.
+
+ * gdb.base/call-ar-st.exp: Don't step into sum_array_print; set a
+ breakpoint there instead. Sometimes GCC emits memcpy to handle
+ the large structures being passed by value, so we step into that
+ instead of sum_array_print, which obscures what we're really testing.
+ * gdb.base/step-test.exp: However, we do want a test that notices
+ the bizarre steps into memcpy, so do that here. Add check for
+ stepping into function calls that pass large structures by value.
+ ("Is that a noun clause, or are you just happy to see me?")
+ Remove all references to specific line numbers.
+ * gdb.base/step-test.c (struct rhomboidal, large_struct_by_value):
+ New type and function.
+ (main): Call large_struct_by_value, passing it a large struct by value.
+ * lib/gdb.exp (gdb_get_line_number): New function.
+
+ * gdb.base/step-test.exp: Rewrite `stepi' and `nexti' tests to be
+ more portable.
+
+1999-03-08 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * lib/gdb.exp: Doc fixes.
+
+1999-03-05 Nick Clifton <nickc@cygnus.com>
+
+ * gdb.base/a2-run.exp: Add expected fails for strongarm-coff.
+
+1999-03-04 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.base/display.exp: Don't exercise the "detach" and "kill"
+ commands. They're not germane to this test, and they don't work
+ that way on remote targets.
+
+1999-03-01 James Ingham <jingham@cygnus.com>
+
+ * Changelog entries merged over from gdb development branch.
+
+ Tue Jan 5 12:33:47 1999 Keith Seitz <keiths@cygnus.com>
+
+ * lib/gdb.exp (gdbtk_analyze_results): Generic function
+ for outputting results of test run.
+
+ 1998-12-07 Martin M. Hunt <hunt@cygnus.com>
+
+ * lib/gdb.exp (gdbtk_start): Fix path for itcl library.
+
+1999-02-25 Felix Lee <flee@cygnus.com>
+
+ * lib/gdb.exp (debug_format): initialize
+
+1999-02-25 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * gdb.base/call-ar-st.c: Include string.h, not strings.h.
+ * gdb.base/call-rt-st.c: Ditto.
+
+1999-02-13 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.threads/pthreads.exp (horiz): New variable.
+ (test_startup): Fix regexps that capture thread numbers.
+
+1999-02-10 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * gdb.base/smoke.exp: Disambiguate two test case names (both
+ called ``print'').
+
+Fri Feb 5 12:42:56 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/volatile.exp: Use gdb_test, add xfails for GCC
+ compilation.
+
+1999-02-04 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * gdb.base/miscexprs.exp: Change patterns to match GDB's
+ actual output formatting.
+ * gdb.base/smoke.exp: GDB removes leading 0's.
+ * gdb.base/volatile.exp: Don't check type of remuneration;
+ that variable is no longer defined in constvars.c.
+ * gdb.base/step-test.c (main): Exit with explicit exit code.
+ * gdb.base/step-test.exp: Remove two nexti checks--they are
+ not portable.
+
+1999-02-04 Jason Molenda (jsm@bugshack.cygnus.com)
+
+ * gdb.base/help.exp ("help delete display"): Fix test to match
+ gdb's output.
+
+ * gdb.base/long_long.c (known_types): Initialize values to zero.
+ * gdb.base/long_long.exp: Step one more line
+ so 'dec' is initialized in "get to known place". GDB removes
+ leading zeros. Explicitly ask for hex formatting. Use
+ unique test case names.
+
+Tue Feb 2 10:16:08 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * lib/gdb.exp (gdb_preprocess): Remove 'puts' statement.
+
+ * gdb.c++/method.exp: Add missing close brace.
+
+1999-01-30 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.base/maint.exp: Use 'set height 0' to disable page
+ prompting, not 'set height 400'.
+
+ Fix a bunch of timeouts.
+ * gdb.base/maint.exp ("maint print objfiles"): Break this up into
+ four separate tests, so expect doesn't take forever to match a ton
+ of text against a regexp with lots of .* forms.
+ ("maint print psymbols", "maint print symbols"): Make some of
+ these greps more selective, so that expect doesn't try to wade
+ through huge piles of output and time out.
+
+ * gdb.base/maint.exp ("maint print msymbols"): Fix pattern.
+
+ * gdb.base/maint.exp ("maint info breakpoints"): Split into two
+ tests: one which doesn't expect shlib events to be reported, and
+ another which does, but is XFAIL for all platforms other than
+ HP/UX.
+
+ * gdb.base/break.exp: Teach the test suite that the `catch
+ fork', `catch vfork', and `catch exec' commands produce error
+ messages on platforms that don't provide these features.
+
+Mon Jan 25 18:35:56 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.hp/gen-so-thresh.c, so-thresh.sh, so-thresh.exp,
+ so-thresh.linkopts, so-thresh.mk: Move to gdb.hp from gdb.base
+ (shortening names from solib_threshold.exp etc), won't run on
+ anything but HP-UX for the foreseeable future.
+ * gdb.hp/Makefile.in, gdb.base/Makefile.in (clean): Adjust to
+ reflect move.
+
+Thu Jan 21 15:46:49 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/Makefile.in, gdb.c++/Makefile.in,
+ gdb.trace/Makefile.in (clean): Remove all test executables.
+
+Tue Jan 19 17:20:09 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * gdb.base/shlib-call.exp: add test cases to verify that gdb
+ successfully re-sets breakpoints in shared libraries.
+ * gdb.base/shmain.c (main): return 0, don't fall off the end.
+
+Fri Jan 15 14:04:57 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.hp/xdb3.exp: do not execute unless on hppa-hpux platform
+ and compiled w/o GCC.
+
+ * gdb.hp/watch-cmd.exp: ditto.
+
+ * gdb.hp/watch-hp.exp: ditto.
+
+ * gdb.hp/xdb1.exp: ditto.
+
+ * gdb.hp/xdb2.exp: ditto.
+
+ * gdb.hp/dbx.exp: ditto.
+
+Thu Jan 14 18:36:48 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * constvars.c: Remove C++-isms.
+ * constvars.exp: Use gdb_test everywhere, add xfails if compiled
+ with GCC.
+
+Mon Jan 11 10:08:03 1999 David Taylor <taylor@texas.cygnus.com>
+
+ The following changes are part of the HP merge.
+
+ * gdb.base/break.exp: new tests to verify that catchpoints for
+ fork, vfork, and exec don't trigger inappropriately.
+
+ * gdb.base/opaque.exp: compile one file at a time, then link.
+
+ * gdb.base/signals.exp: be more restrictive about which hppa
+ systems receive a setup_xfail. new tests.
+
+ * gdb.base/solib_threshold.build: new file.
+ * gdb.base/solib_threshold.exp: new file.
+ * gdb.base/solib_threshold.link_opts: new file.
+ * gdb.base/solib_threshold.mk: new file.
+ * gdb.base/gen_solib_threshold.c: new file.
+
+ * gdb.c++/classes.exp: if on HPUX and not using gcc, skip the
+ tests. New tests for enums inside classes.
+
+ * gdb.c++/compiler.cc: indicate support of template debugging.
+
+ * gdb.c++/demangle.exp: run hp style demangling tests.
+
+ * gdb.c++/inherit.exp: if on HPUX and not using gcc, skip the
+ tests.
+
+ * gdb.c++/misc.cc: changes to support new tests.
+
+ * gdb.c++/templates.cc: changes to support HP's compiler; changes
+ to support new tests.
+
+ * gdb.c++/virtfunc.exp: if we are on HPUX and we are not using
+ gcc, then skip these tests.
+
+Sun Jan 10 23:44:11 1999 David Taylor <taylor@texas.cygnus.com>
+
+ The following files are part of the HP merge; some had longer
+ names at HP, but have been renamed to be no more than 14
+ characters in length.
+
+ * gdb.hp/ambiguous.cc: new file.
+ * gdb.hp/ambiguous.exp: new file.
+ * gdb.hp/attach.exp: new file.
+ * gdb.hp/attach2.exp: new file.
+ * gdb.hp/classes-hp.exp: new file.
+ * gdb.hp/ctti.exp: new file.
+ * gdb.hp/ctti-add.cc: new file.
+ * gdb.hp/ctti-add1.cc: new file.
+ * gdb.hp/ctti-add2.cc: new file.
+ * gdb.hp/ctti-add3.cc: new file.
+ * gdb.hp/dbx.exp: new file.
+ * gdb.hp/exception.cc: new file.
+ * gdb.hp/exception.exp: new file.
+ * gdb.hp/foll-exec.c: new file.
+ * gdb.hp/foll-exec.exp: new file.
+ * gdb.hp/foll-fork.c: new file.
+ * gdb.hp/foll-fork.exp: new file.
+ * gdb.hp/foll-vfork.c: new file.
+ * gdb.hp/foll-vfork.exp: new file.
+ * gdb.hp/inherit-hp.exp: new file.
+ * gdb.hp/more-steps.exp: new file.
+ * gdb.hp/namespace.cc: new file.
+ * gdb.hp/namespace.exp: new file.
+ * gdb.hp/optimize.exp: new file.
+ * gdb.hp/pxdb.c: new file.
+ * gdb.hp/pxdb.exp: new file.
+ * gdb.hp/quicksort.exp: new file.
+ * gdb.hp/reg-test.exp: new file.
+ * gdb.hp/reg-test.s: new file.
+ * gdb.hp/sized-enum.c: new file.
+ * gdb.hp/sized-enum.exp: new file.
+ * gdb.hp/start-stop.exp: new file.
+ * gdb.hp/templ-hp.cc: new file.
+ * gdb.hp/templ-hp.exp: new file.
+ * gdb.hp/thr-lib.c: new file.
+ * gdb.hp/thr-lib.exp: new file.
+ * gdb.hp/thr-lib.h: new file.
+ * gdb.hp/thr-liblib.c: new file.
+ * gdb.hp/virtfun-hp.c: new file.
+ * gdb.hp/virtfun-hp.exp: new file.
+ * gdb.hp/watch-cmd.exp: new file.
+ * gdb.hp/watch-hp.exp: new file.
+ * gdb.hp/xdb1.exp: new file.
+ * gdb.hp/xdb2.exp: new file.
+ * gdb.hp/xdb3.exp: new file.
+
+Wed Jan 6 18:41:15 1999 David Taylor <taylor@texas.cygnus.com>
+
+ The following files are part of the HP merge; some had longer
+ names at HP, but have been renamed to be no more than 14
+ characters in length.
+
+ * gdb.base/ss.h: new file.
+ * gdb.base/call-ar-st.c: new file.
+ * gdb.base/call-ar-st.exp: new file.
+ * gdb.base/call-rt-st.c: new file.
+ * gdb.base/call-rt-st-exp: new file.
+ * gdb.base/call-strs.exp: new file.
+ * gdb.base/ena-dis-br.exp: new file.
+ * gdb.base/environ.exp: new file.
+ * gdb.base/long_long.exp: new file.
+ * gdb.base/sect-cmd.exp: new file.
+ * gdb.base/shlib-cl2.exp: new file.
+ * gdb.base/smoke.exp: new file.
+ * gdb.base/so-impl-ld.c: new file.
+ * gdb.base/so-impl-ld.exp: new file.
+ * gdb.base/so-indr-cl.c: new file.
+ * gdb.base/so-indr-cl.exp: new file.
+ * gdb.base/varargs.exp: new file.
+ * gdb.base/volatile.exp: new file.
+ * gdb.base/whatis-exp.exp: new file.
+ * gdb.base/display.exp: new file.
+ * gdb.c++/derivation.exp: new file.
+ * gdb.c++/local.exp: new file.
+ * gdb.c++/member-ptr.exp: new file.
+ * gdb.c++/overload.exp: new file.
+ * gdb.c++/ovldbreak.exp: new file.
+ * gdb.c++/ref-types.exp: new file.
+ * gdb.c++/ref-types2.exp: new file.
+ * gdb.c++/userdef.exp: new file.
+
+Wed Jan 6 13:50:57 1999 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/default.exp: Reflect wording change in remote.c.
+
+Tue Jan 5 19:14:51 1999 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/help.exp: Update to reflect current text.
+
+Tue Jan 5 13:05:32 1999 David Taylor <taylor@texas.cygnus.com>
+
+ * gdb.c++/anon-union.cc: make foo and bar global, otherwise
+ they're stack variables and contain garbage.
+ * gdb.c++/anon-union.exp: new file.
+
+ The following changes were made by David Taylor
+ <taylor@cygnus.com>, Elena Zannoni <ezannoni@cygnus.com>, and
+ Edith Epstein <eepstein@cygnus.com> as part of a project to merge
+ in changes by HP.
+
+ * gdb.base/bitops.exp: new file.
+ * gdb.base/default.exp: change expected messages for catch and
+ info catch tests to reflect HP merge changes.
+ * gdb.base/enable-disable-break.exp
+ * gdb.base/ending-run.c: new file.
+ * gdb.base/long_long.c: new file.
+ * gdb.base/maint.exp: new file.
+ * gdb.base/pointers2.exp: new file.
+ * gdb.base/shlib-call2.exp: new file.
+ * gdb.base/solib.exp: new file.
+ * gdb.base/step-test.c: new file.
+ * gdb.c++/anon-union.cc: new file.
+ * gdb.c++/local.cc: new file.
+ * gdb.c++/member-pointer.cc: new file.
+ * gdb.c++/method.cc: new file.
+ * gdb.c++/ref-types.cc: new file.
+ * gdb.c++/ref-types2.cc: new file.
+ * gdb.c++/userdef.cc: new file.
+
+ * gdb.base/scope.exp: compile one file at a time, then link.
+ * gdb.base/langs.exp: ditto.
+ * gdb.base/list.exp: ditto.
+
+Mon Jan 4 10:06:43 1999 David Taylor <taylor@texas.cygnus.com>
+
+ The following changes were made by David Taylor
+ <taylor@cygnus.com>, Elena Zannoni <ezannoni@cygnus.com>, and
+ Edith Epstein <eepstein@cygnus.com> as part of a project to merge
+ in changes by HP.
+
+ * gdb.c++/inherit.exp: if on hppa*-*-hpux* and not using gcc,
+ skip tests. When compiling pass c++ flag to gdb_compile.
+ * gdb.c++/
+
+ * lib/gdb.exp (get_compiler_info): new, optional argument -- args;
+ test for on hppa*-*-hpux*; use args to see if c++ was specified.
+ (skip_hp_tests): new function.
+ (gdb_preprocess): new function.
+
+ * configure.in (hpdir): decide whether to configure gdb.hp.
+ * configure: regenerated.
+
+ * gdb.base/Makefile.in (MISCELLANEOUS): new macros -- extra things
+ to delete on clean.
+ (EXECUTABLES): update to reflect new additions.
+ * gdb.base/commands.exp: update message expected.
+ * gdb.base/default.exp: add copyright notice.
+ * gdb.base/funcargs.exp (timeout): if hpux, increase timeout.
+ * gdb.base/help.exp: update messages to reflect current text.
+ * gdb.base/recurse.exp: add hpppa*-*-bsd* to 'list' of enabled
+ targets for recurse tests.
+ * gdb.base/watchpoint.exp: if on hpux and not gcc compiled, then
+ skip this file.
+
+ * gdb.c++/Makefile.in (PROGS): update to reflect new executables.
+ * gdb.c++/cplusfuncs.exp: tell gdb_compile that it's a c++
+ compilation.
+ * gdb.c++/misc.exp: ditto.
+ * gdb.c++/templates.exp: if we're on hpux and it's not gcc, don't
+ run the tests. tell gdb_compile that it's a c++ compilation.
+
+ * gdb.threads/pthreads.exp: fix typo in message.
+
+ * gdb.base/all-bin.exp: new file.
+ * gdb.base/arithmet.exp: new file.
+ * gdb.base/assign.exp: new file.
+ * gdb.base/completion.exp: new file.
+ * gdb.base/cond-expr.exp: new file.
+ * gdb.base/condbreak.exp: new file.
+ * gdb.base/define.exp: new file.
+ * gdb.base/dollar.exp: new file.
+ * gdb.base/environment.exp: new file.
+ * gdb.base/eval-skip.exp: new file.
+ * gdb.base/jump.exp: new file.
+ * gdb.base/logical.exp: new file.
+ * gdb.base/pointers.exp: new file.
+ * gdb.base/relational.exp: new file.
+ * gdb.base/section_command.exp: new file.
+ * gdb.base/whatis-expr.exp: new file.
+
+ * gdb.base/all-types.c: new file.
+ * gdb.base/call-array-struct.c: new file.
+ * gdb.base/call-return-struct.c: new file.
+ * gdb.base/call-strings.c: new file.
+ * gdb.base/callfuncs2.c: new file.
+ * gdb.base/condbreak.c: new file.
+ * gdb.base/constvars.c: new file.
+ * gdb.base/display.c: new file.
+ * gdb.base/int-type.c: new file.
+ * gdb.base/jump.c: new file.
+ * gdb.base/miscexprs.c: new file.
+ * gdb.base/pointers.c: new file.
+ * gdb.base/pointers2.c: new file.
+ * gdb.base/shmain.c: new file.
+ * gdb.base/shr1.c: new file.
+ * gdb.base/shr2.c: new file.
+ * gdb.base/solib.c: new file.
+ * gdb.base/solib1.c: new file.
+ * gdb.base/solib2.c: new file.
+ * gdb.base/varargs.c: new file.
+ * gdb.c++/derivation.cc: new file.
+ * gdb.c++/overload.cc: new file.
+ * gdb.c++/ovldbreak.cc: new file.
+ * gdb.hp/attach.c: new file.
+ * gdb.hp/attach2.c: new file.
+ * gdb.hp/average.c: new file.
+ * gdb.hp/compiler.c: new file.
+ * gdb.hp/compiler.cc: new file.
+ * gdb.hp/execd-program.c: new file.
+ * gdb.hp/follow-exec.c: new file.
+ * gdb.hp/follow-fork.c: new file.
+ * gdb.hp/follow-vfork-and-exec.c: new file.
+ * gdb.hp/misc-hp.cc: new file.
+ * gdb.hp/more-steps.c: new file.
+ * gdb.hp/optimize.c: new file.
+ * gdb.hp/quicksort.c: new file.
+ * gdb.hp/run-hp.c: new file.
+ * gdb.hp/start-stop.c: new file.
+ * gdb.hp/sum.c: new file.
+ * gdb.hp/templates-hp.cc: new file.
+ * gdb.hp/thread-local-in-lib.c: new file.
+ * gdb.hp/thread-local-in-lib.h: new file.
+ * gdb.hp/thread-local-in-lib.lib.c: new file.
+ * gdb.hp/vforked-program.c: new file.
+ * gdb.hp/virtfunc-hp.cc: new file.
+ * gdb.hp/watchpoint-hp.c: new file.
+ * gdb.hp/xdb.c: new file.
+ * gdb.hp/xdb0.c: new file.
+ * gdb.hp/xdb0.h: new file.
+ * gdb.hp/xdb1.c: new file.
+
+Mon Dec 21 14:08:38 1998 David Taylor <taylor@texas.cygnus.com>
+
+ The following change was made by Edith Epstein
+ <eepstein@cygnus.com> as part of a project to merge in changes
+ originally made by HP; HP did not create ChangeLog entries.
+
+ * gdb.c++/demangle.exp: changed the expected output for some
+ ARM-style mangling -- removed second reference to datatype.
+ For example, maint demangle __dt__11T1__pt__2_cFv
+ T1<char>::~T1<char>(void)
+ becomes,
+ maint demangle __dt__11T1__pt__2_cFv
+ T1<char>::~T1(void)
+
+ (test_hp_style_demangling): new hp specific demangling test cases.
+
+Mon Dec 14 15:07:03 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.trace/actions.exp: Ignore compiler warnings compiling actions.c
+ * gdb.trace/backtrace.exp: Likewise.
+ * gdb.trace/circ.exp: Likewise.
+ * gdb.trace/collection.exp: Likewise.
+ * gdb.trace/deltrace.exp: Likewise.
+ * gdb.trace/infotrace.exp: Likewise.
+ * gdb.trace/limits.exp: Likewise.
+ * gdb.trace/packetlen.exp: Likewise.
+ * gdb.trace/passc-dyn.exp: Likewise.
+ * gdb.trace/passcount.exp: Likewise.
+ * gdb.trace/report.exp: Likewise.
+ * gdb.trace/save-trace.exp: Likewise.
+ * gdb.trace/tfind.exp: Likewise.
+ * gdb.trace/tracecmd.exp: Likewise.
+ * gdb.trace/while-dyn.exp: Likewise.
+ * gdb.trace/while-stepping.exp: Likewise.
+
+1998-12-07 Jim Blandy <jimb@zwingli.cygnus.com>
+
+ * gdb.base/restore.exp, gdb.base/restore.c: New tests.
+
+Wed Dec 2 20:03:53 1998 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Brendan Kehoe:
+ * gdb.c++/cplusfuncs.cc, misc.cc, virtfunc.cc: Add now-required
+ int return types.
+
+Sat Oct 24 18:04:22 1998 Felix Lee <flee@cygnus.com>
+
+ * config/slite.exp (gdb_load): use gdb_file_cmd, so we can do
+ remote dos host testing right.
+
+Mon Oct 19 01:31:59 1998 Felix Lee <flee@cygnus.com>
+
+ * gdb.base/corefile.exp: remove some xfails.
+
+Thu Oct 15 10:04:38 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/reread.exp: Sleep 1 - ensures that the two executables
+ have different timestamps.
+
+Thu Oct 1 20:56:14 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * lib/gdb.exp, gdb.base/default.exp, config/monitor.exp,
+ gdb.base/default.exp: Replace "exec" with "executable".
+
+Tue Sep 29 15:06:29 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/default.exp: Change else if to elseif from previous
+ delta.
+
+Mon Sep 28 13:21:43 1998 Nick Clifton <nickc@cygnus.com>
+
+ * gdb.base/default.exp: Add brace missing from previous delta.
+
+Mon Sep 21 14:39:27 1998 Nick Clifton <nickc@cygnus.com>
+
+ * gdb.base/default.exp: Support test for info float for all
+ varieties of arm toolchain.
+
+Fri Sep 18 14:07:44 1998 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.trace/*.exp: remove "remote_download" command.
+
+Wed Sep 16 11:38:21 1998 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.trace/*.exp: remove -gdwarf from compile.
+
+Wed Sep 16 01:23:11 1998 Felix Lee <flee@cygnus.com>
+
+ * gdb.trace/configure.in(AC_INIT): typo
+ * gdb.trace/configure: regenerated
+
+Mon Sep 14 20:00:04 1998 Michael Snyder <msnyder@cygnus.com>
+
+ * config/m68k-emc.exp: New file.
+ * lib/<emc-support.exp trace-support.exp}: New files.
+ * configure.in: add new test directory gdb.trace.
+ * gdb.trace/{configure configure.in Makefile.in}: New files.
+ * gdb.trace/{actions.c actions.exp gdb_c_test.c}: New files.
+ * gdb.trace/{circ.c circ.exp limits.c limits.exp}: New files.
+ * gdb.trace/{collection.c collection.exp tfind.exp }: New files.
+ * gdb.trace/{backtrace.exp deltrace.exp infotrace.exp}: New files.
+ * gdb.trace/{packetlen.exp passc-dyn.exp passcount.exp}: New files.
+ * gdb.trace/{report.exp save-trace.exp tracecmd.exp}: New files.
+ * gdb.trace/{while-dyn.exp while-stepping.exp}: New files.
+
+Fri Sep 11 13:58:02 1998 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.c++/classes.exp: Change all regular expressions to match
+ arbitrary combinations of newline/carriage-return, so that they
+ will work equally well on Unix and Windows.
+ * gdb.c++/inherit.exp: ditto.
+ * gdb.c++/virtfunc.exp: ditto.
+
+1998-08-11 Dawn Perchik <dawn@cygnus.com>
+
+ * gdb.base/setshow.exp: Fix error introduced by call to runto_main.
+
+Fri Jul 24 15:51:34 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.disasm/am33.s: Add tests for autoincrement instructions.
+ * gdb.disasm/am33.exp: Run time. Update tests which use r8-r15
+ to use a0-a3/d0-d3 as needed.
+
+Thu Jul 16 18:20:46 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.disasm/am33.s: Add 4 operand mul and mulu tests.
+ * gdb.disasm/am33.exp: Corresponding changes.
+
+1998-07-11 Felix Lee <flee@cygnus.com>
+
+ * gdb.base/callfuncs.exp: add cmp10 test.
+ * gdb.base/callfuncs.c (cmp10): new function.
+
+Thurs Jul 9 11:08:31 1998 Dawn Perchik <dawn@cygnus.com>
+
+ * gdb.base/commands.exp: Break up infrun_breakpoint_command_test
+ into two parts to get around a synchronization problem in expect.
+
+Fri Jun 26 14:27:13 1998 Keith Seitz <keiths@cygnus.com>
+
+ * lib/gdb.exp (gdbtk_start): Add startup for gdbtk.
+
+ * configure.in: Add options for gdbtk testsuite.
+
+ * configure: Regenerate.
+
+ * gdb.gdbtk: New directory to hold gdbtk tests.
+
+Fri Jun 26 14:52:47 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * gdb.fortran/types.exp: Escape brackets in expect patterns
+ for test_float_literal_types_accepted tests.
+ * gdb.base/scope.exp: Remove extraneous newline in filelocal_bss
+ before run test.
+
+Fri Jun 26 11:12:17 1998 Jeffrey A Law (law@cygnus.com)
+
+ * am33.exp: Just compile, do not link the testcase.
+ * am33.s: Add ".am33" pseudoop to force am33 mode.
+
+1998-06-25 Felix Lee <flee@cygnus.com>
+
+ * gdb.base/setshow.exp: make sure $pc is sane.
+
+ * gdb.stabs/weird.exp: split expect patterns properly.
+
+Wed Jun 24 13:03:15 1998 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.disasm/am33.s: New disassembler testfile for the am33.
+ * gdb.disasm/am33.exp: Run it.
+
+Tue Jun 23 11:45:01 1998 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/funcargs.exp: simplify expect strings to ease pattern
+ match processing (and eliminate spurious timeouts when running).
+
+Fri Jun 12 17:28:22 1998 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/signals.exp (test_handle_all_print): put back Mach
+ exception test, but conditionalize it on target [mach | gnu].
+
+Wed Jun 10 10:40:03 1998 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/overlays.exp: fixup compile line for linker script.
+
+Thu Jun 4 21:54:15 1998 Felix Lee <flee@zog.cygnus.com>
+
+ * gdb.fortran/types.exp: don't guess at float size.
+
+Thu May 21 02:28:37 1998 Felix Lee <flee@zog.cygnus.com>
+
+ * gdb.base/exprs.exp: delete test that depends on int size.
+
+Sun May 17 17:10:22 1998 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/sim.exp: Removed checks for target triplets.
+ (gdb_target_sim): Use gdb,target_sim_options.
+
+Sat May 16 23:43:35 1998 Mark Alexander <marka@cygnus.com>
+
+ * gdb.base/reread.exp: New file.
+ * gdb.base/reread1.c: New file.
+ * gdb.base/reread2.c: New file.
+
+Sat May 16 23:22:09 1998 Mark Alexander <marka@cygnus.com>
+
+ * config/sim.exp: Use 'target sim -sparclite' when running
+ SPARClite programs.
+
+Sat May 16 18:48:08 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * gdb.base/structs2.exp: New file.
+ * gdb.base/structs2.c: New file.
+
+Wed May 13 13:36:14 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * gdb.asm/common.inc: New file.
+ * gdb.asm/d10v.inc: New file.
+ * asm-source.exp: Pass -I's to gas to find .inc files.
+ Update line numbers in expected output.
+ * asmsrc1.s: Rewrite.
+ * asmsrc2.s: Rewrite.
+ * configure.in: Create arch.inc symlink.
+ * configure: Regenerate.
+ * Makefile.in (distclean): Delete arch.inc.
+
+Wed May 6 10:30:54 1998 John Metzler <jmetzler@cygnus.com>
+
+ * callfuncs.c (t_enum_value1) : Cleanup return value warnings
+ (t_enum_value2): ditto
+ (t_enum_value3): ditto
+ (main): ditto
+Fri May 1 09:33:37 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
+
+ * gdb.base/break.exp: Remove xfail for `deleting all breakpoints
+ when none' unexpected prompt case, fixed by breakpoint.c:delete_command
+ change.
+ Use gdb_test instead of send_gdb/gdb_expect sequences.
+
+Thu Apr 23 12:56:19 1998 Jason Molenda (crash@bugshack.cygnus.com)
+
+ * gdb.c++/virtfunc.cc: Declare extern "C" printf to return int,
+ not void.
+
+Thu Apr 16 10:52:34 1998 John Metzler <jmetzler@cygnus.com>
+
+ * gdb.base/branches.c: Code with lots of loops and
+ subroutines. Used to test gdbs ability to single step through PC
+ changes, especially to test mips-tdep.c:mips_next_pc
+
+Mon Apr 13 22:32:51 1998 Frank Ch. Eigler <fche@cygnus.com>
+
+ * gdb.c++/virtfunc.cc: Make extern "C" printf declaration pass
+ more rigorous EGCS C++ error checking.
+
+Fri Apr 10 22:38:12 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/help.exp: Clean up `help set args' and `help show args'
+ tests.
+ * gdb.base/interrupt.exp: Add "i*86-*-solaris2*" xfail for calling
+ function when asleep.
+ * gdb.base/signals.exp: Add "i*86-*-solaris2*" xfails. Add comment
+ for i*86 Linux and SVR4 signal handling problems.
+ Remove linux xfail for `next to handler in signals_tests_1', fixed
+ by recent infrun.c change.
+ Limit backtrace to 10 frames to avoid timeout problems with infinite
+ stack backtraces.
+ Adjust expect pattern in `handle all print' test to match Apr 28 1997
+ target.[ch] change.
+
+Tue Mar 31 00:40:32 1998 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp(gdb_test): Send multiline commands one at a time; wait
+ for a newline from gdb before continuing.
+ (default_gdb_exit): Just look for y or n.
+ (gdb_test): Detect abnormal exit from GDB running on DOS; if
+ it does, fail the rests of the tests in the file.
+
+Tue Mar 24 22:44:52 1998 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/cygmon.exp: New file.
+
+Mon Mar 16 21:39:11 1998 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/list.exp: Fix problem with "list default lines around
+ main" test on remote targets.
+
+ * gdb.base/scope.exp: Fix problem with filelocal_bss before
+ run test on remote targets.
+
+Thu Mar 12 16:23:00 1998 Doug Evans <devans@canuck.cygnus.com>
+
+ * gdb.asm: New directory.
+ * configure.in: Configure it.
+ * configure: Regenerate.
+ * gdb.asm/{Makefile.in,configure.in,configure}: New files.
+ * gdb.asm/{asm-source.exp,asmsrc1.s,asmsrc2.s}: New files.
+
+Mon Feb 23 08:22:44 1998 Mark Alexander <marka@cygnus.com>
+
+ * config/mn10300-eval.exp: New file to support MN10300 eval board.
+
+Wed Feb 18 16:43:46 1998 Michael Snyder (msnyder@cygnus.com)
+
+ * gdb.base/overlays (several files): Merge the two overlay
+ managers into one. Change variables (foox, barx, bazx, grbxx)
+ back into ints but force them to load in their proper sections.
+
+Thu Feb 12 13:49:30 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/d10vovly.c (D10VTranslate): Map IMAP0 to low 128k of
+ on-chip insn memory and IMAP1 to upper 128k.
+ (D10VCopy): Handle memory regions crossing 16k boundaries.
+ (D10VCopy): Transfer data in 32 bit chunks.
+
+Tue Feb 10 17:23:22 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/overlays.c (main): Exit normally when result is
+ correct.
+
+ * gdb.base/d10v.ld: Update LMAs to reflect current d10v address
+ map. Include space for printf in .text segment.
+
+ * gdb.base/d10vovly.c (D10VTranslate): New function, handle
+ updated d10v memory VMA/LMA map.
+ (D10VCopy): Call D10VTranslate.
+
+Fri Feb 6 14:13:12 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/m32rovly.c: Force variable _novlys into .data section.
+
+ * gdb.base/bar.c (barx, bar): Change variable to small array so
+ that it won't be put into the .sdata - small data -
+ section. Update reference.
+ * gdb.base/baz.c (bazx, baz): Ditto.
+ * gdb.base/foo.c (foox, foo): Ditto.
+ * gdb.base/grbx.c (grbxx, grbx): Ditto.
+
+ * gdb.base/overlays.exp: Expect variables barx, bazx, foox, grbxx
+ to be arrays.
+
+Thu Jan 29 14:48:19 1998 Michael Snyder (msnyder@cygnus.com)
+
+ * gdb.base/overlays.exp: fix up and get working again.
+ Add tests for backtraces from an overlay function.
+
+Fri Jan 23 07:52:45 1998 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/watchpoint.exp: Set "d10v*-*-*" clear_xfail for
+ "calling function with watchpoint enabled".
+
+Thu Jan 22 14:23:29 1998 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/break.exp (test_next_with_recursion): Remove
+ gdb_suppress_tests for d10v-*-*.
+ * lib/gdb.exp (gdb_suppress_tests): Disable this function
+ pending review of whether it is useful or not.
+
+Tue Jan 20 13:02:09 1998 Mark Alexander <marka@cygnus.com>
+
+ * gdb.base/funcargs.exp: Increase timeout for slow TX39 boards.
+
+Mon Jan 19 08:53:04 1998 Mark Alexander <marka@cygnus.com>
+
+ * gdb.base/break.exp: Increase timeout for slow TX39 boards.
+ * config/dve.exp: New file to support Densan boards.
+
+Mon Dec 15 22:38:05 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/interrupt.exp: Document problem of simulators, signals,
+ reads and BSD.
+
+Wed Nov 26 22:29:18 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/monitor.exp: Be a bit less picky about the "Remote debugging"
+ response.
+
+ * gdb.c++/misc.exp: Call runto_main instead of doint it manually.
+
+Tue Nov 25 12:46:36 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/mips_pro.exp: Add "mips64*-*-elf" xfail for backtrace
+ test.
+
+ * gdb.base/funcargs.exp: Query GDB for target_sizeof_int,
+ target_sizeof_long and target_bigendian_p.
+ (structs_by_value, structs_by_reference): Check values according
+ to targets word size and endianess.
+
+Mon Nov 24 16:37:06 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.base/langs.exp: For "continue to exit" ignore any trailing
+ output.
+
+Fri Oct 17 13:24:43 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/default.exp, gdb.base/help.exp, gdb.base/setshow.exp:
+ Update test of set args help to match source change.
+
+Fri Sep 26 17:36:20 1997 Jason Molenda (crash@pern.cygnus.com)
+
+ * gdb.base/default.exp: Expect help system output to be in
+ alphabetical order.
+ * gdb.base/help.exp: Ditto.
+
+Wed Sep 24 13:08:14 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/signals.exp: Change "i*86-pc-linux-gnu" to
+ "i*86-pc-linux-gnu*".
+ * gdb.base/interrupt.exp: Ditto.
+ * gdb.base/corefile.exp: Ditto.
+
+ * lib/gdb.exp(gdb_compile): If is_vxworks target feature is set,
+ define vxworks when building the testcase.
+
+ * gdb.base/ptype.exp: Fix testnames to be unique.
+ * gdb.base/radix.exp: Ditto.
+ * gdb.base/term.exp: Ditto.
+ * gdb.base/whatis.exp: Ditto.
+ * gdb.c++/classes.exp: Ditto.
+
+Tue Sep 16 22:21:48 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/callfuncs.exp: Fix indentation.
+
+ * lib/gdb.exp(gdb_expect): Set remote_suppress_flag if
+ suppress_flag has been set.
+ (gdb_step_for_stub): Check for gdb,use_breakpoint_for_stub
+ target feature.
+
+Mon Sep 15 15:43:17 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.stabs/weird.exp: Don't start gdb 'til after we've compiled
+ the testcase.
+
+ * gdb.c++/cplusfuncs.cc(main): Add extern "C" declaration for
+ set_debug_traps() and breakpoint().
+ * gdb.c++/misc.cc (main): Ditto.
+ * gdb.c++/templates.cc (main): Ditto.
+ * gdb.c++/virtfunc.cc (main): Ditto.
+
+Fri Sep 12 16:56:38 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp(gdb_step_for_stub): New function.
+ (gdb_run_cmd): Look for gdb,do_reload_on_run target feature--if it
+ exists, reload the executable and do a "continue" instead of
+ doing a jump.
+ (runto_main): Use gdb_step_for_stub.
+
+ * gdb.base/break.exp: Use gdb_step_for_stub. Also, rename certain
+ tests to have unique names.
+ * gdb.base/callfuncs.exp: Ditto.
+ * gdb.base/commands.exp: Ditto.
+ * gdb.base/default.exp: Ditto.
+ * gdb.base/help.exp: Ditto.
+ * gdb.base/list.exp: Ditto.
+ * gdb.base/opaque.exp: Ditto.
+ * gdb.base/printcmds.exp: Ditto. Use a loop to emit multiple
+ similar tests.
+
+ * gdb.base/setshow.c: Add set_debug_traps/breakpoint calls.
+ * gdb.c++/cplusfuncs.cc: Ditto.
+ * gdb.c++/virtfunc.cc: Ditto.
+
+ * config/monitor.exp: Keep track of the last file we saw, rather
+ than trying to get the info from gdb.
+
+ * gdb.fortran/types.exp: Move comment to previous line.
+
+Tue Sep 2 19:55:34 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/sparclet.exp: Detect gratuitous change to sparclet gdb
+ target mode.
+
+Mon Jul 28 12:14:47 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Bob Manson:
+ * config/monitor.exp (gdb_target_monitor): Look for "Connected to"
+ string from GDB when it connects.
+
+ * lib/gdb.exp: Look for $TOOL_EXECUTABLE.
+
+Thu Jul 3 15:35:12 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp(get_debug_format): Don't cause the testsuite to fail
+ if we can't get a debug format from GDB (we may be testing an
+ older GDB). Use a 10 second timeout when checking for the format.
+
+ * gdb.stabs/weird.exp: Fix quoting.
+
+ * config/sparclet.exp: Renamed sparclet-loader.c to stub-loader.c.
+
+Mon Jun 30 18:31:43 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/arm-ice.exp: New file.
+
+Sun Jun 29 16:43:30 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/overlays.exp: Preliminary fixes; temporarily disabled
+ until it has been modified to work with the new testsuite.
+
+ * gdb.*/*.exp: Instead of causing 1 unresolved test when the
+ testcase won't compile, cause all of the testcases in the file to
+ fail instead.
+
+ * lib/gdb.exp(gdb_suppress_entire_file): New procedure.
+ (gdb_clear_suppressed): New procedure.
+ (gdb_stop_suppressing_tests): Only clear suppress_flag if
+ it contains a positive value.
+
+Sat Jun 28 13:31:11 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp(default_gdb_start): Use gdb_opts host feature.
+
+ * gdb.c++/virtfunc.exp: Remove setting of libs variable.
+
+Fri Jun 27 07:44:25 1997 Fred Fish <fnf@cygnus.com>
+
+ * lib/gdb.exp (setup_xfail_format): New function.
+ (get_debug_format): New function to get debug format.
+ (debug_format): New global variable to hold last value set
+ by get_debug_format.
+ * gdb.base/list.exp: Call get_debug_format and expect some
+ tests to fail for DWARF 1 and COFF formats.
+ * gdb.c++/ptype.exp: Ditto.
+ * gdb.c++/classes.exp: Ditto.
+ * gdb.c++/cplusfuncs.exp: Ditto.
+ * gdb.c++/inherit.exp: Ditto.
+ * gdb.c++/templates.exp: Ditto.
+ * gdb.c++/virtfunc.exp: Ditto.
+
+Wed Jun 25 09:08:51 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp(default_gdb_exit): Don't give an error if the remote
+ host doesn't have a currently-open connection.
+
+ * config/sparclet.exp: Cleanups and fixes to make it generic for
+ any gdb stub target. Handle cases where gdb doesn't respond when
+ interrupted in a sane fashion.
+
+ * config/m32r-stub.exp: Load sparclet.exp instead of trying to do the
+ same thing in a totally different way.
+
+ * config/monitor.exp: Pass in timeouts to gdb_expect instead of
+ setting "timeout".
+ (gdb_start): We set the global gdb_prompt variable in
+ default_gdb_init now.
+
+Sun Jun 22 09:11:02 1997 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/printcmds.exp: Fix "check for floating addition"
+ regexp to accept results within approx +/- .01 of exact value.
+ * lib/gdb.exp (gdb_test): Remove unused expect_out global decl.
+
+Wed Jun 18 11:11:39 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp(gdb_init): Pass our arguments to default_gdb_init
+ properly.
+ (gdb_expect): Add optional timeout parameter, and add timeout
+ value to various calls.
+ (gdb_suppress_tests): Only give one warning message per group.
+
+Tue Jun 17 13:10:10 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp(gdb_expect): Declare errorInfo and errorCode as
+ global variables. Handle getting a value for $timeout more
+ gracefully.
+
+Sat Jun 14 09:23:26 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp: Close connection to remote host if gdb doesn't
+ initialize.
+ (default_gdb_init): New procedure; allow gdb_init to be overridden
+ by a target configuration file.
+ (gdb_expect): Pass the timeout to remote_expect.
+
+ * config/monitor.exp(gdb_load): Fix typo in regexp.
+
+Thu Jun 12 20:57:12 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/funcargs.exp: Remove spurious suppress tests call.
+
+Tue Jun 3 15:20:20 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/monitor.exp(gdb_target_monitor): Call gdb_file_cmd
+ here. Call gdb_target_exec before rebooting the target, to make
+ sure the connection to the target is closed.
+ (gdb_load): Pass the name of the executable to gdb_target_monitor.
+ Don't call gdb_file_cmd here; let gdb_target_monitor do it.
+ Also detect "Timeout reading from remote" error.
+
+ * config/gdbserver.exp: Pass the executable being loaded to
+ gdb_target_monitor. Don't call gdb_file_cmd here; let
+ gdb_target_monitor do it.
+
+ * gdb.disasm/hppa.exp: Don't use exec_output.
+
+Fri May 23 13:28:29 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/list.exp: If we're debugging a non-native target,
+ try to set the pc register to point to the start of the
+ program before doing the first list command.
+
+ * gdb.c++/virtfunc.exp(gdb_virtfunc_restart): Make sure we run
+ test_calls after restarting.
+
+ * lib/gdb.exp(gdb_run_cmd): Send jump command again after
+ reloading.
+
+ * gdb.base/watchpoint.exp: Fix typo.
+
+ * gdb.base/setshow.exp: Check for use_gdb_stub.
+
+ * gdb.base/break.exp: Fix continue until exit test for the gdb
+ stub case.
+ * gdb.base/langs.exp: Ditto.
+
+ * config/monitor.exp(gdb_load): Handle gdb_sect_offset and
+ gdb_load_offset. If we weren't given a file to load, figure out
+ what the current file is and use it.
+
+ * config/i386-bozo.exp: New file.
+
+Thu May 22 18:51:32 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp(gdb_expect): Look for gdb,timeout target
+ feature.
+
+ * config/proelf.exp: New entry.
+
+Wed May 21 21:23:16 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp: Remove spurious .* patterns at the beginning
+ of regexps.
+
+ * gdb.base/watchpoint.exp: Don't run the test_stepping
+ tests if gdb can't call functions on the target.
+
+ * gdb.base/setshow.exp: Don't run the set prompt tests if
+ the board has gdb_prompt set.
+
+Tue May 20 08:58:49 1997 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/a2-run.exp: Change "gdb,noargs" to just "noargs".
+ * gdb.base/commands.exp: Likewise.
+ * gdb.base/setshow.exp: Likewise.
+
+Mon May 19 15:37:50 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/monitor.exp(gdb_start): Look for gdb_prompt target
+ feature.
+
+ * config/i960.exp: New file.
+
+Thu May 1 18:01:50 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/funcargs.exp: Check for gdb,short_int target
+ feature instead of looking for explicit target triplets.
+
+Mon Apr 28 17:27:40 1997 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/printcmds.exp: add a couple more tests a la
+ "p 123DEADBEEF", to check parse_number.
+ * top.c: change "to enable to enable" to "to enable" in a couple
+ of help strings.
+
+Thu Apr 24 14:38:18 1997 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/callfuncs.exp: Mark some tests as expected to fail
+ on the mn10300.
+
+Mon Apr 21 15:05:42 1997 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/a2-run.exp: Add arm-*-coff setup_xfails for cases
+ where the test executable is run with explicit args.
+ * gdb.base/default.exp: Handle arm-*-coff case for "info float".
+
+Mon Apr 21 13:38:58 1997 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/run.c: Use FAKEARGV to build test executable that
+ does not require a command line arg, since most simulators
+ don't currently support passing such an arg into the simulated
+ program.
+ * gdb.base/commands.exp: Change tests to insert the proper
+ value as the arg to the first recursive factorial call. Change
+ compilation line to define FAKEARGV at compile time.
+
+Wed Apr 9 11:12:36 1997 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/recurse.exp: Enable these tests for the mn10300.
+ * gdb.base/watchpoint.exp: Don't expect a failure for an "calling
+ function with watchpoint enabled" test.
+
+Tue Apr 8 19:33:20 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/watchpoint.exp(test_watchpoint_triggered_in_syscall):
+ Don't call gdb_test when the command doesn't return to a gdb prompt.
+
+ * lib/gdb.exp(gdb_stop_suppressing_tests): Don't print gratuitous
+ "Tests restarted" messages.
+
+Tue Apr 8 16:38:46 1997 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.disasm/mn10300.exp: Fix buglets in "other" tests.
+
+Thu Apr 3 15:21:26 1997 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/help.exp: update help msg for INFO ADDR; add help test
+ for INFO SYMBOL; add help tests for OVERLAY commands.
+ * gdb.base/default.exp: add tests for INFO SYMBOL command;
+ add tests for OVERLAY commands
+ * gdb.base/overlays.c overlays.exp foo.c bar.c baz.c grbx.c ovlymgr.h
+ d10v.ld m32r.ld d10vovly.c m32rovly.c: add test case for overlays.
+ * gdb.base/sigall.c: add usestubs code frag
+ * gdb.base/watchpoint.exp: turn on complex watchpoint test for M32R.
+
+Thu Apr 3 09:38:53 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp(gdb_suppress_tests): Add explanation for subsequent
+ failures.
+ (gdb_stop_suppressing_tests): Note that tests have restarted.
+
+Wed Apr 2 19:04:20 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/h8300.exp: New file.
+
+Sun Mar 30 13:38:25 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/setshow.exp: Check for the existence of a
+ feature, not its value.
+
+Sat Mar 29 11:19:46 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.c++/virtfunc.exp: Restart gdb in a sane fashion.
+
+ * gdb.base/scope.exp: It's now init0(), not init().
+
+ * gdb.base/scope0.c: For now, change init() to be init0().
+
+ * config/monitor.exp: Use gdb_serial in preference to serial
+ or netport.
+
+ * lib/gdb.exp: Set GDB to [transform gdb] if we're using a remote host
+ and it's not already set.
+
+Fri Mar 28 19:54:18 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/setshow.exp: Only test the run command if the target
+ isn't using a stub and if it supports argument passing.
+
+Sat Mar 22 19:50:25 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/udi.exp(gdb_start): Make sure UDICONF is set
+ properly before starting gdb.
+
+Mon Mar 24 14:40:33 1997 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.disasm/mn10300.s: New test file for mn10300 disassembler.
+ * gdb.disasm/mn10300.exp: Run mn10300 disassembler tests.
+ * gdb.disasm/Makefile.in: Remove "mn10300" when cleaning.
+
+Tue Mar 11 11:42:58 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/vx.exp: Use remote_ld, not vxworks_ld. Don't use
+ specialized code to reboot the board, use remote_reboot instead.
+
+ * config/vxworks29k.exp: Use vx.exp, not vx-gdb.exp.
+
+ * lib/gdb.exp: Add GDB_TESTCASE_OPTIONS.
+
+ * config/monitor.exp: Make sure we disconnect from the target.
+ Also, try a reboot/reload cycle instead of failing if the
+ load fails.
+
+Fri Mar 7 13:48:30 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/default.exp: Don't set match_max.
+ * gdb.base/help.exp: Ditto.
+ * gdb.base/list.exp: Ditto.
+ * gdb.base/signals.exp: Ditto.
+
+ * config/monitor.exp(gdb_load): If gdb,use_standard_load is
+ set, use remote_ld to download the testcase instead of
+ the GDB loader.
+
+Wed Mar 5 00:00:43 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/vr5000.exp: New file.
+
+ * config/monitor.exp(gdb_target_monitor): Add pattern for
+ "Ending remote" to detect errors in connecting.
+
+ * gdb.base/setshow.exp: Add .* within auto language test.
+
+ * lib/gdb.exp(gdb_run_cmd): Add check for gdb_init_command
+ target feature.
+
+ * config/monitor.exp(gdb_load): Check for a failure when loading,
+ and reboot the board if necessary.
+
+ * gdb.base/setvar.exp(test_set): Handle multiple prints within
+ a set of tests. Remove print.* from the patterns being checked.
+
+Mon Mar 3 11:57:43 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/a1-selftest.exp: Use send_gdb consistently. Don't
+ refer to gdb_spawn_id.
+
+ * config/m32r-stub.exp: Remove references to gdb_spawn_id, no
+ longer used.
+ * config/sparclet.exp: Ditto.
+ * config/sparclet-old.exp: Ditto.
+ * config/slite.exp: Ditto.
+ * config/sim.exp: Ditto.
+ * gdb.base/funcargs.exp: Ditto.
+
+ * lib/gdb.exp:Remove references to gdb_spawn_id.
+ (gdb_expect): Move to remote.exp.
+
+Fri Feb 28 20:47:39 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/monitor.exp: Detect the "Couldn't establish connection"
+ message from GDB.
+
+Tue Feb 25 14:08:55 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/bitfields.exp: Use runto instead of explicit
+ gdb_run_cmd/gdb_expect sequences.
+
+ * gdb.base/break.exp(text_next_with_recursion): Add match for
+ gdb_expect call.
+
+ * config/monitor.exp(gdb_target_monitor): Calling exit loses big.
+ We also need to handle the "A program is being debugged already"
+ prompt from gdb. Use gdb_test to set the baud rate.
+
+ * lib/gdb.exp(gdb_init): Increase the default expect buffer size
+ to 20000. Really. I mean it.
+
+Mon Feb 24 13:23:26 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp(gdb_test): Generate a FAIL message when send_gdb
+ fails. If suppress_flag is set, skip perror message about not
+ being able to send to GDB.
+ (send_gdb): If suppress_flag is set, don't try to send commands to
+ GDB.
+ (gdb_expect): If suppress_flag is set, always fail immediately.
+ (gdb_suppress_tests, gdb_stop_suppressing_tests): New functions.
+ (gdb_init): Call gdb_stop_suppressing_tests.
+ (default_gdb_exit): Ditto.
+ (default_gdb_start): Ditto.
+
+ * gdb.base/bitfields.exp: Call gdb_suppress_tests and
+ gdb_stop_suppressing_tests as appropriate.
+ * gdb.base/break.exp: Ditto.
+ * gdb.base/callfuncs.exp: Ditto.
+ * gdb.base/commands.exp: Ditto.
+ * gdb.base/exprs.exp: Ditto.
+ * gdb.base/funcargs.exp: Ditto.
+ * gdb.base/list.exp: Ditto.
+ * gdb.base/recurse.exp: Ditto.
+ * gdb.base/scope.exp: Ditto.
+ * gdb.base/structs.exp: Ditto.
+ * gdb.c++/inherit.exp: Ditto.
+
+Sun Feb 23 19:56:02 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/vr4300.exp: New file.
+
+ * gdb.*/*.exp: Call gdb_expect instead of expect.
+
+ * lib/gdb.exp(gdb_expect): New function.
+
+Thu Feb 20 13:57:01 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp(gdb_init): New function.
+
+ * gdb.base/setvar.exp(test_set): Don't bother printing a PASS/FAIL
+ for each individual variable set.
+
+ * gdb.base/exprs.exp(test_expr): Make sure each test gets a unique
+ name.
+
+ * gdb.base/help.exp: Fix the syntax of a few gdb_test calls.
+
+ * gdb.base/scope.exp: Use gdb_test.
+
+ * gdb.base/ptype.exp: Don't call "gdb_exit; gdb_start" if we're
+ aborting; the testsuite driver will do that for us (see
+ gdb_finish). Also, use gdb_test in a few more places.
+
+Thu Feb 20 13:32:24 1997 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/help.exp: Fix syntax of "help info all-registers" test.
+
+Thu Feb 20 10:34:21 1997 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.disasm/mn10200.s: Add "nop" after "main" so that "main"
+ and "add_tests" are not at the same address.
+
+Fri Feb 14 18:47:23 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/ptype.exp: Use gdb_test.
+
+Thu Feb 13 16:09:36 1997 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.disasm/mn10200.s (misc_tests): Fix targets for "jsr" insns.
+ * gdb.disasm/mn10200.exp (misc_tests): Remove bogus line accidentally
+ left in. No longer expect them to fail.
+
+ * gdb.stabs/*.mt; Deleted, no longer used.
+ * gdb.stabs/configure.in: Remove references to target makefile
+ frags.
+ * gdb.stabs/configure: Rebuilt.
+
+ * gdb.disasm/*.mt: Deleted, no longer used.
+ * gdb.disasm/configure.in: Remove references to target makefile
+ frags. Use "sh3.s" as the unique filename for this directory.
+ * gdb.disasm/configure: Rebuilt.
+
+ * gdb.disasm/mn10200.s: New test file for mn10200 disassembler.
+ * gdb.disasm/mn10200.exp: Run mn10200 disassembler tests.
+ * gdb.disasm/Makefile.in: Remove "mn10200" when cleaning.
+
+Tue Feb 11 16:57:58 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/udi.exp: Use mondfe,name instead of remote_host.
+
+Tue Feb 11 11:22:36 1997 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/watchpoint.exp: Don't expect a failure when calling
+ a function with a watchpoint enabled on the mn10200.
+
+ * gdb.stabs/weird.exp: Don't quit if "weird.s" doesn't exist
+ before trying to create it!
+
+Mon Feb 10 16:40:47 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/vx.exp: Use hostname instead of netport.
+
+ * config/vxworks.exp: New file.
+
+ * gdb.base/a2-run.exp: Change vxworks cases to use gdb_spawn_id.
+
+ * config/monitor.exp(gdb_target_monitor): Look for a prompt from
+ gdb before assuming everything worked. Send a ^C if a timeout
+ occurs.
+
+ * lib/gdb.exp(gdb_test): Check the result of send_gdb. Use
+ $gdb_spawn_id directly.
+ (gdb_run_cmd): Try _start as well as start. Use the target feature
+ gdb,start_symbol as the symbol to start from when jumping.
+
+Mon Feb 10 11:26:59 1997 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/exprs.exp: Delete bogus/incorrect (and probably
+ redundant) test.
+
+ * gdb.base/recurse.exp: Relax final value test for 'b' so that
+ it doesn't lose for 16bit integer systems.
+
+Fri Feb 7 09:31:21 1997 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.fortran/types.exp: If the target doesn't support "double"
+ data types, then expect "real" types to only be 4 bytes.
+
+ * gdb.c++/virtfunc.exp: Expect failure for virtual function
+ call tests if the target doesn't support inferior function calls.
+
+ * gdb.base/printcmds.exp: Allow minor deviation in FP values
+ in printf tests.
+
+Thu Feb 6 12:46:14 1997 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/help.exp: Disable "help set", "help show", and
+ "help support". Simplify regexp for "help stack".
+
+ * gdb.base/default.exp: Set match_max to 5000 and the timeout
+ to 60 seconds. Temporarily set match_max to 15000 around the
+ "info copying" test.
+
+ * gdb.base/nodebug.exp: Don't try to do an inferior function
+ call if the target doesn't support them.
+ * gdb.base/printcmds.exp: Likewise.
+ * gdb.base/setvar.exp: Likewise.
+ * gdb.base/structs.exp: Likewise.
+ * gdb.c++/templates.exp: Likewise.
+ * gdb.base/ptype.exp: Likewise. Remove UDI specific stuff.
+
+ * gdb.base/recurse.exp: Enable for the mn10200.
+
+ * configure.in: Do configure gdb.stabs directory for *-*-elf
+ targets.
+ * configure: Rebuilt.
+
+ * gdb.base/break.exp: Check for gdb,noresults before testing
+ exit status and/or results from the target.
+ * gdb.base/watchpoint.exp, gdb.base/langs.exp: Likewise.
+ * lib/gdb.exp: Remove old (now bogus) initialization of
+ noinferior, noargs, noresults and nosignals.
+
+Tue Feb 4 21:52:17 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/sh.exp: New file.
+
+ * config/slite.exp: Try to connect multiple times to the board
+ before rebooting. Only send a "monitor run" if need_monitor_run
+ is set.
+
+ * gdb.base/break.exp: Don't do the "stub continue" test if
+ the target has gdb_stub set.
+
+ * gdb.base/callfuncs.exp: Increase the timeout.
+
+ * gdb.base/interrupt.exp: Don't even try to compile the testcase
+ if the target has gdb,noinferiorio set.
+
+ * gdb.base/list.exp: Increase match_max to 10000 characters.
+
+ * gdb.base/sigall.exp: Check for gdb,nosignals on the target.
+
+ * gdb.base/watchpoint.exp: Check for gdb,noinferiorio on the
+ target.
+
+ * lib/gdb.exp(gdb_run_cmd): Fix for targets that use stubs.
+
+Mon Feb 3 12:09:37 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/a1-selftest.exp: Make sure we call gdb_exit before
+ trying to delete the copy of gdb. Catch the file delete so we
+ don't die if the delete fails; also, the file should be copied to
+ the host, not to the build.
+
+Sun Feb 2 00:55:14 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * lib/gdb.exp(gdb_test): Surround the result pattern with
+ parenthesis in case it contains multiple regexps separated
+ with |.
+
+ * gdb.base/watchpoint.exp: Use gdb_test.
+ * gdb.base/default.exp: Ditto.
+
+Sat Feb 1 23:51:01 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.*/*.exp: Replace $prompt with $gdb_prompt.
+
+ * gdb.base/scope.exp: Use gdb_test.
+ * gdb.c++/classes.exp: Ditto.
+ * gdb.c++/inherit.exp: Ditto.
+
+Fri Jan 31 13:09:12 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/crossload.exp: Don't use execute_anywhere, use
+ remote_exec instead.
+ * gdb.base/corefile.exp: Don't be ridiculous.
+ * gdb.base/*.c: Add missing stub invocations.
+
+Thu Jan 30 16:49:25 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * config/slite.exp: Miscellaneous fixes.
+
+ * lib/gdb.exp: Fix runto.
+
+ * gdb.base/signals.exp: Check for a gdb,nosignals feature of
+ the target.
+
+ * gdb.base/watchpoint.exp: Fix regexp.
+
+ * lib/gdb.exp(default_gdb_exit): Add a catch to the
+ close and wait commands, as the descriptor may now be
+ invalid. Always call "remote_close host".
+
+Tue Jan 28 14:42:31 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ Major rewrite for testsuite revision.
+
+ * lib/gdb.exp: Remove references to global CC, CXX, B_OPTIONS,
+ TARGET_INCLUDES, LDFLAGS and target_alias. Use gdb_spawn_id
+ instead of relying on spawn_id to always contain a valid
+ spawn id.
+ (get_compiler_info): New procedure to build the ${binfile}.ci
+ file, instead of replicating this in N different places.
+ (gdb_compile): New procedure.
+
+ gdb.*/*.exp: Use gdb_compile and get_compiler_info (with
+ appropriate arguments) instead of compile. Use gdb_test in a lot
+ more places. Use send_gdb instead of send. Always run gdb_start
+ at the start of a testcase, as this is no longer done magically.
+
+ config/*-gdb.exp: Rename without the -gdb suffix.
+
+ config/mips.exp: Use remote_close instead of exit_remote_shell.
+ config/monitor.exp: Use target_info instead of looking at
+ baud, timeout, etc.
+ config/sim.exp: Use gdb_spawn_id instead of relying on spawn_id.
+
+Sat Dec 14 00:43:57 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.c++/templates.exp (test_ptype_of_templates),
+ gdb.c++/inherit.exp (test_ptype_si, test_print_anon_union):
+ Update expect patterns for destructors and assignment operators
+ to match corresponding c-typeprint.c changes.
+ * gdb.c++/templates.exp (test_template_breakpoints): Revert change
+ to destructor breakpoint test, GDB should be able to set the
+ destructor breakpoint without specifying arguments.
+
+Tue Dec 3 20:17:52 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.threads/pthreads.exp: Change result for failure to compile due
+ to lack of pthreads runtime support from an error to simply an
+ unsupported test, per dejagnu standards.
+
+Sun Dec 1 00:18:59 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * lib/gdb.exp (gdb_test): Simplify expect pattern for the case
+ where GDB exits to reduce pattern match time.
+ (skip_chill_tests): Skip chill tests for mips*-sgi-irix6*.
+
+ * gdb.base/nodebug.exp: Add mips*-sgi-irix6* xfails.
+
+Tue Nov 26 18:29:23 1996 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/callfuncs.exp: Turn on function call tests for h8300.
+ * gdb.base/default.exp: ditto.
+ * gdb.base/nodebug.exp: ditto.
+ * gdb.base/printcmds.exp: ditto.
+ * gdb.base/ptype.exp: ditto.
+ * gdb.base/setvar.exp: ditto.
+ * gdb.base/structs.exp: ditto.
+ * gdb.base/setshow.c: Guard against uninitialized values of argc.
+
+Tue Nov 26 17:23:28 1996 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure, */configure: Rebuild with autoconf 2.12.
+
+Sat Nov 23 13:32:15 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/a1-selftest.exp: Change x86 linux setup_xfails to
+ use new i*86-pc-linux*-gnu quads.
+ * gdb.base/corefile.exp: Ditto.
+ * gdb.base/signals.exp: Ditto.
+ * gdb.base/sigall.exp: Ditto.
+ * gdb.base/interrupt.exp: Ditto.
+
+ * gdb.base/signals.exp (signal_tests_1): Remove setup_xfail
+ "i*86-*-linux" for "signal SIGUSR1". Now works, at least with
+ RedHat 4.0.
+
+ * gdb.threads/pthreads.c (_MIT_POSIX_THREADS): Define if target is
+ linux. This allows the test case to at least compile on latest
+ linux, but still not run due to missing the threads runtime library.
+
+Fri Nov 22 10:13:29 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/a1-selftest.exp (do_steps_and_nexts): Reinitialize source
+ directory to search gdb directory. Accept and step over conditional
+ stack alignment code. Consume $prompt in failure cases.
+ Reset timeout to $oldtimeout instead of some arbitrary value.
+ * gdb.base/nodebug.exp: Limit backtrace to 10 frames to avoid
+ timeout problems with infinite stack backtraces.
+ * gdb.base/ptype.exp (ptype struct link, union tu_link):
+ Accept function parameters for linkfunc member.
+
+Thu Nov 21 09:17:19 1996 Fred Fish <fnf@cygnus.com>
+
+ * lib/gdb.exp (CFLAGS): Remove, unreferenced.
+ (CXXFLAGS): Remove, unreferenced.
+ (B_OPTIONS): Add for -B options and add code to initialize with
+ previous -B options and also add -B option to pick up cross compiled
+ runtime.
+ (TARGET_INCLUDES): Add for -I options and add code to initialize when
+ doing cross compiles.
+ (target_alias): Declare global.
+ (xgcc): Set variable to full path of gcc in build tree. Use findfile
+ to verify that gcc exists in build tree, and if so set CC to that
+ gcc and to use B_OPTIONS and TARGET_INCLUDES.
+
+Tue Nov 12 16:20:13 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.c++/inherit.exp (test_print_anon_union): Reenable
+ ptype test for anonymous union. Fixup testcase to match
+ current gcc debug output.
+
+Mon Nov 11 14:12:06 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/funcargs.c: Use cast rather than "UL" suffix to
+ force argument to an unsigned long type.
+
+Mon Nov 11 10:27:55 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.c++/inherit.exp (test_ptype_si): Fix tagless struct ptype
+ tests and anonymous union print/ptype tests.
+ * gdb.base/list.exp (test_forward-search): Increase timeout by
+ 5 minutes for the "search extremely long line" case.
+ * lib/gdb.exp (gdb_test): Document that the third arg to gdb_test is
+ completely optional and that the pass/fail messages use the command as
+ the message if that third arg is a null string.
+ (gdb_test_exact): Arrange that a null string pattern means match a
+ null string output rather than any output, which might include random
+ errors.
+ * gdb.base/mips_pro.exp: Add "mips*-sgi-irix4*" xfail for
+ backtrace test.
+ * gdb.c++/demangle.exp: Add a "*-*-*" xfail for test that was
+ always failing and failure is now exposed by gdb.exp changes.
+
+Sat Nov 9 11:13:24 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.c++/inherit.exp (test_ptype_vi): Log some passes that
+ weren't being noted.
+
+Sat Nov 9 01:05:10 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/corefile.exp: Consume $prompt in mmap fail cases.
+ * gdb.stabs/weird.exp: Remove v_comb xfails.
+
+Tue Nov 5 10:44:23 1996 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/[bitfields.exp crossload.exp funcargs.exp interrupt.exp
+ list.exp scope.exp watchpoint.exp]
+ Make all timeout error msgs explicitly say "(timeout)".
+
+Mon Nov 4 12:03:06 1996 Michael Snyder <msnyder@cygnus.com>
+
+ * config/monitor.exp: Increase download timeout to 1000 seconds.
+
+Mon Nov 4 12:02:26 1996 Michael Snyder <msnyder@cygnus.com>
+
+ * config/m32r.exp: Increase timeout to 120 seconds.
+
+Sun Nov 3 14:37:05 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.c++/classes.exp: Modify to handle current gcc C++ member ordering
+ and accept older ordering as obsolescent gcc or gdb.
+ * gdb.c++/templates.exp: Ditto.
+ * gdb.c++/virtfunc.exp: Ditto.
+
+Fri Nov 1 11:56:09 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/coremaker.c: Add code to mmap some data so we
+ can check that it ends up in the core file.
+ * gdb.base/corefile.exp: Add test to read mmapped data
+ from core file.
+
+Wed Oct 30 18:19:16 1996 Michael Snyder <msnyder@cygnus.com>
+
+ * config/m32r.exp: New file.
+
+Mon Oct 21 14:40:50 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * testsuite/gdb.base/nodebug.exp: Whack out -g options by hand so
+ that cflags can contains -gstabs, and work correctly for other tests.
+
+Mon Oct 21 14:00:37 1996 Michael Snyder <msnyder@cygnus.com>
+
+ * gdb.base/setshow.exp: New file, tests show and set.
+ * gdb.base/setshow.c: New file, tests show and set.
+ * gdb.base/help.exp: Add test for help set|show annotate.
+ * gdb.base/default.exp: Add test for set|show annotate.
+
+Wed Oct 16 19:03:54 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * testsuite/gdb.base/break.exp: Make backtrace from factorial
+ errors unique.
+ * testsuite/gdb.base/nodebug.exp: Whack out all -g options
+ explicitly.
+
+Tue Oct 15 16:45:02 1996 Stu Grossman (grossman@critters.cygnus.com)
+
+ * config/sim-gdb.exp (gdb_target_sim): Remove setting of height
+ and width commands. This is done elsewhere.
+ * (gdb_start): Don't call gdb_start_sim here. That's already
+ done in gdb_load. This fixes lots of failures in default.exp.
+
+Sun Oct 13 10:40:23 1996 Fred Fish <fnf@cygnus.com>
+
+ From Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>:
+ * gdb.base/mips_pro.exp: Fix misplaced gdb_exit/gdb_start/gdb_load.
+ * lib/gdb.exp (gdb_test): Treat failures due to program exiting
+ in the same we we treat other failures (since it may be an expected
+ condition), rather than as an error.
+ * gdb.base/signals.exp (test_handle_all_print): Revert back to
+ old test format.
+
+Fri Oct 11 17:05:22 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (clean mostlyclean): Also remove chill *.grt files.
+ (distclean maintainer-clean realclean): No need to remove files
+ twice. Nuke the duplicates.
+ * gdb.base/Makefile.in (EXECUTABLES): Add "structs".
+ * gdb.threads/Makefile.in (distclean maintainer-clean realclean):
+ Remove config.h along with other config files.
+
+Mon Sep 30 20:16:22 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/interrupt.exp: Add i*86-*-linux* setup_xfail for
+ "p func1 ()" and note that rests of tests are skipped.
+ * gdb.base/corefile.exp: Add i*86-*-linux* and m68*-*-hpux*
+ setup_xfails for "print func2::coremaker_local".
+ Add i*86-*-linux* setup_xfail for "backtrace in corefile.exp".
+ * gdb.base/mips_pro.exp: Restart gdb in this test so it isn't
+ affected by the previous run test.
+ * gdb.chill/misc.exp: Add m68*-*-hpux* setup_xfails for
+ "print array () ubyte (foo)" and "print/x array () byte (\$i)"
+ * gdb.chill/pr-8742.exp: Add m68*-*-hpux* setup_xfails for
+ "pass int powerset tuple" and "pass modeless int powerset tuple".
+ * gdb.chill/tests2.exp: Add m68*-*-hpux* setup xfails for
+ "real write 4" and "real write 8".
+ * gdb.shill/tuples.exp: Add i*86-*-linux* and m68*-*-hpux*
+ setup_xfails for "print vs1 after tuple assign 2",
+ "print \$i after tuple assign 2", and
+ "print vs2 after tuple assign 2".
+ * lib/gdb.exp (gdb_test): When a gdb aborts, print a more
+ meaningful error message and return -1 so the caller can
+ suppress further tests and avoid a cascade of errors.
+
+Fri Sep 27 10:34:51 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/a1-selftest.exp: Tweak tests to account for new
+ format for printing version.
+ * gdb.base/default.exp: Ditto.
+ * gdb.base/interrupt.exp: Fix problem with cascade of
+ errors if child process dies while calling a function.
+
+Fri Sep 13 21:43:48 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (VPATH): Add
+ * Makefile.in (Makefile, config.status): Fix rules so things get
+ remade when necessary.
+
+Fri Sep 13 18:16:10 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (just-check): Add path to sibling expect dir
+ to environment variable specified by RPATH_ENVVAR.
+
+Fri Sep 13 12:05:34 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (RPATH_ENVVAR): New var, set to @RPATH_ENVVAR@.
+ (just-check): Add shared library paths for libstdc++, tk,
+ tcl, bfd, and opcodes to the environment variable specified
+ in RPATH_ENVVAR.
+ * configure.in: Add support to recognize --enable-shared flag
+ and generate correct value for RPATH_ENVVAR.
+ * configure: Regenerated with autoconf.
+
+Mon Sep 2 06:36:02 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/break.exp: Expand "Delete all breakpoints" xfail to
+ include all osf versions.
+ * gdb.threads/pthreads.exp: Expand "run to main" xfail to include
+ all osf versions. Add -D_MIT_POSIX_THREADS to compilation command
+ when target is linux. When failing to build pthreads test
+ executable, give more meaningful message.
+ * gdb.threads/pthreads.c: Hpux also uses old definition of second
+ arg for pthread_create.
+
+Mon Aug 19 09:58:59 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.threads/pthreads.c (PTHREAD_CREATE_ARG2,
+ PTHREAD_CREATE_NULL_ARG2): Accomodate old pthreads implementations.
+ * gdb.threads/pthreads.exp: Try linking with both -lpthread (Solaris)
+ and -lpthreads (everybody else).
+ (test_startup): Fail gracefully if threads are not supported.
+ * gdb.base/nodebug.exp: Add setup_xfail hppa*-*-hpux* for
+ "p/c array_index("abcdef",2)" when not gcc compiled.
+ * gdb.base/corefile.exp: Add setup_xfail hppa*-*-hpux* for
+ "print func2::coremaker_local" when not gcc compiled.
+ * gdb.base/opaque.exp: Remove setup_xfail hppa*-*-hpux* for
+ "ptype on opaque struct tagname (statically)",
+ "ptype on opaque struct tagname (dynamically) 1", and
+ "ptype on opaque struct tagname (dynamically) 2"
+ for not compiled with gcc.
+ * gdb.base/mips_pro.exp: Only do setup_xfail hppa*-*-* for
+ backtrace when compiled with gcc.
+ * lib/gdb.exp (runto_main): Return result of "runto main" rather
+ than always return success.
+
+Sat Aug 17 13:28:00 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.c++/virtfunc.exp: Remove setup_xfail for "mips-*-irix5*".
+
+Tue Aug 13 10:26:10 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/structs.exp: Undo last change.
+
+Mon Aug 12 15:29:08 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/a1-selftest.exp (do_steps_and_nexts): New routine to
+ encapsulate all the steps/nexts done during self test, starting
+ at main, and makes them less sensitive to optimization issues.
+ Add "hppa*-*-hpux*" to setup_xfail for "backtrace through
+ signal handler" test.
+ * gdb.threads/pthreads.exp: Only run this for native configs.
+ * gdb.base/structs.exp (do_function_calls): Add hppa*-*-hpux9*"
+ setup_xfails for "p fun5()", "p fun6()", "p fun7()", and "p fun8"
+ tests.
+ gdb.c++/virtfunc.exp (do_tests): Add "mips-*-irix5*" setup_xfail
+ for "runto test_calls(void)" test.
+
+Sun Aug 11 13:11:24 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/term.exp: Set 7-bit strings, address off, width to 0,
+ and don't expect address info in breakpoint confirmations.
+
+Wed Aug 7 20:47:43 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/list.exp (test_forward_search): Increase timeout
+ temporarily by 60 seconds for searching extremely long line,
+ and then reset to old value when done. Increase expect input
+ buffer to 10000.
+
+Wed Aug 7 15:34:22 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/list.exp (test_forward_search): Fix to handle very
+ long source line without overflowing expect's input buffer.
+
+Wed Aug 7 12:03:25 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * config/slite-gdb.exp (gdb_start): Use "full_buffer", not
+ "buffer_full".
+
+ * config/nind-gdb.exp (gdb_start): Use "full_buffer", not
+ "buffer_full".
+
+ * config/mips-gdb.exp (gdb_start): Use "full_buffer", not
+ "buffer_full".
+
+ * lib/gdb.exp (gdb_test): Correct pattern is "full_buffer", not
+ "buffer_full".
+
+Wed Aug 7 11:05:47 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure.in (configdirs): Add gdb.threads.
+ * configure: Regenerated with autoconf.
+ * gdb.threads/{config.in, pthreads.c, pthreads.exp}: New.
+ * gdb.threads/{Makefile.in, configure.in}: Complete rewrites.
+ * gdb.threads/configure: New, generated with autoconf.
+
+Tue Aug 6 10:23:04 1996 Tom Tromey <tromey@rtl.cygnus.com>
+
+ * lib/gdb.exp (gdb_test_exact): Turn \n in pattern into \r\n.
+
+Mon Aug 5 18:11:53 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/signals.exp (test_handle_all_print): Test separately for
+ each signal's status in the output of "handle all print".
+ * lib/gdb.exp (gdb_test): Document that the pattern must NOT include
+ the \r\n sequence that immediately precedes the gdb prompt.
+ * gdb.base/a1-selftest.exp: Save original timeout and restore
+ after test.
+
+Sun Aug 4 10:20:50 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.disasm/hppa.s: Export fmemLRbug_tests_4 as a ST_CODE
+ symbol.
+
+Fri Aug 2 17:37:26 1996 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * config/vx-gdb.exp (gdb_start): Fix syntax of `$shell_id < 0'.
+
+Thu Jun 27 20:41:40 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/signals.exp (test_handle_all_print): Temporarily increase
+ timeout by 60 seconds.
+
+Thu Jun 27 18:13:57 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/unix-gdb.exp: Increase default timeout from 30 to 60 sec.
+ * config/netware.exp (gdb_run_cmd): Restore old timeout before doing
+ error return.
+
+Thu Jun 27 10:54:58 1996 Fred Fish <fnf@cygnus.com>
+
+ * lib/gdb.exp (default_gdb_start): When reporting a timeout during
+ gdb initialization, also report how long dejagnu waited. Restore
+ old timeout before doing error return. Temporarily increase timeout
+ by 3 minutes to allow for slow startups over heavy NFS use.
+
+Tue Jun 25 19:59:17 1996 Fred Fish <fnf@cygnus.com>
+
+ * lib/gdb.exp: Report timeout value for verbosity level 2.
+ * config/gdbserver.exp: Ditto.
+ * config/hppro.exp: Ditto.
+ * config/mips-gdb.exp: Ditto.
+ * config/monitor.exp: Ditto.
+ * config/netware.exp: Ditto.
+ * config/sim-gdb.exp: Ditto.
+ * config/slite-gdb.exp: Ditto.
+ * config/udi-gdb.exp: Ditto.
+ * config/unix-gdb.exp: Ditto.
+ * config/vx-gdb.exp: Ditto.
+ * gdb.base/a1-selftest.exp: Ditto.
+ * gdb.base/a2-run.exp: Ditto.
+ * gdb.base/break.exp: Ditto.
+ * gdb.base/corefile.exp: Ditto.
+ * gdb.base/list.exp: Ditto.
+ * gdb.base/recurse.exp: Ditto.
+ * gdb.base/scope.exp: Ditto.
+ * gdb.base/signals.exp: Ditto.
+
+Tue Jun 25 23:16:58 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
+
+ * gdb.threads/Makefile.in (docdir): Removed.
+
+Tue Jun 25 17:02:39 1996 Jason Molenda (crash@godzilla.cygnus.co.jp)
+
+ * configure.in (AC_PREREQ): autoconf 2.5 or higher.
+ * gdb.{base,c++,chill,disasm,stabs}/Makefile.in (VPATH): set to
+ @srcdir@.
+ * gdb.{base,c++,chill,disasm,stabs}/configure.in (AC_PREREQ):
+ autoconf 2.5 or higher.
+ * gdb.{base,c++,chill,disasm,stabs}/configure: Rebuilt.
+
+Thu Jun 13 11:16:10 1996 Tom Tromey <tromey@thepub.cygnus.com>
+
+ * configure: Regenerated.
+ * aclocal.m4 (CY_AC_PATH_TCLH, CY_AC_PATH_TKH): Use odd names to
+ avoid name clashes with SunOS headers.
+
+Wed Jun 5 16:43:27 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.c++/virtfunc.exp: Search $objdir/../../libstdc++ for libstdc++.
+
+Thu May 30 11:35:11 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/callfuncs.exp: Finish last change -- make sure the
+ prototype information ends up in the compiler info file.
+
+Thu May 23 12:48:41 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/callfuncs.exp: Remove the compiler info file prior to
+ attempting to regenerate it. Eliminate use of a temporary file
+ and just generate the info file directly. Source it immediately,
+ for consistency of use.
+ * gdb.base/corefile.exp: Ditto
+ * gdb.base/exprs.exp: Ditto.
+ * gdb.base/funcargs.exp: Ditto.
+ * gdb.base/langs.exp: Ditto.
+ * gdb.base/list.exp: Ditto.
+ * gdb.base/mips_pro.exp: Ditto.
+ * gdb.base/nodebug.exp: Ditto.
+ * gdb.base/opaque.exp: Ditto.
+ * gdb.base/ptype.exp: Ditto.
+ * gdb.base/scope.exp: Ditto.
+ * gdb.base/setvar.exp: Ditto.
+ * gdb.base/signals.exp: Ditto.
+ * gdb.base/whatis.exp: Ditto.
+ * gdb.c++/templates.exp: Ditto.
+ * gdb.c++/virtfunc.exp: Ditto.
+ * gdb.c++/virtfunc.exp: Use contents of gcc_compiled to decide
+ whether or not to add -lstdc++ to the compile command line args.
+
+Sat May 18 02:43:58 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/recurse.exp: Remove setup_xfail for "sparc*-*-sunos4*",
+ it got fixed by the recent lookup_minimal_symbol_by_pc change.
+ Increase timeout, a lot of single stepping might be needed if the
+ target has no hardware watchpoints.
+
+Wed May 15 08:47:42 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/break.exp: Ignore compiler warnings when compiling
+ break.c.
+ * gdb.base/callfuncs.exp: Don't run these tests on the h8300.
+ * gdb.base/default.exp: Add h8300 xfails. Handle messages
+ from remote-sim.
+ * gdb.base/exprs.exp: Add h8300 xfails.
+ * gdb.base/funcargs.exp: Likewise.
+ * gdb.base/nodebug.exp: Likewise.
+ * gdb.base/printcmds.exp: Likewise.
+ * gdb.base/ptype.exp: Likewise.
+ * gdb.base/setvar.exp: Handle sizeof (int) != 4 for h8300. Add
+ h8300 xfails.
+ * gdb.base/return.exp: Handle float/double precision problems
+ on the h8300.
+ * gdb.base/funcargs.c: Explicitly make last constant argument to
+ call_after_alloca_subr an unsigned long type.
+ * gdb.base/return.c: Include stdio.h.
+
+Tue May 7 22:01:12 1996 Rob Savoye <rob@chinadoll.cygnus.com>
+
+ * config/abug.exp: New file for the older Motorola Bug monitor
+ that runs on the mvme13x series VME boards.
+ * config/monitor.exp: Use the new config array for target settings
+ if they exist.
+
+Fri May 3 16:02:55 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * sim-gdb.exp: Make the SH simulator allocate less space when
+ it is targeted.
+
+Thu May 2 12:31:56 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/mips_pro.exp: Expect failure for hppa*-*-* in backtrace
+ test.
+
+Wed Mar 20 08:48:03 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/list.exp (test_list_function): Remove setup_xfail for
+ "rs6000-*-*" for "list function in include file" when gcc compiled.
+ * gdb.base/printcmds.exp: Remove setup_xfail for "rs6000-*-aix*"
+ for "p ctable1[120]".
+ * gdb.base/scope.exp: Remove setup_xfail for "rs6000-*-*" for
+ "print 'scope0.c'::filelocal_bss before run" when gcc compiled.
+ Remove setup_xfail for "rs6000-*-*" for
+ "print 'scope0.c'::filelocal before run".
+ * gdb.base/{langs.exp, lists.exp, opaque.exp, scope.exp},
+ gdb.stabs/weird.exp: Remove use of compiler options "-c -o ..."
+ since some compilers don't allow both options to be given
+ on the same command line. Create object file and move it.
+
+Tue Mar 19 23:49:31 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/corefile.exp: Always regenerate the core file, since
+ we always regenerate the coremaker program. Detect special case
+ where registers cannot be read from core file.
+
+Tue Mar 19 16:52:49 1996 Fred Fish <fnf@cygnus.com>
+
+ From Peter Schauer <Peter.Schauer@Regent.E-Technik.TU-Muenchen.DE>
+ * gdb.base/funcargs.c: Patch for SPARCworks alloca compatibility
+ * gdb.c++/templates.exp: Only match on basename of file since
+ some formats like xcoff don't encode directory information.
+ * gdb.stabs/weird.exp: Use the right sed script for powerpc
+ and rs6000 AIX xcoff targets.
+ * configure.in: Add stabsdirs to configdirs for powerpc-*-aix*.
+ * configure: Regenerate.
+ * gdb.base/Makefile.in (clean): Remove generated file twice-tmp.c
+ here, rather than in distclean.
+
+Sun Mar 17 13:35:31 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/mips_pro.exp: Create mips_pro.ci to get gcc_compiled
+ defined, and use it to compile the test case with -O2. The
+ native compilation still uses no optimization.
+ * gdb.base/mips_pro.c: Remove inline assembly code since
+ it is compiled PIC by default, which results in assembler
+ warnings that make the testsuite think the compilation
+ was unsuccessful.
+
+Sat Mar 16 15:02:24 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.c++/misc.exp: Add note to message for
+ "print s.a for foo struct" that this is a known gcc 2.7.2
+ and earlier bug.
+
+Fri Mar 15 17:49:57 1996 Fred Fish (fnf@cygnus.com)
+
+ * gdb.base/break.exp: Fix pattern for matching "Delete all
+ breakpoints (y or n) ". Add "mips-dec-ultrix*" to
+ setup_xfail for deleting all breakpoints test. Fix various
+ timeout messages to include "(timeout)".
+ * gdb.base/callfuncs.exp: Add "i*86-*-sysv4*" to setup_xfail
+ for "p t_float_values2(3.14159,float_val2)".
+ * gdb.base/funcargs.exp: Remove "mips-sgi-irix4*" setup_xfail
+ for "continue to call2g" when gcc compiled.
+ * gdb.base/langs.exp: Remove "i*86-*-sysv4*" setup_xfail for
+ "up to foo in langs.exp", "show language at foo in langs.exp",
+ "show language at cppsub_ in langs.exp", "up to fsub in langs.exp",
+ and "show language at fsub in langs.exp".
+ * gdb.base/list.exp: Remove "*-*-sysv4*" setup_xfail for
+ "list line 1 in include file", "list message for lines past EOF",
+ "list function in include file", "list list0.h:foo", and
+ "list filename:function; nonexistant function".
+ * gdb.base/ptype.exp: Change "i*86-*-sysv4*" setup_xfail for
+ "whatis unnamed typedef'd enum (compiler bug in IBM's xlc)"
+ and "ptype t_char_array" to be for native cc only.
+
+Fri Mar 15 16:17:22 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/corefile.exp: Remove "alpha-dec-osf2*" native compiled
+ setup_xfail for "print coremaker_bss", "print coremaker_ro",
+ "print func2::coremaker_local", and "backtrace in corefile.exp".
+
+Wed Mar 13 14:54:11 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/signals.exp: Remove "alpha-*-osf2*" setup_xfail for
+ "bt in signals.exp". This problem only appears when running
+ the testsuite, and then only intermittently.
+
+Tue Mar 12 15:00:16 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/return.exp (return_tests): Differentiate between
+ two tests of continuing.
+
+Tue Mar 5 14:33:33 1996 Stan Shebs <shebs@andros.cygnus.com>
+
+ * */Makefile.in (maintainer-clean): Remove config.log.
+ * gdb.base/Makefile.in (EXECUTABLES): Replace twice with twice-tmp.
+ * gdb.c++/Makefile.in (PROGS): Add inherit.
+ (clean): Remove *.ci.
+
+Tue Feb 20 16:36:10 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.c++/misc.cc: Add test code from Mike Stump.
+ * gdb.c++/misc.exp: Add test to print s.a, for Mike Stump.
+
+Sun Feb 18 11:39:12 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/signals.exp: Change setup_xfail for "alpha-*-osf2"
+ to "alpha-*-osf2*" and add comment.
+ * gdb.base/a1-selftest.exp (test_with_self): Remove "alpha-dec-osf2*"
+ setup_xfail for "step over execarg initialization" and
+ "step over corearg initialization".
+ * gdb.base/callfuncs.exp (do_function_calls): Restore setup_xfail
+ for "hppa*-*-*", "sparc-*-*", "mips*-*-*", and "alpha-dec-osf2*".
+ * gdb.base/corefile.exp: Add "alpha-dec-osf2*" setup_xfail when not
+ gcc compiled for "print coremaker_bss", "print coremaker_ro",
+ "print func2::coremaker_local", and "backtrace in corefile.exp".
+ * gdb.base/signals.exp: Build and source signals.ci.
+ Change "alpha-dec-osf2*" setup_xfail for "bt in signals.exp"
+ to be for gcc only.
+ * lib/gdb.exp: Move verbose statements outside conditionals.
+
+Sat Feb 17 02:22:14 1996 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/sigall.exp: Remove setup_xfail for irix4. Fixed by
+ Feb 3 procfs.c change.
+
+Fri Feb 16 13:25:31 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/unix-gdb.exp: Remove extraneous newlines from end of file.
+
+Thu Feb 15 08:12:55 1996 Fred Fish <fnf@cygnus.com>
+
+ * config/unix-gdb.exp: Default timeout in UNIX case to 30 seconds, up
+ from dejagnu's apparent default of 10 seconds, which gives random
+ results when running the tests over NFS on moderately loaded systems.
+ * lib/gdb.exp (gdb_run_cmd): Add "(timeout)" in timeout case.
+
+Mon Feb 12 16:50:28 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/callfuncs.exp: Remove setup_xfail for PR 5318. Now fixed.
+ * gdb.base/a2-run.exp: Replace $binfile with $testfile in test
+ result reports.
+
+Fri Feb 9 15:56:51 1996 Fred Fish <fnf@cygnus.com>
+
+ * configure.in (CY_AC_PATH_TCLH): Remove.
+ * configure: Regenerate.
+
+Fri Feb 9 08:21:31 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.c++/Makefile.in (clean): Add missing '{'.
+
+Fri Feb 2 10:19:40 1996 Jeffrey A Law (law@cygnus.com)
+
+ * lib/gdb.exp: Provide a default value for noinferior.
+
+ * lib/gdb.exp: Fix typos (LDLAGS -> LDFLAGS).
+ Load libgloss.exp.
+
+Thu Feb 1 20:20:14 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.disasm/hppa.exp: Compile directly into an executable, use
+ the executable, not the .o to run the tests from.
+
+Wed Jan 31 14:21:09 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/break.exp: Don't test for program exit or exit status
+ if $noresults if nonzero.
+ * gdb.base/langs.exp: Likewise.
+ * gdb.base/watchpoint.exp: Likewise.
+
+ * gdb.base/default.exp: Remove extraneous call to load gdb.exp.
+ * gdb.chill/pr-8405.exp: Move skip_chill_tests check to just before
+ trying to compile the testcase.
+
+Wed Jan 24 23:42:39 1996 Doug Evans <dje@charmed.cygnus.com>
+
+ * gdb.base/interrupt.exp (p func1): xfail sparc64-*-solaris2.
+ * gdb.base/signals.exp (continue to handler): Likewise.
+
+Tue Jan 23 16:28:22 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * gdb.c++/classes.exp: Now = returns false/true, not 1/0.
+
+ * gdb.fortran/exprs.exp: .LT. and .GT. now return .TRUE. or .FALSE..
+
+Tue Jan 23 15:41:57 1996 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/corefile.exp: Recognize "not found" as failure
+ when trying to determine if a core file was generated.
+ If no core file was generate the first time, try again without
+ the ulimit -c to work around braindamaged shells.
+
+Mon Jan 15 09:33:00 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.stabs/configure.in (alpha-*-*,mips-*-*): Replace
+ [] tests with "test" and enclose string in quotes.
+ * gdb.stabs/configure: Rebuild
+
+Thu Jan 11 09:43:14 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ Changes in sync with expect:
+ * aclocal.m4 (CY_AC_PATH_TCLH): Handle Tcl 7.5 and greater.
+ (CY_AC_PATH_TCLLIB): Handle Tcl 7.5 and greater.
+ (CY_AC_PATH_TKH): Handle Tk 4.1 and greater.
+ (CY_AC_PATH_TKLIB): Handle Tk 4.1 and greater. Properly quote
+ argument to AC_REQUIRE.
+ * configure: Regenerated.
+
+Thu Jan 4 08:17:22 1996 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/corefile.exp: When generating a core, discard any
+ error messages about ulimit not found and the "core dumped"
+ message from the shell that runs the coredumper.
+
+Wed Jan 3 01:30:41 1996 Jeffrey A Law (law@cygnus.com)
+
+ * lib/gdb.exp (skip_chill_tests): Skip them on the PA too.
+
+ * gdb.stabs/weird.exp: Use ${target_triplet} to determine
+ which sed script to run. Expect failure for v_comb test
+ on PA targets too.
+
+Sat Dec 30 16:09:04 1995 Fred Fish <fnf@rtl.cygnus.com>
+
+ * gdb.base/corefile.exp: Remove "i*86-*-linux" xfail for
+ "print func2::coremaker_local" and for "backtrace in corefile.exp"
+
+Sat Dec 30 12:59:12 1995 Fred Fish <fnf@cygnus.com>
+
+ * lib/gdb.exp: Fix typo and rewrite skip_chill_tests.
+ * gdb.stabs/weird.exp: Setup "sparc-sun-sunos4*" and
+ "sparc-sun-solaris*" xfails for "p v_comb".
+ * lib/gdb.exp (default_gdb_start): Fix typo.
+ * gdb.base/corefile.exp: Allow "Core was generated by ..."
+ messages to not include the full program name that caused
+ the core dump since some systems (such as solaris) apparently
+ truncate this path to about 80 characters.
+ When generating a core file first try increasing the core file
+ size limit to unlimited since some systems may default it to
+ zero, and it is harmless to try it. Move the test for failing
+ to generate a core file to where it will actually get executed.
+ * gdb.c++/templates.exp (test_ptype_of_templates): Accept
+ new gdb result from g++ debug info improvements and make old
+ pattern obsolescent. Also account for size_t differences
+ (may be int or long).
+ * gdb.base/a1-selftest.exp (test_with_self): Check for case where
+ initialization before function call is placed in the delay slot
+ and thus appears to be skipped over by commands such as "next".
+
+Fri Dec 29 16:09:20 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/a1-selftest.exp (test_with_self): Run without windows.
+
+Wed Dec 6 10:45:42 1995 Jeffrey A. Law <law@sethra.cygnus.com>
+
+ * gdb.base/*.exp: Make ${srcfile} only be the basename of the
+ input source file; fix code to compile test to deal with this
+ convention.
+ * gdb.c++/*.exp: Likewise.
+
+Mon Nov 27 11:40:16 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/signals.exp: Setup "alpha-*-osf2*" xfail for
+ "bt in signals.exp".
+
+Sat Nov 25 20:52:15 1995 Fred Fish <fnf@phydeaux.cygnus.com>
+
+ * gdb.base/a1-selftest.exp: Add alpha-dec-osf2 setup_xfail for
+ "step over execarg initialization" and
+ "step over corearg initialization".
+
+Sat Nov 25 18:20:14 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/ptype.c (main): Declare malloc as a "char *" for systems
+ with sizeof(pointer) > sizeof(int). Avoid "void *" or include files.
+
+Sat Nov 25 11:03:42 1995 Fred Fish <fnf@cygnus.com>
+
+ From Rob Savoye (rob@poseidon.cygnus.com)
+ * Makefile.in, configure.in, gdb.base/{Makefile.in, configure.in},
+ gdb.c++/{Makefile.in, configure.in}, gdb.chill/{Makefile.in,
+ configure.in}, gdb.disasm/{Makefile.in, configure.in},
+ gdb.stabs/{Makefile.in, configure.in}, gdb.threads/{Makefile.in,
+ configure.in}: Major reworking for autoconfig.
+ * aclocal.m4, configure, gdb.base/configure, gdb.c++/configure,
+ gdb.disasm/configure, gdb.stabs/configure, gdb.stabs/default.mt :
+ New files.
+ * config/unix-gdb.exp: Make GDB global.
+ * gdb.base/{a1-selftest.exp, a2-run.exp,bitfields.exp, break.exp,
+ callfuncs.exp, commands.exp, corefile.exp, crossload.exp, exprs.exp,
+ funcargs.exp, interrupt.exp, langs.exp, list.exp, mips_pro.exp,
+ nodebug.exp, opaque.exp, printcmds.exp, ptype.exp, recurse.exp,
+ regs.exp, return.exp, scope.exp, setvar.exp, sigall.exp, signals.exp,
+ term.exp, twice.exp, watchpoint.exp, whatis.exp},
+ gdb.c++/{classes.exp, callfuncs.exp, inherit.exp, misc.exp,
+ templates.exp, virtfunc.exp}, gdb.chill/{callch.exp, chillvars.exp,
+ misc.exp, pr-4975.exp, pr-5016.exp, pr-5020.exp, pr-5022.exp,
+ pr-5646.exp, pr-5984.exp, pr-6292.exp, pr-6632.exp, pr-8134.exp,
+ pr-8136.exp, result.exp, string.exp, tuples.exp},
+ gdb.disasm/{hppa.exp, sh3.exp}, gdb.stabs/weird.exp: Change continues
+ to returns as necessary, arrange for test to compile own testcase
+ executable.
+ * lib/gdb.exp: Changes for testsuite to compile own test cases.
+
+Tue Nov 21 16:15:45 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.c++/classes.exp (test_pointers_to_class_members): Add
+ clear_xfail at end of test which might not call either pass or fail.
+ * gdb.base/a1-selftest.exp: Add i*86-*-linuxaout xfail for
+ "backtrace through signal handler".
+
+Sat Nov 18 04:09:31 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/sigall.exp: Work around OSF/1-3.x kernel bug when
+ continuing from a job control stop signal.
+ * gdb.stabs/alpha.mt: Use $(CFLAGS) when building weird.o.
+
+Wed Nov 15 00:28:03 1995 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/callfuncs.exp: Remove bogus hppa xfails.
+ * gdb.base/corefile.exp: Likewise.
+ * gdb.base/funcargs.exp: Likewise.
+
+Tue Nov 14 15:18:10 1995 Stu Grossman (grossman@cygnus.com)
+
+ * config/hmsirom.exp: Setup for talking to hmsi ROM monitor.
+ * config/monitor.exp: Add support for setting baud rate.
+
+Sat Nov 4 15:35:52 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/a1-selftest.exp: Remove i*86-*-sysv4* and
+ i*86-*-linux* xfails for "backtrace through signal handler".
+ * gdb.base/corefile.exp: Add i*86-*-sysv4* xfail for
+ "print func2::coremaker_local".
+ * gdb.base/break.exp: Add i*86-*-sysv4*, sparc-sun-sunos4,
+ alpha-dec-osf2* xfail for
+ "delete all breakpoints when none".
+
+Wed Nov 1 15:57:16 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/break.exp: Change test that deletes all breakpoints
+ when no user breakpoints are installed. A post 4.15 change
+ causes gdb to no longer prompt in this case.
+
+Tue Oct 31 15:13:43 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/return.exp (return_tests): Change xfail for test
+ "correct value returned double test" to stop xfailing at
+ Solaris 2.5. Apparently the bug has been fixed.
+
+Sun Oct 29 12:18:16 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.stabs/ecoff.sed: Remove comment lines except for first one.
+ IRIX 4.0 /bin/sed chokes on them, though they work fine elsewhere.
+
+Tue Oct 24 11:12:12 1995 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.disasm/hppa.exp: Test lci and syncdma instructions.
+ * gdb.disasm/hppa.s: Corresponding changes.
+
+Wed Oct 18 11:27:47 1995 Jeffrey A Law (law@cygnus.com)
+
+ * gdb.base/configure.in (hppa*-*-hpux*): No longer needs target
+ makefile fragment.
+ * config/mt-hpux: Deleted.
+
+Tue Oct 17 23:02:12 1995 Jeffrey A Law (law@cygnus.com)
+
+ * Many files: When warning about suppressed tests due to a
+ nonexistant test binary, avoid incrementing the warning count.
+
+Tue Oct 10 11:00:41 1995 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (TARGET_FLAGS_TO_PASS): Remove BISON.
+
+Sun Oct 8 04:23:14 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/return.exp: Change xfail from "sparc-*-solaris2.*" to
+ "sparc-*-solaris2*".
+
+Sat Sep 23 01:22:23 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/coremaker.c: Produce a full core dump for AIX targets.
+ Add global and local variables and initialize them.
+ * gdb.base/corefile.exp: Test correct mapping of corefile sections
+ by printing variables. Remove rs6000 and powerpc xfails, BFD now
+ extracts the file name and terminating signal from the core file.
+ * TODO: Remove note about tests for correct mapping of corefile.
+ * gdb.base/ptype.c (main): Use boolean2 to inhibit AIX 4.1 xlc
+ from optimizing it away.
+ * gdb.stabs/weird.exp: Remove rs6000 xfail, xcoffread.c now
+ handles common blocks.
+
+Thu Sep 21 01:28:10 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/sh3.s (fmac): Update for new assembler syntax
+ * gdb.disasm/sh3.exp (fmac): Corresponding changes.
+
+Wed Sep 20 13:15:05 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in (maintainer-clean): New target, synonym for
+ realclean.
+ * gdb.base/Makefile.in (maintainer-clean): Likewise.
+ * gdb.c++/Makefile.in (maintainer-clean): Likewise.
+ * gdb.chill/Makefile.in (maintainer-clean): Likewise.
+ * gdb.disasm/Makefile.in (maintainer-clean): Likewise.
+ * gdb.stabs/Makefile.in (maintainer-clean): Likewise.
+ * gdb.threads/Makefile.in (maintainer-clean): Likewise.
+
+Sun Sep 10 13:14:01 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/scope.exp (text_at_main): Add "hppa*-*-hpux*"
+ xfails when not gcc compiled for "print foo::funclocal".
+ (test_at_foo): Add "hppa*-*-hpux*" xfails when not gcc compiled for:
+ "print foo::funclocal at foo",
+ "print 'scope1.c'::foo::funclocal at foo",
+ "print foo::funclocal_bss at foo",
+ "print 'scope1.c'::foo::funclocal_bss at foo",
+ "print foo::funclocal_ro at foo",
+ "print 'scope1.c'::foo::funclocal_ro at foo",
+ "print bar::funclocal at foo" and
+ "print 'scope1.c'::bar::funclocal at foo".
+ (test_at_bar): Add "hppa*-*-hpux*" xfails when not
+ gcc compiled for "print foo::funclocal at bar".
+ Expand all messages to ensure that they identify that
+ the test is at bar().
+ * gdb.base/opaque.exp: Add "hppa*-*-hpux*" xfails when not
+ gcc compiled for:
+ "ptype on opaque struct pointer (statically)",
+ "ptype on opaque struct tagname (statically)",
+ "ptype on opaque struct pointer (dynamically) 1",
+ "ptype on opaque struct tagname (dynamically) 1",
+ "ptype on opaque struct pointer (dynamically) 2" and
+ "ptype on opaque struct tagname (dynamically) 2
+ * gdb.base/nodebug.exp: Add "hppa*-*-hpux*" xfails when not
+ gcc compiled for:
+ "p datalocal"
+ "whatis datalocal",
+ "ptype datalocal",
+ "p bsslocal",
+ "whatis bsslocal", and
+ "ptype bsslocal".
+ * gdb.base/langs.exp: Add "hppa*-*-hpux*" xfails for
+ "backtrace in langs.exp" and "up to langs0__2do in langs.exp"
+ when not gcc compiled.
+ * gdb.base/funcargs.exp (float_and_integral_args): Add
+ "hppa*-*-hpux*" xfail for "run to call2a" when not gcc
+ compiled.
+ (discard_and_shuffle): Add "hppa*-*-hpux*" xfail for
+ "backtrace from call6a" when not gcc compiled.
+ (shuffle_round_robin): Add "hppa*-*-hpux*" xfail for
+ "backtrace from call7a" when not gcc compiled.
+ * gdb.base/callfuncs.exp (do_function_calls):
+ Add "hppa*-*-hpux*" xfail when not gcc compiled for
+ "p t_char_array_values(char_array_val2,char_array_val1)",
+ "p t_char_array_values(char_array_val1,char_array_val2)",
+ "p t_char_array_values("carray 1","carray 2")",
+ "p t_char_array_values("carray 1",char_array_val2)",
+ "p t_char_array_values(char_array_val1,"carray 2")",
+ "p sum_args(1,{2})",
+ "p sum_args(2,{2,3})",
+ "p sum_args(3,{2,3,4})",
+ "p sum_args(4,{2,3,4,5})"
+ * gdb.base/corefile.exp: Add "hppa*-*-hpux*" xfail for
+ "backtrace in corefile.exp" when not gcc compiled.
+
+Sat Sep 9 01:35:39 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/signals.exp: Rewrite `handle all print' test as
+ a procedure. Accept blanks or TABs as whitespace, increase
+ timeout and expect input buffer size for the large output
+ from the command. Remove "i*86-*-bsdi2.0" xfail.
+
+Sat Sep 2 06:41:26 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/setvar.exp: Add new testcases for truncation when
+ assigning invalid values to bitfields.
+
+Sat Sep 2 00:17:31 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/callfuncs.exp (do_function_calls): Remove
+ mips-sgi-irix* xfail for
+ "call inferior func with struct - returns char *"
+ and fix test so that an optional (unsigned char *) cast is
+ accepted in the result.
+
+Fri Sep 1 13:42:01 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/funcargs.exp (float_and_integral_args): Remove
+ sparc-sun-solaris2* xfail for "print f1 after run to call2a".
+ * gdb.c++/Makefile.in (SUFFIXES): Add .SUFFIXES and ".cc" suffix.
+ * gdb.base/signals.exp: Remove duplicate "handle all print" test
+ that accidentally got checked in.
+
+Sun Aug 27 23:35:35 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/callfuncs.exp (do_function_calls): Add alpha-dec-osf2*
+ clear_xfail for "p t_float_values2(3.14159,float_val2)" for gcc
+ compiled test.
+ * gdb.base/opaque.exp (setup_xfail_on_opaque_pointer):
+ Add mips-sgi-irix5* xfail for not gcc compiled.
+ * gdb.base/Makefile.in (nodebug.o): Also create nodebug.ci.
+ * gdb.base/nodebug.exp: Add mips-sgi-irix5 xfail when not gcc compiled for
+ "p top", "whatis top", "p middle", and "whatis middle".
+ * gdb.base/whatis.exp: Add mips-sgi-irix* xfail for
+ "whatis signed char" for not gcc compiled.
+ * gdb.base/setvar.exp: Add mips-sgi-irix4* xfail (works on irix5) for
+ "set variable signed char=-1 (-1)" and
+ "set variable signed char=0xFF (0xFF)" for not gcc compiled.
+ * gdb.base/funcargs.exp (float_and_integral_args):
+ Add mips-sgi-irix5* xfail for "run to call2a" for not gcc compiled.
+ Add mips-sgi-irix* xfail when not gcc compiled for
+ "continue to call2b".
+ Add mips-sgi-irix4* xfail (works with irix5) when gcc compiled for
+ "continue to call2g".
+ (discard_and_shuffle): Add mips-sgi-irix5* xfail whn not gcc compiled for
+ "backtrace from call6a"
+ (shuffle_round_robin): Add mips-sgi-irix* xfail when not gcc compiled for
+ "backtrace from call7k".
+ Add mips-sgi-irix5* xfail when not gcc compiled for
+ "backtrace from call7a".
+ (localvars_after_alloca): Fix gdb_test cmds for
+ "print * after runto ...".
+ Remove rs6000-*-* xfails for
+ "print i after runto localvars_after_alloca" and
+ "print l after runto localvars_after_alloca"
+ for all compilers.
+ * gdb.base/exprs.exp: Add mips-sgi-irix4* xfails (works with irix5),
+ when not compiled with gcc, for:
+ "print signed char == (minus)",
+ "print signed char != (minus)",
+ "print signed char < (minus)",
+ "print signed char > (minus)".
+ * gdb.base/callfuncs.exp (do_function_calls):
+ Add mips-sgi-irix* xfail, when compiled with native compiler, for
+ "call inferior func with struct - returns char *".
+ * gdb.base/return.exp (return_tests): Change xfail for
+ "correct value returned double test" to include Solaris 2.4.
+ * gdb.base/funcargs.exp (float_and_integral_args):
+ Add sparc-sun-solaris2* xfail for "print f1 after run to call2a".
+
+Sat Aug 26 00:26:11 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/setvar.c, gdb.base/setvar.exp: Add new tests for
+ enumeration bitfields if compiling with GNU C.
+ * lib/gdb.exp: Consume `(y or n) ' in `Reinitialize source path
+ to empty' prompt.
+
+Tue Aug 22 00:30:37 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/scope.exp: xfail 'scope0.c'::filelocal_bss before run
+ test for PRO targets.
+
+ * gdb.base/funcargs.exp: Avoid ever setting more than 8
+ breakpoints in the inferior at any given time by making
+ two groups of breakpoints for call2*, call6* and call7*
+ tests.
+
+Sun Aug 20 06:58:25 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/funcargs.exp: Fix typos introduced by Aug 15 change.
+ * gdb.base/callfuncs.c (main): Use struct_val1 to inhibit xlc
+ from optimizing it away.
+ * gdb.base/callfuncs.exp: Remove rs6000-*-* xfails for
+ "call inferior func with struct".
+
+Wed Aug 16 11:57:15 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * configure.in: Only configure gdb.chill for particular targets.
+
+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.
+ * gdb.base/corefile.exp: Likewise.
+ * gdb.base/list.exp: Likewise.
+ * gdb.base/scope.exp: Likewise.
+ * gdb.base/siganls.exp: Likewise.
+
+ * gdb.base/nodebug.exp: Add xfails for the powerpc. Handle aix4
+ compiler output.
+ * gdb.base/whatis.exp: Likewise.
+
+Fri Aug 11 13:36:20 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/sh3.exp (all_fp_misc_tests): No longer expect a
+ failure (opcode table has been fixed to match reality).
+
+Mon Aug 14 09:01:59 1995 Fred Fish <fnf@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
+ "backtrace through signal handler" to "i*86-*-sysv4*".
+ * gdb.base/signals.exp: Add xfail for "'next' behaved as
+ continue" case. Add "known SVR4 bug" to fail message.
+ Add "i*86-*-bsdi2.0" xfail for "handle all print".
+ Add "i*86-*-bsdi2.0" xfail for "backtrace in signals_tests_1".
+ * gdb.base/ptype.exp: Add "i*86-*-sysv4*" xfail for
+ "whatis unnamed typedef'd enum..." and "ptype t_char_array".
+ * gdb.base/langs.exp: Add "i*86-*-sysv4*" xfail for
+ "up to foo in langs.exp", "show language at foo in
+ langs.exp", "up to cppsub_ in langs.exp", "show
+ language at cppsub_ in langs.exp", "up to fsub in
+ langs.exp", and "show language at fsub in langs.exp".
+ * gdb.base/corefile.exp: Add "i*86-*-sysv4*" to xfail for
+ "bactrace in corefile.exp".
+ * gdb.base/callfuncs.exp: Change xfail to "i*86-*-*" for
+ "call inferior function with struct - returns float" and
+ "call inferior function with struct - returns double".
+
+Mon Aug 7 02:43:28 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/sh3.s: Source for sh3 disassembler tests.
+ * gdb.disasm/sh3.exp: Run the sh3 disassembler tests.
+ * gdb.disasm/configure.in (sh-*-*): Use sh3.mt makefile fragment.
+ * gdb.disasm/sh3.mt: Makefile fragment for sh3 ests.
+
+Mon Aug 7 08:09:37 1995 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (CHILL_FOR_TARGET): Use previously defined
+ (or overriden) "CHILL" macro rather then bare "gcc".
+ Also look for ../../gcc/xgcc since that is what we will
+ actually need, not "Makefile". Remove following assignment
+ of CHILL to CHILL_FOR_TARGET because that results in
+ recursive definition.
+
+Sun Aug 6 16:52:29 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/corefile.exp: Change xfail for backtrace in
+ corefile.exp from linuxaout to all linux.
+ * gdb.base/sigall.exp (test_one_sig): Specifically deal with
+ cases where we miss the breakpoint at the signal handler
+ for some reason. Setup xfail for linuxoldld/linuxaout and
+ getting SIGIO. Setup xfail for linuxoldld/linuxaout for
+ hitting SIGURG breakpoint.
+ * gdb.base/signals.exp: Setup xfail for "next" acting like
+ continue to add linuxoldld. Setup xfail for all linux for
+ "next to handler in signals_tests_1", "backtrace in
+ signals_tests_1", "continue to func1", "pass SIGUSR1",
+ and continue to handler".
+
+Thu Aug 3 10:45:37 1995 Fred Fish <fnf@cygnus.com>
+
+ * Update all FSF addresses except those in COPYING* files.
+
+Sun Jul 30 17:50:35 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/a2-run.exp: Change messages to be more explicit about
+ the status of args, and quote binfile in results.
+
+Sun Jul 30 10:24:20 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/callfuncs.exp: Add tests for passing structs to
+ inferior functions and return various types.
+ * gdb.base/callfuncs.c: Add functions to receive a struct
+ and return a member of the struct, in various types.
+
+Sat Jul 29 14:22:33 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/Makefile.in (clean): Remove callf-info.exp.
+
+Fri Jul 28 13:36:11 1995 Brendan Kehoe <brendan@lisa.cygnus.com>
+
+ * config/vxworks29k.exp: New file, sources vxworks.exp.
+
+Fri Jul 28 00:28:36 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * config/gdbremote.exp: New file. Testing framework using
+ gdbserver.
+
+Thu Jul 27 12:17:14 1995 Fred Fish (fnf@cygnus.com)
+
+ * gdb.base/interrupt.exp: Setup "i*86-*-linux" xfail for
+ "call function when asleep" and "send end of file".
+ * gdb.base/corefile.exp: Add "i*86-*-linuxaout" to xfail list
+ for "backtrace in corefile.exp".
+ * gdb.base/a1-selftest.exp: Add "i*86-*-linux*" to xfail list
+ for "backtrace through signal handler".
+ * gdb.base/corefile.exp: Make sure we actually generate a core file
+ before trying the core tests. Some systems allow the user to suppress
+ generation of core files and default to that (linux for example).
+ * gdb.base/signals.exp: Change xfail for "next" acting like "continue"
+ from "i*86-*-linux" to "i*86-*-linuxaout". Works with ELF beta.
+
+Tue Jul 25 17:30:10 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * gdb.threads: New directory with some crude multi-threaded
+ gdb tests (step.exp and step2.exp).
+ * config/mt-lynx (STEP_EXECUTABLE): Define.
+ (THREADFLAGS): Define.
+
+Tue Jul 25 01:03:52 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/sigall.exp: Avoid losing in SIGPRIO test on lynx.
+
+ * gdb.base/signals.exp: Disable whole file for lynx until
+ further notice.
+
+ * gdb.base/signals.exp: xfail test where "next" acts like
+ "continue" for lynx.
+
+ * gdb.base/interrupt.exp: xfail test for calling function while
+ inferior is asleep for lynx.
+
+ * gdb.base/watchpoint.exp: Handle more cases of gdb echoing more
+ than one cr-lf after each command.
+
+Sun Jul 23 23:33:18 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * configure.in: Reinstate setting of stabsdirs variable, fix
+ typo in setting up configdirs for native builds.
+
+ * gdb.base/return.exp: Fix typo in return double test.
+ * gdb.base/return.c (tmp2, tmp3): Made global to inhibit the
+ compiler from optimizing them away.
+
+Fri Jul 21 11:39:34 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/gdbvars.exp: Expect zero or more additional cr-lf
+ sequences to be echo'd by gdb when using gdb_test.
+ * gdb.chill/chexp.exp: Likewise.
+ * gdb.fortran/exprs.exp: Likewise
+
+Thu Jul 20 13:28:36 1995 Jeffrey A. Law <law@rtl.cygnus.com>
+
+ * gdb.base/a1-selftest.exp: Reset the timeout value to 30 seconds
+ after the inferior gdb has started.
+
+ * gdb.base/a2-run.exp: Handle gdb echoing more than one cr-lf
+ after each command.
+ * gdb.base/funcargs.exp: Likewise.
+ * gdb.base/gdbvars.exp: Likewise.
+ * gdb.base/interrupt.exp: Likewise.
+ * gdb.base/list.exp: Likewise.
+ * gdb.base/watchpoint.exp: Likewise.
+ * gdb.c++/demangle.exp: Likewise.
+ * gdb.c++/inherit.exp: Likewise.
+ * gdb.chill/chexp.exp: Likewise.
+ * gdb.fortran/exprs.exp: Likewise.
+
+ * gdb.base/watchpoint.exp: Disable watchpoint triggered in syscall
+ test if we can't handle IO to/from the inferior.
+
+ * gdb.c++/misc.exp: Always check for a program already being
+ started after sending a "run" command to gdb.
+
+ * gdb.base/twice.exp: Start with a fresh gdb.
+
+ * gdb.chill/chexp.exp: Remove skip_chill_tests check; these tests
+ only depend on gdb's expression code, not the chill runtime.
+
+ * gdb.base/return.c: Put return values into variables so we
+ can have gdb print them rather than depending on the program
+ to print them.
+ * gdb.base/return.exp: Corresponding changes.
+
+ * lib/gdb.exp: Provide default value for noinferiorio.
+ * gdb.base/interrupt.exp: Skip tests if we can't handle IO to/from
+ the inferior.
+
+ * gdb.base/break.exp: Always check for a program already being
+ started after sending a "run" command to gdb.
+ (text_next_with_recursion): Don't check the output from the
+ program's printf statement. Instead just make sure the program
+ exited.
+
+ * gdb.base/commands.exp: Protect tests which need arguments with
+ $noargs conditionals.
+
+Wed Jul 19 22:42:43 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/printcmds.exp: Adjust expect patterns for addresses
+ of structure member arrays to match gdb/valops.c:value_addr change.
+
+Mon Jul 17 10:12:27 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/a1-selftest.exp: Fix unmatched quotes in many timeout
+ cases.
+
+Wed Jul 12 10:20:08 1995 Fred Fish (fnf@cygnus.com)
+
+ * configure.in (configdirs): Remove gdb.chill from default list
+ of subdirs and then add it back in only if doing a native build.
+ The current chill compiler does not yet work in any cross build.
+ * Revert all signal changes from Jul 6.
+ * gdb.base/{sigall.c signals.c}: Define away signal() and alarm()
+ for sh-hms targets, allowing these tests to link, with no other
+ changes. Testing is suppressed by setting "nosignals" in site.exp.
+
+Thu Jul 6 20:58:30 1995 Fred Fish (fnf@cygnus.com)
+
+ * configure.in (signaldirs): Define and add to configdirs for all
+ targets except some specific ones that are known to not support signals.
+ Also clean up formatting.
+ * gdb.base/Makefile.in (EXECUTABLES): Remove sigall and signals.
+ (signals, sigall): Remove rules to build.
+ * gdb.base/{sigall.c, sigall.exp, signals.c, signals.exp}:
+ Moved to new gdb.signals directory.
+ * gdb.signals: New test directory.
+ * gdb.signals/{Makefile.in, configure.in, sigall.c, sigall.exp,
+ signals.c signals.exp}: New or moved files.
+
+Sun Jun 25 12:55:18 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/interrupt.exp: Don't choke if $nointerrupts doesn't exist.
+
+Wed Jun 21 16:35:55 1995 Fred Fish <fnf@cygnus.com>
+
+ * gdb.base/return.exp: Xfail `return double' test failure
+ on at least Solaris 2.3 and handle future/past versions on
+ a case by case basis as appropriate. Also update message
+ to include i*86 failures.
+
+Wed May 24 07:10:10 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in: Change variable CFLAGS to TESTSUITE_CFLAGS.
+
+ * lib/gdb.exp: Fix comment which erroneously identified
+ gdb_file_cmd as gdb_load (the 19 May change was in fact to
+ gdb_file_cmd not gdb_load).
+ * config/unix-gdb.exp (gdb_load): Add "upvar timeout timeout".
+
+ * gdb.base/setvar.exp: Make test names consistent between pass and
+ fail cases. Use gdb_test more.
+
+Fri May 19 07:22:58 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * lib/gdb.exp (gdb_load): Add "upvar timeout timeout".
+
+Mon May 15 23:50:51 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/help.exp: Fix expected help string for `show commands'.
+
+Thu May 11 07:55:11 1995 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * gdb.stabs/xcoff.sed: Change N_LSYM to C_DECL not C_LSYM.
+
+ * gdb.stabs/weird.exp: Remove xfail for xcoff bitching about lack
+ of a text section.
+
+Thu May 11 15:02:24 1995 Stu Grossman (grossman@andros.cygnus.com)
+
+ * config/monitor.exp (gdb_target_monitor): Fix loop interator so
+ that loop eventually terminates. Fix Connection refused logic so
+ that testsuite will expire nicely.
+
+Wed May 10 17:57:35 1995 Stu Grossman (grossman@andros.cygnus.com)
+
+ * config/cpu32bug.exp, config/est.exp, config/hppro.exp,
+ config/rom68k.exp: New tcl glue for the appropriate monitors.
+ These all just end up calling monitor.exp.
+ * config/monitor.exp (gdb_target_monitor): Handle `Connection
+ refused' by retrying. Cleanup some timeout issues.
+ * (gdb_load): Reduce timeout. Cleanup some timeout issues.
+ * lib/gdb.exp (gdb_test gdb_test_exact): Upvar timeout so that
+ callers don't have to set/restore global timeout variable.
+
+ * The following set of changes centralizes management of the global
+ timeout variable. This way, it can be set in one target dependent
+ place instead of dozens of places scattered throughout the test suite.
+ If you need to lengthen a timeout, then you should either set timeout
+ in one of the config/{target}.exp files, or multiply it by a factor.
+ Setting it to an absolute value is always going to lose for some
+ targets.
+ * gdb.base/a1-selftest.exp (test_with_self): Only use local timeout.
+ * gdb.base/callfuncs.exp (do_function_calls): Don't set timeout.
+ * gdb.base/funcargs.exp: Don't set timeout.
+ * gdb.base/list.exp (test_forward_search): Only use local timeout.
+ * gdb.base/printcmds.exp (test_print_string_constants
+ test_print_array_constants): Don't set timeout.
+ * gdb.base/ptype.exp: Don't set timeout.
+ * gdb.base/recurse.exp: Don't set timeout.
+ * gdb.base/return.exp: Don't set timeout.
+ * gdb.base/watchpoint.exp: Don't set timeout.
+ * gdb.c++/classes.exp (do_tests): Don't set timeout.
+ * gdb.c++/virtfunc.exp (test_virtual_calls): Don't set timeout.
+
+Wed May 10 16:03:23 1995 Torbjorn Granlund <tege@adder.cygnus.com>
+
+ * Makefile.in: Make clean targets work also when SUBDIRS is empty.
+
+Mon May 1 07:32:48 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * lib/gdb.exp: Disable chill tests for irix5.
+
+Wed Apr 26 07:36:03 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/scope.exp: Make test names unique. Use gdb_test. Make
+ each test pass or fail.
+
+Sun Apr 23 21:32:32 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/opaque.exp: Remove xfails for aix; print a warning if
+ xlc not gcc.
+
+Fri Apr 21 15:44:02 1995 Stu Grossman (grossman@rtl.cygnus.com)
+
+ * cpu32bug.exp est.exp rom68k.exp: Delete. Unify into monitor.exp.
+
+Wed Apr 19 17:41:21 1995 Stu Grossman (grossman@cygnus.com)
+
+ * config/est.exp: Fix copyright and comments. Remove dead code.
+ Use targetname, serialport and baud variables instead of fixed
+ constants.
+ * config/rom68k.exp: Fix copyright and comments. Remove dead code.
+ * config/cpu32bug.exp: New file to support cpu32bug monitors.
+
+Wed Apr 19 13:47:16 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/watchpoint.exp: Don't run
+ test_watchpoint_triggered_in_syscall for sunos.
+
+Mon Apr 17 12:48:52 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/{break.c,run.c}: Don't include vxWorks.h or stdioLib.h;
+ they don't seem to exist. Do include stdio.h.
+
+Fri Apr 14 09:40:22 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/a1-selftest.exp: Add alpha xfail.
+
+Mon Apr 10 13:07:50 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/watchpoint.c (main): Prompt before calling read().
+ * gdb.base/watchpoint.exp (test_watchpoint_triggered_in_syscall):
+ Revise accordingly. Remove cruft about sending "123" several
+ times, until it gets noticed. Clean up the "print buf[0]" stuff
+ so that it passes or fails, and waits for prompts in the usual way.
+
+Sun Apr 9 09:02:36 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/recurse.exp: Fix comment.
+
+ * TODO: Remove item about printing variables in nodebug.exp. Add
+ item about enabling tests which are only run on some targets.
+
+ * gdb.base/watchpoint.exp: Various cleanups (make each test pass or
+ fail, make test names unique, use new gdb_test convention
+ regarding pattern, use gdb_test more, etc.).
+
+ * gdb.base/bitfields.exp: Various cleanups (make each test pass or
+ fail, make test names unique, etc.).
+
+Sat Apr 8 02:47:45 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/nodebug.c: Change return type of top and middle to
+ short.
+ * gdb.base/nodebug.exp: Remove xfails for ecoff systems, they
+ are fixed by the recent mdebugread.c changes. Allow `short ()'
+ as type for top and middle.
+
+Thu Apr 6 08:54:18 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/break.exp: Remove commented out if $usestubs {}. As
+ nearly as I can tell, the whole thing was an accident in Stu's
+ change of 24 Mar 1995 (logged in ../ChangeLog), in which he meant
+ to replace a send/expect pair with gdb_test, but ended up only
+ adding the gdb_test. My change of 24 Mar 1995 and Kung's change
+ of 30 Mar 1995 took care of it, but left this vestigial comment
+ which I am now nuking.
+
+Mon Apr 3 09:00:27 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/break.exp: Look for different line number for
+ breakpoint at main depending on usestubs.
+
+Sun Apr 2 08:15:45 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/list.exp: Adjust some alternate expect patterns to
+ match recent list0.c change. Add alternate expect pattern for
+ output from `list default lines around main' for optimizing
+ compilers.
+
+Sat Apr 1 07:23:22 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * lib/gdb.exp: If nosignals is not set, set it to 0.
+
+Fri Mar 31 16:13:48 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * config/slite-gdb.exp: Responds to load symbol table prompt.
+ * gdb.base/break.exp: Adjust line number, fix rerun.
+ * gdb.base/langs0.c: Add #ifdef usestubs.
+
+Thu Mar 30 15:36:55 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * gdb.base/list.exp: Adjust line contents after adding new lines in
+ list0.c. Also fix a syntax error.
+
+ * lib/gdb.exp (gdb_run_cmd): Special handling for targets use stubs.
+ * gdb.base/break.exp: ditto.
+ * gdb.base/list.exp: ditto.
+ * gdb.base/bitfields.c: Add #ifdef usestubs in main().
+ * gdb.base/run.c: ditto.
+ * gdb.base/list0.c: ditto.
+ * gdb.base/funcargs.c: ditto.
+
+Wed Mar 29 17:09:29 1995 Stu Grossman (grossman@cygnus.com)
+
+ * testsuite/config/rom68k.exp (gdb_target_rom68k): Use
+ $targetname, $serialport and $baud instead of hardwired variables.
+ * testsuite/gdb.base/{sigall.exp signals.exp}: Skip these if the
+ target doesn't support signals.
+
+Wed Mar 29 12:29:34 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * lib/gdb.exp (runto_main): Fix regular expression bug, add return 1.
+
+Tue Mar 28 08:46:45 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/recurse.exp: Make test names unique. Change \\(+ to \\(.
+ Don't rely on the value of an auto variable before it has been
+ initialized. Use gdb_test more.
+
+Mon Mar 27 08:00:34 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * lib/gdb.exp (default_gdb_version): A version number must start
+ with a digit, but other than that contains all characters up to
+ the first whitespace character.
+
+Sun Mar 26 13:19:32 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/commands.exp (breakpoint_command_test): New tests.
+
+Sat Mar 25 15:38:06 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.c++/*.exp: Warn if executable does not exist. The original
+ reason for skipping the warning was that configure.in sometimes
+ intentionally skipped building the executables but the tcl code
+ had no way of knowing. That (a) was always bogus with respect to
+ error handling, (b) is no longer true (right now there is no way
+ to skip C++ tests).
+
+ * gdb.c++/demangle.exp: Remove unused binfile and srcfile variables.
+
+Sat Mar 25 01:16:10 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/list.exp: Add expect patterns for output from
+ SunPRO compiled executables.
+ * gdb.base/whatis.exp: Allow leading `signed' for all v_signed_*
+ types.
+
+Fri Mar 24 06:11:05 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/break.exp (test_next_with_recursion): Accept any line
+ number (we are already testing that the correct source line text
+ gets printed).
+
+ * gdb.base/break.exp: Make one test if $usestubs. I'm not sure
+ that is what is intended, but something needed to be done to get
+ sunos4 native working again.
+
+ * gdb.c++/misc.cc (main): Fix typo (#iffef -> #ifdef).
+
+ * gdb.base/a1-selftest.exp (test_with_self): Remove comment which
+ apparently went with a (very) old xfail.
+
+Fri Mar 24 13:41:09 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * gdb.base/callfuncs.exp: call runto_main instead of runto main.
+ runto_main is a proc in gdb.exp that will do 'step' for target use
+ stubs.
+ * gdb.base/exprs.exp: ditto.
+ * gdb.base/interrupt.exp: ditto.
+ * gdb.base/opaque.exp: ditto.
+ * gdb.base/printcmds.exp: ditto.
+ * gdb.base/ptype.exp: ditto.
+ * gdb.base/scope.exp: ditto.
+ * gdb.base/setvar.exp: ditto.
+ * gdb.base/signals.exp: ditto.
+ * gdb.base/twice.exp: ditto.
+ * gdb.c++/classes.exp: ditto.
+ * gdb.c++/inherit.exp: ditto.
+ * gdb.c++/templates.exp: ditto.
+ * gdb.base/break.exp: no run and hit main for stubs. Change line
+ numbers for breakpoints and info breakpoint.
+ * gdb.base/break.c: Add #ifdef usestubs for set_debug_traps() and
+ breakpoint().
+ * gdb.base/callfuncs.c: ditto.
+ * gdb.base/exprs: ditto.
+ * gdb.base/interrupt.c: ditto.
+ * gdb.base/opaque0.c: ditto.
+ * gdb.base/printcmds.c: ditto.
+ * gdb.base/ptype.c: ditto.
+ * gdb.base/scope0.c: ditto.
+ * gdb.base/setvar.c: ditto.
+ * gdb.base/signals.c: ditto.
+ * gdb.base/twice.c: ditto.
+ * gdb.c++/misc.cc: ditto.
+ * gdb.c++/templates.cc: ditto.
+
+Fri Mar 24 06:11:05 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/vx-gdb.exp, lib/gdb.exp: Regexp cleanups (\[(\] -> \\(, etc.).
+
+ * gdb.base/a1-selftest.exp: Don't check for # followed by a digit
+ somewhere between `read' and `main.c'. I'm pretty sure the
+ pattern ".*#\[0-9\].*" was slowing down pattern matching a lot,
+ and it isn't particularly useful.
+
+ * gdb.base/scope.exp: Make test names unique. \[(\] -> \\(.
+
+Thu Mar 23 14:58:35 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/commands.exp (infrun_breakpoint_command_test): New test.
+
+Wed Mar 22 18:36:05 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * config/mt-slite: add LIBS and -nostdlib.
+ * config/slite-gdb.exp: add this new file to support sparclite target.
+
+Tue Mar 21 21:41:04 1995 Doug Evans <dje@canuck.cygnus.com>
+
+ * config/vx-gdb.exp (gdb_load): Update test of vxworks_ld return code.
+
+ * gdb.base/a2-run.exp: Change argument to istarget from
+ "*-*-vxworks" to "*-*-vxworks*".
+ * gdb.base/{break.exp,default.exp,scope.exp}: Likewise.
+
+Tue Mar 21 17:08:47 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * lib/gdb.exp: add proc runto_main, for targets that use stubs, this
+ will not runto main but do a 'step' to step out of breakpoint().
+ * config/mt-slite: add -Dusestubs.
+
+Tue Mar 21 12:14:12 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/printcmds.exp (test_artificial_arrays): Send ^V@
+ instead of just @.
+
+ * gdb.base/signals.exp: Add test for "handle all print".
+ * TODO: Remove "handle all print". Also remove item about
+ checking copyright date (I don't like the idea of a spurious FAIL
+ based on when we run the tests).
+
+ * gdb.base/recurse.exp: Enable test for SunOS4. xfail one test
+ for SunOS4 (reason for failure not investigated). Remove
+ redundant test for $binfile.
+
+ * gdb.base/nodebug.c (array_index): Call malloc.
+
+ * gdb.base/{corefile.exp,default.exp}: Make names of "up" tests unique.
+
+Mon Mar 20 10:08:17 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/recurse.exp: Update gdb_test invocation to use new
+ conventions and slightly simplify the matching regexp.
+
+Fri Mar 17 05:43:28 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/break.exp: Update gdb_test invocation to use new
+ convention.
+
+ * lib/gdb.exp: If noargs is not set, set it to 0.
+
+ * gdb.base/nodebug.exp: Comment out redundant test. Make name of
+ tests unique.
+
+ * lib/gdb.exp: Skip CHILL for AIX and Solaris.
+
+Thu Mar 16 16:27:07 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/nodebug.exp: It is OK if GDB thinks top and middle have
+ one argument of type "<non-float parameter>".
+
+Wed Mar 15 15:54:56 1995 Stu Grossman (grossman@cygnus.com)
+
+ * config/rom68k.exp: New file to support Motorola IDP board.
+ * gdb.base/a2-run.exp: Skip this file if noargs is set.
+ * gdb.base/break.c: Change things around so that this program
+ doesn't depend upon args. This is necessary to make remote
+ targets work (in general, they can't take args).
+ * gdb.base/break.exp: Don't try to send args to program. Don't
+ expect output. Also, replace lots of code with gdb_test.
+
+Wed Mar 15 04:11:14 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/printcmds.exp (test_character_literals_accepted): Test
+ printing of '\'' (which is what the comment says we are testing,
+ even though we were not), not '''.
+ (test_integer_literals_rejected): Test that printing ''' is an error.
+
+ * gdb.fortran/exprs.exp, gdb.fortran/types.exp,
+ gdb.chill/chexp.exp, gdb.base/printcmds.exp,
+ gdb.c++/cplusfuncs.exp, gdb.chill/callch.exp, gdb.chill/misc.exp,
+ gdb.chill/pr-6292.exp, gdb.chill/string.exp, gdb.chill/tuples.exp:
+ Use gdb_test not test_print_accept.
+ * lib/gdb.exp: Remove test_print_accept.
+
+ * gdb.base/signals.exp (signal_tests_1): Make pass message
+ consistent with fail message.
+
+ * gdb.base/whatis.exp: Remove xfails for printing char vs.
+ unsigned char; the bug (PR 1821) is fixed.
+
+ * gdb.base/scope.exp: Remove xfails for PRs 1843 and 1868.
+
+ * gdb.base/scope.exp (test_at_localscopes): Call pass for
+ successful tests--makes xfailing them work right.
+
+Tue Mar 14 07:39:19 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * lib/gdb.exp (gdb_test): Between $pattern and $prompt, expect
+ only \r\n, not .*. The test can pass .* as the last thing in
+ $pattern if that is what it wants. In addition to providing this
+ flexibility, this change should speed up pattern matching in cases
+ where the pattern already ended with .* (there were a number of
+ them). This change also helps catch bad patterns--in the old
+ scheme the typo "char \*" instead of "char \\*" would pass. Now
+ it is caught.
+ * Many .exp files: Update callers.
+
+ * gdb.base/funcargs.exp: Replace \[(\]+ with \\(. The latter is
+ clearer and does not spuriously match multiple ('s. Likewise for
+ ) and *.
+
+ * gdb.base/nodebug.exp: Test ability to call a function and pass
+ it a string (even with no debugging info).
+
+ * gdb.base/printcmds.exp (test_integer_literals_rejected): Change
+ "p '\'", which is the same as "p ''" once tcl gets done with
+ quoting, to "p '\\'", which I suspect is what is intended (one
+ backslash gets sent to GDB).
+
+ * gdb.base/printcmds.exp (test_artificial_arrays): New tests.
+
+Fri Mar 10 13:31:46 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/a1-selftest.exp: Remove xfail for solaris. The bug (PR
+ 1817) was fixed literally years ago.
+
+Fri Mar 10 02:49:40 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/funcargs.exp (call_after_alloca): Remove `next'
+ test, it causes stepping out of call_after_alloca_subr with
+ optimizing compilers.
+ (localvars_in_indirect_call): Consume GDB prompt if `finish'
+ fails.
+
+ * gdb.c++/templates.exp: Source templ-info.exp only if
+ the templates executable exists.
+
+ * gdb.c++/misc.cc (class Contains_static_instance,
+ class Contains_nested_static_instance),
+ gdb.c++/classes.exp (test_static_members): Test printing of
+ a class that contains a static instance of the class.
+
+Thu Mar 9 11:43:55 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/langs2.c (cppsub_): Don't prototype.
+ * gdb.base/langs2.cxx (cppsub_): Fix prototype (cosmetic value
+ only, I believe).
+
+Wed Mar 8 10:29:33 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * lib/gdb.exp (skip_chill_tests): New procedure.
+
+ * gdb.base/signals.exp (signal_tests_1): xfail for irix.
+
+Mon Mar 6 10:44:06 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/hppa.exp: Delete redundant ".*" at the beginning of
+ each expect pattern. Cuts runtime from 12 to about 4 seconds.
+
+Thu Mar 2 05:31:34 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/langs.exp: Don't insist that foo__Fi be demangled.
+
+ * gdb.disasm/hppa.exp (all_fpu_comparison_tests): Only
+ disassemble 8, not 16, instructions for part 4.
+
+ * config/vx-gdb.exp (gdb_start): Use \030, not \CX. tcl doesn't
+ support the latter anymore.
+
+ * gdb.base/Makefile.in: Try compiling callfuncs.c, if that fails try
+ -DNO_PROTOTYPES.
+ * gdb.base/callfuncs.c: Control use of prototypes based on
+ NO_PROTOTYPES, not __STDC__.
+ * gdb.base/callfuncs.exp (do_function_calls): xfail one of the
+ t_float_values2 tests if prototypes in use.
+
+ * gdb.base/callfuncs.c (t_float_values, t_float_values2,
+ t_double_values): When checking differences against DELTA, check
+ that difference is within the range (-DELTA,DELTA), not just
+ (-infinity,DELTA).
+
+Tue Feb 28 16:28:54 1995 Kung Hsu <kung@mexican.cygnus.com>
+
+ * config/mips-gdb.exp (gdb_load): In every test case, we need to do
+ 'file' command firts, then 'target', then 'load', this is due to gdb
+ target set up.
+ * config/mips-gdb.exp: Fix a couple regular exp bugs.
+
+Thu Feb 23 17:44:55 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/hppa.s (fmemLRbug_tests): Add tests for the indexing
+ FP load/store variants.
+ * gdb.disasm/hppa.exp (fmemLRbug_tests): Test new variants.
+
+Wed Feb 22 18:29:08 1995 Jim Kingdon <kingdon@rtl.cygnus.com>
+
+ * gdb.base/term.exp: Do not give a warning if not native, it is
+ not an abnormal condition.
+
+Tue Feb 21 13:08:47 1995 Jim Kingdon <kingdon@cygnus.com>
+
+ * gdb.base/ptype.exp: Accept char[0] as well as char[] for "ptype
+ t_char_array".
+
+Sun Feb 19 13:10:06 1995 Jim Kingdon <kingdon@rtl.cygnus.com>
+
+ * lib/gdb.exp (default_gdb_version): Pass GDBFLAGS to gdb when we
+ are getting the version number.
+
+ * gdb.base/{a1-selftest.exp,corefile.exp}: Do not give a warning
+ if not native, it is not an abnormal condition.
+
+Thu Feb 16 15:56:56 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * lib/gdb.exp: Just use "file exists", rather than undocumented
+ dejagnu procedure "findfile".
+
+Thu Feb 16 10:30:24 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * config/mt-vxworks (CFLAGS): Set to -g -Dvxworks.
+ (LDFLAGS): Set to -Xlinker -Ur.
+
+ * Makefile.in, gdb.{base,c++,chill}/Makefile.in (GDB, GDBFLAGS):
+ Removed, these values are set by lib/gdb.exp.
+
+ * lib/gdb.exp: If GDBFLAGS is unset, set it to -nx.
+
+Wed Feb 15 14:23:28 1995 J.T. Conklin <jtc@rtl.cygnus.com>
+
+ * config/vx-gdb.exp (spawn_vxgdb): Use default_gdb_start instead
+ of replicating gdb startup code.
+
+ * config/mt-vxworks (LDFLAGS): Set to -r.
+ (CFLAGS_FOR_TARGET): Removed.
+
+ * config/vx-gdb.exp: always set prompt; gdb.exp sets it to
+ (gdb) and gdb for vxworks uses (vxgdb).
+
+ * Makefile.in, gdb.{base,c++,chill}/Makefile.in (GDB): If a gdb
+ executable is not in the tree and host != target, use sed and
+ program_transform_name to determine the gdb name used by the
+ target.
+
+ * configure.in, gdb.{base,c++,chill}/configure.in: changed so
+ *-*-vxworks* matches vxworks and *-*-netware* matches NetWare.
+
+Sun Feb 12 08:11:58 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/{callfuncs.exp,callfuncs.c}: Add tests for passing
+ floats, chars, and shorts where there are ANSI-style function
+ definitions.
+
+ * gdb.base/langs.exp, gdb.base/langs*: New test.
+ * gdb.base/Makefile.in: Build it.
+ * TODO: Remove item about checking that C names don't get C++
+ demangling applied; this test tests it.
+
+Thu Feb 9 12:43:56 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.stabs/weird.exp: Remove "Haven't examined" comment which
+ went with the const70 xfail. The xfail went away a year ago.
+
+ * gdb.base/signals.exp: Rename a bunch of tests to give unique names.
+
+ * gdb.base/corefile.exp: Give backtrace test unique name. xfail
+ for hp300.
+
+ * gdb.base/interrupt.exp: Also xfail hpux (for hp300).
+
+ * gdb.base/a1-selftest.exp: Don't run on hp300.
+
+Sat Feb 4 15:04:32 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (site.exp): Set host_alias and target_alias as well
+ as host_triplet and target_triplet.
+
+Wed Feb 1 08:03:48 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/a1-selftest.exp: Invoke stty before starting inferior.
+
+ * gdb.base/nodebug.exp: Add xfails for ultrix and irix5 (same
+ places as other ecoff systems).
+
+ * gdb.base/a1-selftest.exp (test_with_self): Don't invoke stty on
+ ultrix.
+
+Mon Jan 30 11:44:52 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/nodebug.c (inner): Use variables so AIX linker doesn't
+ remove them.
+ * gdb.base/nodebug.exp: Accept "function" in addition to "text
+ variable and "variable" in addition to "data variable".
+ * gdb.base/nodebug.exp: xfail datalocal and bsslocal tests for AIX.
+
+ * gdb.base/list.exp (test_forward_search): Set listsize to 4 not
+ 2.
+ * gdb.base/list1.c (long_line): Add additional statement at start
+ of function.
+ * gdb.base/list.exp (test_forward_search): Update line number to
+ reflect new statement.
+
+Sun Jan 29 13:34:25 1995 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/signals.exp: Reinitialize searched source directories
+ after gdb_start call.
+
+Sat Jan 28 01:34:44 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/Makefile.in (clean): Delete "errs" file.
+ * gdb.stabs/Makefile.in: Likewise.
+
+ * gdb.disasm/hppa.exp (all_fpu_comparison_tests): Revert last
+ change. Instead split the tests into smaller pieces.
+ * gdb.disasm/hppa.s: Corresponding changes.
+
+Fri Jan 27 09:24:51 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/a1-selftest.exp (test_with_self), gdb.base/interrupt.exp:
+ Quote ^C when passing it to stty. For some shells ^ is a pipe.
+
+ * gdb.base/funcargs.exp: Modify many tests so that every test
+ either passes or fails. Make some test names unique.
+
+Thu Jan 26 19:20:34 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/a1-selftest.exp (test_with_self), gdb.base/interrupt.exp:
+ Call stty to set interrupt character.
+
+ * gdb.disasm/hppa.mt (hppa), gdb.stabs/hppa.mt (weird.o): Check
+ for HP assembler versus GNU assembler based on actual behavior of
+ $(CC), rather than assuming that $(AS) is always the GNU assembler.
+
+ * TODO: Suggest a few more stepping tests.
+
+Wed Jan 25 14:52:41 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/default.exp: xfail no-stack backtraces for h8300,
+ restart GDB for h8300 after a continue.
+ (return): Add pattern to match a29k-udi behavior.
+ * gdb.base/nodebug.exp: Remove obsolete comment.
+ * gdb.base/regs.exp: New file, testing of register displays.
+ * gdb.base/return.exp: Fix typo in reference to $objdir.
+ * gdb.base/whatis.exp: Always start with a fresh GDB.
+
+Wed Jan 25 11:12:07 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.disasm/hppa.exp (all_fpu_comparison_tests): Set timeout
+ higher, these tests generate a lot of output.
+
+Tue Jan 24 07:58:44 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * lib/gdb.exp (gdb_test): Remove catch from around the send. The
+ code following the catch silently ignored some errors; without the
+ catch they should be thrown like any other tcl error. Also, the
+ catch used "" instead of {} which meant all the callers who wanted
+ to include one of the characters "[]$ had to quote it an extra time.
+ * gdb.base/{callfuncs.exp,commands.exp,gdbvars.exp,printcmds.exp,
+ ptype.exp,signals.exp,watchpoint.exp}, gdb.c++/{cplusfuncs.exp,
+ demangle.exp}, gdb.chill/chexp.exp, gdb.fortran/exprs.exp:
+ Remove extra quoting.
+
+Mon Jan 23 21:57:54 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/commands.exp: Make test names unique; every test either
+ passes or fails. Update some comments.
+
+ * gdb.disasm/hppa.exp (do_system_control_tests): Update.
+
+Sat Jan 21 15:34:52 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ The following fixes a FAIL caused by the fact that the alpha stabs
+ configuration didn't use the ".if alpha" code in weird.def.
+ * gdb.stabs/weird.def (v_comb): Use type attribute to specify 32
+ bit pointer, so the 32 bit version works even on the alpha.
+ * gdb.stabs/{alpha.mt,ecoff.mt,aout.sed,hppa.sed,xcoff.sed,weird.def}:
+ Remove the stuff which allowed us to have separate versions for
+ alpha and everything else.
+
+ * gdb.c++/cplusfuncs.exp (test_lookup_operator_functions): Fix
+ regexp which "info func operator\[\](" is supposed to match. Fix
+ string to send to GDB. Note that GDB still doesn't work right. Add a
+ new test for "info func .perator\[\](" which GDB does handle correctly.
+
+ * gdb.base/nodebug.exp: xfail most of the new tests for ecoff systems.
+
+Fri Jan 20 12:14:23 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.c++/classes.exp, gdb.c++/cplusfuncs.exp,
+ gdb.c++/inherit.exp, gdb.c++/templates.exp, gdb.c++/virtfunc.exp,
+ gdb.fortran/exprs.exp, gdb.fortran/types.exp, gdb.chill/chexp.exp,
+ gdb.base/printcmds.exp: Remove passcount, failcount, etc., stuff;
+ it makes the tests harder to understand and confuses test-o-matic.
+ The preferred style is that each test provides a PASS or a FAIL,
+ and has a unique message (e.g. "continue #54" not just "continue")
+ which is the same for the pass and the fail.
+ * gdb.fortran/exprs.exp, gdb.fortran/types.exp,
+ gdb.chill/chexp.exp: Move test_print_accept and test_print_reject
+ to lib/gdb.exp.
+ * gdb.base/printcmds.exp: Use test_print_accept. Remove
+ prt_accept which was basically the same thing. Likewise for
+ test_print_reject and prt_reject.
+ * lib/gdb.exp (test_print_reject): Add some more error message
+ patterns to match from the former printcmds.exp (prt_reject).
+ * gdb.c++/classes.exp, gdb.base/scope.exp: Remove spurious xfails.
+ One defect of the passcount stuff is that some of it failed to
+ report XPASS where appropriate.
+ * gdb.c++/cplusfuncs.exp (print_addr_of): No longer accept extra
+ stuff before and after arg in expected pattern.
+ (test_paddr_operator_functions): Re-do test without print_addr_of;
+ this is the only test which seems to want extra stuff there.
+
+Tue Jan 17 10:47:53 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * gdb.base/nodebug.exp: Update new tests to reflect improved
+ wording of gdb output.
+
+ * gdb.base/nodebug.exp: Add tests to check that "print", "whatis"
+ and "ptype" work on variables in files compiled without -g.
+ Replaces commented out "maint print msymbol" tests.
+
+Mon Jan 16 12:13:28 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * gdb.base/setvar.c (dummy): Call malloc.
+
+ * gdb.stabs/aout.sed: Enclose comments within a sed command to avoid
+ losing with the irix4 sed.
+
+ * gdb.base/sigall.exp (test_one_sig): Add xfail for "get signal
+ ALRM" on irix4.
+
+Sun Jan 15 21:58:26 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * TODO: Remove items about corefile.exp testing new exec-file and
+ backtrace; both are now done. Add items about printing enums.
+
+Sat Jan 14 11:25:28 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * gdb.base/sigall.exp (test_one_sig): Attempt to recover if
+ "get signal $thissig" test fails.
+
+ * gdb.base/setvar.exp: Check for and reject crazy expected type hacks.
+
+Thu Jan 12 01:14:53 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * gdb.base/sigall.c (gen_*): Pass argument to handle_* to avoid
+ compiler warning with dec alpha compiler.
+
+ * gdb.base/commands.exp (if_while_breakpoint_command_test): Remove
+ extra \n from gdb_test call (this explains why the prompt test
+ that I removed yesterday was there).
+ (user_defined_command_test): Remove extra \n and prompt test.
+
+ * gdb.base/sigall.c: If SIGABRT == SIGLOST, just act as if SIGLOST
+ doesn't exist. Likewise if SIGIO == SIGPOLL, pretend SIGPOLL
+ doesn't exist.
+ * gdb.base/sigall.exp: Remove special handling for SIGIO and SIGPOLL.
+ Also remove alpha workaround, which turns out to be because
+ SIGABRT == SIGLOST.
+
+ * gdb.base/sigall.exp: Add workaround for alpha weirdness.
+
+ * gdb.base/help.exp: Don't test "help show".
+
+Wed Jan 11 14:37:04 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * gdb.base/commands.exp: Call gdb_exit and gdb_start so that
+ "set print address" is on.
+ * gdb.base/commands.exp (if_while_breakpoint_command_test): Don't
+ pass prompt to gdb_test; gdb_test already looks for the prompt.
+
+ * gdb.base/help.exp: Replace most of docstring for "define" with ".*".
+
+ * gdb.base/a1-selftest.exp: Don't test "maint dump-me". That test
+ was a vestige of the manual TESTSTRATEGY, and the purpose of it
+ was to make sure that gdb can read a core file. But (a) the "read
+ the corefile" part didn't make it to a1-selftest.exp, we just
+ delete the corefile after creating it, and (b) we test reading
+ corefiles in corefile.exp anyway. Also, this test left around a
+ xgdb process on Solaris.
+
+ * gdb.base/corefile.exp: Also test backtrace.
+
+Wed Jan 11 00:14:40 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/commands.exp: Test a simple user defined command with
+ arguments and if/while statements; verify the full user command is
+ printed by "show user".
+
+ * gdb.base/commands.exp: Test if/while commands as part of a
+ breakpoint command list; verify they appear in breakpoint
+ information.
+
+Wed Jan 11 00:47:58 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * gdb.base/sigall.c (gen_FPE): Generate SIGFPE with kill() rather
+ than by dividing by zero.
+
+Tue Jan 10 21:38:05 1995 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/watchpoint.exp: hppa*-*-*bsd* no longer has problems
+ performing an inferior call with watchpoints enabled.
+ * gdb.base/watchpoint.c (main): Delete second unnecessary read
+ call.
+
+Tue Jan 10 18:42:07 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * gdb.stabs/weird.exp: Allow spaces followed by backspaces in echo
+ of "file" command.
+
+ * gdb.c++/classes.exp (test_ptype_class_objects, ptype class Foo):
+ Add additional pattern for when "int operator int(void);" appears
+ in a different order.
+
+Mon Jan 9 16:22:46 1995 Jim Kingdon <kingdon@lioth.cygnus.com>
+
+ * gdb.base/signals.exp: Call gdb_exit and gdb_start.
+
+ * gdb.base/help.exp: Replace most of docstrings for "info signals"
+ and "signal" with ".*".
+
+Wed Jan 4 11:35:19 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Add note about "handle all nostop".
+
+ * gdb.base/{sigall.c, sigall.exp}: New test.
+ * gdb.base/Makefile.in: Add it.
+
+Thu Jan 5 17:34:03 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * lib/gdb.exp, gdb.base/corefile.exp: Supply -nw as argument
+ when invoking GDB, suppresses any windowing interface.
+
+Mon Jan 2 17:40:21 1995 Stan Shebs <shebs@andros.cygnus.com>
+
+ * config/sim-gdb: New file, simulator testing support.
+
+Wed Dec 28 12:21:50 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/interrupt.exp: Test calling func1 twice.
+
+Wed Dec 21 12:51:37 1994 Jim Kingdon <kingdon@deneb.cygnus.com>
+
+ * gdb.base/list.exp (test_forward_search): Set timeout higher
+ when we'll be getting lots of output from gdb.
+
+ * gdb.base/a1-selftest.exp: Move code that was inside expect -re
+ "init_malloc" to after the expect statement. Run it if that
+ regexp is taken, but also for two others which happen if source
+ cannot be found.
+
+Tue Dec 20 12:35:21 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/printcmds.exp: New test, for printing register before
+ program is running.
+
+Mon Dec 19 00:32:55 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/list.exp: Correct some alternate expect patterns
+ to reflect changes in list1.c.
+
+Sat Dec 17 14:20:03 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Add item regarding large frames.
+
+ * gdb.base/{funcargs.exp, funcargs.c} (call_after_alloca): New test.
+
+ * TODO: Remove item about enabling return.exp; it
+ is enabled. Suggest a few more "return" tests.
+
+Sat Dec 17 02:33:37 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.c++/misc.cc, gdb.c++/inherit.exp: Add testcases for
+ anonymous unions.
+
+Tue Dec 13 11:26:00 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.chill/Makefile.in: Put all rule before rules for pr-4975.o
+ and pr-5646.o, so "make" is the same as "make all", not "make
+ pr-4975.o".
+
+Wed Dec 7 19:02:02 1994 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/list.exp: Adjust expectations to reflect changes in
+ list1.c.
+ (test_forward_search): New test proc.
+ * gdb.base/list1.c (long_line): New function, has long source line.
+
+Thu Dec 1 23:14:49 1994 Stan Shebs <shebs@andros.cygnus.com>
+
+ * gdb.base/a1-selftest.exp: Change initial stepping to know about
+ additional line of code that was added.
+
+Wed Nov 30 19:43:14 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/hppa.s: Break the large branching tests into smaller
+ tests so as not to overflow expect's input buffers.
+ * gdb.disasm/hppa.exp: Corresponding changes.
+
+Fri Nov 25 13:37:10 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ Beginnings of template debugging tests.
+ * gdb.c++/templ-info.cc: New file to test for template
+ debugging capability of the compiler.
+ * gdb.c++/Makefile.in: Add rule to build templ-info.exp from
+ templ-info.cc.
+ * gdb.c++/templates.cc: Add explicit template instantiations
+ to enable compiling with -fno-implicit-templates. Add destructor
+ and 'value' method to T5 class for template tests.
+ * gdb.c++/templates.exp: Add testcases for printing of template
+ types, setting breakpoints on template methods and calling a
+ template method.
+
+Sat Nov 5 00:20:17 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/hppa.exp (branch_tests): Allow any symbol as the
+ branch target since some assemblers (gas-2.5) may emit a
+ relocation for the branch instead of resolving it in the
+ assembler.
+
+Sat Oct 29 02:40:40 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/a1-selftest.exp: Remove RS/6000 xfail for backtrace
+ through signal handler.
+
+Fri Oct 21 11:10:16 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * configure.in (*-*-netware): Use config/mt-netware.
+
+ * config/mt-netware: New file.
+ * config/mt-i386-netware: Removed, separate configs for different
+ netware architectures are no longer needed now that we have
+ --with-headers.
+
+Sat Oct 15 03:43:00 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/exprs.exp: Remove xfail for alpha, it is fixed
+ by the recent changes to use ANSI C arithmetic conversions.
+
+Sun Oct 9 07:44:06 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/corefile.exp: Add (xfail'd) test for reinit_frame_cache
+ bug involving using inferior_pid to figure out whether to select a
+ frame.
+
+Wed Sep 28 23:12:02 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/hppa.exp: Change arg[0..3] to r[26..23] to
+ match the current disassembler output.
+
+Fri Sep 16 11:42:41 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * gdb.fortran/exprs.exp: Expect VOID instead of void.
+ * gdb.fortran/types.exp: Escape the expected '*'s in Fortran
+ types, expect "int" as type of integer values (for now).
+
+Wed Sep 7 23:33:51 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/commands.exp: New tests for if/while commands.
+
+Tue Sep 6 13:16:11 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * lib/gdb.exp (runto): Replace sub-pattern for hex value
+ by .*, since hex values have different syntax in Chill mode.
+
+Tue Sep 6 02:15:51 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.c++/demangle.exp (test_arm_style_demangling): Remove
+ linefeed from expect pattern for repeated types with indices > 9.
+
+Mon Aug 29 14:20:44 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ First part of Fortran test suite.
+ * gdb.fortran: New directory.
+ * gdb.fortran/exprs.exp, gdb.fortran/types.exp: New files.
+
+Sat Aug 27 23:32:43 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/default.exp: Update expect pattern for load command
+ without arguments.
+
+Wed Aug 24 13:15:02 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
+
+ * configure.in: Change i386 to i[345]86.
+ * gdb.base/configure.in: Likewise.
+ * gdb.c++/configure.in: Likewise.
+ * gdb.chill/configure.in: Likewise.
+
+Tue Aug 23 19:14:06 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * lib/gdb.exp (gdb_run_cmd): Move comment out from between expect
+ patterns, since that is not a valid context for comments.
+
+Fri Aug 19 15:07:30 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * gdb.c++/demangle.exp (test_arm_style_demangling): Add tests for
+ repeated types and repeated types with indices > 9.
+
+Tue Aug 16 15:57:52 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * gdb.base/printcmds.exp: Remove all the a29k XFAILs tagged with
+ 2417; old bug has been fixed.
+
+Fri Aug 12 19:35:41 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/interrupt.exp: When trying to wake up the inferior,
+ send the newline ourselves instead of assuming gdb_test will do
+ so when passed an empty input string.
+
+ * gdb.stabs/hppa.mt: Use $(AS), not $(CC) to assemble the
+ stabs testcode.
+
+Fri Aug 5 17:01:07 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * lib/gdb.exp (gdb_test): Don't send anything if the first
+ argument is an empty string. This makes cases where we want to
+ match output that is already in expect's buffers (for example,
+ matching a breakpoint after gdb_run_cmd has been called) work
+ reliably.
+
+Tue Aug 2 10:24:08 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * config/netware.exp: New file.
+
+Thu Jul 28 12:54:07 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * config/mt-slite (LDFLAGS): If using the newlib in the tree, set
+ the -B and -L prefixes so we can find the debugging stub.
+
+ * Makefile.in (CC_FOR_TARGET, CXX_FOR_TARGET): Use newlib if it is
+ there and we are using the gcc from the tree.
+
+ * gdb.base/types.c: Removed.
+
+ * gdb.base/configure.in: Look for makefile fragments in ../config.
+ Recognize i386-*-netware.
+ * gdb.c++/configure.in: Likewise.
+
+Mon Jul 25 23:48:50 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/corefile.exp: Change `else if' to `elseif', which is
+ the correct TCL syntax.
+
+Mon Jul 25 15:35:56 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * gdb.base/opaque.exp: use runto instead of messing around with
+ breakpoints. Simplify by using gdb_test.
+
+ * gdb.base/bitfields.exp: restart between tests on netware targets
+ because breakpoints aren't relocated after target death. Run
+ processes to completion.
+
+ * gdb.base/{opaque,watchpoint}.exp: Use gdb_run_cmd.
+
+Sun Jul 24 09:55:51 1994 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in: Remove extra tabs that confuse some versions
+ of "make". Use the newly built gdb to test with by default,
+ rather than the first one in the tester's search path.
+
+Sat Jul 23 15:05:47 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * gdb.base/whatis.exp (v_signed_short_array): Fix a typo.
+
+ * gdb.base/help.exp: Update expected add-symbol-file, ignore, and
+ condition help.
+
+Tue Jul 19 10:26:32 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * lib/gdb.exp (runto): Rewrite in terms of gdb_run_cmd.
+
+ * lib/gdb.exp (gdb_run_cmd): New function, used to start program
+ running.
+ * gdb.base/bitfields.exp: Use gdb_run_cmd to start program.
+ * gdb.base/funcargs.exp: Likewise.
+
+ * gdb.base/bitfields.exp: Simplify by using gdb_test.
+ * gdb.base/funcargs.exp: Likewise.
+
+ * lib/gdb.exp (gdb_test): if match times out, don't call fail if
+ message is "".
+
+Mon Jul 18 12:18:07 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * gdb.base/{a2-run,callfuncs,funcargs,interrupt,mips_pro,nodebug,
+ return,signals,twice}.exp: Handle non-existant binaries
+ consistantly.
+
+ * gdb.base/corefile.exp: Execute coremaker to generate core dump.
+ * gdb.base/Makefile.in: Don't try to generate a core dump, we
+ might testing a cross development system.
+
+Thu Jul 14 18:13:56 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * Makefile.in (RUNTEST_FOR_TARGET): Fix relative pathname, the
+ runtest script is relative to ${srcdir}, not ${rootdir}.
+
+Thu Jul 14 14:56:59 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * gdb.base/signals.exp: Allow for optionality of breakpoint
+ address.
+
+Thu Jul 14 11:21:27 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.base/{ptype.exp,ptype.c}: Add t_char_array test.
+
+Tue Jul 12 12:22:32 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
+
+ * gdb.c++/cplusfuncs.cc: Include <stddef.h>, not <sys/types.h>,
+ for size_t definition.
+ * gdb.c++/templates.cc: Likewise
+
+ * config/mt-i386-netware: New file.
+
+ * gdb.base/interrupt.c: Do not test if errno == EINTR if it's not
+ defined.
+
+ * gdb.base/Makefile.in: Added support for systems that name core
+ files by appending "core" to the program name.
+ * gdb.base/a1-selftest.exp: Likewise.
+
+Mon Jul 11 23:59:18 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/return.exp: Add comment and message for `return double'
+ test failure on Sparc Solaris.
+
+Mon Jul 4 12:10:48 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * lib/gdb.exp (runto): Allow for optionality of breakpoint address.
+
+Wed Jun 29 00:26:17 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.c++/misc.cc: Instantiate classes to inhibit the compiler
+ from optimizing them away.
+ * gdb.c++/classes.exp, gdb.c++/inherit.exp: Update ptype expect
+ patterns to include default constructors and assignment operators,
+ to match gcc versions beyond 2.5.8. Accept any cplus demangling
+ character in the output of the virtual base pointer.
+
+Fri Jun 24 08:15:42 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.c++/cplusfuncs.exp: Use string_to_regexp and a regular
+ expression match in print_addr_of to avoid unintented matches.
+ * gdb.c++/virtfunc.exp: Accept alternate ptype output of g++
+ versions up to 2.5.8.
+
+Mon Jun 20 23:54:37 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.base/list.exp: Tweak alternate pattern for listing of an
+ included file to run under newer versions of expect.
+ * gdb.c++/demangle.exp: Add spaces to the expect patterns between
+ consecutive >'s in templates to accomodate recent cplus-dem.c change.
+ Remove xfail for the virtual table of BDDHookV.
+
+Sat Jun 18 12:51:34 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * lib/gdb.exp (string_to_regexp): Set a default result.
+ (default_gdb_start): Fix misleading message.
+
+Wed Jun 15 12:10:10 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * config/mt-a29k-udi, config/mt-i960-nindy, config/mt-sparc-aout:
+ Remove all CC, etc definitions.
+ * config/mt-hpux: New file.
+ * config/mt-mips-ecoff (CFLAGS_FOR_TARGET): Remove:
+ (CFLAGS, LDFLAGS): Define.
+ * config/mt-slite (CFLAGS_FOR_TARGET): Change to LDFLAGS.
+
+ * Makefile.in (site.exp): Don't insert host_os, etc.
+ (just-check): Just use RUNTEST with RUNTESTFLAGS only.
+ (distclean): Check existence of subdir.
+ * gdb.base/configure.in (hppa*-*-hpux*): Recognize.
+ * gdb.base/Makefile.in: General cleanup and simplification.
+ Use CC, CFLAGS, and LDFLAGS instead of ..._FOR_TARGET versions
+ to build executables. Use default rule to build .o files.
+ (EXPECT, RUNTEST, CC): Fix relative pathname.
+ (site.exp): Don't insert host_os, etc.
+ * gdb.base/signals.c (main): Don't call signal unless SIGALRM
+ and/or SIGUSR1 defined.
+ * gdb.base/watchpoint.c: Don't include stdio.h a second time.
+ * gdb.c++/Makefile.in: General cleanup and simplification.
+ Use CC, CFLAGS, and LDFLAGS instead of ..._FOR_TARGET versions
+ (CFLAGS): Remove.
+ (EXPECT, RUNTEST_FOR_TARGET, CXX): Fix relative pathname.
+
+Fri Jun 10 10:55:09 1994 Jeff Law (law@snake.cs.utah.edu)
+
+ * gdb.base/recurse.exp: Misc changes to get tests running again
+ after Kung's changes to the watchpoint code.
+ * gdb.base/watchpoint.exp: Likewise.
+
+Thu Jun 9 15:16:55 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * lib/gdb.exp (string_to_regexp): Convert {\} also.
+
+Wed Jun 8 12:12:17 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * config/udi-gdb.exp, config/unix-gdb.exp: Call default_gdb_start.
+ * lib/gdb.exp (default_gdb_start): Define.
+ * gdb.base/bitfields.exp, gdb.base/break.exp, gdb.base/exprs.exp,
+ gdb.base/funcargs.exp, gdb.base/opaque.exp,
+ gdb.base/printcmds.exp, gdb.base/ptype.exp, gdb.base/recurse.exp,
+ gdb.base/scope.exp, gdb.base/setvar.exp, gdb.base/watchpoint.exp,
+ gdb.c++/classes.exp, gdb.c++/misc.exp, gdb.c++/virtfunc.exp:
+ Don't call gdb_target_udi in between tests.
+
+Tue Jun 7 08:30:15 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.c++/demangle.exp: Use gdb_test_exact, rather than demangle
+ (which was basically just a local version of the same thing). In
+ addition to avoiding duplication, gdb_test_exact is faster.
+ * lib/gdb.exp (gdb_test_exact): Fix typo.
+
+ * lib/gdb.exp (delete_breakpoints): If there were no breakpoints,
+ don't give an error.
+
+ * gdb.base/term.exp: Call delete_breakpoints before starting.
+
+ * gdb.base/Makefile.in (EXECUTABLES): Remove t10.
+ (t10): Add comment.
+
+Mon Jun 6 18:26:50 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ Reorganization of the GDB Test Suite.
+
+ * gdb.base: New directory, contains all the basic tests.
+ * gdb.c++: New directory, tests specific to C++.
+ * gdb.chill: New directory, tests specific to Chill.
+ * gdb.t00, gdb.t01, gdb.t02, gdb.t03, gdb.t04, gdb.t05, gdb.t06,
+ gdb.t07, gdb.t08, gdb.t09, gdb.t10, gdb.t11, gdb.t12, gdb.t13,
+ gdb.t15, gdb.t16, gdb.t17, gdb.t20, gdb.t21, gdb.t22, gdb.t23,
+ gdb.t24, gdb.t30, gdb.t31: Removed directories, contents moved
+ into appropriate new directories (t00-t17 to base, t20-t23 to c++,
+ t30-31 to chill).
+ * */gdbme.*: Rename to match appropriate expect scripts.
+ * gdb.base/bitfields.c, gdb.base/break.c, gdb.base/callfuncs.c,
+ gdb.base/coremaker.c, gdb.base/exprs.c, gdb.base/funcargs.c,
+ gdb.base/interrupt.c, gdb.base/list0.c, gdb.base/list0.h,
+ gdb.base/list1.c, gdb.base/mips_pro.c, gdb.base/nodebug.c,
+ gdb.base/opaque-info.c, gdb.base/opaque0.c, gdb.base/opaque1.c,
+ gdb.base/printcmds.c, gdb.base/ptype.c, gdb.base/recurse.c,
+ gdb.base/return.c, gdb.base/run.c, gdb.base/scope0.c,
+ gdb.base/scope1.c, gdb.base/setvar.c, gdb.base/signals.c,
+ gdb.base/types.c, gdb.base/twice.c, gdb.base/watchpoint.c,
+ gdb.base/whatis-info.c, gdb.base/whatis.c: New names of C files.
+ * gdb.c++/cplusfuncs.cc, gdb.c++/templates.cc, gdb.c++/misc.cc,
+ gdb.c++/virtfunc.cc: New names of C++ files.
+ * gdb.chill/chillvars.ch: New name of Chill file.
+ * gdb.base/configure.in, gdb.c++/configure.in,
+ gdb.chill/configure.in: Merge in contents of gdb.t*/configure.in.
+ * gdb.base/Makefile.in, gdb.c++/Makefile.in,
+ gdb.chill/Makefile.in: Merge in contents of gdb.t*/Makefile.in.
+ * configure.in (configdirs): Update to reflect directory changes.
+ (target_abbrev): No longer define for any configuration.
+ * Makefile.in: Cosmetic improvements to header comments.
+
+Fri Jun 3 18:56:06 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ Various changes to gdb.t31:
+
+ * Makefile.in (gdbme.o): Compile with -fspecial_UC.
+ * gdbme.ch: Make all key-words and predefineds be upper-case.
+ * chillvars.exp: Expect key-words and predefinds in upper-case.
+
+ * chillvars.exp: Use gdb_test_exact many places.
+ Change expected output for arrays (which now includes index labels).
+
+ * pr-5020.exp, gdme.ch (module PR_5020):
+ New test, for PR-5020.
+
+Thu Jun 2 16:02:41 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * lib/gdb.exp (string_to_regexp, gdb_test_exact): New procedures.
+ * Makefile.in (CHILL_LIB): Remove bogus redundant definitions.
+
+Sun May 29 22:31:42 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * Makefile.in: Fix bit-rot in definitions of CHILL,
+ CHILL_FOR_TARGET and Chill_LIB.
+ * gdb.t31/gdbme.ch: Fix syntax of nested array tuples.
+ * gdb.t31/Makefile.in: Add definitions for CHILLFLAGS,
+ CHILL, and CHILL_LIB.
+
+Sat May 21 10:05:08 1994 Bill Cox (bill@rtl.cygnus.com)
+
+ * Revert the previous changes. Please see Rob's directory
+ /lisa/test/rob/progressive/gdb/testsuite for these fixes.
+
+Thu May 19 12:51:00 1994 Bill Cox (bill@rtl.cygnus.com)
+
+ * Makefile.in, configure.in, config/mips-gdb.exp,
+ config/mt-a29k-udi, config/mt-i386-aout, config/mt-i960-nindy,
+ config/mt-sparc-aout, config/udi-gdb.exp, config/unix-gdb.exp,
+ config/unknown.exp, gdb.t00/default.exp, gdb.t00/help.exp,,
+ gdb.t00/teststrategy.exp, gdb.t01/Makefile.in, gdb.t02/Makefile.in,
+ gdb.t02/whatis.exp, gdb.t03/Makefile.in, gdb.t03/gdbme.c,
+ gdb.t04/Makefile.in, gdb.t05/Makefile.in, gdb.t06/Makefile.in,
+ gdb.t06/break.exp, gdb.t06/signals.c, gdb.t06/signals.exp,
+ gdb.t08/Makefile.in, gdb.t08/opaque.exp, gdb.t09/Makefile.in,
+ gdb.t10/Makefile.in, gdb.t11/Makefile.in, gdb.t12/Makefile.in,
+ gdb.t13/Makefile.in, gdb.t15/Makefile.in, gdb.t15/funcargs.exp,
+ gdb.t15/gdbme.c, gdb.t15/return.exp, gdb.t16/Makefile.in,
+ gdb.t17/Makefile.in, gdb.t17/callfuncs.exp, gdb.t17/gdbme.c,
+ gdb.t20/Makefile.in, gdb.t21/Makefile.in, gdb.t21/cplusfuncs.exp,
+ gdb.t22/Makefile.in, gdb.t22/virtfunc.exp, gdb.t23/Makefile.in,
+ gdb.t24/demangle.exp, lib/gdb.exp: Check in Rob's testing
+ changes from 94Q1.
+
+Wed May 18 17:04:03 1994 Bill Cox (bill@rtl.cygnus.com),
+
+ * config/mt-lynx, config/mt-m68k, config/mt-mips-ecoff,
+ config/mt-slite, config/mt-unix, config/mt-vxworks: Add
+ Rob's new testing fragments.
+
+Tue May 17 15:04:14 1994 Bill Cox (bill@rtl.cygnus.com)
+
+ * config/mips-gdb.exp, config/udi-gdb.exp, config/vx-gdb.exp,
+ lib/gdb.exp: Replace error proc calls with perror.
+
+Mon May 16 19:00:50 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * gdb.t00/teststrategy.exp: Reorder so that AIX gdb can print the
+ version also, match on casted version strings, and match on
+ gdb startup case where the line numbers might be messed up.
+
+Fri May 13 18:00:27 1994 Bill Cox (bill@rtl.cygnus.com)
+
+ * config/mt-i960-vx (LDFLAGS): Add '-r' option for test links.
+ (CFLAGS): Delete it from here.
+
+Tue May 3 16:08:09 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * gdb.t22/virtfunc.exp: Fix g++ ptype expected outputs.
+
+Fri Apr 29 14:26:35 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * Makefile.in (RUNTEST): Default to just "runtest".
+
+Tue Apr 26 22:21:40 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.t17/callfuncs.exp: More comments about t_func_values tests.
+ * gdb.t17/gdbme.c (t_func_values): Add comments about how and why
+ the code has been restructured.
+
+Thu Apr 21 12:48:07 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t00/default.exp (set write): Allow any number of \r and/or
+ \n, not just one of each.
+
+ * gdb.t07/gdbme.c (main): Don't take address of an array; SunOS4
+ /bin/cc gives a warning if you do.
+
+Thu Apr 21 11:54:04 1994 Kung Hsu (kung@mexican.cygnus.com)
+
+ * gdb.t24/demangle.exp: change expect pattern of
+ __t10ListS_link1ZUiRCUiPT0
+
+Wed Apr 13 15:05:00 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.t07/{recurse.exp, recurse.c}: New tests for watchpoints
+ on local variables in recursive functions.
+
+ * gdb.t07/Makefile.in: Build the new test.
+
+Tue Apr 12 20:45:25 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.t17/gdbme.c (t_func_values): Do not compare function pointers
+ directly. Instead compare the return values from actual calls.
+
+Mon Apr 11 10:31:00 1994 Bill Cox (bill@rtl.cygnus.com)
+
+ * Makefile.in (check): Set TCL_LIBRARY for runtest.
+
+Mon Apr 11 09:15:30 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * From Peter Schauer with minor modifications.
+ * gdb.t15/return.exp (return_tests): Handle targets where "return"
+ stops in mid-line in the caller. Add xfail for returning a float
+ value on X86 targets.
+
+Tue Apr 5 15:16:33 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/hppa.exp (fcmp_tests): Break up into two halves
+ to avoid expect lossage.
+ (fmem_LRbug_tests): Likewise.
+ * gdb.disasm/hppa.s: Corresponding changes.
+
+ * gdb.disasm/hppa.exp: Rework escape sequences and end-of-line
+ conditions to work with latest dejagnu/expect.
+
+ * gdb.t15/funcargs.exp (finish from indirect call): No longer
+ expected to fail on the PA.
+ (backtrace in call with trampolines): Explicitly require main
+ to be frame #1 (no trampolines should show up in backtrace).
+
+ * gdb.t00/default.exp: Use "exp_continue" rather than obsolete
+ "continue -expect".
+ * gdb.t06/break.exp: Likewise.
+ * gdb.t07/watchpoint.exp: Likewise.
+ * gdb.t13/bitfields.exp: Likewise.
+ * gdb.t15/{funcargs,return}.exp: Likewise.
+ * gdb.stabs/weird.exp: Likewise.
+ * config/{mips,udi}-gdb.exp: Likewise.
+
+ * hppa.sed: Enclose comments within a sed command to avoid
+ losing with the old OSF1 sed.
+
+Wed Mar 30 00:31:49 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t02/whatis.exp, gdb.t08/opaque.exp: Add XFAILs for
+ sequent dynix.
+ * gdb.t06/signals.exp: Add clear_xfail for sequent dynix.
+ * gdb.t15/funcargs.exp: Conditionally step again to really
+ finish from marker_call_with_trampolines. Handle the case where
+ the first step from within call_with_trampolines already steps
+ us back to main.
+ * gdb.t15/gdbme.c: Add comment to closing brace of
+ call_with_trampolines for funcargs.exp.
+
+Tue Mar 29 23:55:27 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.t07/watchpoint.exp (test_watchpoint_triggered_in_syscall):
+ Fix typo(s).
+
+Sun Mar 27 16:53:14 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.t07/gdbme.c: More code for watchpoint testing.
+
+ * gdb.t07/watchpoint.exp: Accept both "Watchpoint" and
+ "Hardware watchpoint" throughout file.
+ (test_watchpoint_triggered_in_syscall): New test.
+ (test_complex_watchpoint): New test.
+
+Fri Mar 25 17:05:31 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdbme.c (call_with_trampolines): New function to try and step
+ into. Tests trampoline problems on the PA.
+
+ * funcargs.exp (localvars_in_indirect_call): No longer expect
+ stepping into indirect call to fail on PAs.
+ (test_stepping_over_trampolines): New test.
+
+Wed Mar 23 07:43:33 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Add suggestions for static member function tests, and
+ completion tests.
+
+Wed Mar 16 08:28:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Add suggestions for "p/a" tests.
+
+ * lib/gdb.exp: Set prompt to (gdb) if it isn't already set.
+ (default_gdb_exit): Replace all the hair with sending "quit" to
+ the process with a simple close.
+
+Tue Mar 15 08:45:50 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Add suggestions for shared library tests.
+
+Sun Mar 13 10:45:22 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Add suggestions for x/s tests.
+
+Fri Mar 11 08:22:00 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t00/help.exp: Replace most of docstrings for "tbreak",
+ "enable once", and "enable breakpoints once" with ".*".
+
+Thu Mar 10 08:34:27 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Add suggestions about structure passing tests.
+
+Mon Mar 7 13:45:54 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t03/gdbme.c: gcc version 1 puts out the wrong stabs for
+ the primary1 test, use work around if __GNUC__ < 2.
+ * gdb.t06/signals.c: Add comments for signals.exp pattern matching.
+ * gdb.t06/signals.exp: Add XFAILs for i386 bsd and vax ultrix.
+ Test for bad output rather than waiting for timeout. Issue
+ second continue only if first continue failed.
+
+Wed Mar 2 10:08:01 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * gdb.t21/cplusfuncs.exp (test_paddr_operator_functions): Do
+ operator[] test with gdb_test because the old code didn't seem to
+ be getting the quoting right with the new dejagnu.
+
+Thu Feb 24 19:49:25 1994 Rob Savoye (rob@poseidon.cygnus.com)
+
+ * lib/gdb.exp: Set GDB to a fresh gdb if there is one, else use
+ one from the path.
+ * Makefile.in: Use a fresh expect if there is one, use runtest
+ from the src tree if there is one.
+
+Thu Feb 24 18:49:37 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * gdb.t06/break.exp (test_next_with_recursion): Remove xfail for
+ next over recursive call. Revise the tests from that point on
+ (which had been skipped) to match GDB's actual (correct) output.
+
+ * gdb.t07/watchpoint.exp (test_stepping): Remove xfail for bug
+ with next over a breakpoint whose condition is false.
+
+ * gdb.t00/help.exp: Comment out "help set print" tests just like
+ (and for same reason as) "help set" test.
+
+Mon Feb 14 09:58:23 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/hppa.s (fmemLRbug_tests): New tests.
+ * gdb.disasm/hppa.exp (fmemLRbug_tests): Run them.
+
+Sun Feb 6 15:36:13 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t06/break.exp (test_next_with_recursion): Remove no longer
+ necessary gdb_target_udi.
+
+ * gdb.t03/ptype.exp: For UDI, skip tests which call malloc.
+
+ * gdb.t02/whatis.exp, gdb.t03/ptype.exp: Remove xfails for PRs
+ 1838 and 2417; they are fixed.
+
+ * gdb.t02/whatis.exp (v_char_array, v_signed_char_array),
+ gdb.t03/ptype.exp (ptype structure, ptype union):
+ Remove xfails; the test is looser than when the xfails were added.
+
+ * gdb.t00/{help.exp,default.exp}: Don't test "target remote" on UDI.
+ * gdb.t00/help.exp: Don't expect remote to be in "help target" output.
+
+ * gdb.t01/run.exp: Only run shell test if isnative.
+
+ * config/udi-gdb.exp (gdb_load): Use "file", not "load" command,
+ since "run" automatically loads if necessary. Call gdb_target_udi
+ after the "file" since "file" kills any execution target.
+
+ * config/udi-gdb.exp (gdb_start): Don't send "set args main" to
+ GDB. GDB doesn't work that way (not anymore at least) on UDI.
+ * gdb.t01/run.exp, gdb.t06/break.exp: Don't pass extra first
+ argument for UDI.
+
+Fri Feb 4 12:19:32 1994 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * gdb.t17/interrupt.c: If we get EINTR, don't print an error message.
+
+ * gdb.t17/callfuncs.exp: Add xfails for rs6000.
+
+Sat Feb 5 09:11:56 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t24/demangle.exp: Re-write demangle to just call gdb_test,
+ properly quoting regexps. This makes the second argument to
+ demangle a fixed string, which matches the callers, instead of a
+ shell-style pattern which is what the previous implementation
+ used. Update some of the callers.
+
+Sat Feb 5 10:19:09 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/hppa.s (comib_tests): Add missing instruction.
+ (comib_nullified_tests): Fix typo.
+ * gdb.disasm/hppa.exp (all comb tests): Fix thinkos in expect
+ strings. No longer expected to fail.
+
+ * gdb.disasm/hppa.s (addib_tests): Fix typo.
+ * gdb.disasm/hppa.exp (all addb tests): Fix thinkos in expect
+ strings. No longer expected to fail.
+
+ * gdb.disasm/hppa.exp (fmpy_addsub_tests): Fix typo in expect
+ string. No longer expected to fail.
+
+Fri Feb 4 23:45:11 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/hppa.exp (fcmp_tests): Fix thinko in expect string.
+ No longer expected to fail.
+
+ * gdb.disasm/hppa.exp (xmpyu_tests): Fix buglet in expect
+ string. No longer expected to fail.
+
+Fri Feb 4 10:35:42 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t24/demangle.exp: Remove a bunch more tests which differ
+ only in the names (I probably got most of them). I was even
+ generous with some which differed in underscores in names, and
+ probably missed a few, and I *still* was able to remove almost a
+ third of the file with almost no impact on testsuite coverage.
+
+Thu Feb 3 12:04:49 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t00/default.exp: Match udi_attach error message as well as
+ the one from child_attach.
+
+ * gdb.t00/default.exp: Use "." instead of "?" to match a question mark.
+
+ * gdb.stabs/weird.exp: Remove xfail for const70; just fixed in GDB.
+
+ * gdb.stabs/weird.def (bad_neg0type): Size of this type is 16, not 8.
+ * gdb.stabs/weird.exp: Remove xfail for "p bad_neg0"; this fixes it.
+
+ * Move test with enums and partial symbols back to
+ gdb.t03/{ptype.exp,gdbme.c} from gdb.stabs/{weird.def,weird.exp}.
+ Reverts the change of 26 May 93. Per today's change to
+ stabs.texinfo, the behavior that weird.exp was expecting was
+ unreasonable; what is important is that the compiler+gdb get
+ things right, which happens with a recent gcc. Also fix the test
+ to deal with native compilers which put out the stab gdb can't
+ deal with.
+
+Mon Jan 31 15:40:11 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t24/demangle.exp: Remove a bunch of tests which differ only
+ in the names. The main thing these accomplish is to slow things down.
+ Many more such duplicates surely remain.
+
+ * gdb.t00/help.exp: Comment out "help support" test just like
+ (and for same reason as) "help set" test.
+
+Mon Jan 31 06:43:45 1994 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t06/break.exp: Remove setup_xfails for
+ sparc-sun-solaris2.*, these tests now pass with latest gcc and gdb.
+ * gdb.t20/inherit.exp (test_ptype_si): Update warning message
+ about known bug in gcc to include up through 2.5.8.
+ * gdb.t20/inherit.exp (test_ptype_vi): Accept "_vb." as well as
+ well as "_vb$".
+ * gdb.t21/cplusfuncs.exp (test_lookup_operator_functions):
+ Remove setup_xfails for sparc-sun-solaris2.*, these tests now pass
+ with latest gcc and gdb.
+ * gdb.t22/virtfunc.exp (test_ptype_of_classes): Accept "_vb." as
+ well as "_vb$".
+
+Sat Jan 29 23:31:26 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * configure.in (hppa*-*-*): Also configure and build stabs-only
+ tests.
+
+Thu Jan 27 08:21:16 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.t10/hppa.mt: A makefile fragment for the PA.
+ * gdb.t10/configure.in (hppa*-*-*): Use it.
+
+Tue Jan 25 12:58:26 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t09/corefile: Increase timeout when spawning gdb explicitly.
+
+Wed Jan 19 12:40:25 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t06/signals.exp: Handle blocked SIGTRAP on sun3 for bash
+ versions prior to 1.13.5.
+
+Tue Jan 18 20:10:50 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t00/default.exp (show prompt): In FAIL case, only match if
+ the prompt is at the start of a line.
+
+Mon Jan 17 20:07:51 1994 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.disasm/hppa.s: Add new tests for sfu and copr instructions.
+ Enable "diag" instruction. Delete copr from fpu_misc_tests, it's
+ in the copr tests now.
+ * gdb.disasm/hppa.exp: Run new sfu and copr tests. Do not expect
+ copr in the fpu_misc tests anymore. fpu_misc tests are no longer
+ expected to fail.
+
+Fri Jan 14 14:24:21 1994 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * gdb.t00/teststrategy.exp, gdb.t07/watchpoint.exp,
+ gdb.t31/chillvars.exp, lib/gdb.exp:
+ Tweak to run under either version of expect.
+ * lib/gdb.exp (default_gdb_exit): Remove "catch" statement.
+ * gdb.t00/teststrategy.exp: Use isnative and verbose procedures.
+ * gdb.t11/list.exp: Remove extraneous whitespace.
+
+Sat Jan 15 09:57:22 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t16/printcmds.exp (test_print_strings): Accept
+ "(unsigned char *) " before the string.
+
+ * TODO: Add notes about printing of fancy types and GDB expressions.
+
+Thu Jan 13 17:16:09 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * Makefile.in: Pass LDFLAGS and LIBS to sub-makes.
+ * gdb.t06/configure.in: Don't try to compile signals test program
+ if doing mips-idt-ecoff.
+
+Thu Jan 13 08:25:55 1994 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * Most .exp files: Tweak to run under either version of expect.
+
+Tue Jan 11 15:21:13 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t12/scope.exp: Add xfails for rs6000. Remove 1806 from existing
+ xfails; I'm not sure why they are failing, but not because of PR 1806.
+
+Mon Jan 10 22:14:20 1994 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * config/unix-gdb.exp: Remove gdb_unload cause it's already
+ defined in lib/gdb.exp.
+
+Fri Jan 7 12:42:45 1994 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t07/watchpoint.exp: Clear xfail for calling function with
+ watchpoint enabled on mips, CALL_DUMMY_BREAKPOINT_OFFSET got defined.
+ * gdb.t20/gdbme.cc, gdb.t21/gdbme.cc: Conversion operator functions
+ have to be typeless.
+
+Tue Jan 4 09:32:22 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: Add suggestion for copyright year test.
+
+Mon Jan 3 11:35:26 1994 Stan Shebs (shebs@andros.cygnus.com)
+
+ * configure.in (*-*-lynxos*): Add stabs tests.
+
+Wed Dec 1 21:54:05 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.stabs/hppa.sed: Only lables should ever start in column zero,
+ so insert a tab before any assembler directive in column zero.
+
+ * gdb.disasm/hppa.exp (all_fpu_memory_tests): Test FP quadword
+ stores.
+ * gdb.disasm/hppa.s (fpu_memory_indexing_tests): Add FP quadword
+ stores.
+ (fpu_short_memory_tests): Likewise.
+
+Mon Nov 22 13:23:22 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.stabs/ecoff.mt: Delete alpha specific if block, fix typo.
+ * gdb.stabs/ecoff.sed: Escape inserted blanks with backslashes, embed
+ .stabs directives in comments.
+
+Fri Nov 19 14:09:02 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * TODO: New file, describing tests we could write.
+ * gdb.t09/corefile.exp: Move description of tests to write to TODO.
+
+Tue Nov 16 21:07:44 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t06/signals.exp: Add kludge to force re-sync.
+
+ * gdb.t00/teststrategy.exp: If we accidently send the "maint dump-me"
+ to xgdb instead of gdb, get out of gdb.
+
+Tue Nov 16 10:21:57 1993 Rob Savoye (rob@cygnus.com)
+
+ * lib/gdb.exp: Make GDB and GDBFLAGS global so the scoping work
+ for info.
+
+Sat Nov 13 23:17:48 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
+
+ * gdb.stabs/hppa.mt: A makefile fragment for the PA.
+ * gdb.stabs/configure.in (hppa*-*-*): Use it.
+ * gdb.stabs/hppa.sed: New sed script for the PA.
+
+Sat Nov 13 22:50:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.stabs: Re-write weird.def and configuration to use sed
+ instead of cpp. sed is portable and POSIX; cpp is neither.
+
+Fri Nov 12 15:26:36 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t06/signals.exp: Remove one sun3 XFAIL which has been fixed.
+
+Mon Nov 8 16:55:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t20/gdbme.cc: Add comment about pmi being optimized out.
+
+Thu Nov 4 23:07:59 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.stabs/weird.exp, gdb.t22/virtfunc.exp: Accept "_vb." as well as
+ "_vb$".
+ * gdb.t00/teststrategy.exp: Add xfail for RS/6000.
+ * gdb.t03/ptype.exp: Add comments and messages about FAILs with xlc.
+
+Wed Nov 3 13:53:34 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * lib/gdb.exp: Comment out code which depends on non-existent
+ `transform' procedure.
+
+Wed Nov 3 11:23:11 1993 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * lib/gdb.exp (default_gdb_exit): Remove `catch "close"'.
+ * lib/gdb.exp: Transform tool name.
+ * gdb.t*/*.exp: Change error to perror so it works with DejaGnu
+ 1.1's new error handling system.
+
+Mon Nov 1 10:36:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in, gdb.t2*/Makefile.in: Add -O to CXXFLAGS.
+
+Fri Oct 29 17:58:14 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t00/default.exp: Avoid tests with a lot of .* in them.
+ They made pattern matching so slow that timeouts happened on
+ heavily loaded systems. Now any output from "show print" which
+ gets us back to the GDB prompt is a PASS.
+
+Mon Oct 25 14:36:50 1993 Stu Grossman (grossman at cygnus.com)
+
+ * gdb.disasm/hppa.mt: Use $(srcdir) in hppa.o make rule.
+
+Mon Oct 25 13:35:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t06/signals.exp: Skip whole file with xfail for HPPA.
+
+ * gdb.t24/demangle.exp: Remove "3220" from the one remaining xfail.
+ It is not from PR 3220.
+
+Sun Oct 24 18:49:58 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t00/{help.exp,default.exp}: Loosen up a few more tests which
+ just started failing because they depended on the order the
+ subcommands are presented, or exact docstring text. This kind of
+ test is a pain and has minimal benefit.
+
+Thu Oct 21 08:26:48 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t09/corefile.exp: At end of test, use "core" command with
+ no arguments.
+
+Wed Oct 20 08:56:02 1993 Stu Grossman (grossman at cygnus.com)
+
+ * gdb.t{01 02 03 04 05 06 07 08 09 10 11 12 13 15 16
+ 17}/Makefile.in: Make it possible to run the testsuite with Sun
+ make and CC = cross gcc by adding explicit build rules for .o
+ files.
+
+Tue Oct 19 14:57:38 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t15/funcargs.exp: Don't put comments on same line as
+ setup_xfail (@#$*%& tcl braindamage!).
+
+Mon Oct 18 21:50:08 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.disasm/hppa.exp: Use $objdir/$subdir/$binfile not just $binfile.
+
+Fri Oct 15 15:39:54 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * gdb.t20/classes.exp: 'const xxx &' becomes 'xxx const &'.
+ * gdb.t20/inherit.exp: remove three dumplicate entries.
+
+Fri Oct 15 13:45:25 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t06/break.exp: For "next over recursive call", fail on any
+ incorrect output, not just on "factorial (value=2)".
+
+Fri Oct 15 11:52:56 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t12/scope.exp: Remove xfails, filename::var syntax should be
+ working now. Add an xfail if accesing a bss variable causes
+ a memory error if the target is not yet run.
+
+Thu Oct 14 19:16:56 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t24/demangle.exp: Clean up spacing (2 strings), inclusion of
+ constructor name (2 string), name of _GLOBAL_ demangling (2 strings),
+ name of __st* demangling (2 strings). Did Kung really get the
+ more than 95 others right without testing them?
+
+Thu Oct 14 16:27:08 1993 Kung Hsu (kung@cirdan.cygnus.com)
+
+ * gdb.t24/demangle.exp: clean up XFAILS, more than 100
+
+Thu Oct 14 11:40:30 1993 Jeffrey Law (law@cs.uah.edu)
+
+ * configure.in (configdirs): Add gdb.disasm
+ * gdb.disasm: New directory for GDB disassembler tests.
+ * gdb.disasm/hppa.{exp,s,mt}: Disassembly tests for the HPPA.
+
+Thu Oct 14 11:40:30 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t00/help.exp: Don't test "help set".
+
+ * gdb.t20/inherit.exp, gdb.t22/virtfunc.exp: Remove all xfails
+ from within expect statements. None of these happen anymore and
+ they cause regressions to be silently unnoticed.
+
+ * gdb.t20/inherit.exp, gdb.t22/virtfunc.exp: Add notes (in failure
+ messages) about known failures with gcc cygnus-2.4.5-930417.
+
+ * gdb.t02/Makefile.in, gdb.t08/Makefile.in: Make all depend on
+ comp-info.exp so it gets built if it doesn't exist.
+
+ * gdb.t13/{Makefile.in,bitfields.exp}: Remove comp-info.exp stuff;
+ it is no longer used.
+ * gdb.t13/comp-info.c: Removed.
+
+Wed Oct 13 22:54:06 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * gdb.t06/signals.exp: Add xfail for sun3.
+
+Thu Oct 7 12:01:03 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t17/interrupt.exp: Add xfail for Irix (currently not really
+ relevant because ^C doesn't get sent but failure can be reproduced
+ interactively).
+
+Tue Oct 5 10:43:11 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.stabs/alpha.mt: New configuration file for alpha.
+ * gdb.stabs/configure.in: Use it.
+ * gdb.stabs/ecoff.mt, weird-ecoff.sed: Change sed script to enable
+ sharing with alpha.mt, redefine long to word via preprocessor.
+ * gdb.stabs/weird.def: Conditionally adapt storage layout of v_comb
+ for alpha.
+ * gdb.stabs/weird.exp: Handle compilation of weird.s by alpha
+ native cc.
+ * gdb.t00/teststrategy.exp: Change expect string so that we
+ consume the `(xgdb)' from the command echo and from the gdb prompt.
+ * gdb.t05/expr.exp: xfail "print unsigned int == (~0)" on the alpha.
+ gdb currently compares all values as long, so this failure probably
+ applies to any configuration where LONGEST is bigger than a target int.
+ * gdb.t08/comp-info.c: New file to determine if gdbme is compiled
+ with gcc.
+ * gdb.t08/Makefile.in, opaque.exp: Use it. Alpha native cc is unable
+ to handle opaque pointers, gcc is.
+ * gdb.t21/gdbme.cc, gdb.t23/gdbme.cc: operator new takes a size_t
+ as first argument. Include <sys/types.h> and change all operator
+ new definitions to use size_t.
+ * gdb.t21/cplusfuncs.exp: Handle changes in output for operator new
+ now that we use size_t.
+
+Wed Sep 29 00:55:49 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t03/ptype.exp, gdb.t15/printcmds.exp: When constructing
+ a long or float array cast all array members to the same type.
+ * gdb.t04/setvar.exp: Handle the decimal output of an unsigned long
+ with 64 bit longs.
+ * gdb.t07/watchpoint.exp: Add finish and until variations encountered
+ on alpha.
+ * gdb.t08/opaque.exp, gdb.t17/interrupt.exp: Add xfails for alpha.
+
+Tue Sep 28 17:26:47 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t24 (demangle.exp): Constructors of templates have names like
+ vector<int>::vector(int) not vector<int>::vector<int>(int). See
+ section 14.6 of the ARM.
+
+ * gdb.t24 (demangle.exp): Remove a whole bunch of tests of the form
+ "_vt$MoveCmd"; these differ only in name from "_vt$foo", so they
+ accomplish little and slow down the testsuite.
+
+ * gdb.t24 (demangle.exp): Accept "XXX const" as well as "const XXX".
+ Accept spaces various places.
+
+Tue Sep 21 17:28:45 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t07/watchpoint.exp: On sparc, clear xfail for calling function
+ with watchpoint enabled.
+
+ * Makefile.in: Remove definition of CC and remove the second
+ definition of CXX (the "CXX = gcc" one remains). These definitions
+ were causing backquotes to be expanded within backquotes, which
+ doesn't work.
+
+Sat Sep 18 09:43:21 1993 Jim Kingdon (kingdon@poseidon.cygnus.com)
+
+ * gdb.t17/callfuncs.exp: Add "return 0" to end.
+
+Fri Sep 17 04:41:17 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.stabs/ecoff.mt: Remove STABSCC hack.
+ * gdb.stabs/weird.exp: Handle the case where weird.o is compiled
+ by mips cc and contains no stabs entries.
+
+Thu Sep 16 17:22:12 1993 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * config/vx-gdb.exp: Use fake device to load files rather than
+ NFS.
+ * lib/gdb.exp: New proc to do "file" command.
+ * config/unix-gdb.exp: Use new "file" proc.
+
+Thu Sep 16 13:45:44 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
+
+ * config/mips-gdb.exp (gdb_load): Increase timeout to 2400.
+ Rework board rebooting slightly.
+ (gdb_exit): Don't exit from the remote shell; there isn't one.
+ * gdb.stabs/weird.exp: If a program is being debugged already,
+ kill it.
+ * gdb.t04/setvar.exp: Stop and restart gdb.
+ * gdb.t05/expr.exp: Likewise.
+ * gdb.t07/watchpoint.exp: If target is mips-idt-*, stop and
+ restart gdb and reload the program.
+ * gdb.t08/opaque.exp: Likewise.
+ * gdb.t12/scope.exp: Likewise.
+ * gdb.t13/bitfields.exp: Likewise.
+ * gdb.t15/funcargs.exp: Likewise.
+ * gdb.t20/classes.exp: Likewise.
+ * gdb.t03/ptype.exp: Increase timeout.
+ * gdb.t16/printcmds.exp (test_print_string_constants,
+ test_print_array_constants): Likewise.
+ * gdb.t17/callfuncs.exp (do_function_calls): Likewise.
+ * gdb.t20/classes.exp (do_tests): Likewise.
+ * gdb.t22/virtfunc.exp (test_virtual_calls): Likewise.
+
+Wed Sep 15 14:24:36 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * gdb.stabs: Renamed *wierd* to *weird*.
+
+Wed Sep 15 10:36:50 1993 Jim Kingdon (kingdon@cirdan.cygnus.com)
+
+ * gdb.t13/bitfields.exp: Test for bad output rather than waiting
+ for timeout. Add "known gcc 2.4.5 bug" to failure message.
+
+Tue Sep 14 17:16:44 1993 Jim Kingdon (kingdon@cirdan.cygnus.com)
+
+ * gdb.stabs/wierd.exp (print_wierd_var): Test size, not type name.
+ (do_tests): Remove xfail for whatis on one_var and two_var.
+
+Wed Sep 8 23:14:23 1993 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * Makefile.in: Made cross building work better by adding
+ {RUNTEST,CC}_FOR_TARGET and using TARGET_FLAGS_TO_PASS.
+
+Tue Sep 7 14:11:52 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t15/{return.c,return.exp,Makefile.in}:
+ New test, currently commented out.
+
+Tue Aug 31 16:51:29 1993 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * config/udi-gdb.exp: gdb_exit now kills any isstip processes
+ still running and removes the leftover named socket so GDb can do
+ clean restarts.
+
+Mon Aug 30 17:55:16 1993 Rob Savoye (rob@darkstar.cygnus.com)
+
+ * gdb.t01/run.exp: Add match for VxWorks, cause I/O comes out the
+ console, not GDB.
+ * config/mt-*: Added default values for RUNTEST and RUNTESTFLAGS so
+ cross testing works better with "make check"
+ * config/unix-gdb: Use default procedures for exit and version.
+ * config/vx-gdb.exp: Cleaned up and massaged back to working order
+ with the newest VxWorks.
+
+Thu Aug 26 17:50:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t20/classes.exp: For "ptype class Base1", continue to accept
+ old form.
+
+ * gdb.t22/virtfunc.exp: If it prints `struct' (not `class') with a
+ name (e.g. devo gdb with gcc 2.4.5), it is still a pass.
+
+ * gdb.t10/crossload.exp: Skip whole file (for now, until we fix it).
+
+ * config/unix-gdb.exp: Remove this version of gdb_exit
+ * lib/gdb.exp: Merge in all the crap from config/unix-gdb.exp.
+ Rob says he'll look at it when he gets back to testing boards.
+
+Thu Aug 26 07:20:00 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * gdb.t22/virtfunc.exp: Accept missing struct/class names as
+ an expected fail for certain ptype commands.
+
+ * gdb.t20/classes.exp: Update expected results of "ptype class
+ Base1" to account for the constructor that now appears in the type.
+
+Wed Aug 25 16:48:05 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * configure.in (configdirs): Restore gdb.t04, which mysteriously
+ disappeared from list.
+ * config/{udi-gdb.exp, gdb-unix.exp}: Replace calls to obsolete
+ "alldone" proc with call to cleanup and exit.
+ * {gdb.t01/run.exp, gdb.t01/term.exp, gdb.t02/whatis.exp,
+ gdb.t03/ptype.exp, gdb.t04/setvar.exp, gdb.t05/expr.exp,
+ gdb.t06/break.exp, gdb.t07/watchpoint.exp, gdb.t08/opaque.exp,
+ gdb.t09/corefile.exp, gdb.t10/crossload.exp, gdb.t11/list.exp,
+ gdb.t12/scope.exp, gdb.t13/bitfields.exp}: Replace calls to
+ "alldone" proc with simple returns that suppress remaining
+ tests. The alldone proc went away many months ago.
+
+Tue Aug 24 11:04:06 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t10/nodebug.exp: Comment out "maint print msymbols" tests.
+
+ * gdb.t12/gdbme0.c (localscopes, autovars): Modify to foil gcc -O.
+
+Thu Aug 19 22:08:41 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t15/funcargs.exp: Allow arguments for main in backtraces
+ as vax gdb will display them.
+
+Thu Aug 19 18:18:59 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t20/gdbme.cc: Do some calculation with v.x, to confound
+ optimizers.
+
+ * scope.exp: Change "bad value for localval" messages so each one
+ is unique.
+
+ * config/unix-gdb.exp (gdb_exit): Move info on this vs.
+ lib/gdb.exp (gdb_exit) from ChangeLog to comments.
+
+ * gdb.t06/signals.exp: Skip the whole file with xfail for delta68.
+
+Tue Aug 17 00:05:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t00/teststrategy.exp: Deal with it if cmdsize = 1 line
+ doesn't exist (due to optimization).
+
+Mon Aug 16 21:05:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.stabs/wierd.exp: Deal with it if echo of "file" command
+ contains \r because the filename is long.
+
+ * gdb.t06/signals.exp: Revise comments regarding "'next' behaved as
+ 'continue'" bug, and change xfail back to i*86-univel-sysv4*.
+
+Mon Aug 16 03:05:17 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t00/help.exp, gdb.t02/whatis.exp, gdb.t07/watchpoint.exp,
+ gdb.t08/opaque.exp, gdb.t17/interrupt.exp: Update for vax running
+ Ultrix.
+ * gdb.t02/whatis.exp: Use procedure to setup xfails on long versus
+ int tests.
+ * gdb.t08/opaque.exp: Use procedure to setup xfails for opaque tests.
+
+Thu Aug 12 15:24:28 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * Makefile.in (distclean): Remove *.log *.plog *.sum *.psum site.*.
+
+ * gdb.t17/interrupt.exp: Fix 'missing Continuing' case so pattern
+ to match does not match the passing case but still matches the
+ failing case.
+
+Thu Aug 12 16:58:59 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Makefile.in (distclean): Remove *.plog *.sum *.psum site.*.
+
+Wed Aug 11 19:47:27 1993 John Gilmore (gnu@rtl.cygnus.com)
+
+ * lib/gdb.exp (gdb_exit): Move the best version of gdb_exit
+ to here. Fix 'Quit anyway.*?' bug (? is a regexp metacharacter).
+ * config/{mips-gdb.exp, nind-gdb.exp, udi-gdb.exp, vx-gdb.exp}:
+ Remove various versions of gdb_exit.
+ * config/vx-gdb.exp: Remove quit_vxgdb, change a caller to call
+ gdb_exit.
+ * config/unix-gdb.exp: gdb_exit remains here, and should override
+ the generic version, since it's doing a lot of wierd stuff that
+ the other versions aren't. FIXME, fold it in, or abandon this
+ version.
+
+Wed Aug 11 12:09:32 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t24/demangle.exp: Add tests for PR 3220.
+
+Tue Aug 10 15:49:35 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t24/demangle.exp: Add lucid test for __vtbl__3foo__vt_cc_main_.
+
+Tue Aug 10 15:45:25 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * gdb.t07/watchpoint.exp: Clear xfail with "i*86-*-*", not just
+ "i386-*-*". Works for i486 as well.
+
+ * gdb.t06/signals.exp: Rework code that recognizes known SVR4
+ bug, and expand domain of xfail to all SVR4 systems, since the
+ actual problem is likely to be in generic SVR4 /proc support.
+
+Tue Aug 10 15:49:35 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/unix-gdb.exp (gdb_load): Add eof to expect statement.
+
+Tue Aug 10 09:56:56 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * gdb.t17/interrupt.exp: Set up xfail for *-*-sysv4*, in chain of
+ xfails for other systems. Match a missing 'Continuing.' as an
+ explicit fail for i*86-*-sysv4*, so it doesn't hose other tests.
+
+ * gdb.t20 {classes.exp, inherit.exp, misc.exp}, gdb.t21/cplusfuncs.exp,
+ gdb.t22/virtfunc.exp, gdb.t23/templates.exp, gdb.t31/chillvars.exp:
+ Only issue warning for missing executables if -all option is used.
+
+ * gdb.stabs/wierd.exp: Only issue warning for missing wierd.o
+ file if -all option is used. It's like an unpredictable XFAIL.
+
+Mon Aug 9 10:13:34 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t15/funcargs.exp: Add comments that hppa xfails are only
+ for dynamically linked binaries.
+
+ * gdb.t10/crossload.exp: Add `set gnutarget auto' at end of tests.
+
+Sun Aug 8 14:21:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t20/inherit.exp: Change message for "print tagless struct"
+ to state that this is a known bug in old versions of g++.
+
+Fri Aug 6 21:40:30 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t17/interrupt.exp: Add xfail for 386 bsd. Accept echoed newline
+ while waiting for `Continuing'.
+
+Fri Aug 6 13:38:08 1993 Fred Fish (fnf@deneb.cygnus.com)
+
+ * gdb.t10/nodebug.exp: Expect to find local/global minimal symbols
+ in text, data, and bss.
+ * gdb.t10/nodebug.c: Add local and global test variables for
+ initialized and uninitialized data.
+
+Thu Aug 5 12:18:40 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/unix-gdb.exp (gdb_exit): Add "wait".
+
+Thu Aug 5 18:14:06 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t06/signals.exp: xfail the continue from the handler for all
+ targets.
+
+ * gdb.t07/watchpoint.exp: clear_xfail for i386 when calling a
+ function with watchpoints enabled, the i386 call dummy starts with
+ a call.
+
+ * gdb.t00/teststrategy.exp, gdb.t09/Makefile.in: Handle the way
+ 386 bsd names its corefiles.
+
+Wed Aug 4 08:53:41 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t10/Makefile.in (nodebug.o): Don't use "-c -o", many
+ compilers don't grok it.
+ * gdb.t16/gdbme.c (ctable1): Initialize unsigned char array
+ with small octal ints rather than character constants, which
+ are signed and might not fit if first promoted to int.
+
+Tue Aug 3 18:28:25 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t09/Makefile.in (clean): Remove corefile.
+
+Mon Aug 2 12:47:44 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t07/watchpoint.exp: Add missing `$prompt $'.
+
+Mon Aug 2 12:30:14 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+ and Jim Kingdon (kingdon@cygnus.com)
+
+ * gdb.t06/signals.exp: Change xfail from "*-*-*" to be only for
+ NO_SINGLE_STEP machines. Fix comment about its cause. Uncomment
+ the `continue' test right after it (also xfailed if NO_SINGLE_STEP).
+
+Fri Jul 30 19:46:55 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t17/interrupt.exp: Add xfail for hppa.
+
+Fri Jul 30 12:54:11 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t02/whatis.exp, gdb.t03/ptype.exp, gdb.t08/opaque.exp,
+ gdb.t09/corefile.exp: Cleanup xfails for fixed mips bugs.
+ * gdb.t13/bitfields.exp, gdbme.c: Examine a variable in the inferior
+ to determine signed-ness of bitfields and use the result to setup
+ the xfail.
+ * gdb.t15/gdbme.c: Add comments to the two indirect call0a lines.
+ * gdb.t15/funcargs.exp: Use them to step until the second indirect
+ call line is reached if necessary.
+
+Thu Jul 29 20:33:08 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.stabs/wierd.exp: New test, for nameless baseclasses.
+
+Mon Jul 26 00:15:02 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t06/break.exp: Also test `clear' command.
+
+Wed Jul 21 18:03:38 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * gdb.t00/teststrategy.exp: Remove extra quote.
+
+ * gdb.t07/watchpoint.exp: Change xfail for calling function with
+ watchpoint enabled to be for all non-68k machines.
+
+ * gdb.t15/{mips_pro.{c,exp},Makefile.in}: New test.
+
+Mon Jul 19 23:59:26 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.stabs/configure.in: If configured -with-gnu-as for mips-*-*
+ targets use aout.mt instead of ecoff.mt as gas understands
+ standard aout format.
+
+Mon Jul 19 18:14:06 1993 Jim Kingdon (kingdon@deneb.cygnus.com)
+
+ * lib/gdb.exp (runto): Don't insist that function we are running to
+ was compiled with -g.
+
+ * gdb.t10/{nodebug.{c,exp},Makefile.in}: New test.
+
+ * gdb.t17/interrupt.exp: Before sending ^C, give the inferior time
+ to get back into the read system call.
+ Accept leading newline in case where we woke it up.
+
+Sun Jul 18 08:40:45 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.stabs/{ecoff.mt,wierd-ecoff.S,wierd-ecoff.sed}: New files
+ to make the stabs test work on ecoff systems using gcc and -with-stabs.
+ * gdb.stabs/{Makefile.in,configure.in,aout.mt,xcoff.mt}: Modify to
+ enable ecoff configuration.
+
+Thu Jul 15 11:54:58 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t15/funcargs.exp (localvars_in_indirect_call): New test.
+
+Wed Jul 14 09:36:42 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t16/printcmds.exp: Add another printf test.
+
+Wed Jul 14 15:37:13 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure.in: If configured -with-stabs on any target, add
+ stabsdirs to configdirs.
+
+Wed Jul 14 09:36:42 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t16/printcmds.exp: Change printf "%f\n" to printf "%f is
+ fun" so pattern does not match the command itself.
+
+Mon Jul 12 11:22:06 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t15/{gdbme.c,funcargs.exp}: Test for alloca-influenced frames.
+
+Sun Jul 11 12:03:24 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t17/interrupt.exp: Test for more things.
+
+Fri Jul 9 14:11:17 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t07/watchpoint.exp: In until test, deal with the way the DEC
+ compiler arranges the code and line numbers.
+
+ * gdb.t17/interrupt.exp: Don't send \n after ^C.
+
+Fri Jul 9 09:47:02 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t00/help.exp: Increase expect input buffer size.
+
+Thu Jul 8 14:26:50 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t06/signals.exp: Remove sparc xfail; bug fixed.
+
+ * gdb.t07/watchpoint.exp: Add xfail for hppa.
+
+ * gdb.t17/{gdbme.c,callfuncs.exp}: Add sum10 function, to test pa bug.
+
+ * gdb.t06/signals.exp: At "p func1 ()" test, check for breakpoint
+ [0-9]*, not just [0-9].
+
+Wed Jul 7 17:52:28 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t20/{gdbme.cc,classes.exp}: Add xfail for gdb/2972.
+
+ * gdb.t2*: Set CXXFLAGS, not CFLAGS, since that's what we use.
+
+Tue Jul 6 13:54:49 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t00/help.exp: Replace most of docstring for "continue" with .*.
+
+Mon Jul 5 22:03:45 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t06/signals.c: Add xfails for sun3.
+
+ * gdb.t07/watchpoint.exp: Comment out xfail for fixed bug 1836.
+
+ * gdb.t07/{gdbme.c,watchpoint.exp}: Add test for 2597. Also add
+ test_stepping tests.
+
+Fri Jul 2 09:08:10 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t{06,17}/Makefile.in (clean): Remove all executables.
+
+ * gdb.t17/{interrupt.{c,exp},Makefile.in}: New test for solaris bug.
+
+ * gdb.t06/twice.exp, Makefile.in: Just use an include of twice.c
+ rather than actually putting it through cpp twice.
+
+ * gdb.t06/signals.exp: Add xfails for unixware and rs6000.
+
+Fri Jul 2 10:48:03 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * config/mips-gdb.exp (gdb_exit): Removed close statement which is
+ no longer needed.
+
+Fri Jul 2 09:08:10 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t06/signals.exp: Add test for sparc bug with do_save_insn.
+
+ * gdb.t20/{classes,inherit}.exp: If a class which doesn't use any
+ C++ features prints as "struct", make it a pass, not an xfail.
+
+Thu Jul 1 22:03:33 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t22/virtfunc.exp: Remove a bunch of xfails.
+ Don't require VA to print as "class" rather than "struct".
+
+Thu Jul 1 18:27:40 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * gdb.t06/twice.exp: Don't care about the file name GDB prints.
+
+Wed Jun 30 18:01:00 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t{02,13}/comp-info.c, gdb.t06/twice.exp: Add "return 0" to end.
+
+Tue Jun 29 13:15:42 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t12/scope.exp: Remove xfail for parameter printing in wrong
+ order.
+
+Tue Jun 29 09:22:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t16/printcmds.exp: Add printf tests.
+
+ * gdb.t06/{twice.{c,exp},Makefile.in}: New test.
+
+ * gdb.t10/Makefile.in (clean): Remove $(EXECUTABLES) too.
+
+Mon Jun 28 11:25:59 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t20/classes.exp: Add clear_xfail's before printing summary
+ pass counts, to counteract any existing or future setup_xfails.
+
+Mon Jun 28 09:15:17 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.stabs/wierd{.def,-aout.S,-xcoff.S}: Use new macros
+ {BEGIN,END}_COMMON for common block instead of STAB.
+ * gdb.stabs/wierd.exp: Add xfail for rs6000.
+
+ * gdb.stabs/wierd.def: Make value of N_GSYM's 0.
+ intp_var should be N_GSYM not N_LSYM.
+ wierd-aout.S: Use a label for the value of the N_SO.
+ wierd.def: Remove all backslashes.
+ wierd-{aout,xcoff}.S: Put a few tests with backslashes here.
+
+Mon Jun 28 07:21:51 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t20/gdbme.cc (main): Move variable initialization for AIX to
+ get the expected next to inheritance3.
+
+Sun Jun 27 12:29:53 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t00/teststrategy.exp: Remove expected failure for mips-*-*
+ now that gcc-2.4 gets it right.
+
+Fri Jun 25 12:00:46 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.stabs/wierd{.def,.exp,-aout.S,-xcoff.S}: Add common block test.
+
+ * gdb.t{02,13}/{Makefile.in,gdbme.c,comp-info.c}: New way of
+ generating comp-info.exp which works for cross-compilation.
+
+Thu Jun 24 16:55:05 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t11/list.exp: For SVR4 xfails, match "*-*-sysv4*", not
+ "*-*-sysv4.*".
+
+Tue Jun 22 21:17:26 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t01/run.exp: Start with a fresh gdb.
+ * gdb.t11/list.exp: For SVR4 xfails, match on all versions of
+ SVR4.x.
+
+Mon Jun 21 15:23:22 1993 Fred Fish (fnf@cygnus.com)
+
+ * {gdb.t01, gdb.t02, gdb.t03, gdb.t04, gdb.t05, gdb.t06, gdb.t07,
+ gdb.t08, gdb.t09, gdb.t10, gdb.t11, gdb.t12, gdb.t13, gdb.t15,
+ gdb.t16, gdb.t17, gdb.t20, gdb.t21, gdb.t22, gdb.t23, gdb.t30}/
+ Makefile.in (distclean, realclean): Remove gdbme.c from list of
+ things to remove.
+
+Sat Jun 19 07:49:10 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t24/demangle.exp (test_gnu_style_demangling): Add some new
+ test cases from bug reports.
+
+Fri Jun 18 10:38:49 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t06/break.exp: Add xfails for sparc-sun-solaris2.*.
+ * gdb.t12/scope.exp: Add clear_xfails at appropriate places to
+ avoid spurious xfails.
+ * gdb.t20/classes.exp: Add xfails for longstanding C++ problems.
+ * gdb.t21/cplusfuncs.exp: Add xfails for sparc-sun-solaris2.*.
+ * gdb.t22/virtfunc.exp: Add xfails for longstanding C++ problems.
+
+Wed Jun 16 10:11:57 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t00/teststrategy.exp: Rework to provide more useful
+ description of each test, fix problem with systems that define
+ ALIGN_STACK_ON_STARTUP code, other misc cleanups.
+ * gdb.t06/break.exp (test_next_with_recursion): Fix expected
+ results for "next over recursive call" so timeouts aren't taken
+ by error.
+
+Mon Jun 14 09:09:04 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * gdb.t12/scope.exp: Test printing of variables before run.
+
+ * gdb.t12/{gdbme0.c,scope.exp}: Test for bug where parameters are
+ printed in wrong order due to sorting.
+
+Sat Jun 12 15:03:58 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t00/teststrategy.exp: Fix expected results for printing
+ user entered string constant. Is array of char, prints with no
+ address.
+
+ * gdb.t00/{default.exp, help.exp}: Account for changes to radix
+ commands.
+ * gdb.t16/gdbme.c: Add and use struct containing arrays of char.
+ * gdb.t16/printcmds.exp: Fix all lines that match "unsigned char *".
+ * gdb.t16/printcmds.exp (test_print_char_arrays): Test printing
+ of struct of char arrays.
+ * gdb.t00/radix.exp: New tests for radix commands.
+
+Fri Jun 11 13:12:27 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * gdb.t16/printcmd.exp: Print a variable before running program
+ (with xfail for AIX).
+
+Thu Jun 10 11:04:04 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * gdb.t06/{signals.exp,signals.c,Makefile.in}: New test.
+
+ * gdb.t16/printcmd.exp: Don't print variables before running program.
+
+ * gdb.t06/break.exp: Don't require envp argument to main.
+
+ * gdb.t0{2,3,4,5}/gdbme.c [_AIX]: Use signed keyword.
+
+ * gdb.t02/whatis.exp, gdb.t11/list.exp:
+ Add xfails for rs6000.
+
+ * gdb.t02/whatis.exp: Change other tests not to re-test something
+ we already tested.
+
+ * gdb.t{03,15,16}/gdbme.c: Reference all variables and make sure
+ each type used has a variable of that type.
+
+Tue Jun 8 16:45:20 1993 Jim Kingdon (kingdon@rtl.cygnus.com)
+
+ * gdb.t20/{inherit.exp,gdbme.cc}: Test tagless structure.
+
+Fri Jun 4 11:07:19 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
+
+ * configure.in: change srctrigger to be a file, not a directory
+
+Fri Jun 4 08:23:57 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure.in (mips-idt-ecoff*): Added trailing '*'.
+
+ * gdb.t11/list.exp: Fixed a couple of typos.
+
+Tue Jun 1 21:28:06 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t00 (teststrategy.exp): Remove notice about PR 1823. Bug
+ is fixed and PR is closed.
+ * gdb.t16 (gdbme.c): Add simple test string variable.
+ * gdb.t16 (printcmds.exp): Add tests with simple test string
+ variable, primarily for boundaries on "set print elements".
+
+Mon May 31 11:36:08 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * gdb.stabs/wierd.exp: Remove xfail for printing big integer.
+ Make leading 0's optional and don't expect a tab in the middle
+ of the number.
+
+ * gdb.t00/teststrategy.exp: Remove xgdb before trying the copy.
+
+ * gdb.stabs/wierd.def: Type attributes must be preceded by number=.
+ * gdb.stabs/wierd.exp: Remove xfails for type attributes. Also
+ don't end command passed to gdb_test with newline.
+
+ * gdb.t13/{Makefile.in,gdbme.c,bitfields.exp}: If we #defined the
+ signed keyword away, don't expect signed bitfields to be signed.
+
+ * gdb.t13/bitfields.exp (bitfield containment): Accept the fields
+ printing with only as many 1's as are in the field as well as printing
+ with 32 1's (see comment).
+
+Sat May 29 17:57:01 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t00/default.exp: Start with a fresh gdb.
+ * configure.in (configdirs): Remove gdb.t31 until the chill
+ compiler works again. It no longer is able to find chillrt0
+ since it isn't in libchill.a anymore.
+ * gdb.stabs/wierd.exp: Rewrite to properly handling a missing
+ wierd.o, make more modular.
+ * gdb.stabs/wierd.def (bad_neg0type, bad_neg0const): Remove
+ spurious newlines that caused problems.
+
+Wed May 26 09:57:19 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * Move test with enums and partial symbols from gdb.t03/ptype.exp
+ to gdb.stabs/wierd.exp since GCC has worked around the bug.
+ gdb.stabs/wierd.{exp,def}: Many new tests.
+
+ * gdb.t00/default.exp: update info line for new message.
+
+ * gdb.t02/{whatis.exp,gdbme.c}:
+ Test that "char *" doesn't print as "caddr_t".
+
+Tue May 25 13:28:27 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t00/help.exp: Use .* in place of some help messages which
+ just changed.
+ gdb.t00/default.exp: Update "info frame" test for new message.
+ * gdb.stabs/wierd.exp: Check for eof, directly or via gdb_test.
+ Remove some xfails
+
+Mon May 24 00:24:47 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * gdb.t03/{gdbme.c,ptype.exp}:
+ Add tests for typedef'd struct and union without tags.
+ Also check "whatis" on a variable of a typedef'd enum without a tag.
+
+ * gdb.t00/teststrategy.exp: For p "foo", remove sun4 XFAIL (see
+ PRMS 1823; the bug still exists but isn't reproduced by this test
+ anymore), and remove rs6000 XFAIL (the bug is fixed).
+
+ * gdb.t03/ptype.exp: Comment out a lot of tests which are basically
+ duplicated from whatis.exp. For those that are left, accept
+ "long", "long int", or "int" for long variables (whatis.exp already
+ has an XFAIL for "int", so no need to fail it here).
+
+ * gdb.t02/whatis.exp, gdb.t10/crossload.exp:
+ Deal with GCC's names for types now that GDB uses the compiler's names.
+
+ * gdb.t02/{Makefile.in,gdbme.c,whatis.exp}: If not GCC, do some
+ setup_xfail's for sunos4. If we #defined the signed keyword away,
+ don't expect GDB to know that char it is signed.
+
+ * gdb.t00/teststrategy.exp: Update for symbolic signal names.
+
+Sun May 23 08:44:55 1993 Fred Fish (fnf@cygnus.com)
+
+ * configure.in (configdirs): Add gdb.t24 for C++ tests that
+ should work on any system, regardless of debugging format.
+ * gdb.t21/demangle.exp: Move to gdb.t24.
+ * gdb.t24/demangle.exp: Move from gdb.t21.
+ * gdb.t24/{Makefile.in, configure.in}: New files.
+
+Thu May 20 19:39:03 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * configure.in: Do gdb.stabs and C++ tests only for stabs.
+ * gdb.stabs: New directory.
+
+Tue May 18 21:12:09 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * config/{mips,nind,udi,unix,vx}-gdb.exp: Look for "Quit anyway.*?"
+ not just "Quit anyway?".
+
+Tue May 18 17:13:20 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t21/demangle.exp: Add a couple of new patterns. Ensure
+ that all setup_xfails are immediately followed by clear_xfails.
+
+Tue May 11 09:10:47 1993 Fred Fish (fnf@cygnus.com)
+
+ * config/unix-gdb.exp, gdb.t00/echo.exp, gdb.t00/help.exp,
+ gdb.t00/teststrategy.exp, gdb.t00/gdbvars.exp, gdb.t01/run.exp,
+ gdb.t01/term.exp, gdb.t02/whatis.exp, gdb.t03/ptype.exp,
+ gdb.t04/setvar.exp, gdb.t05/expr.exp, gdb.t06/break.exp,
+ gdb.t07/watchpoint.exp, gdb.t08/opaque.exp, gdb.t09/corefile.exp,
+ gdb.t10/crossload.exp, gdb.t11/list.exp, gdb.t12/scope.exp,
+ gdb.t13/bitfields.exp, gdb.t15/funcargs.exp, gdb.t16/printcmds.exp,
+ gdb.t17/callfuncs.exp, gdb.t20/misc.exp, gdb.t20/inherit.exp,
+ gdb.t20/classes.exp, gdb.t21/demangle.exp, gdb.t21/cplusfuncs.exp,
+ gdb.t22/virtfunc.exp, gdb.t23/templates.exp, gdb.t30/chexp.exp,
+ gdb.t31/chillvars.exp, lib/gdb.exp:
+ Change place to report bugs from bug-dejagnu@prep.ai.mit.edu to
+ bug-gdb@prep.ai.mit.edu.
+
+Fri May 7 09:15:35 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t17/callfuncs.exp (do_function_calls): Call t_double_values
+ with 0.0, not integer 0.
+
+Fri Apr 30 13:17:24 1993 Jim Kingdon (kingdon@cygnus.com)
+
+ * gdb.t06/break.exp: Update for "Kill the program" message change.
+
+Fri Apr 30 09:42:57 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (GDBFLAGS): Set to -nx.
+ * Makefile.in (site.exp): Use GDBFLAGS.
+
+Wed Apr 28 13:19:07 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ * */Makefile.in (CFLAGS): add CFLAGS = -g to all subdirectory
+ Makefiles.
+ (check): depend on just-check.
+ (just-check): added so that tests can be run without a noop
+ build pass.
+
+Fri Apr 23 18:13:28 1993 K. Richard Pixley (rich@rtl.cygnus.com)
+
+ Switch to using configure's configdirs.
+ * Makefile.in (Makefile): add configure.in dependency.
+ (SUBDIRS): removed redundant assignment.
+ * configure.in: switch subdirs assignment to configdirs.
+ * gdb.t*/configure.in: new files.
+
+Thu Apr 22 08:27:53 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * gdb.t07/watchpoint.exp: Removed a29k expected failure which now
+ works.
+
+Tue Apr 20 13:38:40 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.{t20,t21,t22,t23}/Makefile.in: Use $(srcdir) to avoid $<
+ in explicit rules. Apparently this is not supported by some makes.
+
+Mon Apr 19 01:54:53 1993 John Gilmore (gnu@cygnus.com)
+
+ * gdb.t31/Makefile.in: Use $(srcdir) when avoiding $<, sigh.
+
+Fri Apr 16 09:33:46 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/unix-gdb.exp: Add back missing return 0 which mysteriously
+ disappeared.
+
+Thu Apr 15 02:28:24 1993 John Gilmore (gnu@cacophony.cygnus.com)
+
+ * gdb.t31/Makefile.in: Avoid $< in explicit rule.
+
+Wed Apr 14 16:38:47 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t07/watchpoint.exp: Remove setup_xfail for i486
+ watchpoint problem that is now fixed.
+ * gdb.t30/chexp.exp: Remove setup_xfail for printing
+ uninitialized convenience variables.
+ * gdb.t31/chillvars.exp: Fix expected patterns for printing
+ structures.
+
+Wed Apr 14 12:55:58 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t00/help.exp: Compensate for bug in mips-*-ultrix* OS
+ which causes expect to get out of sync with gdb on long output
+ from help set.
+ * gdb.t09/corefile.exp: Make expected pattern for core file
+ failing signal and frame output format less sun specific.
+
+Tue Apr 13 23:18:07 1993 Per Bothner (bothner@cygnus.com)
+
+ * gdb.t31/chillvars.exp: Add and remove initial dummy
+ breakpoint, so that symbol table is forced in.
+ (Needed at least on Sunos4, though it seems not SVR4.)
+ * gdb.t31/chillvars.exp: Update for changed output format.
+
+Sun Apr 11 17:21:45 1993 Rob Savoye (rob at darkstar.cygnus.com)
+
+ * config/unix-gdb.exp: Gracefully exits if $GDB is a bogus path.
+
+Wed Apr 7 21:28:21 1993 Rob Savoye (rob@cygnus.com)
+
+ * Makefile.in: Added --srcdir when invoking runtest, removed the
+ need for a local config file. (optional now)
+
+Wed Apr 7 14:13:41 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t21/demangle.exp: Only count real fails (not xfails) for
+ failure count used to force early termination. Add some more
+ expected failures for gnu style demangling.
+
+Thu Apr 1 09:50:30 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * Makefile.in (CXXFLAGS): Remove -O. It caused the debug info for the
+ pmi variable from gdb.t20/gdbme to get optimized away.
+ * gdb.t00/teststrategy.exp: Added expected failure for mips-*-*.
+ Check for written corefile upon timeout _and_ eof.
+
+Tue Mar 30 09:58:16 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * config/unix-gdb.exp: Add missing return 0.
+
+Tue Mar 30 08:34:25 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
+
+ * gdb.t16/printcmds.exp: Remove misplaced xfail that caused an early
+ test termination.
+
+Mon Mar 29 17:37:25 1993 Fred Fish (fnf@cygnus.com)
+
+ * configure.in (subdirs): Put back gdb.t17 which mysteriously
+ disappeared.
+
+Thu Mar 25 21:05:16 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t10/crossload.exp: Disable the i860-elf test until such
+ time as i860 support works.
+
+ * gdb.t15/funcargs.exp: Fix expected outputs to include
+ "backtrace 100\r" rather than just "backtrace\r", to match last
+ change.
+
+Thu Mar 25 12:14:28 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * config/udi-gdb.exp (gdb_exit): Remove close command.
+ (gdb_target_udi): New procedure to set the UDI target.
+ (gdb_start): Don't remove *_soc files. Use gdb_target_udi.
+ * gdb.t00/default.exp: Added expected failures for a29k-*-udi.
+ Added waits for prompts after several question responses. Added
+ some more responses used by a29k-amd-udi-gdb.
+ * gdb.t01/run.exp, gdb.t06/break.exp: Added a29k-*-udi support:
+ pass different arguments, restart UDI connection after program
+ completion.
+ * gdb.t02/whatis.exp, gdb.t03/ptype.exp, gdb.t07/watchpoint.exp,
+ gdb.t08/opaque.exp, gdb.t11/list.exp, gdb.t12/scope.exp,
+ gdb.t15/funcargs.exp, gdb.t16/printcmds.exp, gdb.t20/misc.exp,
+ gdb.t21/cplusfuncs.exp: Added expected failures for a29k-*-*.
+ * gdb.t04/setvar.exp, gdb.t05/expr.exp, gdb.t07/watchpoint.exp,
+ gdb.t08/opaque.exp, gdb.t12/scope.exp, gdb.t13/bitfields.exp,
+ gdb.t15/funcargs.exp, gdb.t16/printcmds.exp,
+ gdb.t17/callfuncs.exp, gdb.t20/classes.exp, gdb.t20/inherit.exp,
+ gdb.t20/misc.exp, gdb.t22/virtfuncs.exp: Restart UDI connection
+ after program completion.
+ * gdb.t10/crossload.exp: Does not work for a29k-*-*, since BFD is
+ compiled with a SELECT_VECS setting.
+ * gdb.t15/funcargs.exp: Use argument to backtrace to prevent
+ infinite recursion.
+
+ * gdb.t20/classes.exp, gdb.t20/inherit.exp, gdb.t22/virtfuncs.exp:
+ Added checks for COFF results, and made them expected failures for
+ all targets. It would be better to make them expected failures
+ for COFF targets only.
+
+Wed Mar 24 14:43:38 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com)
+
+ * Makefile.in: add null dvi target, don't bother to recurse
+ through test directories for info and install-info; rename
+ $(datadir) to be dejagnu instead of deja-gnu
+
+Wed Mar 24 09:48:03 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t31/gdbme.ch: Re-enable code that previously caused
+ compiler to coredump.
+ * gdb.t31/chillvars.exp: Re-enable tests that depend on that
+ code.
+
+Tue Mar 23 08:53:42 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t31/gdbme.ch: Comment out code that causes chill compiler
+ coredump.
+ * gdb.t31/chillvars.exp: Comment out tests that depend on that
+ code.
+
+Sun Mar 21 17:56:47 1993 Rob Savoye (rob at darkstar.cygnus.com)
+
+ * gdb.t03/ptype.exp: tests for return code from gdb_test.
+ * gdb.t00/teststrategy.exp: Uses which proc rather than spawning
+ which in a shell. Deletes xgdb when done.
+ * config/unix-gdb.exp: Won't try to spawn $GDB unless it exists.
+ Tests the return from the "set height" or "set width" commands.
+ Added a few return codes where needed.
+
+Wed Mar 17 11:31:01 1993 Fred Fish (fnf@cygnus.com)
+
+ * Makefile.in (SUBDIRS): Add gdb.t17.
+ * configure.in (subdirs): Add gdb.t17.
+ * gdb.t17/{Makefile.in, callfuncs.exp, gdbme.c}: New test
+ files to test gdb's calling of functions in the inferior with
+ the correct arguments and gdb's ability to retrieve any
+ result returned.
+
+Tue Mar 16 15:37:11 1993 Fred Fish (fnf@cygnus.com)
+
+ * config/unix-gdb.exp (gdb_exit): Remove close commands that
+ may be called after gdb goes away. Previous versions of expect
+ needed these to avoid file descriptor leaks, but they cause
+ errors with the current revision of expect.
+ * gdb.t00/gdbvars.exp: Use -re on expected output after
+ setting sevenbit-strings.
+ * gdb.t04/setvar.exp, gdb.t13/bitfields.exp: Make commands
+ to set sevenbit-strings consistent across tests.
+ gdb.t30/chexp.exp, gdb.t31/chillvars.exp: Make commands to
+ set sevenbit-strings consistent across tests.
+
+Fri Mar 12 08:47:20 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t21/demangle.exp (proc demangle): Adjust quotes in an
+ expected output to match current "expect" expectations.
+
+Wed Mar 10 18:01:49 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t00/default.exp: Change expected output for default "source"
+ command, to match new gdb behavior which requires a filename to
+ source.
+
+Tue Mar 9 11:00:56 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t07/watchpoint.exp (test_simple_watchpoint): Set up
+ expected fail for i486-*-* that misses the marker2 function.
+ * gdb.t10/crossload.exp (bfddefault): Allow successful
+ recognition of a format to pass even if no symbols are found.
+ Explicitly catch failures where the format is not recognized
+ or is ambiguous, and add the reason to the fail message.
+ * gdb.t10/crossload.exp (bfdexplicit): Catch failure where
+ the cause is and invalid target and add reason to failure message.
+ * gdb.t10/crossload.exp: Fix bfd target names for elf32-m68k,
+ elf32-i386, elf32-sparc, and elf32-i860.
+ * gdb.t12/scope.exp (test_at_main, test_at_foo, test_at_bar):
+ Set up expected failure for 'filename'::variable scope resolution,
+ which is now apparently broken on all targets.
+ * gdb.t20/classes.exp, gdb.t20/inherit.exp, gdb.t20/misc.exp,
+ gdb.t21/cplusfuncs.exp, gdb.t22/virtfunc.exp,
+ gdb.t23/templates.exp: Change failure for missing binfile into
+ just a warning.
+ gdb.t21/demangle.exp: Change all cfront references to 'arm'
+ references.
+
+Mon Mar 8 19:20:28 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t00/default.exp: Add expected output for default "source"
+ command, to match new gdb behavior.
+ * gdb.t09/corefile.exp: Use GDBFLAGS when spawning GDB.
+
+Sun Mar 7 15:14:09 1993 Rob Savoye (rob@cygnus.com)
+
+ * config/*-gdb.exp: returns an error, rather than exiting on
+ internal errors.
+
+Tue Mar 2 18:09:32 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t03/gdbme.c: Add pointer to struct variable.
+ * gdb.t03/ptype.exp: Test equivalence of '.' and '->' for
+ referencing struct members.
+
+Thu Feb 25 10:39:06 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * configure.in (mips-idt-ecoff): New target.
+ * config/mips-gdb.exp: New file for remote board using MIPS remote
+ debugging protocol.
+
+ * Redid configuration scheme. Removed gdb.t*/configure.in.
+ Renamed gdb.t*/in-gdbme* to gdb.t*/gdbme*. Changed to use CC, CXX
+ instead of CC_FOR_TARGET, CXX_FOR_TARGET. Added mostlyclean and
+ distclean targets. Built executables via .o files. Adjusted
+ tests to account for source files in $(srcdir) rather than
+ $(objdir).
+ * lib/gdb.exp (runto): Don't expect () after the function name,
+ because it may have arguments.
+
+Wed Feb 24 08:05:38 1993 Ian Lance Taylor (ian@cygnus.com)
+
+ * gdb.t00/default.exp, gdb.t01/run.exp, gdb.t02/whatis.exp,
+ gdb.t03/ptype.exp, gdb.t06/break.exp, gdb.t12/scope.exp: Added
+ expected failures for mips-idt-* and mips-sgi-*.
+ * gdb.t00/default.exp (attach): Kill process if requested.
+ * gdb.t00/help.exp (help target core, help target): Accept a gdb
+ that does not read core files.
+ * gdb.t01/run.exp: Removed checks for exit status code.
+ * gdb.t03/in-gdbme.c: Make explicit call to malloc to ensure that
+ it is linked in.
+ * gdb.t03/ptype.exp: Increase timeout when calling malloc.
+ * gdb.t04/setvar.exp, gdb.t05/expr.exp: Use runto function where
+ appropriate, rather than doing it by hand.
+ * gdb.t07/watchpoint.exp: If mips-idt-*, reload file after first
+ execution.
+ * gdb.t10/crossload.exp: Kill existing program if needed.
+ * gdb.t15/funcargs.exp: Use delete_breakpoints function where
+ appropriate, rather than doing it by hand. Always increase
+ timeout for this test, not just for VxWorks.
+
+Wed Feb 24 08:03:38 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t31/chillvars.exp (test_structs): New proc to test printing
+ of Chill STRUCT types and STRUCT values.
+ * gdb.t31/chillvars.exp (test_strings): Expect "CHAR" now, rather
+ than "char".
+ * gdb.t31/in-gdbme.ch (simple_struct, nested_struct, struct1,
+ struct2): New struct definitions and initializations to test
+ simple Chill STRUCT types.
+
+Tue Feb 23 11:55:06 1993 Fred Fish (fnf@cygnus.com)
+
+ * gdb.t00/teststrategy.exp: Track reversion in gdb to not print
+ the null byte at the end of strings.
+ * gdb.t00/default.exp: Make show version insensitive to copyright
+ date.
+ * gdb.t16/in-gdbme.c (ctable1, ctable2): Make explicitly unsigned
+ to avoid dependencies on target char signedness.
+ * gdb.t16/printcmds.exp: Update expected results for explicitly
+ unsigned char.
+ * gdb.t16/printcmds.exp: Remove setup_xfails for i960 that should
+ now work.
+ * gdb.t21/demangle.exp: Add many more patterns for template
+ demangling, most of them being expected failures.
+ * gdb.t21/demangle.exp (proc demangle): Quote the demangled
+ string we are matching for, to match on the whole string.
+ * gdb.t21/demangle.exp: Add many new test strings to demangle,
+ and fix a whole bunch that had incorrect expected output but were
+ passing anyway because of the bug in "proc demangle".
+ * gdb.t31/chillvars.exp: Remove setup_xfail for printing string
+ type.
+ * gdb.t31/in-gdbme.ch: Uncomment string4, now compiles.
+
+Mon Feb 22 07:54:03 1993 Mike Werner (mtw@poseidon.cygnus.com)
+
+ * gdb/testsuite: made modifications to testcases, etc., to allow
+ them to work properly given the reorganization of deja-gnu and the
+ relocation of the testcases from deja-gnu to a "tool" subdirectory.
+
+Sun Feb 21 10:55:55 1993 Mike Werner (mtw@poseidon.cygnus.com)
+
+ * gdb/testsuite: Initial creation of gdb/testsuite.
+ Migrated dejagnu testcases and support files for testing nm to
+ gdb/testsuite from deja-gnu. These files were moved "as is"
+ with no modifications. This migration is part of a major overhaul
+ of dejagnu. The modifications to these testcases, etc., which
+ will allow them to work with the new version of dejagnu will be
+ made in a future update.
+
+Local Variables:
+mode: indented-text
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
new file mode 100644
index 00000000000..b936e39fdb9
--- /dev/null
+++ b/gdb/testsuite/Makefile.in
@@ -0,0 +1,192 @@
+# Makefile for regression testing the GNU debugger.
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+
+# This file is part of GDB.
+
+# GDB is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# GDB is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+host_alias = @host_alias@
+target_alias = @target_alias@
+program_transform_name = @program_transform_name@
+build_canonical = @build@
+host_canonical = @host@
+target_canonical = @target@
+target_cpu = @gdb_target_cpu@
+
+SHELL = @SHELL@
+EXEEXT = @EXEEXT@
+SUBDIRS = @subdirs@
+RPATH_ENVVAR = @RPATH_ENVVAR@
+
+EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
+ echo $${rootme}/../../expect/expect ; \
+ else echo expect ; fi`
+
+RUNTEST = $(RUNTEST_FOR_TARGET)
+
+RUNTESTFLAGS =
+
+RUNTEST_FOR_TARGET = `\
+ if [ -f $${srcdir}/../../dejagnu/runtest ]; then \
+ echo $${srcdir}/../../dejagnu/runtest; \
+ else \
+ if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
+ echo runtest; \
+ else \
+ t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
+ fi; \
+ fi`
+
+#### host, target, and site specific Makefile frags come in here.
+
+# The use of $$(x_FOR_TARGET) reduces the command line length by not
+# duplicating the lengthy definition.
+
+TARGET_FLAGS_TO_PASS = \
+ "prefix=$(prefix)" \
+ "exec_prefix=$(exec_prefix)" \
+ "against=$(against)" \
+ 'CC=$$(CC_FOR_TARGET)' \
+ "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
+ "CFLAGS=$(TESTSUITE_CFLAGS)" \
+ "CHILLFLAGS=$(CHILLFLAGS)" \
+ 'CHILL=$$(CHILL_FOR_TARGET)' \
+ "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
+ "CHILL_LIB=$(CHILL_LIB)" \
+ 'CXX=$$(CXX_FOR_TARGET)' \
+ "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
+ "CXXFLAGS=$(CXXFLAGS)" \
+ "MAKEINFO=$(MAKEINFO)" \
+ "INSTALL=$(INSTALL)" \
+ "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
+ "INSTALL_DATA=$(INSTALL_DATA)" \
+ "LDFLAGS=$(LDFLAGS)" \
+ "LIBS=$(LIBS)" \
+ "RUNTEST=$(RUNTEST)" \
+ "RUNTESTFLAGS=$(RUNTESTFLAGS)"
+
+all:
+ @echo "Nothing to be done for all..."
+
+.NOEXPORT:
+INFODIRS=doc
+info:
+install-info:
+dvi:
+html:
+install-html:
+
+install:
+
+uninstall: force
+
+site.exp: ./config.status Makefile
+ @echo "Making a new config file..."
+ -@rm -f ./tmp?
+ @touch site.exp
+ -@mv site.exp site.bak
+ @echo "## these variables are automatically generated by make ##" > ./tmp0
+ @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
+ @echo "# add them to the last section" >> ./tmp0
+ @echo "set host_alias $(host_alias)" >> ./tmp0
+ @echo "set host_triplet ${host_canonical}" >> ./tmp0
+ @echo "set target_alias $(target_alias)" >> ./tmp0
+ @echo "set target_triplet ${target_canonical}" >> ./tmp0
+ @echo "set build_triplet ${build_canonical}" >> ./tmp0
+ @echo "set srcdir ${srcdir}" >> ./tmp0
+ @echo "set tool gdb" >> ./tmp0
+ @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
+ @cat ./tmp0 > site.exp
+ @cat site.bak | sed \
+ -e '1,/^## All variables above are.*##/ d' >> site.exp
+ -@rm -f ./tmp?
+
+installcheck:
+
+check: site.exp all just-check
+
+just-check:
+ rootme=`pwd`; export rootme; \
+ srcdir=${srcdir} ; export srcdir ; \
+ EXPECT=${EXPECT} ; export EXPECT ; \
+ EXEEXT=${EXEEXT} ; export EXEEXT ; \
+ $(RPATH_ENVVAR)=$$rootme/../../expect:$$rootme/../../libstdc++:$$rootme/../../tk/unix:$$rootme/../../tcl/unix:$$rootme/../../bfd:$$rootme/../../opcodes:$$$(RPATH_ENVVAR); \
+ export $(RPATH_ENVVAR); \
+ if [ -f $${rootme}/../../expect/expect ] ; then \
+ TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
+ export TCL_LIBRARY ; fi ; \
+ $(RUNTEST) $(RUNTESTFLAGS)
+
+subdir_do: force
+ @for i in $(DODIRS); do \
+ if [ -d ./$$i ] ; then \
+ if (rootme=`pwd`/ ; export rootme ; \
+ rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
+ cd ./$$i; \
+ $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \
+ else exit 1 ; fi ; \
+ else true ; fi ; \
+ done
+
+force:;
+
+subdirs:
+ for dir in ${SUBDIRS} ; \
+ do \
+ echo "$$dir:" ; \
+ if [ -d $$dir ] ; then \
+ (rootme=`pwd`/ ; export rootme ; \
+ rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
+ cd $$dir; $(MAKE) $(TARGET_FLAGS_TO_PASS)); \
+ fi; \
+ done
+
+clean mostlyclean:
+ -rm -f *~ core *.o a.out xgdb *.x *.grt
+ if [ x"${SUBDIRS}" != x ] ; then \
+ for dir in ${SUBDIRS}; \
+ do \
+ echo "$$dir:"; \
+ if [ -d $$dir ]; then \
+ (cd $$dir; $(MAKE) clean); \
+ fi; \
+ done ; \
+ else true; fi
+
+distclean maintainer-clean realclean: clean
+ -rm -f *~ core
+ -rm -f Makefile config.status *-init.exp
+ -rm -fr *.log summary detail *.plog *.sum *.psum site.*
+ if [ x"${SUBDIRS}" != x ] ; then \
+ for dir in ${SUBDIRS}; \
+ do \
+ echo "$$dir:"; \
+ if [ -d $$dir ]; then \
+ (cd $$dir; $(MAKE) distclean); \
+ fi; \
+ done ; \
+ else true; fi
+
+Makefile : Makefile.in config.status $(host_makefile_frag) $(target_makefile_frag)
+ $(SHELL) config.status
+
+config.status: configure
+ $(SHELL) config.status --recheck
diff --git a/gdb/testsuite/TODO b/gdb/testsuite/TODO
new file mode 100644
index 00000000000..978991c77cd
--- /dev/null
+++ b/gdb/testsuite/TODO
@@ -0,0 +1,202 @@
+The highest priority item is not on this list: Fix bugs in the
+existing testsuite, fix the GDB/compiler/shell/etc bugs which it
+detects (particularly when they are hard to XFAIL), make it run
+reliably without unexpected failures on the "standard" machines, etc.
+This list exists largely as "tests we can add when we are ready to
+risk destabilizing it again".
+
+There are some tests which are only run on some platforms because they
+have not been tested on more platforms. Enable them and fix any
+problems. A partial list: recurse.exp, watchpoint.exp
+(test_watchpoint_triggered_in_syscall, test_complex_watchpoint).
+
+Test printing of structures passed by value, for the 7th, 8th, and 9th
+arguments (PR 1714). Test printing structure arguments of
+2,4,6,8,12,16,and 20 bytes. Same for structure return of all those
+sizes ("return", "finish", and call function).
+
+Get crossload tests to use --enable-targets and reenable them.
+
+corefile.exp:
+Test ability to run program when there is a core target, then go
+back to the core file when the program exits.
+
+Test handling of floating point variables
+1. float, double, or long double
+2. in register or saved register or memory. Also the case where a
+double is in two float registers and only one of them is saved.
+3. print them or set them
+4. (Alpha) integer (32 or 64 bit) in floating point register.
+
+Print registers--"p $r5", "p sizeof ($r5)". Test that they print
+appropriately (integer registers in decimal, registers which always
+contain addresses (pc, probably sp and fp, maybe others) in hex,
+floating point).
+
+Test completer. Test that it completes a variety of things correctly
+(see the list of test cases in main.c in the gdb source). Test TAB,
+M-?, and the "complete" command.
+
+Test "info line" with all kinds of linespecs. Test that the last line
+of the file works right.
+
+weird.exp--test that unrecognized cross-reference types or
+unrecognized visibility or virtual characters get skipped properly
+(see stabs.texinfo).
+
+Test C++ nested types (especially if PR 1954 is fixed; even if not
+*some* things already should work even in the presence of nested
+types). Test classes nested more than 9 levels deep (g++ mangles
+these differently) (both a demangle test and some tests which also
+test the compiler). Test calling a method of a class nested more than
+9 levels (for gdb_mangle_name and demangling).
+
+Test static member functions (C++). Test that "ptype" shows them
+correctly, both before and after they have been converted from stub
+methods. Test that we can call them.
+
+Test printing complicated types, including functions, pointers to
+arrays of pointers of functions, functions which return pointers to
+functions, etc.
+
+printcmd.exp--test printing enum values. Test printing an enum
+variable whose value is out of range. Test "p (int)enum_var", "p/x
+enum_var". Test that in something like "enum {FOO, LAST_THING=FOO}"
+we print FOO, not LAST_THING.
+
+Test GDB expressions--test all operators (and overloaded operators for
+C++). Test integer constants which are signed or unsigned int, long,
+or long long. Test detection of overflow of an integer constant.
+Here are a few integer constants to test (test they get the right
+types): 5, 5LL, 5LuL, 5L6u (invalid), 5LU. Maybe things like
+0x12345678, 0x87654321, etc., but their types depend on sizes of int,
+long, etc.
+
+Test that printing const-qualified versions of various types works.
+In particular, on the sparc and probably other machines, "double" is
+handled differently from most types because it requires more alignment
+and thus goes in a different section (there is a gcc 2.4.5 bug with
+"const double" on sparc).
+
+Test that GDB's "source" command works and that things work if stdin
+is redirected (to a file or a pipe). Test user defined command. Run
+an inferior each of these ways (to test that inflow.c works). Test
+that GDB works if the last line of stdin or a source'd file lacks a
+newline.
+
+Test that unmatched single quotes produce error messages, both in
+expressions and linespecs.
+
+Test "cd". "foo/bar/.." should get simplified to "foo". "/../.."
+should not get simplified (for Mach). "/.." should not get simplified
+(for other networked OSes; POSIX.1 section B.2.3.7). All these
+examples should continue to work with trailing slashes.
+
+Test scoping; here is a start
+ 1 int i=2;
+ 2 int j=3;
+ 3 main()
+ 4 {
+ 5 int i;
+ 6 for (i=600; i>0; i--)
+ 7 print_line(i);
+ 8 }
+ 9
+10 print_line(i)
+11 int i;
+12 {
+13 h();
+14 printf("%d\n",i);
+15 }
+16
+17 h()
+18 {
+19 printf("In h...");
+20 }
+Set a breakpoint in h, and print i, print_line::i, and main::i. Set a
+breakpoint in main (or don't run the program), and test that
+print_line::i is an error. But if i were static, "p main::i" should
+work even if the program is not being run.
+
+Write a test for the reentracy bug with rs6000_struct_return_address
+in rs6000-tdep.c.
+
+Test "return" from dummy frames. Test "return" from non-innermost
+frame. Test that "return" from a non-innermost frame restores
+registers which are saved not in that frame but in a frame more inner
+(I believe this currently works on few if any architectures).
+
+FORTRAN common blocks (a.out and xcoff--weird.exp has the start of
+one but it is not quite right as of 19 Nov 1993).
+
+Test that "x" command sets $_ and $__. Test $_ in general.
+
+Test that "p/a" works when given addresses in text, data, and bss
+segments. Test that it works if program is compiled with or without
+-g. Test that it works if preceding symbol is static or if it is
+extern.
+
+Given `char abc[] = "abc\0def";' test "x/s abc" followed by "x/s"
+(should display "abc" followed by "def"). Test this works with no
+error message even if this is the last thing in the section (tests
+that val_print_string ignores an error if the error occurs after the
+'\0').
+
+Test ability to process NMAGIC a.out files.
+
+Test shared libraries: "next" over printf, "step" into a function in
+a shared library which has line number info, breakpoint in a function
+in a shared library (either before or after the program is run and the
+shared libraries are loaded--also maybe write a test where the PLT
+will be in an unloaded state even though the shared library is loaded).
+
+If there are two breakpoints in the same place, and exactly one of
+them has its condition true, test that the correct breakpoint gets
+printed.
+
+Test "jump" including jump to a breakpoint (the latter will need an
+xfail for UDI and probably VxWorks (PR 1786 for vxworks; PR 2416
+contains some info for 29k).
+
+Set a watchpoint on a local variable (to be interesting, make a few
+calls, to be more interesting, make a recursive call). Test that it
+gets disabled when leaving that scope.
+
+Test calling a function, hitting a breakpoint in the called function,
+calling another function, and hitting a breakpoint. Test backtrace
+works in the presence of multiple dummy frames. Test that "continue"
+will get you out of the inner called function, and "continue" again
+will get you back to where you were when you called the first one.
+
+Test special longjmp handling in wait_for_inferior (need to figure out
+in detail what the proper behavior in each case is). Test longjmp to
+a place where there is a breakpoint (such that
+BPSTAT_WHAT_CLEAR_LONGJMP_RESUME_SINGLE happens). In general, test
+interactions between longjmp and watchpoints, breakpoints, stepping,
+call function, etc.
+
+Test jumping right past a breakpoint (the case where wait_for_inferior
+passes not_a_breakpoint to bpstat_stop_status). Might already be
+tested by some of the sun3 tests. Probably want a .s test to avoid
+compiler dependencies.
+
+Test more obscure wait_for_inferior cases, expanding on the tests in
+watchpoint.exp, signals.exp, etc.
+
+Test stepping into functions which are one line long and functions
+which are on line 1 of the source file. (there is a class of bugs in
+which gdb doesn't find the line number information, and thus doesn't
+step into the function).
+
+Test that prologue recognition, backtrace, printing locals, etc.,
+still work in the presence of large frames (the point being that at
+some point immediate fields in RISC instructions will overflow and
+prologues will need to look different. For sparc, the immediate field
+is 13 bits (signed), so I believe the threshold would be 4K bytes in a
+frame).
+
+
+(this is for editing this file with GNU emacs)
+Local Variables:
+mode: text
+End:
diff --git a/gdb/testsuite/aclocal.m4 b/gdb/testsuite/aclocal.m4
new file mode 100644
index 00000000000..c754fdcf2f7
--- /dev/null
+++ b/gdb/testsuite/aclocal.m4
@@ -0,0 +1,583 @@
+dnl This file is duplicated in four places:
+dnl * gdb/aclocal.m4
+dnl * gdb/testsuite/aclocal.m4
+dnl * expect/aclocal.m4
+dnl * dejagnu/aclocal.m4
+dnl Consider modifying all copies in parallel.
+dnl written by Rob Savoye <rob@cygnus.com> for Cygnus Support
+dnl CYGNUS LOCAL: This gets the right posix flag for gcc
+AC_DEFUN(CY_AC_TCL_LYNX_POSIX,
+[AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP])
+AC_MSG_CHECKING([to see if this is LynxOS])
+AC_CACHE_VAL(ac_cv_os_lynx,
+[AC_EGREP_CPP(yes,
+[/*
+ * The old Lynx "cc" only defines "Lynx", but the newer one uses "__Lynx__"
+ */
+#if defined(__Lynx__) || defined(Lynx)
+yes
+#endif
+], ac_cv_os_lynx=yes, ac_cv_os_lynx=no)])
+#
+if test "$ac_cv_os_lynx" = "yes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(LYNX)
+ AC_MSG_CHECKING([whether -mposix or -X is available])
+ AC_CACHE_VAL(ac_cv_c_posix_flag,
+ [AC_TRY_COMPILE(,[
+ /*
+ * This flag varies depending on how old the compiler is.
+ * -X is for the old "cc" and "gcc" (based on 1.42).
+ * -mposix is for the new gcc (at least 2.5.8).
+ */
+ #if defined(__GNUC__) && __GNUC__ >= 2
+ choke me
+ #endif
+ ], ac_cv_c_posix_flag=" -mposix", ac_cv_c_posix_flag=" -X")])
+ CC="$CC $ac_cv_c_posix_flag"
+ AC_MSG_RESULT($ac_cv_c_posix_flag)
+ else
+ AC_MSG_RESULT(no)
+fi
+])
+
+AC_DEFUN(CY_AC_PATH_TCLH, [
+#
+# Ok, lets find the tcl source trees so we can use the headers
+# Warning: transition of version 9 to 10 will break this algorithm
+# because 10 sorts before 9. We also look for just tcl. We have to
+# be careful that we don't match stuff like tclX by accident.
+# the alternative search directory is involked by --with-tclinclude
+#
+no_tcl=true
+AC_MSG_CHECKING(for Tcl private headers)
+AC_ARG_WITH(tclinclude, [ --with-tclinclude directory where tcl private headers are], with_tclinclude=${withval})
+AC_CACHE_VAL(ac_cv_c_tclh,[
+# first check to see if --with-tclinclude was specified
+if test x"${with_tclinclude}" != x ; then
+ if test -f ${with_tclinclude}/tclInt.h ; then
+ ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)`
+ else
+ AC_MSG_ERROR([${with_tclinclude} directory doesn't contain private headers])
+ fi
+fi
+# next check in private source directory
+#
+# since ls returns lowest version numbers first, reverse its output
+if test x"${ac_cv_c_tclh}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[[0-9]]* 2>/dev/null` \
+ ${srcdir}/../../tcl \
+ `ls -dr ${srcdir}/../../tcl[[0-9]]* 2>/dev/null` \
+ ${srcdir}/../../../tcl \
+ `ls -dr ${srcdir}/../../../tcl[[0-9]]* 2>/dev/null ` ; do
+ if test -f $i/tclInt.h ; then
+ ac_cv_c_tclh=`(cd $i; pwd)`
+ break
+ fi
+ # Tcl 7.5 and greater puts headers in subdirectory.
+ if test -f $i/generic/tclInt.h ; then
+ ac_cv_c_tclh=`(cd $i; pwd)`/generic
+ break
+ fi
+ done
+fi
+# finally check in a few common install locations
+#
+# since ls returns lowest version numbers first, reverse its output
+if test x"${ac_cv_c_tclh}" = x ; then
+ for i in \
+ `ls -dr /usr/local/src/tcl[[0-9]]* 2>/dev/null` \
+ `ls -dr /usr/local/lib/tcl[[0-9]]* 2>/dev/null` \
+ /usr/local/src/tcl \
+ /usr/local/lib/tcl \
+ ${prefix}/include ; do
+ if test -f $i/tclInt.h ; then
+ ac_cv_c_tclh=`(cd $i; pwd)`
+ break
+ fi
+ done
+fi
+# see if one is installed
+if test x"${ac_cv_c_tclh}" = x ; then
+ AC_HEADER_CHECK(tclInt.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="")
+fi
+])
+if test x"${ac_cv_c_tclh}" = x ; then
+ TCLHDIR="# no Tcl private headers found"
+ AC_MSG_ERROR([Can't find Tcl private headers])
+fi
+if test x"${ac_cv_c_tclh}" != x ; then
+ no_tcl=""
+ if test x"${ac_cv_c_tclh}" = x"installed" ; then
+ AC_MSG_RESULT([is installed])
+ TCLHDIR=""
+ else
+ AC_MSG_RESULT([found in ${ac_cv_c_tclh}])
+ # this hack is cause the TCLHDIR won't print if there is a "-I" in it.
+ TCLHDIR="-I${ac_cv_c_tclh}"
+ fi
+fi
+
+AC_MSG_CHECKING([Tcl version])
+orig_includes="$CPPFLAGS"
+
+if test x"${TCLHDIR}" != x ; then
+ CPPFLAGS="$CPPFLAGS $TCLHDIR"
+fi
+
+# Get major and minor versions of Tcl. Use funny names to avoid
+# clashes with eg SunOS.
+cat > conftest.c <<'EOF'
+#include "tcl.h"
+MaJor = TCL_MAJOR_VERSION
+MiNor = TCL_MINOR_VERSION
+EOF
+
+tclmajor=
+tclminor=
+if (eval "$CPP $CPPFLAGS conftest.c") 2>/dev/null >conftest.out; then
+ # Success.
+ tclmajor=`egrep '^MaJor = ' conftest.out | sed -e 's/^MaJor = *//' -e 's/ *$//'`
+ tclminor=`egrep '^MiNor = ' conftest.out | sed -e 's/^MiNor = *//' -e 's/ *$//'`
+fi
+rm -f conftest.c conftest.out
+
+if test -z "$tclmajor" || test -z "$tclminor"; then
+ AC_MSG_RESULT([fatal error: could not find major or minor version number of Tcl])
+ exit 1
+fi
+AC_MSG_RESULT(${tclmajor}.${tclminor})
+
+CPPFLAGS="${orig_includes}"
+
+AC_PROVIDE([$0])
+AC_SUBST(TCLHDIR)
+])
+AC_DEFUN(CY_AC_PATH_TCLLIB, [
+#
+# Ok, lets find the tcl library
+# First, look for one uninstalled.
+# the alternative search directory is invoked by --with-tcllib
+#
+
+if test $tclmajor -ge 7 -a $tclminor -ge 4 ; then
+ installedtcllibroot=tcl$tclversion
+else
+ installedtcllibroot=tcl
+fi
+
+if test x"${no_tcl}" = x ; then
+ # we reset no_tcl incase something fails here
+ no_tcl=true
+ AC_ARG_WITH(tcllib, [ --with-tcllib directory where the tcl library is],
+ with_tcllib=${withval})
+ AC_MSG_CHECKING([for Tcl library])
+ AC_CACHE_VAL(ac_cv_c_tcllib,[
+ # First check to see if --with-tcllib was specified.
+ # This requires checking for both the installed and uninstalled name-styles
+ # since we have no idea if it's installed or not.
+ if test x"${with_tcllib}" != x ; then
+ if test -f "${with_tcllib}/lib$installedtcllibroot.so" ; then
+ ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.so
+ elif test -f "${with_tcllib}/libtcl.so" ; then
+ ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.so
+ # then look for a freshly built statically linked library
+ # if Makefile exists we assume its configured and libtcl will be built first.
+ elif test -f "${with_tcllib}/lib$installedtcllibroot.a" ; then
+ ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.a
+ elif test -f "${with_tcllib}/libtcl.a" ; then
+ ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.a
+ else
+ AC_MSG_ERROR([${with_tcllib} directory doesn't contain libraries])
+ fi
+ fi
+ # then check for a private Tcl library
+ # Since these are uninstalled, use the simple lib name root.
+ if test x"${ac_cv_c_tcllib}" = x ; then
+ for i in \
+ ../tcl \
+ `ls -dr ../tcl[[0-9]]* 2>/dev/null` \
+ ../../tcl \
+ `ls -dr ../../tcl[[0-9]]* 2>/dev/null` \
+ ../../../tcl \
+ `ls -dr ../../../tcl[[0-9]]* 2>/dev/null` ; do
+ # Tcl 7.5 and greater puts library in subdir. Look there first.
+ if test -f "$i/unix/libtcl.so" ; then
+ ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so
+ break
+ elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then
+ ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a
+ break
+ # look for a freshly built dynamically linked library
+ elif test -f "$i/libtcl.so" ; then
+ ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so
+ break
+
+ # then look for a freshly built statically linked library
+ # if Makefile exists we assume its configured and libtcl will be
+ # built first.
+ elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then
+ ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a
+ break
+ fi
+ done
+ fi
+ # check in a few common install locations
+ if test x"${ac_cv_c_tcllib}" = x ; then
+ for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
+ # first look for a freshly built dynamically linked library
+ if test -f "$i/lib$installedtcllibroot.so" ; then
+ ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.so
+ break
+ # then look for a freshly built statically linked library
+ # if Makefile exists we assume its configured and libtcl will be built first.
+ elif test -f "$i/lib$installedtcllibroot.a" -o -f "$i/Makefile" ; then
+ ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.a
+ break
+ fi
+ done
+ fi
+ # check in a few other private locations
+ if test x"${ac_cv_c_tcllib}" = x ; then
+ for i in \
+ ${srcdir}/../tcl \
+ `ls -dr ${srcdir}/../tcl[[0-9]]* 2>/dev/null` ; do
+ # Tcl 7.5 and greater puts library in subdir. Look there first.
+ if test -f "$i/unix/libtcl.so" ; then
+ ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so
+ break
+ elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then
+ ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a
+ break
+ # look for a freshly built dynamically linked library
+ elif test -f "$i/libtcl.so" ; then
+ ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so
+ break
+
+ # then look for a freshly built statically linked library
+ # if Makefile exists we assume its configured and libtcl will be
+ # built first.
+ elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then
+ ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a
+ break
+ fi
+ done
+ fi
+
+ # see if one is conveniently installed with the compiler
+ if test x"${ac_cv_c_tcllib}" = x ; then
+ orig_libs="$LIBS"
+ LIBS="$LIBS -l$installedtcllibroot -lm"
+ AC_TRY_RUN([
+ Tcl_AppInit()
+ { exit(0); }], ac_cv_c_tcllib="-l$installedtcllibroot", ac_cv_c_tcllib=""
+ , ac_cv_c_tclib="-l$installedtcllibroot")
+ LIBS="${orig_libs}"
+ fi
+ ])
+ if test x"${ac_cv_c_tcllib}" = x ; then
+ TCLLIB="# no Tcl library found"
+ AC_MSG_WARN(Can't find Tcl library)
+ else
+ TCLLIB=${ac_cv_c_tcllib}
+ AC_MSG_RESULT(found $TCLLIB)
+ no_tcl=
+ fi
+fi
+
+AC_PROVIDE([$0])
+AC_SUBST(TCLLIB)
+])
+AC_DEFUN(CY_AC_PATH_TKH, [
+#
+# Ok, lets find the tk source trees so we can use the headers
+# If the directory (presumably symlink) named "tk" exists, use that one
+# in preference to any others. Same logic is used when choosing library
+# and again with Tcl. The search order is the best place to look first, then in
+# decreasing significance. The loop breaks if the trigger file is found.
+# Note the gross little conversion here of srcdir by cd'ing to the found
+# directory. This converts the path from a relative to an absolute, so
+# recursive cache variables for the path will work right. We check all
+# the possible paths in one loop rather than many seperate loops to speed
+# things up.
+# the alternative search directory is invoked by --with-tkinclude
+#
+AC_MSG_CHECKING(for Tk private headers)
+AC_ARG_WITH(tkinclude, [ --with-tkinclude directory where the tk private headers are],
+ with_tkinclude=${withval})
+no_tk=true
+AC_CACHE_VAL(ac_cv_c_tkh,[
+# first check to see if --with-tkinclude was specified
+if test x"${with_tkinclude}" != x ; then
+ if test -f ${with_tkinclude}/tk.h ; then
+ ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)`
+ else
+ AC_MSG_ERROR([${with_tkinclude} directory doesn't contain private headers])
+ fi
+fi
+# next check in private source directory
+#
+# since ls returns lowest version numbers first, reverse the entire list
+# and search for the worst fit, overwriting it with better fits as we find them
+if test x"${ac_cv_c_tkh}" = x ; then
+ for i in \
+ ${srcdir}/../tk \
+ `ls -dr ${srcdir}/../tk[[0-9]]* 2>/dev/null` \
+ ${srcdir}/../../tk \
+ `ls -dr ${srcdir}/../../tk[[0-9]]* 2>/dev/null` \
+ ${srcdir}/../../../tk \
+ `ls -dr ${srcdir}/../../../tk[[0-9]]* 2>/dev/null ` ; do
+ if test -f $i/tk.h ; then
+ ac_cv_c_tkh=`(cd $i; pwd)`
+ break
+ fi
+ # Tk 4.1 and greater puts this in a subdir.
+ if test -f $i/generic/tk.h; then
+ ac_cv_c_tkh=`(cd $i; pwd)`/generic
+ fi
+ done
+fi
+# finally check in a few common install locations
+#
+# since ls returns lowest version numbers first, reverse the entire list
+# and search for the worst fit, overwriting it with better fits as we find them
+if test x"${ac_cv_c_tkh}" = x ; then
+ for i in \
+ `ls -dr /usr/local/src/tk[[0-9]]* 2>/dev/null` \
+ `ls -dr /usr/local/lib/tk[[0-9]]* 2>/dev/null` \
+ /usr/local/src/tk \
+ /usr/local/lib/tk \
+ ${prefix}/include ; do
+ if test -f $i/tk.h ; then
+ ac_cv_c_tkh=`(cd $i; pwd)`
+ break
+ fi
+ done
+fi
+# see if one is installed
+if test x"${ac_cv_c_tkh}" = x ; then
+ AC_HEADER_CHECK(tk.h, ac_cv_c_tkh=installed)
+fi
+])
+if test x"${ac_cv_c_tkh}" != x ; then
+ no_tk=""
+ if test x"${ac_cv_c_tkh}" = x"installed" ; then
+ AC_MSG_RESULT([is installed])
+ TKHDIR=""
+ else
+ AC_MSG_RESULT([found in $ac_cv_c_tkh])
+ # this hack is cause the TKHDIR won't print if there is a "-I" in it.
+ TKHDIR="-I${ac_cv_c_tkh}"
+ fi
+else
+ TKHDIR="# no Tk directory found"
+ AC_MSG_WARN([Can't find Tk private headers])
+ no_tk=true
+fi
+
+# if Tk is installed, extract the major/minor version
+if test x"${no_tk}" = x ; then
+AC_MSG_CHECKING([Tk version])
+orig_includes="$CPPFLAGS"
+
+if test x"${TCLHDIR}" != x ; then
+ CPPFLAGS="$CPPFLAGS $TCLHDIR"
+fi
+if test x"${TKHDIR}" != x ; then
+ CPPFLAGS="$CPPFLAGS $TKHDIR"
+fi
+if test x"${x_includes}" != x -a x"${x_includes}" != xNONE ; then
+ CPPFLAGS="$CPPFLAGS -I$x_includes"
+fi
+
+# Get major and minor versions of Tk. Use funny names to avoid
+# clashes with eg SunOS.
+cat > conftest.c <<'EOF'
+#include "tk.h"
+MaJor = TK_MAJOR_VERSION
+MiNor = TK_MINOR_VERSION
+EOF
+
+tkmajor=
+tkminor=
+if (eval "$CPP $CPPFLAGS conftest.c") 2>/dev/null >conftest.out; then
+ # Success.
+ tkmajor=`egrep '^MaJor = ' conftest.out | sed -e 's/^MaJor = *//' -e 's/ *$//'`
+ tkminor=`egrep '^MiNor = ' conftest.out | sed -e 's/^MiNor = *//' -e 's/ *$//'`
+fi
+rm -f conftest.c conftest.out
+
+if test -z "$tkmajor" || test -z "$tkminor"; then
+ AC_MSG_RESULT([fatal error: could not find major or minor version number of Tk])
+ exit 1
+fi
+AC_MSG_RESULT(${tkmajor}.${tkminor})
+
+CPPFLAGS="${orig_includes}"
+fi
+
+AC_PROVIDE([$0])
+AC_SUBST(TKHDIR)
+])
+AC_DEFUN(CY_AC_PATH_TKLIB, [
+AC_REQUIRE([CY_AC_PATH_TCL])
+#
+# Ok, lets find the tk library
+# First, look for the latest private (uninstalled) copy
+# Notice that the destinations in backwards priority since the tests have
+# no break.
+# Then we look for either .a, .so, or Makefile. A Makefile is acceptable
+# is it indicates the target has been configured and will (probably)
+# soon be built. This allows an entire tree of Tcl software to be
+# configured at once and then built.
+# the alternative search directory is invoked by --with-tklib
+#
+
+if test x"${no_tk}" = x ; then
+ # reset no_tk incase something fails here
+ no_tk="true"
+
+ if test $tkmajor -ge 4 ; then
+ installedtklibroot=tk$tkversion
+ else
+ installedtkllibroot=tk
+ fi
+
+ AC_ARG_WITH(tklib, [ --with-tklib directory where the tk library is],
+ with_tklib=${withval})
+ AC_MSG_CHECKING([for Tk library])
+ AC_CACHE_VAL(ac_cv_c_tklib,[
+ # first check to see if --with-tklib was specified
+ # This requires checking for both the installed and uninstalled name-styles
+ # since we have no idea if it's installed or not.
+ if test x"${with_tklib}" != x ; then
+ if test -f "${with_tklib}/lib$installedtklibroot.so" ; then
+ ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.so
+ no_tk=""
+ elif test -f "${with_tklib}/libtk.so" ; then
+ ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.so
+ no_tk=""
+ # then look for a freshly built statically linked library
+ # if Makefile exists we assume its configured and libtk will be built
+ elif test -f "${with_tklib}/lib$installedtklibroot.a" ; then
+ ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.a
+ no_tk=""
+ elif test -f "${with_tklib}/libtk.a" ; then
+ ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.a
+ no_tk=""
+ else
+ AC_MSG_ERROR([${with_tklib} directory doesn't contain libraries])
+ fi
+ fi
+ # then check for a private Tk library
+ # Since these are uninstalled, use the simple lib name root.
+ if test x"${ac_cv_c_tklib}" = x ; then
+ for i in \
+ ../tk \
+ `ls -dr ../tk[[0-9]]* 2>/dev/null` \
+ ../../tk \
+ `ls -dr ../../tk[[0-9]]* 2>/dev/null` \
+ ../../../tk \
+ `ls -dr ../../../tk[[0-9]]* 2>/dev/null` ; do
+ # Tk 4.1 and greater puts things in subdirs. Check these first.
+ if test -f "$i/unix/libtk.so" ; then
+ ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so
+ no_tk=
+ break
+ elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then
+ ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.a
+ no_tk=
+ break
+ # look for a freshly built dynamically linked library
+ elif test -f "$i/libtk.so" ; then
+ ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so
+ no_tk=
+ break
+ # then look for a freshly built statically linked library
+ # if Makefile exists we assume its configured and libtk will be built
+ elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then
+ ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a
+ no_tk=""
+ break
+ fi
+ done
+ fi
+ # finally check in a few common install locations
+ if test x"${ac_cv_c_tklib}" = x ; then
+ for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
+ # first look for a freshly built dynamically linked library
+ if test -f "$i/lib$installedtklibroot.so" ; then
+ ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.so
+ no_tk=""
+ break
+ # then look for a freshly built statically linked library
+ # if Makefile exists, we assume it's configured and libtcl will be built
+ elif test -f "$i/lib$installedtklibroot.a" -o -f "$i/Makefile" ; then
+ ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.a
+ no_tk=""
+ break
+ fi
+ done
+ fi
+ # check in a few other private locations
+ if test x"${ac_cv_c_tklib}" = x ; then
+ for i in \
+ ${srcdir}/../tk \
+ `ls -dr ${srcdir}/../tk[[0-9]]* 2>/dev/null` ; do
+ # Tk 4.1 and greater puts things in subdirs. Check these first.
+ if test -f "$i/unix/libtk.so" ; then
+ ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so
+ no_tk=
+ break
+ elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then
+ ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtk.a
+ no_tk=
+ break
+ # look for a freshly built dynamically linked library
+ elif test -f "$i/libtk.so" ; then
+ ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so
+ no_tk=""
+ break
+ # then look for a freshly built statically linked library
+ # if Makefile exists, we assume it's configured and libtcl will be built
+ elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then
+ ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a
+ no_tk=""
+ break
+ fi
+ done
+ fi
+ # see if one is conveniently installed with the compiler
+ if test x"${ac_cv_c_tklib}" = x ; then
+ AC_REQUIRE([AC_PATH_X])
+ orig_libs="$LIBS"
+ LIBS="$LIBS -l$installedtklibroot $x_libraries $ac_cv_c_tcllib -lm"
+ AC_TRY_RUN([
+ Tcl_AppInit()
+ { exit(0); }], ac_cv_c_tklib="-l$installedtklibroot", ac_cv_c_tklib=""
+ , ac_cv_c_tklib="-l$installedtklibroot")
+ LIBS="${orig_libs}"
+ fi
+ ])
+ if test x"${ac_cv_c_tklib}" = x ; then
+ TKLIB="# no Tk library found"
+ AC_MSG_WARN(Can't find Tk library)
+ else
+ TKLIB=$ac_cv_c_tklib
+ AC_MSG_RESULT(found $TKLIB)
+ no_tk=
+ fi
+fi
+AC_PROVIDE([$0])
+AC_SUBST(TKLIB)
+])
+AC_DEFUN(CY_AC_PATH_TK, [
+ CY_AC_PATH_TKH
+ CY_AC_PATH_TKLIB
+])
+AC_DEFUN(CY_AC_PATH_TCL, [
+ CY_AC_PATH_TCLH
+ CY_AC_PATH_TCLLIB
+])
diff --git a/gdb/testsuite/config/abug.exp b/gdb/testsuite/config/abug.exp
new file mode 100644
index 00000000000..99b8a9db1f7
--- /dev/null
+++ b/gdb/testsuite/config/abug.exp
@@ -0,0 +1,20 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
diff --git a/gdb/testsuite/config/arm-ice.exp b/gdb/testsuite/config/arm-ice.exp
new file mode 100644
index 00000000000..d9842743d94
--- /dev/null
+++ b/gdb/testsuite/config/arm-ice.exp
@@ -0,0 +1 @@
+load_lib "../config/monitor.exp";
diff --git a/gdb/testsuite/config/cfdbug.exp b/gdb/testsuite/config/cfdbug.exp
new file mode 100644
index 00000000000..edd91e4df76
--- /dev/null
+++ b/gdb/testsuite/config/cfdbug.exp
@@ -0,0 +1,20 @@
+# Copyright 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib "../config/monitor.exp"
diff --git a/gdb/testsuite/config/cpu32bug.exp b/gdb/testsuite/config/cpu32bug.exp
new file mode 100644
index 00000000000..99b8a9db1f7
--- /dev/null
+++ b/gdb/testsuite/config/cpu32bug.exp
@@ -0,0 +1,20 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
diff --git a/gdb/testsuite/config/cygmon.exp b/gdb/testsuite/config/cygmon.exp
new file mode 100644
index 00000000000..d9842743d94
--- /dev/null
+++ b/gdb/testsuite/config/cygmon.exp
@@ -0,0 +1 @@
+load_lib "../config/monitor.exp";
diff --git a/gdb/testsuite/config/d10v.exp b/gdb/testsuite/config/d10v.exp
new file mode 100644
index 00000000000..955288c7ff0
--- /dev/null
+++ b/gdb/testsuite/config/d10v.exp
@@ -0,0 +1,20 @@
+# Copyright (C) 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib "../config/monitor.exp"
diff --git a/gdb/testsuite/config/dve.exp b/gdb/testsuite/config/dve.exp
new file mode 100644
index 00000000000..4b60b5aa965
--- /dev/null
+++ b/gdb/testsuite/config/dve.exp
@@ -0,0 +1,23 @@
+# Copyright 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
+set timeout 1000
+verbose "Timeout is now $timeout seconds" 2
+
diff --git a/gdb/testsuite/config/est.exp b/gdb/testsuite/config/est.exp
new file mode 100644
index 00000000000..99b8a9db1f7
--- /dev/null
+++ b/gdb/testsuite/config/est.exp
@@ -0,0 +1,20 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
diff --git a/gdb/testsuite/config/gdbserver.exp b/gdb/testsuite/config/gdbserver.exp
new file mode 100644
index 00000000000..2c63729d72e
--- /dev/null
+++ b/gdb/testsuite/config/gdbserver.exp
@@ -0,0 +1,212 @@
+# Test framework for GDB (remote protocol) using a "gdbserver",
+# ie. a debug agent running as a native process on the same or
+# a different host.
+
+# Copyright 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder. (msnyder@redhat.com)
+
+#
+# This module to be used for testing gdb with a "gdbserver"
+# built either from libremote or from gdb/gdbserver.
+#
+
+# Load the basic testing library, and the remote stuff.
+load_lib ../config/monitor.exp
+
+#
+# To be addressed or set in your baseboard config file:
+#
+# set_board_info gdb_protocol "remote"
+# Unles you have a gdbserver that uses a different protocol...
+#
+# set_board_info use_gdb_stub 1
+# This tells the rest of the test suite not to do things
+# like "run" which don't work well on remote targets.
+#
+# set_board_info gdb,do_reload_on_run 1
+# Unles you have a gdbserver that can handle multiple sessions.
+#
+# set_board_info noargs 1
+# At present there is no provision in the remote protocol
+# for passing arguments. This test framework does not
+# address the issue, so it's best to set this variable
+# in your baseboard configuration file.
+# FIXME: there's no reason why the test harness couldn't
+# pass commandline args when it spawns gdbserver.
+#
+# set_board_info gdb,noinferiorio 1
+# Neither the traditional gdbserver nor the one in libremote
+# can presently capture stdout and relay it to GDB via the
+# 'O' packet. This means that tests involving printf will
+# fail unles you set this varibale in your baseboard
+# configuration file.
+#
+# set_board_info gdb,no_hardware_watchpoints 1
+# Unles you have a gdbserver that supports hardware watchpoints.
+# FIXME: gdb should detect if the target doesn't support them,
+# and fall back to using software watchpoints.
+#
+# set_board_info gdb_server_prog
+# This will be the path to the gdbserver program you want to test.
+# Defaults to "gdbserver".
+#
+# set_board_info sockethost
+# The name of the host computer whose socket is being used.
+# Defaults to "localhost". Note: old gdbserver requires
+# that you define this, but libremote/gdbserver does not.
+#
+# set_board_info socketport
+# Port id to use for socket connection. If not set explicitly,
+# it will start at "2345" and increment for each use.
+#
+
+
+
+#
+# gdb_load -- load a file into the debugger.
+# return a -1 if anything goes wrong.
+#
+
+global server_exec;
+global portnum;
+set portnum "2345";
+
+proc gdb_load { args } {
+ global server_exec;
+ global portnum;
+ global verbose;
+ global gdb_prompt;
+
+ # Port id -- either specified in baseboard file, or managed here.
+ if [target_info exists gdb,socketport] {
+ set portnum [target_info gdb,socketport];
+ } else {
+ # Bump the port number to avoid conflicts with hung ports.
+ incr portnum;
+ }
+
+ # Extract the local and remote host ids from the target board struct.
+
+ if [target_info exists sockethost] {
+ set debughost [target_info sockethost];
+ } else {
+ set debughost "localhost:";
+ }
+ # Extract the protocol
+ if [target_info exists gdb_protocol] {
+ set protocol [target_info gdb_protocol];
+ } else {
+ set protocol "remote";
+ }
+
+ # Extract the name of the gdbserver, if known (default 'gdbserver').
+ if [target_info exists gdb_server_prog] {
+ set gdbserver [target_info gdb_server_prog];
+ } else {
+ set gdbserver "gdbserver";
+ }
+ # Extract the socket hostname
+ if [target_info exists sockethost] {
+ set sockethost [target_info sockethost];
+ } else {
+ set sockethost ""
+ }
+
+ # Export the host:port pair.
+ set gdbport $debughost$portnum;
+
+ if { $args == "" || $args == "{}" } {
+ if [info exists server_exec] {
+ set args $server_exec;
+ } else {
+ send_gdb "info files\n";
+ gdb_expect 30 {
+ -re "Symbols from \"(\[^\"\]+)\"" {
+ set args $expect_out(1,string);
+ exp_continue;
+ }
+ -re "Local exec file:\[\r\n\]+\[ \t\]*`(\[^'\]+)'," {
+ set args $expect_out(1,string);
+ exp_continue;
+ }
+ -re "$gdb_prompt $" { }
+ }
+ }
+ }
+
+ # remember new exec file
+ set server_exec $args;
+
+ # Fire off the debug agent
+ if [target_info exists gdb_server_args] {
+ # This flavour of gdbserver takes as arguments those specified
+ # in the board configuration file
+ set custom_args [target_info gdb_server_args];
+ remote_spawn host \
+ "$gdbserver $custom_args >& /dev/null < /dev/null &" \
+ writeonly
+ } else {
+ # This flavour of gdbserver takes as arguments the port information
+ # and the name of the executable file to be debugged.
+ remote_spawn host \
+ "$gdbserver $sockethost$portnum $args >& /dev/null < /dev/null &" \
+ writeonly
+ }
+ # Give it a little time to establish
+ sleep 2
+
+ # tell gdb what file we are debugging
+ if [gdb_file_cmd $args] {
+ return -1;
+ }
+
+ # attach to the "serial port"
+ gdb_target_cmd $protocol $gdbport;
+
+ # do the real load if needed
+ if [target_info exists gdb_server_do_load] {
+ send_gdb "load\n"
+ set timeout 2400
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ if $verbose>1 then {
+ send_user "Loaded $arg into $GDB\n"
+ }
+ set timeout 30
+ verbose "Timeout is now $timeout seconds" 2
+ return 1
+ }
+ -re "$gdb_prompt $" {
+ if $verbose>1 then {
+ perror "GDB couldn't load."
+ }
+ }
+ timeout {
+ if $verbose>1 then {
+ perror "Timed out trying to load $arg."
+ }
+ }
+ }
+ }
+
+ return 0;
+}
diff --git a/gdb/testsuite/config/h8300.exp b/gdb/testsuite/config/h8300.exp
new file mode 100644
index 00000000000..d9842743d94
--- /dev/null
+++ b/gdb/testsuite/config/h8300.exp
@@ -0,0 +1 @@
+load_lib "../config/monitor.exp";
diff --git a/gdb/testsuite/config/hmsirom.exp b/gdb/testsuite/config/hmsirom.exp
new file mode 100644
index 00000000000..8c6e7dad560
--- /dev/null
+++ b/gdb/testsuite/config/hmsirom.exp
@@ -0,0 +1,22 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Support for testing against a Hitachi SH3 target rom
+
+load_lib ../config/monitor.exp
diff --git a/gdb/testsuite/config/hppro.exp b/gdb/testsuite/config/hppro.exp
new file mode 100644
index 00000000000..e341ae6e9e5
--- /dev/null
+++ b/gdb/testsuite/config/hppro.exp
@@ -0,0 +1,24 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
+
+# Hppro monitor is very slow...
+set timeout 540
+verbose "Timeout is now $timeout seconds" 2
diff --git a/gdb/testsuite/config/i386-bozo.exp b/gdb/testsuite/config/i386-bozo.exp
new file mode 100644
index 00000000000..78090937380
--- /dev/null
+++ b/gdb/testsuite/config/i386-bozo.exp
@@ -0,0 +1 @@
+load_lib "../config/monitor.exp"
diff --git a/gdb/testsuite/config/i960.exp b/gdb/testsuite/config/i960.exp
new file mode 100644
index 00000000000..99b8a9db1f7
--- /dev/null
+++ b/gdb/testsuite/config/i960.exp
@@ -0,0 +1,20 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
diff --git a/gdb/testsuite/config/m32r-stub.exp b/gdb/testsuite/config/m32r-stub.exp
new file mode 100644
index 00000000000..cd04787ddb6
--- /dev/null
+++ b/gdb/testsuite/config/m32r-stub.exp
@@ -0,0 +1 @@
+load_lib "../../testsuite/config/sparclet.exp"
diff --git a/gdb/testsuite/config/m32r.exp b/gdb/testsuite/config/m32r.exp
new file mode 100644
index 00000000000..39688ba8cf9
--- /dev/null
+++ b/gdb/testsuite/config/m32r.exp
@@ -0,0 +1,23 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
+set timeout 120
+verbose "Timeout is now $timeout seconds" 2
+
diff --git a/gdb/testsuite/config/m68k-emc.exp b/gdb/testsuite/config/m68k-emc.exp
new file mode 100644
index 00000000000..70b8f5ef426
--- /dev/null
+++ b/gdb/testsuite/config/m68k-emc.exp
@@ -0,0 +1,17 @@
+load_lib gdb.exp
+load_lib "../config/monitor.exp"
+
+proc gdb_emclaptop_command { command } {
+ global board_info;
+ set tname [board_info target name];
+
+ if ![info exists board_info($tname,m68k_connected)] {
+ m68k_emc_board_connect target;
+ }
+ # This is about all we can do for now. *sigh*
+ set dos_host [board_info target dos_host];
+
+ remote_send $dos_host "${command}\n";
+ #remote_expect $dos_host {
+ #}
+}
diff --git a/gdb/testsuite/config/mips-idt.exp b/gdb/testsuite/config/mips-idt.exp
new file mode 100644
index 00000000000..72664dff1b1
--- /dev/null
+++ b/gdb/testsuite/config/mips-idt.exp
@@ -0,0 +1,22 @@
+# Copyright (C) 1993, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# DejaGnu@cygnus.com
+
+load_lib ../config/monitor.exp
+
+
diff --git a/gdb/testsuite/config/mips.exp b/gdb/testsuite/config/mips.exp
new file mode 100644
index 00000000000..72664dff1b1
--- /dev/null
+++ b/gdb/testsuite/config/mips.exp
@@ -0,0 +1,22 @@
+# Copyright (C) 1993, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# DejaGnu@cygnus.com
+
+load_lib ../config/monitor.exp
+
+
diff --git a/gdb/testsuite/config/mn10300-eval.exp b/gdb/testsuite/config/mn10300-eval.exp
new file mode 100644
index 00000000000..4b60b5aa965
--- /dev/null
+++ b/gdb/testsuite/config/mn10300-eval.exp
@@ -0,0 +1,23 @@
+# Copyright 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
+set timeout 1000
+verbose "Timeout is now $timeout seconds" 2
+
diff --git a/gdb/testsuite/config/monitor.exp b/gdb/testsuite/config/monitor.exp
new file mode 100644
index 00000000000..c0fb464fb95
--- /dev/null
+++ b/gdb/testsuite/config/monitor.exp
@@ -0,0 +1,271 @@
+# Test Framework Driver for GDB driving a ROM monitor (via monitor.c).
+# Copyright 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+load_lib gdb.exp
+# puts "***** DID USE MONITOR ******"
+
+#
+# gdb_target_cmd
+# Send gdb the "target" command
+#
+proc gdb_target_cmd { targetname serialport } {
+ global gdb_prompt
+
+ for {set i 1} {$i <= 3} {incr i} {
+ send_gdb "target $targetname $serialport\n"
+ gdb_expect 60 {
+ -re "A program is being debugged already.*ill it.*y or n. $" {
+ send_gdb "y\n";
+ exp_continue;
+ }
+ -re "Couldn't establish connection to remote.*$gdb_prompt" {
+ verbose "Connection failed";
+ }
+ -re "Remote MIPS debugging.*$gdb_prompt" {
+ verbose "Set target to $targetname";
+ return 0;
+ }
+ -re "Remote debugging using .*$serialport.*$gdb_prompt" {
+ verbose "Set target to $targetname";
+ return 0;
+ }
+ -re "Remote target $targetname connected to.*$gdb_prompt" {
+ verbose "Set target to $targetname";
+ return 0;
+ }
+ -re "Connected to.*$gdb_prompt" {
+ verbose "Set target to $targetname";
+ return 0;
+ }
+ -re "Ending remote.*$gdb_prompt" { }
+ -re "Connection refused.*$gdb_prompt" {
+ verbose "Connection refused by remote target. Pausing, and trying again."
+ sleep 30
+ continue
+ }
+ -re "Timeout reading from remote system.*$gdb_prompt" {
+ verbose "Got timeout error from gdb.";
+ }
+ timeout {
+ send_gdb "";
+ break
+ }
+ }
+ }
+ return 1
+}
+
+
+
+#
+# gdb_target_monitor
+# Set gdb to target the monitor
+#
+proc gdb_target_monitor { exec_file } {
+ global gdb_prompt
+ global exit_status
+ global timeout
+
+ if [target_info exists gdb_protocol] {
+ set targetname "[target_info gdb_protocol]"
+ } else {
+ perror "No protocol specified for [target_info name].";
+ return -1;
+ }
+ if [target_info exists baud] {
+ gdb_test "set remotebaud [target_info baud]" "" ""
+ }
+ if [target_info exists binarydownload] {
+ gdb_test "set remotebinarydownload [target_info binarydownload]" "" ""
+ }
+ if { [ target_info exists disable_x_packet ] } {
+ gdb_test "set remote X-packet disable" ""
+ }
+ if { [ target_info exists disable_z_packet ] } {
+ gdb_test "set remote Z-packet disable" ""
+ }
+ if [target_info exists gdb_serial] {
+ set serialport "[target_info gdb_serial]";
+ } elseif [target_info exists netport] {
+ set serialport "[target_info netport]"
+ } else {
+ set serialport "[target_info serial]"
+ }
+
+ for {set j 1} {$j <= 2} {incr j} {
+ if [gdb_file_cmd $exec_file] { return -1; }
+
+ if ![gdb_target_cmd $targetname $serialport] { return 0; }
+
+ gdb_target_exec;
+
+ if { $j == 1 && ![reboot_target] } {
+ break;
+ }
+ }
+
+ perror "Couldn't set target for $targetname, port is $serialport.";
+ return -1;
+}
+
+proc gdb_target_exec { } {
+ gdb_test "target exec" "No executable file now." "" ".*Kill it.*y or n.*" "y"
+
+}
+#
+# gdb_load -- load a file into the debugger.
+# return a -1 if anything goes wrong.
+#
+proc gdb_load { arg } {
+ global verbose
+ global loadpath
+ global loadfile
+ global GDB
+ global gdb_prompt
+ global timeout
+ global last_gdb_file;
+
+ if [target_info exists gdb_download_size] {
+ send_gdb "set download-write-size [target_info gdb_download_size]\n";
+ gdb_expect 30 {
+ -re "$gdb_prompt $" { }
+ default {
+ perror "Setting download-write-size for target failed";
+ return -1;
+ }
+ }
+ }
+
+ if { $arg == "" } {
+ if [info exists last_gdb_file] {
+ set arg $last_gdb_file;
+ } else {
+ send_gdb "info files\n";
+ gdb_expect 30 {
+ -re "Symbols from \"(\[^\"\]+)\"" {
+ set arg $expect_out(1,string);
+ exp_continue;
+ }
+ -re "Local exec file:\[\r\n\]+\[ \t\]*`(\[^'\]+)'," {
+ set arg $expect_out(1,string);
+ exp_continue;
+ }
+ -re "$gdb_prompt $" { }
+ }
+ }
+ }
+
+ set last_gdb_file $arg;
+
+ for { set j 1; } { $j <= 2 } {incr j; } {
+ if [target_info exists gdb,use_standard_load] {
+ gdb_target_exec;
+ if ![target_info exists gdb,no_push_conn] {
+ remote_push_conn host;
+ }
+ set state [remote_ld target $arg];
+ if ![target_info exists gdb,no_push_conn] {
+ remote_close target;
+ remote_pop_conn host;
+ }
+ if { $state == "pass" } {
+ if [gdb_target_monitor $arg] { return -1; }
+ gdb_test "list main" ".*" ""
+ verbose "Loaded $arg into $GDB\n";
+ return 0;
+ }
+ } else {
+
+ if [gdb_target_monitor $arg] { return -1 }
+
+ if [is_remote host] {
+ # FIXME: Multiple downloads. bleah.
+ set farg [remote_download host $arg];
+ } else {
+ set farg $arg;
+ }
+
+ if { $arg != "" && [target_info exists gdb_sect_offset] } {
+ set textoff [target_info gdb_sect_offset];
+ send_gdb "sect .text $textoff\n";
+ gdb_expect 30 {
+ -re "(0x\[0-9a-z]+) - 0x\[0-9a-z\]+ is \\.data" {
+ set dataoff $expect_out(1,string);
+ exp_continue;
+ }
+ -re "(0x\[0-9a-z\]+) - 0x\[0-9a-z\]+ is \\.bss" {
+ set bssoff $expect_out(1,string);
+ exp_continue;
+ }
+ -re "$gdb_prompt" { }
+ }
+ set dataoff [format 0x%x [expr $dataoff + $textoff]];
+ set bssoff [format 0x%x [expr $bssoff + $textoff]];
+ send_gdb "sect .data $dataoff\n";
+ gdb_expect 30 {
+ -re "$gdb_prompt" { }
+ }
+ send_gdb "sect .bss $bssoff\n";
+ gdb_expect 30 {
+ -re "$gdb_prompt" { }
+ }
+ }
+
+ verbose "Loading $farg"
+ if [target_info exists gdb_load_offset] {
+ set command "load $farg [target_info gdb_load_offset]\n";
+ } else {
+ set command "load $farg\n";
+ }
+ if [target_info exists gdb_load_timeout] {
+ set loadtimeout [target_info gdb_load_timeout]
+ } else {
+ set loadtimeout 1600
+ }
+
+ send_gdb $command;
+ gdb_expect $loadtimeout {
+ -re "\[Ff\]ailed.*$gdb_prompt $" {
+ verbose "load failed";
+ }
+ -re "Timeout reading from remote.*$gdb_prompt" {
+ }
+ -re "$gdb_prompt $" {
+ verbose "Loaded $farg into $GDB\n"
+ return 0;
+ }
+ timeout {
+ if { $verbose > 1 } {
+ perror "Timed out trying to load $farg."
+ }
+ }
+ }
+ }
+
+ # Make sure we don't have an open connection to the target.
+ gdb_target_exec;
+
+ if { $j == 1 } {
+ if { ![reboot_target] } {
+ break;
+ }
+ }
+ }
+ perror "Couldn't load file into GDB.";
+ return -1;
+}
diff --git a/gdb/testsuite/config/netware.exp b/gdb/testsuite/config/netware.exp
new file mode 100644
index 00000000000..2538ccf49b6
--- /dev/null
+++ b/gdb/testsuite/config/netware.exp
@@ -0,0 +1,218 @@
+# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by J.T. Conklin. (jtc@cygnus.com)
+
+load_lib gdb.exp
+load_lib remote.exp
+
+global shell_id
+
+global LD
+if ![info exists LD] then {
+ set LD [findfile "$base_dir/../../ld/ld.new"]
+}
+
+global NLMCONV
+if ![info exists NLMCONV] then {
+ set NLMCONV [findfile "$base_dir/../../binutils/nlmconv"]
+}
+
+#
+# gdb_version -- extract and print the version number of gcc
+#
+proc gdb_version {} {
+ default_gdb_version
+}
+
+#
+# gdb_unload -- unload a file if one is loaded
+#
+
+#
+# gdb_load -- load a file into the debugger.
+# return a -1 if anything goes wrong.
+#
+proc gdb_load { arg } {
+ global gdb_prompt
+ global LD
+ global NLMCONV
+ global errorCode
+ global shell_id
+
+ # FIXME: this is wrong.
+ set targetname [target_info name];
+
+ set obj [file tail $arg]
+ set nlm "$obj.nlm"
+ set lnk "$obj.lnk"
+
+ # build *.lnk file
+ set fd [open $lnk w]
+ puts $fd "description \"[file tail $nlm]\""
+ puts $fd "screenname \"System Console\""
+ puts $fd "module clib.nlm"
+ puts $fd "module mathlib.nlm"
+ puts $fd "stack 32768"
+# puts $fd "stack 64512"
+ puts $fd "debug"
+ # FIXME: don't hardcode location of prelude.o
+ puts $fd "input /s1/cygnus/dejagnu/i386-netware/lib/prelude.o"
+ puts $fd "input $arg"
+ puts $fd "output $nlm"
+ close $fd
+
+ # run nlmconv
+ verbose "Executing: $NLMCONV -l$LD -T$lnk" 1
+ catch "exec $NLMCONV -l$LD -T$lnk" output
+ if ![string match "" $output] then {
+ verbose $output 1
+ }
+ if ![string match "NONE" $errorCode] {
+ warning "Can't link $arg"
+
+ return -1
+ }
+ catch "exec rm -f $lnk"
+
+ # download
+ verbose "Downloading $nlm" 1
+ catch "exec cp $nlm /.NetWare/$targetname.nws/sys.nwv/tmp/x.nlm" output
+ if ![string match "" $output] then {
+ verbose $output 1
+ return -1
+ }
+
+ gdb_file_cmd $nlm
+}
+
+proc gdb_run_cmd { } {
+ global shell_id
+ global gdb_prompt
+ global timeout
+
+ set connhost [target_info name];
+ if [board_info $connhost exists serial] {
+ set serialport [board_info $connhost serial];
+ } else {
+ set serialport [board_info $connhost netport];
+ }
+
+ if [board_info $connhost exists baud] {
+ set baud [board_info $connhost baud];
+ } else {
+ set baud 9600;
+ }
+ # FIXME: This is wrong.
+ send "kill\n"
+ gdb_expect {
+ -re ".*Kill the program being debugged.*y or n. $" {
+ send "y\n"
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {}
+ }
+
+ verbose "Starting GDB stub on [target_info name]" 1
+ send -i $shell_id "load nlmstub BAUD=$baud x.nlm\r\n"
+
+ send "set remotebaud $baud\n"
+ gdb_expect {
+ -re "$gdb_prompt" {}
+ timeout {
+ perror "Couldn't set remote baud rate"
+ return
+ }
+ }
+
+ set otimeout $timeout
+ set timeout 60
+ verbose "Timeout is now $timeout seconds" 2
+ send "target remote $serialport\n"
+ gdb_expect {
+ -re "Couldn't establish connection to remote target" {
+ send "target remote $serialport\n"
+ exp_continue
+ }
+ -re "$gdb_prompt" {}
+ timeout {
+ set timeout $otimeout
+ verbose "Timeout restored to $timeout seconds" 2
+ perror "Couldn't set remote target"
+ return
+ }
+ }
+ set timeout $otimeout
+ verbose "Timeout restored to $timeout seconds" 2
+
+ send "continue\n"
+ gdb_expect {
+ "Continuing.$" {}
+ }
+
+ return
+}
+
+
+
+#
+# start the remote shell
+#
+
+set shell_prompt "Password:"
+set shell_id [remote_open target]
+
+if $shell_id<0 then {
+ warning "Couldn't connect to target"
+ return -1
+}
+
+if [string match "" $passwd] then {
+ stty -echo
+ send_user "Password: "
+ expect_user -re "(.*)\n"
+ send_user "\n"
+ set passwd "$expect_out(1,string)"
+ stty echo
+}
+
+send -i $shell_id "$passwd\n"
+gdb_expect {
+ -i $shell_id ":" {
+ verbose "Got termtype prompt" 0
+ }
+
+ -i $shell_id timeout {
+ warning "Connection timed out"
+ return -1
+ }
+}
+
+
+# FIXME: this is wrong.
+set shell_prompt "[string toupper [target_info name]]:"
+send -i $shell_id "1\n"
+
+gdb_expect {
+ -i $shell_id -re "$shell_prompt" {}
+ -i $shell_id timeout {
+ warning "Connection timed out"
+ return -1
+ }
+}
diff --git a/gdb/testsuite/config/nind.exp b/gdb/testsuite/config/nind.exp
new file mode 100644
index 00000000000..d8aecdbc60a
--- /dev/null
+++ b/gdb/testsuite/config/nind.exp
@@ -0,0 +1,49 @@
+# Test Framework Driver
+# Copyright (C) 1988, 1990, 1991, 1992, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# DejaGnu@cygnus.com
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+load_lib gdb.exp
+
+#
+# gdb_load -- load a file into the debugger.
+#
+proc gdb_load { arg } {
+ global verbose
+ global loadpath
+ global loadfile
+ global gdb_prompt
+ global GDB
+ set loadfile [file tail $arg]
+ set loadpath [file dirname $arg]
+ send_user "Not implememted yet\n" ; return -1
+}
+
+#
+# gdb_start -- start GDB running
+#
+proc gdb_start { } {
+ global GDB
+ global GDBFLAGS
+ global spawn_id
+ global gdb_prompt
+ global verbose
+ send_user "Not implememted yet\n" ; return -1
+}
diff --git a/gdb/testsuite/config/proelf.exp b/gdb/testsuite/config/proelf.exp
new file mode 100644
index 00000000000..99b8a9db1f7
--- /dev/null
+++ b/gdb/testsuite/config/proelf.exp
@@ -0,0 +1,20 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
diff --git a/gdb/testsuite/config/rom68k.exp b/gdb/testsuite/config/rom68k.exp
new file mode 100644
index 00000000000..99b8a9db1f7
--- /dev/null
+++ b/gdb/testsuite/config/rom68k.exp
@@ -0,0 +1,20 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
diff --git a/gdb/testsuite/config/sh.exp b/gdb/testsuite/config/sh.exp
new file mode 100644
index 00000000000..99b8a9db1f7
--- /dev/null
+++ b/gdb/testsuite/config/sh.exp
@@ -0,0 +1,20 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
diff --git a/gdb/testsuite/config/sid.exp b/gdb/testsuite/config/sid.exp
new file mode 100644
index 00000000000..987c9beab12
--- /dev/null
+++ b/gdb/testsuite/config/sid.exp
@@ -0,0 +1,216 @@
+# Test Framework Driver for GDB driving an external simulator
+# Copyright 1999, 2001 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+load_lib gdb.exp
+
+proc sid_start {} {
+ global verbose
+
+ set port [lindex [split [target_info netport] ":"] 1]
+
+ # Set a default endianness
+ case [target_info multilib_flags] in {
+ { *big-endian* *-EB* *-meb* } { set sidendian "-EB" }
+ { *little-endian* *-EL* *-mel* } { set sidendian "-EL" }
+ default {
+ if {[target_info exists sim,defaultendian]} then {
+ set sidendian [target_info sim,defaultendian]
+ } else {
+ # rely on endianness settings in sid configuration defaults
+ set sidendian ""
+ }
+ }
+ }
+ case $sidendian in {
+ { -EB } { set sidendian2 {-e "set cpu endian big"} }
+ { -EL } { set sidendian2 {-e "set cpu endian little"} }
+ default { set sidendian2 {} }
+ }
+
+ # test to see whether to use use sid in build or install tree
+ set use_build_tree [file exists ../../sid]
+
+ if {$use_build_tree} then {
+ set pre_spawn {
+ global env
+ set env(SID_LIBRARY_PATH) [join [glob "../../sid/component/*"] ":"]
+ set env(SID) "../../sid/main/dynamic/sid"
+ if {! [file exists $env(SID)]} then { error "Cannot find sid in build tree" }
+ }
+ if { [board_info target sim,protocol] == "sid" } {
+ set spawncmd "[target_info sim] [target_info sim,options] $sidendian2 -e \"set cpu-gdb-socket sockaddr-local 0.0.0.0:$port\""
+ } elseif { [board_info target sim,protocol] == "rawsid" } {
+ set spawncmd "[target_info sim] [target_info sim,options] -$sidendian --gdb=$port"
+ } else {
+ set spawncmd "../../sid/bsp/[target_info sim] $sidendian --gdb=$port [target_info sim,options]"
+ }
+ set post_spawn {
+ global env
+ unset env(SID_LIBRARY_PATH)
+ unset env(SID)
+ }
+ } else {
+ set pre_spawn {}
+ if { [board_info target sim,protocol] == "sid" } {
+ # FIXME: sim,options may be from the build tree, should find
+ # it in the install tree.
+ set spawncmd "sid [target_info sim,options] $sidendian2 -e \"set cpu-gdb-socket sockaddr-local 0.0.0.0:$port\""
+ } elseif { [board_info target sim,protocol] == "rawsid" } {
+ set spawncmd "[target_info sim] [target_info sim,options] -$sidendian --gdb=$port"
+ } else {
+ set spawncmd "[target_info sim] $sidendian --gdb=$port [target_info sim,options]"
+ }
+ set post_spawn {}
+ }
+
+ eval $pre_spawn
+ if {[catch [list remote_spawn host $spawncmd] msg]} {
+ perror $msg
+ exit 1
+ }
+ eval $post_spawn
+
+ # Don't do the following any more; it breaks with "runtest ... < /dev/null"
+# expect_background {
+# -re \[^\n\]*\n {
+# regsub "\n" $expect_out(buffer) {} msg
+# verbose "SID: $msg" 2
+# }
+# }
+
+ # There should be no need to sleep to give SID time to start;
+ # GDB would wait for a fair while for the stub to respond.
+ sleep 4
+
+ if ![target_info exists gdb,no_push_conn] {
+ remote_push_conn host;
+ }
+}
+
+#
+# Handle GDB talking to SID
+#
+
+proc gdb_start {} {
+ sid_start
+ return [default_gdb_start]
+}
+
+proc sid_exit {} {
+ if ![target_info exists gdb,no_push_conn] {
+ remote_close host;
+ remote_pop_conn host;
+ }
+}
+
+proc gdb_exit {} {
+ set result [default_gdb_exit]
+ sid_exit
+ return $result
+}
+
+#
+# gdb_target_sid
+# Set gdb to target the simulator
+#
+proc send_target_sid { } {
+ # wait a little while, giving sid time to shut down & restart its
+ # gdb socket
+ sleep 4
+ send_gdb "target [target_info gdb_protocol] [target_info netport]\n"
+}
+
+proc gdb_target_sid { } {
+ global gdb_prompt
+ global exit_status
+
+ send_target_sid
+
+ global timeout
+ set prev_timeout $timeout
+ set timeout 60
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ -re ".*\[Ee\]rror.*$gdb_prompt $" {
+ perror "Couldn't set target for remote simulator."
+ cleanup
+ gdb_exit
+ }
+ -re "Remote debugging using.*$gdb_prompt" {
+ verbose "Set target to sid"
+ }
+ timeout {
+ perror "Couldn't set target for remote simulator."
+ cleanup
+ gdb_exit
+ }
+ }
+ set timeout $prev_timeout
+ verbose "Timeout is now $timeout seconds" 2
+}
+
+#
+# gdb_load -- load a file into the debugger.
+# return a -1 if anything goes wrong.
+#
+proc gdb_load { arg } {
+ global verbose
+ global loadpath
+ global loadfile
+ global GDB
+ global gdb_prompt
+ global retval
+
+ gdb_unload
+ if [gdb_file_cmd $arg] then { return -1 }
+ gdb_target_sid
+
+ send_gdb "load\n"
+ global timeout
+ set prev_timeout $timeout
+ set timeout 2400
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ -re ".*\[Ee\]rror.*$gdb_prompt $" {
+ if $verbose>1 then {
+ perror "Error during download."
+ }
+ set retval -1;
+ }
+ -re ".*$gdb_prompt $" {
+ if $verbose>1 then {
+ send_user "Loaded $arg into $GDB\n"
+ }
+ set retval 1;
+ }
+ -re "$gdb_prompt $" {
+ if $verbose>1 then {
+ perror "GDB couldn't load."
+ }
+ set retval -1;
+ }
+ timeout {
+ if $verbose>1 then {
+ perror "Timed out trying to load $arg."
+ }
+ set retval -1;
+ }
+ }
+ set timeout $prev_timeout
+ verbose "Timeout is now $timeout seconds" 2
+ return $retval;
+}
diff --git a/gdb/testsuite/config/sim.exp b/gdb/testsuite/config/sim.exp
new file mode 100644
index 00000000000..5d8a93d5311
--- /dev/null
+++ b/gdb/testsuite/config/sim.exp
@@ -0,0 +1,85 @@
+# Test Framework Driver for GDB driving a builtin simulator
+# Copyright 1994, 1997, 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+load_lib gdb.exp
+
+#
+# gdb_target_sim
+# Set gdb to target the simulator
+#
+proc gdb_target_sim { } {
+ global gdb_prompt
+ global exit_status
+
+ set target_sim_options "[board_info target gdb,target_sim_options]";
+
+ send_gdb "target sim $target_sim_options\n"
+ set timeout 60
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ -re "Connected to the simulator.*$gdb_prompt $" {
+ verbose "Set target to sim"
+ }
+ timeout {
+ perror "Couldn't set target for simulator."
+ cleanup
+ exit $exit_status
+ }
+ }
+ set timeout 10
+ verbose "Timeout is now $timeout seconds" 2
+}
+
+#
+# gdb_load -- load a file into the debugger.
+# return a -1 if anything goes wrong.
+#
+proc gdb_load { arg } {
+ global verbose
+ global loadpath
+ global loadfile
+ global GDB
+ global gdb_prompt
+
+ if [gdb_file_cmd $arg] then { return -1 }
+
+ gdb_target_sim
+
+ send_gdb "load\n"
+ set timeout 2400
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ if $verbose>1 then {
+ send_user "Loaded $arg into $GDB\n"
+ }
+ set timeout 30
+ verbose "Timeout is now $timeout seconds" 2
+ return 1
+ }
+ -re "$gdb_prompt $" {
+ if $verbose>1 then {
+ perror "GDB couldn't load."
+ }
+ }
+ timeout {
+ if $verbose>1 then {
+ perror "Timed out trying to load $arg."
+ }
+ }
+ }
+}
diff --git a/gdb/testsuite/config/slite.exp b/gdb/testsuite/config/slite.exp
new file mode 100644
index 00000000000..3656665536c
--- /dev/null
+++ b/gdb/testsuite/config/slite.exp
@@ -0,0 +1,183 @@
+# Copyright 1993, 1997, 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# DejaGnu@cygnus.com
+
+# This file was written by Ian Lance Taylor <ian@cygnus.com>.
+
+# GDB support routines for a board using the MIPS remote debugging
+# protocol. These are actually pretty generic.
+
+# DejaGnu currently assumes that debugging is being done over the main
+# console port. It would probably be more convenient for people using
+# IDT boards to permit the debugging port and the connected port to be
+# different, since an IDT board has two ports. This would require
+# extending some of the tests in a fashion similar to that done for
+# VxWorks, because the test output would appear on the other port,
+# rather than being displayed by gdb.
+
+load_lib remote.exp
+load_lib gdb.exp
+set gdb_prompt "\\(gdb\\)"
+
+#
+# gdb_load -- load a file into the GDB.
+# Returns a 0 if there was an error,
+# 1 if it load successfully.
+#
+proc gdb_load { arg } {
+ global verbose
+ global loadpath
+ global loadfile
+ global gdb_prompt
+ global GDB
+ global expect_out
+
+ set loadfile [file tail $arg]
+ set loadpath [file dirname $arg]
+
+ gdb_file_cmd $arg
+
+ if [target_info exists gdb_protocol] {
+ set protocol [target_info gdb_protocol];
+ } else {
+ set protocol "sparclite"
+ }
+
+ if [target_info exists serial] {
+ set targetname [target_info serial];
+ set command "target $protocol [target_info serial]\n";
+ } else {
+ if ![target_info exists netport] {
+ perror "Need either netport or gdb_serial entry for [target_info name].";
+ return -1;
+ }
+ set targetname [target_info netport];
+ set command "target $protocol udp [target_info netport]\n";
+ }
+ set timeout 60
+ verbose "Timeout is now $timeout seconds" 2
+ set try_count 0;
+ send_gdb $command;
+ gdb_expect {
+ -re "Unknown response.*resetting the board.|remote timeout" {
+ incr try_count;
+ if { $try_count > 3 } {
+ set try_count 0;
+ reboot_target;
+ sleep 5;
+ }
+ sleep 1;
+ send_gdb $command;
+ exp_continue;
+ }
+ -re "Remote target.*$gdb_prompt $" { }
+ -re ".*SPARClite appears to be alive.*$gdb_prompt $" {
+ if $verbose>1 then {
+ send_user "Set target to $targetname\n"
+ }
+ }
+ timeout {
+ perror "Couldn't set SLITE target."
+ set timeout 10
+ verbose "Timeout is now $timeout seconds" 2
+ return -1
+ }
+ }
+
+ if [target_info exists gdb_load_offset] {
+ set offset "[target_info gdb_load_offset]";
+ } else {
+ set offset "";
+ }
+ if { 1 } {
+ if [is_remote host] {
+ set arg [remote_download host $arg];
+ if { $arg == "" } {
+ error "download failed"
+ return -1;
+ }
+ }
+ send_gdb "load $arg $offset\n"
+ verbose "Loading $arg into $GDB" 2
+ set timeout 2400
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ -re "Loading.*$gdb_prompt $" {
+ verbose "Loaded $arg into $GDB" 1
+ set timeout 30
+ verbose "Timeout is now $timeout seconds" 2
+ }
+ -re "$gdb_prompt $" {
+ if $verbose>1 then {
+ perror "GDB couldn't load."
+ }
+ }
+ timeout {
+ if $verbose>1 then {
+ perror "Timed out trying to load $arg."
+ }
+ }
+ }
+ }
+ # Some SPARClite boards automagically do a run after the program is
+ # loaded.
+ if [target_info exists need_monitor_run] {
+ set timeout 10
+ verbose "Timeout is now $timeout seconds, doing monitor run" 2
+ send_gdb "monitor run\n";
+ sleep 2;
+ send_gdb "";
+ gdb_expect {
+ -re ".*$gdb_prompt $" { verbose "Run command succeded" }
+ default {
+ perror "error sending monitor run command";
+ }
+ }
+ } else {
+ sleep 2;
+ }
+
+ if [target_info exists gdb_serial] {
+ set serial [target_info gdb_serial];
+ } else {
+ set serial [target_info serial];
+ }
+ send_gdb "target remote $serial\n"
+ set timeout 60
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ -re ".*Kill it?.*y or n.*" {
+ send_gdb "y\n";
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {
+ verbose "Set remote target to [target_info serial]" 2
+ }
+ timeout {
+ perror "Couldn't set remote target."
+ set timeout 10
+ verbose "Timeout is now $timeout seconds" 2
+ return -1
+ }
+ }
+
+ if [info exists expect_out(buffer)] then {
+ send_log $expect_out(buffer)
+ }
+ return 0
+}
diff --git a/gdb/testsuite/config/sparclet.exp b/gdb/testsuite/config/sparclet.exp
new file mode 100644
index 00000000000..83dc8c4e079
--- /dev/null
+++ b/gdb/testsuite/config/sparclet.exp
@@ -0,0 +1,391 @@
+# Copyright 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# DejaGnu@cygnus.com
+
+# This file was written by Michael Snyder <msnyder@cygnus.com>.
+
+# GDB support routines for a board using the sparclet remote debugging
+# protocol.
+
+load_lib remote.exp
+load_lib gdb.exp
+
+#
+# Sparclet remote run command.
+#
+
+proc gdb_start { } {
+ global gdb_prompt
+
+ if ![file exists loader] {
+ global libdir
+ set loader loader;
+
+ if [target_info exists gdb_stub_offset] {
+ set result [target_compile "${libdir}/stub-loader.c" $loader executable "libs=-Wl,-Ttext,[target_info gdb_stub_offset]"];
+ } else {
+ set result [target_compile "${libdir}/stub-loader.c" $loader executable "ldscript=[target_info gdb_stub_ldscript]"];
+ }
+ }
+
+ verbose -log "$gdb_prompt is gdb prompt"
+
+ set result 0;
+ for { set y 0; } { $y < 4 } { incr y } {
+ if { [default_gdb_start] != 0 } {
+ return -1;
+ }
+
+ if [target_info exists baud] {
+ send_gdb "set remotebaud [target_info baud]\n"
+ gdb_expect {
+ -re "$gdb_prompt" { }
+ default {
+ perror "Error setting baud rate."
+ return -1;
+ }
+ }
+ }
+
+ for {set x 1;} { $x < 4 } {incr x} {
+ set result [gdb_sparclet_startup $result];
+ if { $result > 0 } {
+ return 1;
+ }
+ # mmmmm, magic numbers.
+ if { $result == -42 || $result == -43 } {
+ break;
+ } else {
+ reboot_target;
+ }
+ }
+ if { $x == 4 } {
+ return -1;
+ }
+ gdb_exit;
+ sleep 5;
+ }
+ return -1;
+}
+
+proc gdb_sparclet_startup { arg } {
+ global gdb_prompt
+ global GDB
+ global verbose
+
+ set is_running_stub 0;
+
+ if [target_info exists serial] {
+ set serial [target_info serial];
+ } else {
+ set serial [target_info netport];
+ }
+ set protocol [target_info gdb_protocol];
+ set check_stub 1;
+ if { $arg != -42 } {
+ send_gdb "target $protocol $serial\n";
+ # 10 seconds may be a bit short.
+ gdb_expect 10 {
+ -re "already.*y or n." {
+ gdb_send "y\n";
+ exp_continue;
+ }
+ -re "Remote target.*connected to.*$gdb_prompt" { set check_stub 0; }
+ -re "$gdb_prompt" { }
+ timeout { }
+ }
+ if { $check_stub } {
+ verbose "timed out, checking if stub is already running"
+ send_gdb "\003";
+ sleep 1;
+ send_gdb "\003";
+ gdb_expect 10 {
+ -re "$gdb_prompt" { }
+ default {
+ remote_close host;
+ return -42;
+ }
+ }
+ }
+ }
+ if [target_info exists gdb_serial] {
+ set gdb_serial [target_info gdb_serial];
+ } else {
+ set gdb_serial $serial;
+ }
+ if { $check_stub } {
+ send_gdb "target remote $gdb_serial\n";
+ gdb_expect 15 {
+ -re "Remote debugging.*$gdb_prompt" {
+ verbose "stub is already running"
+ set is_running_stub 1;
+ }
+ default {
+ warning "board isn't responding";
+ remote_close host;
+ remote_reboot target;
+ return -43;
+ }
+ }
+ }
+
+ if { $is_running_stub == 0 } {
+ global srcdir
+
+ if [is_remote host] {
+ set loader [remote_download host "loader"];
+ } else {
+ set loader "loader";
+ }
+ send_gdb "file $loader\n";
+ gdb_expect {
+ -re "A program is being debug.*Kill it.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "Load new symbol table.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "Reading symbols from.*done..*$gdb_prompt $" {}
+ -re "$gdb_prompt $" { perror "GDB couldn't find loader" }
+ timeout {
+ perror "(timeout) read symbol file" ;
+ return -1
+ }
+ }
+
+ send_gdb "target $protocol $serial\n";
+ gdb_expect {
+ -re "Remote target.*connected to.*$gdb_prompt" { }
+ default {
+ perror "Error reconnecting to board.";
+ return -1;
+ }
+ }
+
+ send_gdb "load $loader [target_info gdb_stub_offset]\n"
+ verbose "Loading $loader into $GDB" 2
+ set no_run_command 0;
+ gdb_expect 1200 {
+ -re "Loading.*$gdb_prompt $" {
+ verbose "Loaded $loader into $GDB" 1
+ }
+ -re "Transfer rate:.*Switching to remote protocol.*Remote debugging" {
+ set no_run_command 1;
+ }
+ -re "$gdb_prompt $" {
+ if $verbose>1 then {
+ perror "GDB couldn't load."
+ }
+ }
+ timeout {
+ if $verbose>1 then {
+ perror "Timed out trying to load $arg."
+ }
+ }
+ }
+
+ if !$no_run_command {
+ send_gdb "run\n";
+ gdb_expect 60 {
+ -re "A program is being debug.*Kill it.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "The program being debugged .*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "Starting program:.*loader.*$" {
+ verbose "Starting loader succeeded"
+ }
+ timeout {
+ perror "(timeout) starting the loader" ;
+ return -1
+ }
+ default {
+ perror "error starting the loader";
+ }
+ }
+ }
+ sleep 2;
+ send_gdb ""
+ sleep 1;
+ send_gdb ""
+ verbose "Sent ^C^C"
+ gdb_expect 10 {
+ -re "Give up .and stop debugging it.*$" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "$gdb_prompt $" {
+ verbose "Running loader succeeded"
+ }
+ timeout {
+ warning "(timeout) interrupting the loader" ;
+ remote_close host;
+ }
+ default {
+ warning "error interrupting the loader";
+ }
+ }
+
+ gdb_exit;
+ return [gdb_start];
+ }
+ return 1;
+}
+
+proc gdb_run_cmd { args } {
+ global gdb_prompt
+
+ gdb_breakpoint exit;
+ send_gdb "set \$fp=0\n";
+ gdb_expect {
+ -re "$gdb_prompt" { }
+ }
+ # This is needed for the SparcLite. Whee.
+ if [target_info exists gdb,start_symbol] {
+ set start_comm "jump *[target_info gdb,start_symbol]\n";
+ } else {
+ set start_comm "jump *start\n";
+ }
+ send_gdb "break copyloop\n";
+ gdb_expect 10 {
+ -re "Breakpoint.*$gdb_prompt $" {
+ set start_comm "continue\n";
+ }
+ -re "$gdb_prompt $" { }
+ timeout { warning "break copyloop failed badly"; }
+ }
+ send_gdb $start_comm;
+ gdb_expect 10 {
+ -re "y or n. $" {
+ remote_send host "y\n"
+ exp_continue;
+ }
+ -re "Breakpoint.*in copyloop.*$gdb_prompt $" {
+ remote_send host "jump relocd\n";
+ exp_continue;
+ }
+ -re "Continuing at.*\[\r\n\]" { }
+ default {
+ return -1;
+ }
+ }
+
+ return "";
+}
+
+
+#
+# gdb_load -- load a file into the GDB.
+# Returns a 0 if there was an error,
+# 1 if it load successfully.
+#
+proc gdb_load { arg } {
+ global verbose
+ global loadpath
+ global loadfile
+ global gdb_prompt
+ global GDB
+ global expect_out
+
+ set loadfile [file tail $arg]
+ set loadpath [file dirname $arg]
+
+ set protocol [target_info gdb_protocol];
+
+ if [is_remote host] {
+ set arg [remote_download host $arg];
+ }
+ send_gdb "file $arg\n"
+ gdb_expect 30 {
+ -re "A program is being debug.*Kill it.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "Load new symbol table.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "Reading symbols from.*done..*$gdb_prompt $" {}
+ -re "$gdb_prompt $" { perror "GDB couldn't read file" }
+ timeout {
+ perror "(timeout) read symbol file" ;
+ return -1
+ }
+ }
+
+ if [target_info exists gdb_serial] {
+ set gdb_serial [target_info gdb_serial];
+ } else {
+ if [target_info exists serial] {
+ set gdb_serial [target_info serial];
+ } else {
+ set gdb_serial [target_info netport];
+ }
+ }
+ send_gdb "target remote $gdb_serial\n"
+ gdb_expect 30 {
+ -re "Kill it?.*y or n.*" {
+ send_gdb "y\n";
+ exp_continue
+ }
+ -re "$gdb_prompt $" {
+ verbose "Set remote target to $gdb_serial" 2
+ }
+ timeout {
+ perror "Couldn't set remote target."
+ return -1
+ }
+ }
+ if [target_info exists gdb_load_offset] {
+ set offset "[target_info gdb_load_offset]";
+ } else {
+ set offset "";
+ }
+ send_gdb "load $arg $offset\n"
+ verbose "Loading $arg into $GDB" 2
+ gdb_expect 1200 {
+ -re "Loading.*$gdb_prompt $" {
+ verbose "Loaded $arg into $GDB" 1
+ }
+ -re "$gdb_prompt $" {
+ if $verbose>1 then {
+ perror "GDB couldn't load."
+ }
+ }
+ timeout {
+ if $verbose>1 then {
+ perror "Timed out trying to load $arg."
+ }
+ }
+ }
+ send_gdb "list main\n";
+ gdb_expect 60 {
+ -re "$gdb_prompt" { }
+ default {
+ perror "command for list main never completed";
+ return -1;
+ }
+ }
+
+ return 0
+}
diff --git a/gdb/testsuite/config/udi.exp b/gdb/testsuite/config/udi.exp
new file mode 100644
index 00000000000..2360d6b8d3d
--- /dev/null
+++ b/gdb/testsuite/config/udi.exp
@@ -0,0 +1,113 @@
+# Test Framework Driver for GDB driving Universal Debug Interface on 29K
+# Copyright 1988, 1990, 1991, 1992, 1993, 1994, 1997
+# Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# DejaGnu@cygnus.com
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+load_lib gdb.exp
+
+#
+# gdb_target_udi
+# Set gdb to the desired UDI target
+#
+proc gdb_target_udi { } {
+ global gdb_prompt
+ global verbose
+ global exit_status
+
+ set targetname [target_info mondfe,name];
+ # set targets hostname
+ send_gdb "target udi $targetname\n"
+ set timeout 60
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ -re "target udi $targetname\[\r\n\]+" {
+ exp_continue
+ }
+ -re "TIP UDI 1.2 Conformant.*$gdb_prompt $" {
+ verbose "Set target to $targetname"
+ }
+ -re "TIP-ipc WARNING,.*failed:" {
+ warning "$expect_out(buffer)"
+ }
+ -re "TIP-ipc ERROR,.*failed:" {
+ perror "$expect_out(buffer)"
+ }
+ -re "A program is being debugged already. Kill it\? \(y or n\)" {
+ send "y\n"
+ exp_continue
+ }
+ timeout {
+ perror "Couldn't set target for UDI."
+ cleanup
+ exit $exit_status
+ }
+ }
+ set timeout 10
+ verbose "Timeout is now $timeout seconds" 2
+}
+
+#
+# gdb_load -- load a file into the debugger.
+# return a -1 if anything goes wrong.
+#
+
+proc gdb_load { arg } {
+ global verbose
+ global loadpath
+ global loadfile
+ global GDB
+ global gdb_prompt
+
+ if [gdb_file_cmd $arg] {
+ return -1
+ }
+
+ gdb_target_udi
+}
+
+#
+# gdb_start -- start GDB running. This assumes that there the
+# UDICONF enviroment variable is set.
+#
+proc gdb_start { } {
+ global env;
+
+ set env(UDICONF) [target_info mondfe,udi_soc];
+ default_gdb_start
+ verbose "Setting up target, Please wait..."
+ gdb_target_udi
+}
+
+#
+# gdb_exit -- exit gdb
+#
+proc gdb_exit { } {
+ catch default_gdb_exit
+ set in [open [concat "|ls -F"] r]
+ while {[gets $in line]>-1} {
+ if [regexp "=$" $line] then {
+ set line [string trimright $line "="]
+ verbose "Removing the $line named socket"
+ exec rm -f $line
+ }
+ }
+ close $in
+}
diff --git a/gdb/testsuite/config/unix.exp b/gdb/testsuite/config/unix.exp
new file mode 100644
index 00000000000..321ad542d7a
--- /dev/null
+++ b/gdb/testsuite/config/unix.exp
@@ -0,0 +1,29 @@
+# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+# Set a default timeout to be used for the tests under UNIX, rather than
+# accepting whatever default dejagnu gives us (apparently 10 seconds).
+# When running the tests over NFS, under somewhat heavy load, 10 seconds
+# does not seem to be enough. Try starting with 60.
+set timeout 60
+verbose "Timeout is now $timeout seconds" 2
+
+load_lib gdb.exp
diff --git a/gdb/testsuite/config/unknown.exp b/gdb/testsuite/config/unknown.exp
new file mode 100644
index 00000000000..f61e5af030f
--- /dev/null
+++ b/gdb/testsuite/config/unknown.exp
@@ -0,0 +1,21 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+perror "Sorry, there is no support for this target"
+exit 1
diff --git a/gdb/testsuite/config/vr4300.exp b/gdb/testsuite/config/vr4300.exp
new file mode 100644
index 00000000000..99b8a9db1f7
--- /dev/null
+++ b/gdb/testsuite/config/vr4300.exp
@@ -0,0 +1,20 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
diff --git a/gdb/testsuite/config/vr5000.exp b/gdb/testsuite/config/vr5000.exp
new file mode 100644
index 00000000000..99b8a9db1f7
--- /dev/null
+++ b/gdb/testsuite/config/vr5000.exp
@@ -0,0 +1,20 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/monitor.exp
diff --git a/gdb/testsuite/config/vx.exp b/gdb/testsuite/config/vx.exp
new file mode 100644
index 00000000000..b02142c5052
--- /dev/null
+++ b/gdb/testsuite/config/vx.exp
@@ -0,0 +1,131 @@
+# Copyright 1988, 1990, 1991, 1992, 1995, 1997
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# DejaGnu@cygnus.com
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+#
+# load support libraries
+#
+load_lib remote.exp
+load_lib gdb.exp
+
+set shell_prompt "->"
+set gdb_prompt "\\(vxgdb\\)"
+
+#
+# gdb_version -- extract and print the version number of gcc
+#
+proc gdb_version {} {
+ default_gdb_version
+}
+
+#
+# gdb_load -- load a file into the debugger.
+# We have to stop and start gdb each time we do this, because when
+# vxgdb loads two files in a row, the symbols in the first file loaded
+# take precedence. Returns -1 on error, else 0.
+#
+proc gdb_load { arg } {
+ set result 0
+
+ if { [remote_ld target $arg] != 0 } {
+ perror "Couldn't load $arg"
+ return -1
+ }
+
+ return [gdb_file_cmd $arg]
+}
+
+#
+# gdb_start -- start gdb running
+#
+proc gdb_start { } {
+ global gdb_prompt
+ global verbose
+ global connectmode
+ global reboot
+
+ # get a connection to the board
+ for { set x 0; } { $x < 3 } { incr x } {
+ set shell_id [remote_open target]
+ if { $shell_id > 0 } {
+ verbose "Spawn id for remote shell is $shell_id"
+
+ set timeout 10
+ verbose "Timeout is now $timeout seconds" 2
+
+ set state [spawn_vxgdb];
+ if { $state == "pass" } {
+ return 0;
+ }
+ if { $state == "fail" } {
+ return -1;
+ }
+ }
+ remote_reboot target;
+ }
+}
+
+proc spawn_vxgdb { } {
+ global gdb_prompt
+
+ default_gdb_start
+
+ # set the default arguments to "main", so that "run" with no
+ # arguments will work correctly.
+ send_gdb "set args main\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+
+ verbose "Setting up target, Please wait..."
+ # set targets hostname
+ send_gdb "target vxworks [target_info hostname]\n"
+ set timeout 60
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ -re "Done\..*$gdb_prompt $" {
+ verbose "Set target to [target_info hostname]" 1
+ set timeout 10;
+ return "pass";
+ }
+ -re "net_connect: RPC: (Program not registered|.*Timed out).*$" {
+ warning "Couldn't set GDB to target [target_info netport]."
+ }
+ timeout {
+ warning "Couldn't set target for vxworks."
+ }
+ }
+ return "retry";
+}
+
+proc gdb_exit { } {
+ remote_close target;
+ catch default_gdb_exit
+}
+
+#expect_after {
+# "<return>" { send "\n"; perror "Window too small." }
+# -re "\(y or n\) " { send "n\n"; perror "Got interactive prompt." }
+# buffer_full { perror "internal buffer is full." }
+# eof { perror "eof -- pty is hosed." }
+# timeout { perror "timeout." }
+# "virtual memory exhausted" { perror "virtual memory exhausted." }
+# "Undefined command" { perror "send string probably wrong." }
+#}
+
diff --git a/gdb/testsuite/config/vxworks.exp b/gdb/testsuite/config/vxworks.exp
new file mode 100644
index 00000000000..e3434063e4a
--- /dev/null
+++ b/gdb/testsuite/config/vxworks.exp
@@ -0,0 +1,20 @@
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+load_lib ../config/vx.exp
diff --git a/gdb/testsuite/config/vxworks29k.exp b/gdb/testsuite/config/vxworks29k.exp
new file mode 100644
index 00000000000..795963b97bf
--- /dev/null
+++ b/gdb/testsuite/config/vxworks29k.exp
@@ -0,0 +1,27 @@
+# Copyright 1995, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# DejaGnu@cygnus.com
+
+# This file was written by Brendan Kehoe (brendan@cygnus.com).
+
+# We need this file here because the targetname for the 29k board
+# is `vxworks29k', not `vxworks'. That way other tools (e.g., gcc)
+# can differentiate between the stuff run on that board and others.
+
+verbose "Loading ${srcdir}/config/vx.exp"
+source ${srcdir}/config/vx.exp
diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
new file mode 100755
index 00000000000..bdfc4cd443e
--- /dev/null
+++ b/gdb/testsuite/configure
@@ -0,0 +1,1214 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_help="$ac_help
+ --enable-shared use shared libraries"
+ac_help="$ac_help
+ --enable-gdbtk "
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+sitefile=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=gdb.base
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+ fi
+else
+ CONFIG_SITE="$sitefile"
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../.. $srcdir/`cd $srcdir;pwd`/../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:590: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:611: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:629: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+# Directories to use in all configurations.
+configdirs="gdb.arch \
+ gdb.asm \
+ gdb.base \
+ gdb.c++ \
+ gdb.java \
+ gdb.disasm \
+ gdb.chill \
+ gdb.mi \
+ gdb.threads \
+ gdb.trace"
+
+
+# Directories to use for a configuration which uses stabs.
+stabsdirs="gdb.stabs"
+
+ # this section is for targets that use stabs
+# add stabs tests for appropriate targets
+case "${target}" in
+ powerpc-*-aix*) configdirs="${configdirs} ${stabsdirs}" ;;
+ rs6000-*-aix*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *-*-bsd*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *-*-go32*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *-*-linux*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *-*-lynxos*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *-sun-*) configdirs="${configdirs} ${stabsdirs}" ;;
+ hppa*-*-*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *-*-elf*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *) if test "x${with_stabs}" = x"yes" ; then
+ configdirs="${configdirs} ${stabsdirs}"
+ fi ;;
+esac
+
+# Directory with HP specific tests. They will run only with HP's compilers.
+# These tests will not work on other platforms and compilers.
+
+hpdir="gdb.hp"
+
+case "${target}" in
+ hppa*-*-hpux*) configdirs="${configdirs} ${hpdir}" ;;
+esac
+
+
+# Begin stuff to support --enable-shared
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ case "${enableval}" in
+ yes) shared=true ;;
+ no) shared=false ;;
+ *) shared=true ;;
+esac
+fi
+RPATH_ENVVAR=LD_LIBRARY_PATH
+# If we have shared libraries, try to set RPATH_ENVVAR reasonably.
+if test "${shared}" = "true"; then
+ case "${host}" in
+ *-*-hpux*)
+ RPATH_ENVVAR=SHLIB_PATH
+ ;;
+ esac
+fi
+
+# End stuff to support --enable-shared
+# Start stuff to support --enable-gdbtk
+# Check whether --enable-gdbtk or --disable-gdbtk was given.
+if test "${enable_gdbtk+set}" = set; then
+ enableval="$enable_gdbtk"
+ case "${enableval}" in
+ yes)
+ case "$host" in
+ *go32*)
+ enable_gdbtk=no ;;
+ *windows*)
+ enable_gdbtk=no ;;
+ *)
+ enable_gdbtk=yes ;;
+ esac ;;
+ no)
+ enable_gdbtk=no ;;
+ *)
+ { echo "configure: error: bad value ${enableval} given for gdbtk option" 1>&2; exit 1; } ;;
+esac
+else
+
+# Default is on for everything but go32 and windows
+case "$host" in
+ *go32* | *windows*)
+ ;;
+ *)
+ enable_gdbtk=yes ;;
+ esac
+
+fi
+
+
+if test "${enable_gdbtk}" = "yes"; then
+ configdirs="${configdirs} gdb.gdbtk"
+fi
+# End stuff to support --enable-shared
+
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:754: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 759 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_cygwin=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:787: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 792 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_mingw32=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:818: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_exeext=.exe
+else
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_exeext=
+ if { (eval echo configure:828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+ *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+ test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+
+# configure the subdirectories too
+subdirs="$configdirs"
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g
+s%@EXEEXT@%$EXEEXT%g
+s%@subdirs@%$subdirs%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
+if test "$no_recursion" != yes; then
+
+ # Remove --cache-file and --srcdir arguments so they do not pile up.
+ ac_sub_configure_args=
+ ac_prev=
+ for ac_arg in $ac_configure_args; do
+ if test -n "$ac_prev"; then
+ ac_prev=
+ continue
+ fi
+ case "$ac_arg" in
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ ;;
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+ *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
+ esac
+ done
+
+ for ac_config_dir in $configdirs; do
+
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
+ if test ! -d $srcdir/$ac_config_dir; then
+ continue
+ fi
+
+ echo configuring in $ac_config_dir
+
+ case "$srcdir" in
+ .) ;;
+ *)
+ if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
+ else
+ { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
+ fi
+ ;;
+ esac
+
+ ac_popdir=`pwd`
+ cd $ac_config_dir
+
+ # A "../" for each directory in /$ac_config_dir.
+ ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
+
+ case "$srcdir" in
+ .) # No --srcdir option. We are building in place.
+ ac_sub_srcdir=$srcdir ;;
+ /*) # Absolute path.
+ ac_sub_srcdir=$srcdir/$ac_config_dir ;;
+ *) # Relative path.
+ ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
+ esac
+
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_sub_srcdir/configure; then
+ ac_sub_configure=$ac_sub_srcdir/configure
+ elif test -f $ac_sub_srcdir/configure.in; then
+ ac_sub_configure=$ac_configure
+ else
+ echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
+ ac_sub_configure=
+ fi
+
+ # The recursion is here.
+ if test -n "$ac_sub_configure"; then
+
+ # Make the cache file name correct relative to the subdirectory.
+ case "$cache_file" in
+ /*) ac_sub_cache_file=$cache_file ;;
+ *) # Relative path.
+ ac_sub_cache_file="$ac_dots$cache_file" ;;
+ esac
+
+ echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
+ # The eval makes quoting arguments work.
+ if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
+ then :
+ else
+ { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
+ fi
+ fi
+
+ cd $ac_popdir
+ done
+fi
+
diff --git a/gdb/testsuite/configure.in b/gdb/testsuite/configure.in
new file mode 100644
index 00000000000..48e50d873f4
--- /dev/null
+++ b/gdb/testsuite/configure.in
@@ -0,0 +1,117 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.12.1)
+AC_INIT(gdb.base)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
+AC_CANONICAL_SYSTEM
+
+# Directories to use in all configurations.
+configdirs="gdb.arch \
+ gdb.asm \
+ gdb.base \
+ gdb.c++ \
+ gdb.java \
+ gdb.disasm \
+ gdb.chill \
+ gdb.mi \
+ gdb.threads \
+ gdb.trace"
+
+
+# Directories to use for a configuration which uses stabs.
+stabsdirs="gdb.stabs"
+
+ # this section is for targets that use stabs
+# add stabs tests for appropriate targets
+case "${target}" in
+ powerpc-*-aix*) configdirs="${configdirs} ${stabsdirs}" ;;
+ rs6000-*-aix*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *-*-bsd*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *-*-go32*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *-*-linux*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *-*-lynxos*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *-sun-*) configdirs="${configdirs} ${stabsdirs}" ;;
+ hppa*-*-*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *-*-elf*) configdirs="${configdirs} ${stabsdirs}" ;;
+ *) if test "x${with_stabs}" = x"yes" ; then
+ configdirs="${configdirs} ${stabsdirs}"
+ fi ;;
+esac
+
+# Directory with HP specific tests. They will run only with HP's compilers.
+# These tests will not work on other platforms and compilers.
+
+hpdir="gdb.hp"
+
+case "${target}" in
+ hppa*-*-hpux*) configdirs="${configdirs} ${hpdir}" ;;
+esac
+
+
+# Begin stuff to support --enable-shared
+AC_ARG_ENABLE(shared,
+[ --enable-shared use shared libraries],
+[case "${enableval}" in
+ yes) shared=true ;;
+ no) shared=false ;;
+ *) shared=true ;;
+esac])dnl
+RPATH_ENVVAR=LD_LIBRARY_PATH
+# If we have shared libraries, try to set RPATH_ENVVAR reasonably.
+if test "${shared}" = "true"; then
+ case "${host}" in
+ *-*-hpux*)
+ RPATH_ENVVAR=SHLIB_PATH
+ ;;
+ esac
+fi
+AC_SUBST(RPATH_ENVVAR)
+# End stuff to support --enable-shared
+# Start stuff to support --enable-gdbtk
+AC_ARG_ENABLE(gdbtk,
+[ --enable-gdbtk ],
+[case "${enableval}" in
+ yes)
+ case "$host" in
+ *go32*)
+ enable_gdbtk=no ;;
+ *windows*)
+ enable_gdbtk=no ;;
+ *)
+ enable_gdbtk=yes ;;
+ esac ;;
+ no)
+ enable_gdbtk=no ;;
+ *)
+ AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
+esac],
+[
+# Default is on for everything but go32 and windows
+case "$host" in
+ *go32* | *windows*)
+ ;;
+ *)
+ enable_gdbtk=yes ;;
+ esac
+])
+
+if test "${enable_gdbtk}" = "yes"; then
+ configdirs="${configdirs} gdb.gdbtk"
+fi
+# End stuff to support --enable-shared
+
+dnl Check for exe extension set on certain hosts (e.g. Win32)
+AC_EXEEXT
+
+# configure the subdirectories too
+AC_CONFIG_SUBDIRS($configdirs)
+
+dnl AC_SUBST(gdb_target_cpu)
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.arch/Makefile.in b/gdb/testsuite/gdb.arch/Makefile.in
new file mode 100644
index 00000000000..f2dc1a930ab
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/Makefile.in
@@ -0,0 +1,31 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = altivec-abi altivec-regs
+
+MISCELLANEOUS =
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ *.o a.out *.x *.ci *.tmp
+ -rm -f core core.coremaker coremaker.core corefile $(EXECUTABLES)
+ -rm -f $(MISCELLANEOUS)
+
+distclean maintainer-clean realclean: clean
+ -rm -f *~ core
+ -rm -f Makefile config.status config.log
+ -rm -f *-init.exp
+ -rm -fr *.log summary detail *.plog *.sum *.psum site.*
+
+Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.arch/altivec-abi.c b/gdb/testsuite/gdb.arch/altivec-abi.c
new file mode 100644
index 00000000000..f68ec255642
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/altivec-abi.c
@@ -0,0 +1,141 @@
+#include <altivec.h>
+
+vector short vshort = {111, 222, 333, 444, 555, 666, 777, 888};
+vector unsigned short vushort = {100, 200, 300, 400, 500, 600, 700, 800};
+vector int vint = {-10, -20, -30, -40};
+vector unsigned int vuint = {1111, 2222, 3333, 4444};
+vector char vchar = {'a','b','c','d','e','f','g','h','i','l','m','n','o','p','q','r'};
+vector unsigned char vuchar = {'A','B','C','D','E','F','G','H','I','L','M','N','O','P','Q','R'};
+vector float vfloat = {1.25, 3.75, 5.5, 1.25};
+
+vector short vshort_d = {0,0,0,0,0,0,0,0};
+vector unsigned short vushort_d = {0,0,0,0,0,0,0,0};
+vector int vint_d = {0,0,0,0};
+vector unsigned int vuint_d = {0,0,0,0};
+vector char vchar_d = {'z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z'};
+vector unsigned char vuchar_d = {'Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z'};
+vector float vfloat_d = {1.0, 1.0, 1.0, 1.0};
+
+struct test_vec_struct
+{
+ vector signed short vshort1;
+ vector signed short vshort2;
+ vector signed short vshort3;
+ vector signed short vshort4;
+};
+
+static vector signed short test4[4] =
+{
+ (vector signed short) {1, 2, 3, 4, 5, 6, 7, 8},
+ (vector signed short) {11, 12, 13, 14, 15, 16, 17, 18},
+ (vector signed short) {21, 22, 23, 24, 25, 26, 27, 28},
+ (vector signed short) {31, 32, 33, 34, 35, 36, 37, 38}
+};
+
+void
+struct_of_vector_func (struct test_vec_struct vector_struct)
+{
+ vector_struct.vshort1 = vec_add (vector_struct.vshort1, vector_struct.vshort2);
+ vector_struct.vshort3 = vec_add (vector_struct.vshort3, vector_struct.vshort4);
+}
+
+void
+array_of_vector_func (vector signed short *matrix)
+{
+ matrix[0] = vec_add (matrix[0], matrix[1]);
+ matrix[2] = vec_add (matrix[2], matrix[3]);
+}
+
+vector int
+vec_func (vector short vshort_f, /* goes in v2 */
+ vector unsigned short vushort_f, /* goes in v3 */
+ vector int vint_f, /* goes in v4 */
+ vector unsigned int vuint_f, /* goes in v5 */
+ vector char vchar_f, /* goes in v6 */
+ vector unsigned char vuchar_f, /* goes in v7 */
+ vector float vfloat_f, /* goes in v8 */
+ vector short x_f, /* goes in v9 */
+ vector int y_f, /* goes in v10 */
+ vector char a_f, /* goes in v11 */
+ vector float b_f, /* goes in v12 */
+ vector float c_f, /* goes in v13 */
+ vector int intv_on_stack_f)
+{
+
+ vector int vint_res;
+ vector unsigned int vuint_res;
+ vector short vshort_res;
+ vector unsigned short vushort_res;
+ vector char vchar_res;
+ vector float vfloat_res;
+ vector unsigned char vuchar_res;
+
+ vint_res = vec_add (vint_f, intv_on_stack_f);
+ vint_res = vec_add (vint_f, y_f);
+ vuint_res = vec_add (vuint_f, ((vector unsigned int) {5,6,7,8}));
+ vshort_res = vec_add (vshort_f, x_f);
+ vushort_res = vec_add (vushort_f,
+ ((vector unsigned short) {1,2,3,4,5,6,7,8}));
+ vchar_res = vec_add (vchar_f, a_f);
+ vfloat_res = vec_add (vfloat_f, b_f);
+ vfloat_res = vec_add (c_f, ((vector float) {1.1,1.1,1.1,1.1}));
+ vuchar_res = vec_add (vuchar_f,
+ ((vector unsigned char) {'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a'}));
+
+ return vint_res;
+}
+
+void marker(void) {};
+
+int
+main (void)
+{
+ vector int result = {-1,-1,-1,-1};
+ vector short x = {1,2,3,4,5,6,7,8};
+ vector int y = {12, 22, 32, 42};
+ vector int intv_on_stack = {12, 34, 56, 78};
+ vector char a = {'v','e','c','t','o','r',' ','o','f',' ','c','h','a','r','s','.' };
+ vector float b = {5.5, 4.5, 3.75, 2.25};
+ vector float c = {1.25, 3.5, 5.5, 7.75};
+
+ vector short x_d = {0,0,0,0,0,0,0,0};
+ vector int y_d = {0,0,0,0};
+ vector int intv_on_stack_d = {0,0,0,0};
+ vector char a_d = {'q','q','q','q','q','q','q','q','q','q','q','q','q','q','q','q'};
+ vector float b_d = {5.0, 5.0, 5.0, 5.0};
+ vector float c_d = {3.0, 3.0, 3.0, 3.0};
+
+ int var_int = 44;
+ short var_short = 3;
+ struct test_vec_struct vect_struct;
+
+ vect_struct.vshort1 = (vector signed short){1, 2, 3, 4, 5, 6, 7, 8};
+ vect_struct.vshort2 = (vector signed short){11, 12, 13, 14, 15, 16, 17, 18};
+ vect_struct.vshort3 = (vector signed short){21, 22, 23, 24, 25, 26, 27, 28};
+ vect_struct.vshort4 = (vector signed short){31, 32, 33, 34, 35, 36, 37, 38};
+
+ marker ();
+#if 0
+ /* This line is useful for cutting and pasting from the gdb command line. */
+vec_func(vshort,vushort,vint,vuint,vchar,vuchar,vfloat,x,y,a,b,c,intv_on_stack)
+#endif
+ result = vec_func (vshort, /* goes in v2 */
+ vushort, /* goes in v3 */
+ vint, /* goes in v4 */
+ vuint, /* goes in v5 */
+ vchar, /* goes in v6 */
+ vuchar, /* goes in v7 */
+ vfloat, /* goes in v8 */
+ x, /* goes in v9 */
+ y, /* goes in v10 */
+ a, /* goes in v11 */
+ b, /* goes in v12 */
+ c, /* goes in v13 */
+ intv_on_stack);
+
+ struct_of_vector_func (vect_struct);
+ array_of_vector_func (test4);
+
+ return 0;
+}
+
diff --git a/gdb/testsuite/gdb.arch/altivec-abi.exp b/gdb/testsuite/gdb.arch/altivec-abi.exp
new file mode 100644
index 00000000000..8a9f29dd813
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/altivec-abi.exp
@@ -0,0 +1,113 @@
+# Copyright (C) 2002 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+#
+
+# Tests for Powerpc AltiVec ABI
+
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# This file uses altivec.c for input.
+#
+
+set prms_id 0
+set bug_id 0
+
+if ![istarget "powerpc-*altivec"] then {
+ verbose "Skipping altivec abi tests."
+ return
+}
+
+set testfile "altivec"
+set binfile ${objdir}/${subdir}/${testfile}
+
+set src1 ${srcdir}/${subdir}/${testfile}.c
+
+if { [gdb_compile ${src1} ${binfile} executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# Run to `main' where we begin our tests.
+#
+
+if ![runto_main] then {
+ gdb_suppress_tests
+}
+
+gdb_test "b marker" "Breakpoint 2 at.*file.*altivec.c, line \[0-9\]+." "break marker"
+gdb_test "continue" "Breakpoint 2.*marker.*altivec.c.*" "continue to marker"
+gdb_test "finish" "Run till exit from .0.*in marker.*at.*altivec.c.*main \\(\\) at.*altivec.c.*result = vec_func \\(vshort,.*goes in v2.*" "back to main (1)"
+
+# now all the arguments of vec_fun are initialized
+
+set pattern "vec_func .vshort_f=.111, 222, 333, 444, 555, 666, 777, 888., vushort_f=.100, 200, 300, 400, 500, 600, 700, 800., vint_f=.-10, -20, -30, -40., vuint_f=.1111, 2222, 3333, 4444., vchar_f=.abcdefghilmnopqr., vuchar_f=.ABCDEFGHILMNOPQR., vfloat_f=.1.25, 3.75, 5.5, 1.25., x_f=.1, 2, 3, 4, 5, 6, 7, 8., y_f=.12, 22, 32, 42., a_f=.vector of chars.., b_f=.5.5, 4.5, 3.75, 2.25., c_f=.1.25, 3.5, 5.5, 7.75., intv_on_stack_f=.12, 34, 56, 78.."
+
+set pattern1 $pattern
+append pattern1 " at.*altivec.c.*vint_res = vec_add.*vint_f, intv_on_stack_f.;"
+
+# Now let's call the function. This function has > 12 args,
+# the last one will go on the stack.
+gdb_test "p vec_func(vshort,vushort,vint,vuint,vchar,vuchar,vfloat,x,y,a,b,c,intv_on_stack)" \
+".\[0-9\]+ = .2, 2, 2, 2." "call inferior function with vectors (1) "
+
+# Let's call the function again with dummy arguments. This is to clean
+# up the contents of the vector registers before the next call.
+gdb_test "p vec_func(vshort_d,vushort_d,vint_d,vuint_d,vchar_d,vuchar_d,vfloat_d,x_d,y_d,a_d,b_d,c_d,intv_on_stack_d)" \
+".\[0-9\]+ = .0, 0, 0, 0." "call inferior function with vectors (2) "
+
+# Let's step into the function, to see if the args are printed correctly.
+gdb_test "step" \
+ $pattern1 \
+ "step into vec_fun"
+
+set pattern2 $pattern
+append pattern2 " at.*altivec.c.*in main.*result = vec_func .vshort,.*goes in v2.*Value returned is.*= .2, 2, 2, 2."
+
+# Let's see if the result is returned correctly.
+gdb_test "finish" \
+ "Run till exit from .0.*$pattern2" \
+ "vector value returned correctly"
+
+# can we print the args correctly for this function?
+gdb_test "break struct_of_vector_func" "" ""
+
+set pattern "struct_of_vector_func .vector_struct=.vshort1 = .1, 2, 3, 4, 5, 6, 7, 8., vshort2 = .11, 12, 13, 14, 15, 16, 17, 18., vshort3 = .21, 22, 23, 24, 25, 26, 27, 28., vshort4 = .31, 32, 33, 34, 35, 36, 37, 38... at.*altivec.c.*"
+
+gdb_test "continue" \
+ "Breakpoint 3, $pattern.*vector_struct.vshort1 = vec_add .vector_struct.vshort1, vector_struct.vshort2.;" \
+ "continue to struct_of_vector_func"
+
+gdb_test "finish" \
+ "Run till exit from .0 $pattern\[ \r\n\]+main.*altivec.c.*array_of_vector_func.*" \
+ "back to main (2)"
+
+gdb_test "step" "" "step into array_of_vector_func"
+gdb_test "p matrix\[0\]" ".*= .1, 2, 3, 4, 5, 6, 7, 8." "print first vector"
+gdb_test "p matrix\[1\]" ".*= .11, 12, 13, 14, 15, 16, 17, 18." "print second vector"
+gdb_test "p matrix\[2\]" ".*= .21, 22, 23, 24, 25, 26, 27, 28." "print third vector"
+gdb_test "p matrix\[3\]" ".*= .31, 32, 33, 34, 35, 36, 37, 38." "print fourth vector"
+
diff --git a/gdb/testsuite/gdb.arch/altivec-regs.c b/gdb/testsuite/gdb.arch/altivec-regs.c
new file mode 100644
index 00000000000..4d4fe3f5dbb
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/altivec-regs.c
@@ -0,0 +1,41 @@
+#include <altivec.h>
+#include <stdio.h>
+
+vector unsigned int
+vector_fun (vector unsigned int a, vector unsigned int b)
+{
+ vector unsigned int c;
+ a = ((vector unsigned int) vec_splat_u8(2));
+ b = ((vector unsigned int) vec_splat_u8(3));
+
+ c = vec_add (a, b);
+ return c;
+}
+
+int
+main ()
+{
+ vector unsigned int y;
+ vector unsigned int x;
+ vector unsigned int z;
+ int a;
+
+ /* This line may look unnecessary but we do need it, because we want to
+ have a line to do a next over (so that gdb refetches the registers)
+ and we don't want the code to change any vector registers.
+ The splat operations below modify the VRs,i
+ so we don't want to execute them yet. */
+ a = 9;
+ x = ((vector unsigned int) vec_splat_u8 (-2));
+ y = ((vector unsigned int) vec_splat_u8 (1));
+
+ z = vector_fun (x, y);
+ x = vec_sld (x,y,2);
+
+ x = vec_add (x, ((vector unsigned int){5,6,7,8}));
+ z = (vector unsigned int) vec_splat_u8 ( -2);
+ y = vec_add (x, z);
+ z = (vector unsigned int) vec_cmpeq (x,y);
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.arch/altivec-regs.exp b/gdb/testsuite/gdb.arch/altivec-regs.exp
new file mode 100644
index 00000000000..80433bff155
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/altivec-regs.exp
@@ -0,0 +1,220 @@
+# Copyright (C) 2002 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+#
+
+# Tests for Powerpc AltiVec register setting and fetching
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# Test the use of registers, especially AltiVec registers, for Powerpc.
+# This file uses altivec-regs.c for input.
+#
+
+set prms_id 0
+set bug_id 0
+
+if ![istarget "powerpc-*altivec"] then {
+ verbose "Skipping altivec register tests."
+ return
+}
+
+set testfile "altivec-regs"
+set binfile ${objdir}/${subdir}/${testfile}
+set src1 ${srcdir}/${subdir}/${testfile}.c
+
+if { [gdb_compile ${src1} ${binfile} executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# Run to `main' where we begin our tests.
+#
+
+if ![runto_main] then {
+ gdb_suppress_tests
+}
+
+# set all the registers integer portions to 1
+for {set i 0} {$i < 32} {incr i 1} {
+ for {set j 0} {$j < 4} {incr j 1} {
+ gdb_test "set \$vr$i.v4_int32\[$j\] = 1" "" "set reg vr$i.v4si.f\[$j\]"
+ }
+}
+
+gdb_test "set \$vscr = 1" "" ""
+gdb_test "set \$vrsave = 1" "" ""
+
+# Now execute some target code, so that GDB's register cache is flushed.
+
+gdb_test "next" "" ""
+
+send_gdb "show endian\n"
+gdb_expect {
+ -re "(The target endianness is set automatically .currently )(big|little)( endian.*)$gdb_prompt $" {
+ pass "endianness"
+ set endianness $expect_out(2,string)
+ }
+ -re ".*$gdb_prompt $" {
+ fail "couldn't get endianness"
+ }
+ timeout { fail "(timeout) endianness" }
+}
+
+# And then read the AltiVec registers back, to see that
+# a) the register write above worked, and
+# b) the register read (below) also works.
+
+if {$endianness == "big"} {
+set vector_register ".uint128 = 0x00000001000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.."
+} else {
+set vector_register ".uint128 = 0x00000001000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0.."
+}
+
+for {set i 0} {$i < 32} {incr i 1} {
+ gdb_test "info reg vr$i" "vr$i.*$vector_register" "info reg vr$i"
+}
+
+gdb_test "info reg vrsave" "vrsave.*0x1" "info reg vrsave"
+gdb_test "info reg vscr" "vscr.*0x1" "info reg vscr"
+
+# Now redo the same tests, but using the print command.
+# Note: in LE case, the char array is printed WITHOUT the last character.
+# Gdb treats the terminating null char in the array like the terminating
+# null char in a string and doesn't print it. This is not a failure, but
+# the way gdb works.
+
+if {$endianness == "big"} {
+ set decimal_vector ".uint128 = 0x00000001000000010000000100000001, v4_float = .1.*e-45, 1.*e-45, 1.*e-45, 1.*e-45., v4_int32 = .1, 1, 1, 1., v8_int16 = .0, 1, 0, 1, 0, 1, 0, 1., v16_int8 = ..0.0.0.001.0.0.0.001.0.0.0.001.0.0.0.001.."
+} else {
+ set decimal_vector ".uint128 = 0x00000001000000010000000100000001, v4_float = .1.*e-45, 1.*e-45, 1.*e-45, 1.*e-45., v4_int32 = .1, 1, 1, 1., v8_int16 = .1, 0, 1, 0, 1, 0, 1, 0., v16_int8 = ..001.0.0.0.001.0.0.0.001.0.0.0.001.0.0.."
+}
+
+for {set i 0} {$i < 32} {incr i 1} {
+ gdb_test "print \$vr$i" ".* = $decimal_vector" "print vr$i"
+}
+
+gdb_test "print \$vrsave" ".* = 1" "print vrsave"
+gdb_test "print \$vscr" ".* = 1" "print vscr"
+
+for {set i 0} {$i < 32} {incr i 1} {
+ set pattern$i ".*vr$i.*"
+ append pattern$i $vector_register
+}
+
+send_gdb "info powerpc altivec\n"
+gdb_expect_list "info powerpc altivec" ".*$gdb_prompt $" {
+[$pattern0]
+[$pattern1]
+[$pattern2]
+[$pattern3]
+[$pattern4]
+[$pattern5]
+[$pattern6]
+[$pattern7]
+[$pattern8]
+[$pattern9]
+[$pattern10]
+[$pattern11]
+[$pattern12]
+[$pattern13]
+[$pattern14]
+[$pattern15]
+[$pattern16]
+[$pattern17]
+[$pattern18]
+[$pattern19]
+[$pattern20]
+[$pattern21]
+[$pattern22]
+[$pattern23]
+[$pattern24]
+[$pattern25]
+[$pattern26]
+[$pattern27]
+[$pattern28]
+[$pattern29]
+[$pattern30]
+[$pattern31]
+"\[ \t\n\r\]+vscr\[ \t\]+0x1"
+"\[ \t\n\r\]+vrsave\[ \t\]+0x1"
+}
+
+gdb_test "break vector_fun" \
+ "Breakpoint 2 at.*altivec-regs.c, line \[0-9\]+\\." \
+ "Set breakpoint at vector_fun"
+
+# Actually it is nuch easier to see these results printed in hex.
+gdb_test "set output-radix 16" \
+ "Output radix now set to decimal 16, hex 10, octal 20." \
+ "Set output radix to hex"
+
+gdb_test "continue" \
+ "Breakpoint 2, vector_fun .a=.0xfefefefe, 0xfefefefe, 0xfefefefe, 0xfefefefe., b=.0x1010101, 0x1010101, 0x1010101, 0x1010101.*altivec-regs.c.*vec_splat_u8.2..;" \
+ "continue to vector_fun"
+
+# Do a next over the assignment to vector 'a'.
+gdb_test "next" ".*b = \\(\\(vector unsigned int\\) vec_splat_u8\\(3\\)\\);" \
+ "next (1)"
+
+# Do a next over the assignment to vector 'b'.
+gdb_test "next" "c = vec_add \\(a, b\\);" \
+ "next (2)"
+
+# Now 'a' should be '0x02020202...' and 'b' should be '0x03030303...'
+gdb_test "print/x a" \
+ ".*= .0x2020202, 0x2020202, 0x2020202, 0x2020202." \
+ "print vector parameter a"
+
+gdb_test "print/x b" \
+ ".*= .0x3030303, 0x3030303, 0x3030303, 0x3030303." \
+ "print vector parameter b"
+
+# If we do an 'up' now, and print 'x' and 'y' we should see the values they
+# have in main, not the values they have in vector_fun.
+gdb_test "up" ".1.*main \\(\\) at.*altivec-regs.c.*z = vector_fun \\(x, y\\);" \
+ "up to main"
+
+gdb_test "print/x x" \
+ ".*= .0xfefefefe, 0xfefefefe, 0xfefefefe, 0xfefefefe." \
+ "print vector x"
+
+gdb_test "print/x y" \
+ ".*= .0x1010101, 0x1010101, 0x1010101, 0x1010101." \
+ "print vector y"
+
+# now go back to vector_func and do a finish, to see if we can print the return
+# value correctly.
+
+gdb_test "down" \
+ ".0 vector_fun \\(a=.0x2020202, 0x2020202, 0x2020202, 0x2020202., b=.0x3030303, 0x3030303, 0x3030303, 0x3030303.\\) at.*altivec-regs.c.*c = vec_add \\(a, b\\);" \
+ "down to vector_fun"
+
+gdb_test "finish" \
+ "Run till exit from .0 vector_fun \\(a=.0x2020202, 0x2020202, 0x2020202, 0x2020202., b=.0x3030303, 0x3030303, 0x3030303, 0x3030303.\\) at.*altivec-regs.c.*in main \\(\\) at.*altivec-regs.c.*z = vector_fun \\(x, y\\);.*Value returned is.*= .0x5050505, 0x5050505, 0x5050505, 0x5050505." \
+ "finish returned correct value"
+
+
+
diff --git a/gdb/testsuite/gdb.arch/configure b/gdb/testsuite/gdb.arch/configure
new file mode 100755
index 00000000000..205116b09da
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/configure
@@ -0,0 +1,913 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+sitefile=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=Makefile.in
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+ fi
+else
+ CONFIG_SITE="$sitefile"
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:586: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:607: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:625: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.arch/configure.in b/gdb/testsuite/gdb.arch/configure.in
new file mode 100644
index 00000000000..d72edff83a5
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(Makefile.in)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.asm/Makefile.in b/gdb/testsuite/gdb.asm/Makefile.in
new file mode 100644
index 00000000000..05ed656a387
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/Makefile.in
@@ -0,0 +1,36 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES =
+
+# uuencoded format to avoid SCCS/RCS problems with binary files.
+CROSS_EXECUTABLES =
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ *.o a.out xgdb *.x $(CROSS_EXECUTABLES) *.ci *.tmp
+ -rm -f core core.coremaker coremaker.core corefile $(EXECUTABLES)
+ -rm -f twice-tmp.c
+
+distclean maintainer-clean realclean: clean
+ -rm -f *~ core
+ -rm -f Makefile config.status config.log
+ -rm -f arch.inc
+ -rm -f *-init.exp
+ -rm -fr *.log summary detail *.plog *.sum *.psum site.*
+
+Makefile : $(srcdir)/Makefile.in config.status
+ $(SHELL) ./config.status
+
+config.status: $(srcdir)/configure
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.asm/arm.inc b/gdb/testsuite/gdb.asm/arm.inc
new file mode 100644
index 00000000000..701ecbf56bc
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/arm.inc
@@ -0,0 +1,34 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ mov ip, sp
+ stmdb sp!, {fp, ip, lr, pc}
+ sub fp, ip, #4
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ ldmea fp, {fp, sp, pc}
+ .endm
+
+ .macro gdbasm_call subr
+ bl \subr
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ mov r0, #0
+ swi 0x00123456
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ mov sp, #0
+ .endm
+
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
new file mode 100644
index 00000000000..f6ce1c73b2b
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -0,0 +1,288 @@
+# Copyright 1998, 2000, 2002 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+#
+# This file was written by Kendra.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# Test debugging assembly level programs.
+# This file uses asmsrc[12].s for input.
+#
+
+set prms_id 0
+set bug_id 0
+
+set asm-arch ""
+set asm-flags ""
+set link-flags ""
+
+if [istarget "*arm-*-*"] then {
+ set asm-arch arm
+}
+if [istarget "xscale-*-*"] then {
+ set asm-arch arm
+}
+if [istarget "d10v-*-*"] then {
+ set asm-arch d10v
+}
+if [istarget "s390-*-*"] then {
+ set asm-arch s390
+}
+if [istarget "i\[3456\]86-*-*"] then {
+ set asm-arch i386
+}
+if [istarget "m32r*-*"] then {
+ set asm-arch m32r
+}
+if [istarget "powerpc*-*"] then {
+ set asm-arch powerpc
+}
+if [istarget "sparc-*-*"] then {
+ set asm-arch sparc
+}
+if [istarget "sparc64-*-*"] then {
+ set asm-arch sparc64
+ set asm-flags "-xarch=v9 -gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+}
+if [istarget "xstormy16-*-*"] then {
+ set asm-arch xstormy16
+ set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+}
+if [istarget "v850-*-*"] then {
+ set asm-arch v850
+ set gdb_wrapper_initialized 1
+}
+if { "${asm-arch}" == "" } {
+ gdb_suppress_entire_file "Assembly source test -- not implemented for this target."
+}
+
+# Watch out, we are invoking the assembler, but the testsuite sets multilib
+# switches according to compiler syntax. If we pass these options straight
+# to the assembler, they won't always make sense. If we don't pass them to
+# the assembler, the final link will complain that the object files were
+# built with different defaults. So no matter what we do, we lose. We may as
+# well get out of this test sooner rather than later.
+set dest [target_info name]
+if [board_info $dest exists multilib_flags] {
+ set multilib_flags [board_info $dest multilib_flags]
+ if { "${multilib_flags}" != "" } {
+ gdb_suppress_entire_file "Assembly source test -- multilibs not supported by this test."
+ return;
+ }
+}
+
+set testfile "asm-source"
+set binfile ${objdir}/${subdir}/${testfile}
+set src1 ${srcdir}/${subdir}/asmsrc1.s
+set src2 ${srcdir}/${subdir}/asmsrc2.s
+
+remote_exec build "rm -f ${subdir}/arch.inc"
+remote_download host ${srcdir}/${subdir}/${asm-arch}.inc ${subdir}/arch.inc
+
+if { "${asm-flags}" == "" } {
+ #set asm-flags "-Wa,-gstabs,-I${srcdir}/${subdir},-I${objdir}/${subdir}"
+ set asm-flags "-gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+}
+
+if {[target_assemble ${src1} asmsrc1.o "${asm-flags}"] != ""} then {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+if {[target_assemble ${src2} asmsrc2.o "${asm-flags}"] != ""} then {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+set opts "debug ldflags=-nostartfiles"
+foreach i ${link-flags} {
+ append opts " ldflags=$i"
+}
+if { [gdb_compile "asmsrc1.o asmsrc2.o" "${binfile}" executable $opts] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+remote_exec build "mv asmsrc1.o asmsrc2.o ${objdir}/${subdir}"
+
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# Run to `main' where we begin our tests.
+#
+
+if ![runto_main] then {
+ gdb_suppress_tests
+}
+
+# Execute the `f' command and see if the result includes source info.
+gdb_test "f" "asmsrc1\[.\]s:29.*several_nops" "f at main"
+
+# See if we properly `next' over a macro with several insns.
+gdb_test "n" "33\[ \]*.*foo2" "next over macro"
+
+# See if we can properly `step' into a subroutine call.
+gdb_test "s" "8\[ \]*.*" "step into foo2"
+
+# Test 'info target', and incidentally capture the entry point address.
+set entry_point 0
+send_gdb "info target\n"
+gdb_expect {
+ -re "Symbols from .*asm-source.*Entry point: 0x(\[01232456789abcdefABCDEF\]+).*$gdb_prompt $" {
+ set entry_point $expect_out(1,string)
+ pass "info target"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "info target"
+ }
+ timeout {
+ fail "info target (timeout)"
+ }
+}
+
+# Capture the start symbol (may be '_start' or 'start')
+set entry_symbol ""
+send_gdb "info symbol 0x$entry_point\n"
+gdb_expect {
+ -re "info symbol 0x$entry_point\[\r\n\]+(\[^\r\n\]*) in section .*$gdb_prompt $" {
+ # We match the echoed `info symbol' command here, to help us
+ # reliably identify the beginning of the start symbol in the
+ # command's output. You might think we could just use '^' to
+ # start matching at the beginning of the line, but
+ # unfortunately, in Expect, '^' matches the beginning of the
+ # input that hasn't been matched by any expect clause yet. If
+ # every expect clause consumes a complete line, along with its
+ # terminating CR/LF, this is equivalent to the beginning of a
+ # line. But expect clauses that end with `.*' will consume as
+ # much as happened to arrive from the TTY --- exactly where
+ # they leave you depends on inter-process timing. :(
+ set entry_symbol $expect_out(1,string)
+ pass "info symbol"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "info symbol"
+ }
+ timeout {
+ fail "info symbol (timeout)"
+ }
+}
+
+# Now try a 'list' from the other source file.
+gdb_test "list $entry_symbol" ".*gdbasm_startup.*" "list"
+
+# Now try a source file search
+gdb_test "search A routine for foo2 to call" \
+ "39\[ \t\]+comment \"A routine for foo2 to call.\"" "search"
+
+# See if `f' prints the right source file.
+gdb_test "f" ".*asmsrc2\[.\]s:8.*" "f in foo2"
+
+# `next' one insn (or macro) to set up our stackframe (for the following bt).
+gdb_test "n" "12\[ \]*.*foo3" "n in foo2"
+
+# See if a simple `bt' prints the right source files and
+# doesn't fall off the stack.
+
+gdb_test "bt 10" \
+ "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:33(.*\#2.*start\[^\r\n\]*)?" \
+ "bt ALL in foo2"
+
+# See if a capped `bt' prints the right source files.
+gdb_test "bt 2" "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:33.*" "bt 2 in foo2"
+
+# Step into another subroutine which lives back in the first source file.
+gdb_test "s" "" "s 2"
+
+# Next over insns to set up the stack frame.
+gdb_test "n" "" "n 2"
+
+# Now see if a capped `bt' is correct.
+gdb_test "bt 3" "\#0.*foo3.*asmsrc1\[.\]s:44.*\#1.*foo2.*asmsrc2\[.\]s:12.*\#2.*main.*asmsrc1\[.\]s:33.*" "bt 3 in foo3"
+
+# Try 'info source' from asmsrc1.s
+gdb_test "info source" \
+ "Current source file is .*asmsrc1.s.*Source language is asm.*" \
+ "info source asmsrc1.s"
+
+# Try 'finishing' from foo3
+gdb_test "finish" "Run till exit from.*\[\r\n\]13\[ \t\]+gdbasm_call foo3" \
+ "finish from foo3"
+
+# Try 'info source' from asmsrc2.s
+gdb_test "info source" \
+ "Current source file is .*asmsrc2.s.*Source language is asm.*" \
+ "info source asmsrc2.s"
+
+# Try 'info sources'. This can produce a lot of output on systems
+# with dynamic linking, where the system's shared libc was compiled
+# with debugging info; for example, on Linux, this produces 47kb of
+# output. So we consume it as we go.
+send_gdb "info sources\n"
+set seen_asmsrc_1 0
+set seen_asmsrc_2 0
+gdb_expect {
+ -re "^\[^,\]*asmsrc1.s(, |\[\r\n\]+)" {
+ set seen_asmsrc_1 1
+ exp_continue
+ }
+ -re "^\[^,\]*asmsrc2.s(, |\[\r\n\]+)" {
+ set seen_asmsrc_2 1
+ exp_continue
+ }
+ -re ", " {
+ exp_continue
+ }
+ -re "$gdb_prompt $" {
+ if {$seen_asmsrc_1 && $seen_asmsrc_2} {
+ pass "info sources"
+ } else {
+ fail "info sources"
+ }
+ }
+ timeout {
+ fail "info sources (timeout)"
+ }
+}
+
+
+# Try 'info line'
+gdb_test "info line" \
+ "Line 13 of.*asmsrc2.s.*starts at.*<foo2+.*> and ends at.*<foo2+.*>." \
+ "info line"
+
+# Try 'nexting' over next call to foo3
+gdb_test "next" "17\[ \t\]+gdbasm_leave" "next over foo3"
+
+# Try 'return' from foo2
+gdb_test "return" "\#0 main .*37\[ \t\]+gdbasm_exit0" "return from foo2" \
+ "Make selected stack frame return now\?.*" "y"
+
+# See if we can look at a global variable
+gdb_test "print globalvar" ".* = 11" "look at global variable"
+
+# See if we can look at a static variable
+gdb_test "print staticvar" ".* = 5" "look at static variable"
+
+# See if we can look at a static function
+gdb_test "disassem foostatic" ".*<foostatic>:.*End of assembler dump." \
+ "look at static function"
+
+remote_exec build "rm -f ${subdir}/arch.inc"
diff --git a/gdb/testsuite/gdb.asm/asmsrc1.s b/gdb/testsuite/gdb.asm/asmsrc1.s
new file mode 100644
index 00000000000..f14cd915921
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/asmsrc1.s
@@ -0,0 +1,63 @@
+ .include "common.inc"
+ .include "arch.inc"
+
+comment "WARNING: asm-source.exp checks for line numbers printed by gdb."
+comment "Be careful about changing this file without also changing"
+comment "asm-source.exp."
+
+
+comment "This file is not linked with crt0."
+comment "Provide very simplistic equivalent."
+
+ .global _start
+_start:
+ gdbasm_startup
+ gdbasm_call main
+ gdbasm_exit0
+
+
+comment "main routine for assembly source debugging test"
+comment "This particular testcase uses macros in <arch>.inc to achieve"
+comment "machine independence."
+
+ .global main
+main:
+ gdbasm_enter
+
+comment "Call a macro that consists of several lines of assembler code."
+
+ gdbasm_several_nops
+
+comment "Call a subroutine in another file."
+
+ gdbasm_call foo2
+
+comment "All done."
+
+ gdbasm_exit0
+
+comment "A routine for foo2 to call."
+
+ .global foo3
+foo3:
+ gdbasm_enter
+ gdbasm_leave
+
+ .global exit
+exit:
+ gdbasm_exit0
+
+comment "A static function"
+
+foostatic:
+ gdbasm_enter
+ gdbasm_leave
+
+comment "A global variable"
+
+ .global globalvar
+gdbasm_datavar globalvar 11
+
+comment "A static variable"
+
+gdbasm_datavar staticvar 5
diff --git a/gdb/testsuite/gdb.asm/asmsrc2.s b/gdb/testsuite/gdb.asm/asmsrc2.s
new file mode 100644
index 00000000000..9d7713fad84
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/asmsrc2.s
@@ -0,0 +1,17 @@
+ .include "common.inc"
+ .include "arch.inc"
+
+comment "Second file in assembly source debugging testcase."
+
+ .global foo2
+foo2:
+ gdbasm_enter
+
+comment "Call someplace else (several times)."
+
+ gdbasm_call foo3
+ gdbasm_call foo3
+
+comment "All done, return."
+
+ gdbasm_leave
diff --git a/gdb/testsuite/gdb.asm/common.inc b/gdb/testsuite/gdb.asm/common.inc
new file mode 100644
index 00000000000..51493929765
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/common.inc
@@ -0,0 +1,28 @@
+ .macro comment text
+ .endm
+
+ comment "Can't rely on assembler comment character so do this."
+
+ .macro include arch file
+ .include "\arch\file"
+ .endm
+
+ comment "Declare a data variable"
+ .macro gdbasm_datavar name value
+ .data
+\name:
+ .word \value
+ .endm
+
+comment "arch.inc is responsible for defining the following macros:"
+comment "enter - subroutine prologue"
+comment "leave - subroutine epilogue"
+comment "call - call a named subroutine"
+comment "several_nops - execute several (typically 4) nops"
+comment "exit0 - exit (0)"
+
+comment "arch.inc may also override the default definitions of:"
+comment "datavar - define a data variable"
+
+comment "macros to label a subroutine may also eventually be needed"
+comment "i.e. .global foo\nfoo:\n"
diff --git a/gdb/testsuite/gdb.asm/configure b/gdb/testsuite/gdb.asm/configure
new file mode 100755
index 00000000000..1dd81387d9c
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/configure
@@ -0,0 +1,913 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+sitefile=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=asm-source.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+ fi
+else
+ CONFIG_SITE="$sitefile"
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:586: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:607: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:625: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.asm/configure.in b/gdb/testsuite/gdb.asm/configure.in
new file mode 100644
index 00000000000..bded89e9693
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(asm-source.exp)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.asm/d10v.inc b/gdb/testsuite/gdb.asm/d10v.inc
new file mode 100644
index 00000000000..bd9463fc891
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/d10v.inc
@@ -0,0 +1,55 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ st r11,@-sp
+ st r13,@-sp
+ mv r11,sp
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ add3 sp,r11,0
+ ld r13,@sp+
+ ld r11,@sp+
+ jmp r13
+ .endm
+
+ .macro gdbasm_call subr
+ bl \subr
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ ldi r4, 1
+ ldi r0, 0
+ trap 15
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+; R14 always contains memory base address (0)
+
+ ldi r14,0
+
+; Set the USER and SYSTEM stack pointers.
+
+ ldi r0, 0 ; zero arguments
+ ldi r1, 0
+ mvtc r0, psw ; select SPI and set it
+ ldi sp, _stack
+ ldi r10, 0x8000 ; select SPU/FP and set it
+ mvtc r10, psw || ldi r11, 0; clear stack frame
+ ldi sp, _stack - 0x200
+ ldi r13, 0
+
+ st r11, @-sp
+ st r13, @-sp
+; mv r11, sp
+
+ .endm
diff --git a/gdb/testsuite/gdb.asm/i386.inc b/gdb/testsuite/gdb.asm/i386.inc
new file mode 100644
index 00000000000..9746646ba62
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/i386.inc
@@ -0,0 +1,39 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ push %ebp
+ mov %esp,%ebp
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ pop %ebp
+ ret
+ .endm
+
+ .macro gdbasm_call subr
+ call \subr
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ hlt
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ xor %ebp, %ebp
+ .endm
+
+ comment "Declare a data variable"
+ .macro gdbasm_datavar name value
+ .data
+\name:
+ .long \value
+ .endm
diff --git a/gdb/testsuite/gdb.asm/m32r.inc b/gdb/testsuite/gdb.asm/m32r.inc
new file mode 100644
index 00000000000..6110373df41
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/m32r.inc
@@ -0,0 +1,35 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ push fp -> push lr
+ addi sp,#-4 -> mv fp,sp
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ addi sp,#4 -> pop lr
+ pop fp -> jmp lr
+ .endm
+
+ .macro gdbasm_call subr
+ bl \subr -> nop
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ ldi r0,#1 -> ldi r1,#0
+ ldi r2,#0 -> ldi r3,#0
+ trap #0 -> nop
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ ld24 sp,_stack
+ ldi fp,#0
+ .endm
diff --git a/gdb/testsuite/gdb.asm/powerpc.inc b/gdb/testsuite/gdb.asm/powerpc.inc
new file mode 100644
index 00000000000..5aefde2c02f
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/powerpc.inc
@@ -0,0 +1,46 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ stwu 1, -16(1)
+ stw 31, 8(1)
+ mr 31, 1
+ mflr 0
+ stw 0, 20(1)
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ lwz 0, 20(1)
+ mtlr 0
+ lwz 31, 8(1)
+ lwz 1, 0(1)
+ blr
+ .endm
+
+ .macro gdbasm_call subr
+ bl \subr
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ comment "Don't know how to exit, but this will certainly halt..."
+ li 0, 0
+ lwz 0, 0(0)
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ .endm
+
+ comment "Declare a data variable"
+ .macro gdbasm_datavar name value
+ .data
+\name:
+ .long \value
+ .endm
diff --git a/gdb/testsuite/gdb.asm/s390.inc b/gdb/testsuite/gdb.asm/s390.inc
new file mode 100644
index 00000000000..196a9603c93
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/s390.inc
@@ -0,0 +1,75 @@
+### entry point code
+ .macro gdbasm_startup
+
+ # Align the stack pointer to an 8-byte boundary.
+ lhi %r0,-8
+ nr %r15,%r0
+
+ # Reserve space for the standard stack frame:
+ # back chain, and space for the callee to save its registers.
+ ahi %r15,-104
+
+ # Zero this frame's back chain pointer.
+ xc 0(4,%r15),0(%r15)
+ .endm
+
+
+### Call a function.
+ .macro gdbasm_call subr
+
+ # Put the address of the constant in %r1, load the constant
+ # (SUBR's address), and jump to it.
+ bras %r1, .Lafterconst\@
+ .long \subr
+.Lafterconst\@:
+ l %r1,0(%r1)
+ basr %r14,%r1
+ .endm
+
+
+### Exit with a zero status.
+ .macro gdbasm_exit0
+ lhi %r2, 0
+ svc 1
+ .endm
+
+### Standard subroutine prologue.
+ .macro gdbasm_enter
+
+ # Save all the callee-saves registers. What the heck.
+ stm %r6,%r15,24(%r15)
+
+ # Allocate the stack frame, and write the back chain pointer.
+ # Keep the original SP in %r11.
+ lr %r1,%r15
+ ahi %r15,-96
+ st %r1,0(%r15)
+ .endm
+
+
+### Standard subroutine epilogue.
+ .macro gdbasm_leave
+
+ # Restore all our registers. This also pops the frame, and
+ # restores our return address.
+ lm %r6,%r15,120(%r15)
+
+ # Jump to the return address.
+ br %r14
+
+ .endm
+
+### Several nops.
+ .macro gdbasm_several_nops
+ lr %r0, %r0
+ lr %r0, %r0
+ lr %r0, %r0
+ lr %r0, %r0
+ .endm
+
+### Declare an `int' variable.
+ .macro gdbasm_datavar name value
+ .data
+\name:
+ .long \value
+ .endm
diff --git a/gdb/testsuite/gdb.asm/sparc.inc b/gdb/testsuite/gdb.asm/sparc.inc
new file mode 100644
index 00000000000..916a9e0e794
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/sparc.inc
@@ -0,0 +1,34 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ save %sp, -112, %sp
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ ret
+ restore
+ .endm
+
+ .macro gdbasm_call subr
+ call \subr
+ nop
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ comment "Don't know how to exit, but this will certainly halt..."
+ ld [%g0], %i0
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ clr %fp
+ .endm
+
diff --git a/gdb/testsuite/gdb.asm/sparc64.inc b/gdb/testsuite/gdb.asm/sparc64.inc
new file mode 100644
index 00000000000..fb2253e0c39
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/sparc64.inc
@@ -0,0 +1,34 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ save %sp, -192, %sp
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ return %i7 + 8
+ nop
+ .endm
+
+ .macro gdbasm_call subr
+ call \subr
+ nop
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ comment "Don't know how to exit, but this will certainly halt..."
+ ldx [%g0], %i0
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ clr %fp
+ .endm
+
diff --git a/gdb/testsuite/gdb.asm/v850.inc b/gdb/testsuite/gdb.asm/v850.inc
new file mode 100644
index 00000000000..87977919f0c
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/v850.inc
@@ -0,0 +1,41 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ add -8,sp
+ st.w r31,4[sp]
+ st.w r29,0[sp]
+ mov sp,r29
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ mov r29,sp
+ ld.w 0[sp],r29
+ ld.w 4[sp],r31
+ add 8,sp
+ jmp [r31]
+ .endm
+
+ .macro gdbasm_call subr
+ jarl \subr,r31
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ halt
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ movea 255,r0,r20
+ mov r0, r21
+ ori 65535, r0, r21
+ movhi 32, r0, sp
+ .endm
+
diff --git a/gdb/testsuite/gdb.asm/x86_64.inc b/gdb/testsuite/gdb.asm/x86_64.inc
new file mode 100644
index 00000000000..5bcaeae25ab
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/x86_64.inc
@@ -0,0 +1,39 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ push %rbp
+ mov %rsp,%rbp
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ pop %rbp
+ ret
+ .endm
+
+ .macro gdbasm_call subr
+ call \subr
+ .endm
+
+ .macro gdbasm_several_nops
+ nop
+ nop
+ nop
+ nop
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ hlt
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ xor %rbp, %rbp
+ .endm
+
+ comment "Declare a data variable"
+ .macro gdbasm_datavar name value
+ .data
+\name:
+ .long \value
+ .endm
diff --git a/gdb/testsuite/gdb.asm/xstormy16.inc b/gdb/testsuite/gdb.asm/xstormy16.inc
new file mode 100644
index 00000000000..22827f3eb1c
--- /dev/null
+++ b/gdb/testsuite/gdb.asm/xstormy16.inc
@@ -0,0 +1,34 @@
+ comment "subroutine prologue"
+ .macro gdbasm_enter
+ push r13
+ mov r13,r15
+ .endm
+
+ comment "subroutine epilogue"
+ .macro gdbasm_leave
+ pop r13
+ ret
+ .endm
+
+ .macro gdbasm_call subr
+ callf \subr
+ .endm
+
+ .macro gdbasm_several_nops
+ add r0,#0
+ add r0,#0
+ add r0,#0
+ add r0,#0
+ .endm
+
+ comment "exit (0)"
+ .macro gdbasm_exit0
+ mov.w r2,#0
+ halt
+ .endm
+
+ comment "crt0 startup"
+ .macro gdbasm_startup
+ mov r15,#2
+ .endm
+
diff --git a/gdb/testsuite/gdb.base/Makefile.in b/gdb/testsuite/gdb.base/Makefile.in
new file mode 100644
index 00000000000..c878f15de7c
--- /dev/null
+++ b/gdb/testsuite/gdb.base/Makefile.in
@@ -0,0 +1,43 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = all-types annota1 bitfields break \
+ call-ar-st call-rt-st call-strs callfuncs callfwmall \
+ commands compiler condbreak constvars coremaker \
+ dbx-test display ending-run execd-prog exprs \
+ foll-exec foll-fork foll-vfork funcargs int-type interrupt jump \
+ langs list long_long mips_pro miscexprs nodebug opaque overlays \
+ pointers pointers2 printcmds ptype \
+ recurse reread reread1 restore return run \
+ scope section_command setshow setvar shmain sigall signals \
+ solib solib_sl so-impl-ld so-indr-cl \
+ step-line step-test structs structs2 \
+ twice-tmp varargs vforked-prog watchpoint whatis
+
+MISCELLANEOUS = coremmap.data ../foobar.baz \
+ shr1.sl shr2.sl solib_sl.sl solib1.sl solib2.sl
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ *.o a.out xgdb *.x *.ci *.tmp
+ -rm -f core core.coremaker coremaker.core corefile $(EXECUTABLES)
+ -rm -f $(MISCELLANEOUS) twice-tmp.c
+
+distclean maintainer-clean realclean: clean
+ -rm -f *~ core
+ -rm -f Makefile config.status config.log
+ -rm -f *-init.exp
+ -rm -fr *.log summary detail *.plog *.sum *.psum site.*
+
+Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.base/a2-run.exp b/gdb/testsuite/gdb.base/a2-run.exp
new file mode 100644
index 00000000000..fbc704470cb
--- /dev/null
+++ b/gdb/testsuite/gdb.base/a2-run.exp
@@ -0,0 +1,257 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999, 2000
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+# These tests don't work for targets can't take arguments...
+
+if [target_info exists noargs] then {
+ verbose "Skipping a2-run.exp because of noargs."
+ return
+}
+
+# Can't do this test without stdio support.
+if [gdb_skip_stdio_test "a2run.exp"] {
+ return
+}
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "run"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Run with no arguments.
+# On VxWorks this justs make sure the program was run.
+gdb_run_cmd
+
+if [istarget "*-*-vxworks*"] then {
+ set timeout 120
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ "Program exited normally" {
+ unresolved "run \"$testfile\" with no args"
+ }
+ -re "usage: factorial <number>" {
+ pass "run \"$testfile\" with no args"
+ }
+ timeout {
+ fail "(timeout) run \"$testfile\" with no args"
+ }
+ }
+ set timeout 10
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect -re "$gdb_prompt $" {}
+} else {
+ gdb_expect {
+ -re ".*usage: factorial <number>.*Program exited with code 01.*$gdb_prompt $" {
+ pass "run \"$testfile\" with no args"
+ }
+ -re ".*usage: factorial <number>.* EXIT code 1.*Program exited normally.*$gdb_prompt $" {
+ pass "run \"$testfile\" with no args (exit wrapper)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "run \"$testfile\" with no args"
+ verbose "expect_out is $expect_out(buffer)" 2
+ }
+ timeout {
+ fail "(timeout) run \"$testfile\" no args"
+ }
+ }
+}
+# Now run with some arguments
+if [istarget "*-*-vxworks*"] then {
+ send_gdb "run vxmain \"5\"\n"
+ gdb_expect -re "run vxmain \"5\"\r\n" {}
+ set timeout 120
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ "Program exited normally" {
+ unresolved "run \"$testfile\" with arg"
+ }
+ "120" {
+ pass "run \"$testfile\" with arg"
+ }
+ timeout {
+ fail "(timeout) run \"$testfile\" with arg"
+ }
+ }
+ set timeout 10
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect -re "$gdb_prompt $" {}
+} else {
+ setup_xfail "mips-idt-*" "arm-*-coff strongarm-*-coff"
+ gdb_run_cmd 5
+ gdb_expect {
+ -re ".*120.*$gdb_prompt $"\
+ { pass "run \"$testfile\" with arg" }
+ -re ".*$gdb_prompt $" { fail "run \"$testfile\" with arg" }
+ timeout { fail "(timeout) run \"$testfile\" with arg" }
+ }
+}
+
+# Run again with same arguments.
+setup_xfail "mips-idt-*"
+gdb_run_cmd
+
+if [istarget "*-*-vxworks*"] then {
+ set timeout 120
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ "Program exited normally" {
+ unresolved "run \"$testfile\" again with same args"
+ }
+ "120" { pass "run \"$testfile\" again with same args" }
+ timeout { fail "(timeout) run \"$testfile\" again with same args" }
+ }
+ set timeout 10
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect -re "$gdb_prompt $" {}
+} else {
+ setup_xfail "arm-*-coff strongarm-*-coff"
+ gdb_expect {
+ -re ".*120.*$gdb_prompt $"\
+ { pass "run \"$testfile\" again with same args" }
+ -re ".*$gdb_prompt $" { fail "run \"$testfile\" again with same args" }
+ timeout { fail "(timeout) run \"$testfile\" again with same args" }
+ }
+}
+
+# Use "set args" command to specify no arguments as default and run again.
+if [istarget "*-*-vxworks*"] then {
+ send_gdb "set args main\n"
+} else {
+ send_gdb "set args\n"
+}
+gdb_expect -re "$gdb_prompt $"
+
+gdb_run_cmd
+
+if [istarget "*-*-vxworks*"] then {
+ set timeout 120
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ "Program exited normally" {
+ unresolved "run after setting args to nil"
+ }
+ "usage: factorial <number>" {
+ pass "run after setting args to nil"
+ }
+ timeout {
+ fail "(timeout) run after setting args to nil"
+ }
+ }
+ set timeout 10
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect -re "$gdb_prompt $" {}
+} else {
+ gdb_expect {
+ -re ".*usage: factorial <number>.*$gdb_prompt $" {
+ pass "run after setting args to nil"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "run after setting args to nil"
+ }
+ timeout {
+ fail "(timeout) run after setting args to nil"
+ }
+ }
+}
+
+# Use "set args" command to specify an argument and run again.
+setup_xfail "mips-idt-*"
+if [istarget "*-*-vxworks*"] then {
+ send_gdb "set args vxmain \"6\"\n"
+} else {
+ send_gdb "set args 6\n"
+}
+gdb_expect -re "$gdb_prompt $"
+gdb_run_cmd
+
+if [istarget "*-*-vxworks*"] then {
+ set timeout 120
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect {
+ "Program exited normally" {
+ unresolved "run \"$testfile\" again after setting args"
+ }
+ "720" {
+ pass "run \"$testfile\" again after setting args"
+ }
+ timeout {
+ fail "(timeout) run \"$testfile\" again after setting args"
+ }
+ }
+ set timeout 10
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_expect -re "$gdb_prompt $" {}
+} else {
+ setup_xfail "arm-*-coff strongarm-*-coff"
+ gdb_expect {
+ -re ".*720.*$gdb_prompt $" {
+ pass "run \"$testfile\" again after setting args"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "run \"$testfile\" again after setting args"
+ }
+ timeout {
+ fail "(timeout) run \"$testfile\" again after setting args"
+ }
+ }
+}
+
+# GOAL: Test that shell is being used with "run". For remote debugging
+# targets, there is no guarantee that a "shell" (whatever that is) is used.
+if ![is_remote target] then {
+ send_gdb "run `echo 8`\n"
+ gdb_expect {
+ -re "Starting program.*40320.*$gdb_prompt $" {
+ pass "run \"$testfile\" with shell"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "run \"$testfile\" with shell"
+ }
+ timeout {
+ fail "(timeout) run \"$testfile\" with shell"
+ }
+ }
+}
+
+# Reset the default arguments for VxWorks
+if [istarget "*-*-vxworks*"] then {
+ send_gdb "set args main\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+}
diff --git a/gdb/testsuite/gdb.base/all-bin.exp b/gdb/testsuite/gdb.base/all-bin.exp
new file mode 100644
index 00000000000..fe6b7558e4c
--- /dev/null
+++ b/gdb/testsuite/gdb.base/all-bin.exp
@@ -0,0 +1,471 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This file is part of the gdb testsuite
+#
+# tests for arithmetic, logical and relational operators
+# with mixed types
+#
+
+
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "all-types"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+gdb_test "next" "return 0;" "continuing after dummy()"
+
+send_gdb "print v_int+v_char\n"
+gdb_expect {
+ -re ".*71.*$gdb_prompt $" {
+ pass "print value of v_int+v_char"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_char" }
+ timeout { fail "(timeout) print value of v_int+v_char" }
+ }
+
+send_gdb "print v_int+v_short\n"
+gdb_expect {
+ -re ".*9.*$gdb_prompt $" {
+ pass "print value of v_int+v_short"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_short" }
+ timeout { fail "(timeout) print value of v_int+v_short" }
+ }
+
+
+send_gdb "print v_int+v_signed_char\n"
+gdb_expect {
+ -re ".*72.*$gdb_prompt $" {
+ pass "print value of v_int+v_signed_char"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_signed_char" }
+ timeout { fail "(timeout) print value of v_int+v_signed_char" }
+ }
+
+
+send_gdb "print v_int+v_unsigned_char\n"
+gdb_expect {
+ -re ".*73.*$gdb_prompt $" {
+ pass "print value of v_int+v_unsigned_char"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_unsigned_char" }
+ timeout { fail "(timeout) print value of v_int+v_unsigned_char" }
+ }
+
+
+send_gdb "print v_int+v_signed_short\n"
+gdb_expect {
+ -re ".*10.*$gdb_prompt $" {
+ pass "print value of v_int+v_signed_short"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_signed_short" }
+ timeout { fail "(timeout) print value of v_int+v_signed_short" }
+ }
+
+
+send_gdb "print v_int+v_unsigned_short\n"
+gdb_expect {
+ -re ".*11.*$gdb_prompt $" {
+ pass "print value of v_int+v_unsigned_short"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_unsigned_short" }
+ timeout { fail "(timeout) print value of v_int+v_unsigned_short" }
+ }
+
+
+send_gdb "print v_int+v_signed_int\n"
+gdb_expect {
+ -re ".*13.*$gdb_prompt $" {
+ pass "print value of v_int+v_signed_int"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_signed_int" }
+ timeout { fail "(timeout) print value of v_int+v_signed_int" }
+ }
+
+
+send_gdb "print v_int+v_unsigned_int\n"
+gdb_expect {
+ -re ".*14.*$gdb_prompt $" {
+ pass "print value of v_int+v_unsigned_int"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_unsigned_int" }
+ timeout { fail "(timeout) print value of v_int+v_unsigned_int" }
+ }
+
+
+send_gdb "print v_int+v_long\n"
+gdb_expect {
+ -re ".*15.*$gdb_prompt $" {
+ pass "print value of v_int+v_long"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_long" }
+ timeout { fail "(timeout) print value of v_int+v_long" }
+ }
+
+
+send_gdb "print v_int+v_signed_long\n"
+gdb_expect {
+ -re ".*16.*$gdb_prompt $" {
+ pass "print value of v_int+v_signed_long"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_signed_long" }
+ timeout { fail "(timeout) print value of v_int+v_signed_long" }
+ }
+
+
+send_gdb "print v_int+v_unsigned_long\n"
+gdb_expect {
+ -re ".*17.*$gdb_prompt $" {
+ pass "print value of v_int+v_unsigned_long"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_unsigned_long" }
+ timeout { fail "(timeout) print value of v_int+v_unsigned_long" }
+ }
+
+
+send_gdb "print v_int+v_float\n"
+gdb_expect {
+ -re ".*106.34343.*$gdb_prompt $" {
+ pass "print value of v_int+v_float"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_float" }
+ timeout { fail "(timeout) print value of v_int+v_float" }
+ }
+
+
+send_gdb "print v_int+v_double\n"
+gdb_expect {
+ -re ".*206.565.*$gdb_prompt $" {
+ pass "print value of v_int+v_double"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int+v_double" }
+ timeout { fail "(timeout) print value of v_int+v_double" }
+}
+
+
+#
+# test the relational operators with mixed types
+#
+
+send_gdb "print v_int <= v_char\n"
+gdb_expect {
+ -re ".*1.*$gdb_prompt $" {
+ pass "print value of v_int<=v_char"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_char" }
+ timeout { fail "(timeout) print value of v_int<=v_char" }
+ }
+
+send_gdb "print v_int <= v_short\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of v_int<=v_short"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_short" }
+ timeout { fail "(timeout) print value of v_int<=v_short" }
+ }
+
+
+send_gdb "print v_int <= v_signed_char\n"
+gdb_expect {
+ -re ".*1.*$gdb_prompt $" {
+ pass "print value of v_int<=v_signed_char"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_signed_char" }
+ timeout { fail "(timeout) print value of v_int<=v_signed_char" }
+ }
+
+
+send_gdb "print v_int <= v_unsigned_char\n"
+gdb_expect {
+ -re ".*1.*$gdb_prompt $" {
+ pass "print value of v_int<=v_unsigned_char"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_unsigned_char" }
+ timeout { fail "(timeout) print value of v_int<=v_unsigned_char" }
+ }
+
+
+send_gdb "print v_int <= v_signed_short\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of v_int<=v_signed_short"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_signed_short" }
+ timeout { fail "(timeout) print value of v_int<=v_signed_short" }
+ }
+
+
+send_gdb "print v_int <= v_unsigned_short\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of v_int<=v_unsigned_short"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_unsigned_short" }
+ timeout { fail "(timeout) print value of v_int<=v_unsigned_short" }
+ }
+
+
+send_gdb "print v_int <= v_signed_int\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int<=v_signed_int"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_signed_int" }
+ timeout { fail "(timeout) print value of v_int<=v_signed_int" }
+ }
+
+
+send_gdb "print v_int <= v_unsigned_int\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int<=v_unsigned_int"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_unsigned_int" }
+ timeout { fail "(timeout) print value of v_int<=v_unsigned_int" }
+ }
+
+
+send_gdb "print v_int <= v_long\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int<=v_long"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_long" }
+ timeout { fail "(timeout) print value of v_int<=v_long" }
+ }
+
+
+send_gdb "print v_int <= v_signed_long\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int<=v_signed_long"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_signed_long" }
+ timeout { fail "(timeout) print value of v_int<=v_signed_long" }
+ }
+
+
+send_gdb "print v_int <= v_unsigned_long\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int<=v_unsigned_long"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_unsigned_long" }
+ timeout { fail "(timeout) print value of v_int<=v_unsigned_long" }
+ }
+
+
+send_gdb "print v_int <= v_float\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int<=v_float"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_float" }
+ timeout { fail "(timeout) print value of v_int<=v_float" }
+ }
+
+
+send_gdb "print v_int <= v_double\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int<=v_double"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int<=v_double" }
+ timeout { fail "(timeout) print value of v_int<=v_double" }
+ }
+
+
+
+#
+# test the logical operators with mixed types
+#
+
+gdb_test "set variable v_char=0" "" "set v_char=0"
+gdb_test "set variable v_double=0.0" "" "set v_double=0"
+gdb_test "set variable v_unsigned_long=0" "" "set v_unsigned_long=0"
+
+send_gdb "print v_int && v_char\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of v_int&&v_char"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_char" }
+ timeout { fail "(timeout) print value of v_int&&v_char" }
+ }
+
+send_gdb "print v_int && v_short\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int&&v_short"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_short" }
+ timeout { fail "(timeout) print value of v_int&&v_short" }
+ }
+
+
+send_gdb "print v_int && v_signed_char\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int&&v_signed_char"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_signed_char" }
+ timeout { fail "(timeout) print value of v_int&&v_signed_char" }
+ }
+
+
+send_gdb "print v_int && v_unsigned_char\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int&&v_unsigned_char"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_unsigned_char" }
+ timeout { fail "(timeout) print value of v_int&&v_unsigned_char" }
+ }
+
+
+send_gdb "print v_int && v_signed_short\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int&&v_signed_short"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_signed_short" }
+ timeout { fail "(timeout) print value of v_int&&v_signed_short" }
+ }
+
+
+send_gdb "print v_int && v_unsigned_short\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int&&v_unsigned_short"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_unsigned_short" }
+ timeout { fail "(timeout) print value of v_int&&v_unsigned_short" }
+ }
+
+
+send_gdb "print v_int && v_signed_int\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int&&v_signed_int"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_signed_int" }
+ timeout { fail "(timeout) print value of v_int&&v_signed_int" }
+ }
+
+
+send_gdb "print v_int && v_unsigned_int\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int&&v_unsigned_int"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_unsigned_int" }
+ timeout { fail "(timeout) print value of v_int&&v_unsigned_int" }
+ }
+
+
+send_gdb "print v_int && v_long\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int&&v_long"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_long" }
+ timeout { fail "(timeout) print value of v_int&&v_long" }
+ }
+
+
+send_gdb "print v_int && v_signed_long\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int&&v_signed_long"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_signed_long" }
+ timeout { fail "(timeout) print value of v_int&&v_signed_long" }
+ }
+
+
+send_gdb "print v_int && v_unsigned_long\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of v_int&&v_unsigned_long"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_unsigned_long" }
+ timeout { fail "(timeout) print value of v_int&&v_unsigned_long" }
+ }
+
+
+send_gdb "print v_int && v_float\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of v_int&&v_float"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_float" }
+ timeout { fail "(timeout) print value of v_int&&v_float" }
+ }
+
+
+send_gdb "print v_int && v_double\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of v_int&&v_double"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of v_int&&v_double" }
+ timeout { fail "(timeout) print value of v_int&&v_double" }
+ }
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.base/all-types.c b/gdb/testsuite/gdb.base/all-types.c
new file mode 100644
index 00000000000..2f3a31f739b
--- /dev/null
+++ b/gdb/testsuite/gdb.base/all-types.c
@@ -0,0 +1,62 @@
+/*
+ * the basic C types.
+ */
+
+#if !defined (__STDC__) && !defined (_AIX)
+#define signed /**/
+#endif
+
+char v_char;
+signed char v_signed_char;
+unsigned char v_unsigned_char;
+
+short v_short;
+signed short v_signed_short;
+unsigned short v_unsigned_short;
+
+int v_int;
+signed int v_signed_int;
+unsigned int v_unsigned_int;
+
+long v_long;
+signed long v_signed_long;
+unsigned long v_unsigned_long;
+
+float v_float;
+double v_double;
+
+int main ()
+{
+ extern void dummy();
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ dummy();
+ return 0;
+
+}
+
+void dummy()
+{
+ /* Some linkers (e.g. on AIX) remove unreferenced variables,
+ so make sure to reference them. */
+ v_char = 'A';
+ v_signed_char = 'B';
+ v_unsigned_char = 'C';
+
+ v_short = 3;
+ v_signed_short = 4;
+ v_unsigned_short = 5;
+
+ v_int = 6;
+ v_signed_int = 7;
+ v_unsigned_int = 8;
+
+ v_long = 9;
+ v_signed_long = 10;
+ v_unsigned_long = 11;
+
+ v_float = 100.343434;
+ v_double = 200.565656;
+}
diff --git a/gdb/testsuite/gdb.base/annota1.c b/gdb/testsuite/gdb.base/annota1.c
new file mode 100644
index 00000000000..6a13ee9d53d
--- /dev/null
+++ b/gdb/testsuite/gdb.base/annota1.c
@@ -0,0 +1,51 @@
+#include <stdio.h>
+#include <signal.h>
+
+#ifdef __sh__
+#define signal(a,b) /* Signals not supported on this target - make them go away */
+#endif
+
+
+#ifdef PROTOTYPES
+void
+handle_USR1 (int sig)
+{
+}
+#else
+void
+handle_USR1 (sig)
+ int sig;
+{
+}
+#endif
+
+int value;
+
+#ifdef PROTOTYPES
+int
+main (void)
+#else
+int
+main ()
+#endif
+{
+ int my_array[3] = { 1, 2, 3 };
+
+ value = 7;
+
+#ifdef SIGUSR1
+ signal (SIGUSR1, handle_USR1);
+#endif
+
+ printf ("value is %d\n", value);
+ printf ("my_array[2] is %d\n", my_array[2]);
+
+ {
+ int i;
+ for (i = 0; i < 5; i++)
+ value++;
+ }
+
+ return 0;
+}
+
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
new file mode 100644
index 00000000000..bda2bec3975
--- /dev/null
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -0,0 +1,463 @@
+# Copyright 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+
+# are we on a target board? If so, don't run these tests.
+# note: this is necessary because we cannot use runto_main (which would
+# work for remote targets too) because of the different prompt we get
+# when using annotation level 2.
+#
+if [is_remote target] then {
+ return 0
+}
+
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "annota1"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+#
+# the line at which break main will put the breakpoint
+#
+set main_line 32
+
+# The commands we test here produce many lines of output; disable "press
+# <return> to continue" prompts.
+send_gdb "set height 0\n"
+gdb_expect -re "$gdb_prompt $"
+
+#
+# break at main
+#
+gdb_test "break main" \
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint main"
+
+
+#
+# NOTE: this prompt is OK only when the annotation level is > 1
+# NOTE: When this prompt is in use the gdb_test procedure cannot be used because
+# it assumes that the last char after the gdb_prompt is a white space. This is not
+# true with this annotated prompt. So we must use send_gdb and gdb_expect.
+#
+
+set old_gdb_prompt $gdb_prompt
+set gdb_prompt "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n"
+
+
+
+#
+# set the annotation level to 2
+#
+# of course, this will test:
+# annotate-pre-prompt
+# annotate-prompt
+# annotate-post-prompt (in the next block)
+#
+send_gdb "set annotate 2\n"
+gdb_expect {
+ -re "set annotate 2\r\n$gdb_prompt$" { pass "annotation set at level 2" }
+ -re ".*$gdb_prompt$" { fail "annotation set at level 2" }
+ timeout { fail "annotation set at level 2 (timeout)" }
+ }
+
+
+#
+# info break will test:
+# annotate-breakpoints-headers
+# annotate-field
+# annotate-breakpoints-table
+# annotate-record
+# annotate-breakpoints-table-end
+#
+send_gdb "info break\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-headers\r\n\r\n\032\032field 0\r\nNum \r\n\032\032field 1\r\nType \r\n\032\032field 2\r\nDisp \r\n\032\032field 3\r\nEnb \r\n\032\032field 4\r\nAddress +\r\n\032\032field 5\r\nWhat\r\n\r\n\032\032breakpoints-table\r\n\r\n\032\032record\r\n\r\n\032\032field 0\r\n1 \r\n\032\032field 1\r\nbreakpoint \r\n\032\032field 2\r\nkeep \r\n\032\032field 3\r\ny \r\n\032\032field 4\r\n$hex +\r\n\032\032field 5\r\nin main at ${srcdir}/${subdir}/${srcfile}:$main_line\r\n\r\n\032\032breakpoints-table-end\r\n$gdb_prompt$" \
+ {pass "breakpoint info"}
+ -re ".*$gdb_prompt$" { fail "breakpoint info" }
+ timeout { fail "breakpoint info (timeout)" }
+}
+
+
+#
+# run to a break point will test:
+# annotate-frames-invalid
+# annotate-breakpoints-invalid (a.k.a. breakpoints-changed)
+# annotate-starting
+# annotate-breakpoint
+# annotate-frame-begin
+# annotate-frame-function-name
+# annotate-frame-args
+# annotate-frame-source-begin
+# annotate-frame-source-file
+# annotate-frame-source-file-end
+# annotate-frame-source-line
+# annotate-frame-source-end
+# annotate-source
+# annotate-frame-end
+# annotate-stopped
+#
+#exp_internal 1
+send_gdb "run\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\nStarting program: $binfile \(\r\n\r\n\032\032frames-invalid\)+\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)+\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n\032\032breakpoint 1\r\n\r\nBreakpoint 1, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*annota1.c\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$main_line\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped.*$gdb_prompt$" {
+ pass "run until main breakpoint"
+ }
+ -re ".*$gdb_prompt$" {
+ fail "run until main breakpoint"
+ }
+ timeout {
+ fail "run until main breakpoint (timeout)"
+ }
+ }
+#exp_internal 0
+#exit 0
+
+#
+# Let's do a next, to get to a point where the array is initialized
+# We don't care about the annotated output for this operation, it is the same as
+# the one produced by run above
+#
+send_gdb "next\n"
+gdb_expect {
+ -re ".*$gdb_prompt$" { pass "go after array init line" }
+ timeout { fail "go after array init line (timeout)" }
+}
+
+
+#
+# printing the array will test:
+# annotate-value-history-begin
+# annotate-value-history-value
+# annotate-array-section-begin
+# annotate-elt
+# FIXME: annotate-elt-rep and annotate-elt-rep-end not tested
+# annotate-array-section-end
+# annotate-value-history-end
+# FIXME: annotate-value-begin and annotate-value-end not tested (the gdb output
+# command would cause them to be used)
+#
+send_gdb "print my_array\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032value-history-begin 1 -\r\n.*= \r\n\032\032value-history-value\r\n.\r\n\032\032array-section-begin 0 -\r\n1\r\n\032\032elt\r\n, 2\r\n\032\032elt\r\n, 3\r\n\032\032elt\r\n\r\n\032\032array-section-end\r\n.\r\n\r\n\032\032value-history-end\r\n$gdb_prompt$" \
+ { pass "print array" }
+ -re ".*$gdb_prompt$" { fail "print array" }
+ timeout { fail "print array (timeout)" }
+}
+
+
+#
+# this should generate an error message, so to test:
+# annotate-error-begin
+# FIXME: annotate-error not tested
+#
+
+#exp_internal 1
+send_gdb "print non_existent_value\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032error-begin\r\nNo symbol \"non_existent_value\" in current context.\r\n\r\n\032\032error\r\n$gdb_prompt$" \
+ { pass "print non_existent_value" }
+ -re ".*$gdb_prompt$" { fail "print non_existent_value" }
+ timeout { fail "print non_existent_value (timeout)" }
+}
+
+
+#
+# break at signal handler. So that, once we are in the sig handler, if we do a bt
+# we can test annotate-signal-handler-caller
+#
+send_gdb "break handle_USR1\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\nBreakpoint.*at $hex: file.*$srcfile, line.*\r\n$gdb_prompt$" \
+ { pass "breakpoint handle_USR1" }
+ -re ".*$gdb_prompt$" { fail "break at handle_USR1" }
+ timeout { fail "break at handle_USR1 (timeout)" }
+}
+
+#
+# break at printf. When we are stopped at printf, we can test
+#
+send_gdb "break printf\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\nBreakpoint.*at $hex.*$gdb_prompt$" \
+ { pass "breakpoint printf" }
+ -re ".*$gdb_prompt$" { fail "break printf" }
+ timeout { fail "break printf (timeout)" }
+}
+
+#
+# get to printf
+#
+send_gdb "continue\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 3\r\n\r\nBreakpoint 3, \r\n\032\032frame-begin 0 $hex\r\n\r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*\032\032frame-function-name\r\nprintf\r\n\032\032frame-args\r\n.*\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
+ { pass "continue to printf" }
+ -re ".*$gdb_prompt$" { fail "continue to printf" }
+ timeout { fail "continue to printf (timeout)" }
+}
+
+#
+# test:
+# annotate-frame-where
+# annotate-frame-address
+# annotate-frame-address-end
+#
+send_gdb "backtrace\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032frame-begin 0 $hex\r\n.0 \r\n(\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n)*\032\032frame-function-name\r\nprintf\r\n\032\032frame-args\r\n \\(.*frame-end\r\n\r\n\032\032frame-begin 1 $hex\r\n.1 \r\n\032\032frame-address\r\n$hex\r\n\032\032frame-address-end\r\n in \r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${srcdir}/${subdir}/${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032frame-end\r\n(\r\n\032\032frame-begin .*\r\n\r\n\032\032frame-end\r\n)*$gdb_prompt$" \
+ { pass "backtrace from shlibrary" }
+ -re ".*$gdb_prompt$" { fail "backtrace from shlibrary" }
+ timeout { fail "backtrace from shlibrary (timeout)" }
+}
+
+
+#
+# test printing a frame with some arguments:
+# annotate-arg-begin
+# annotate-arg-name-end
+# annotate-arg-value
+# annotate-arg-end
+#
+send_gdb "signal SIGUSR1\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\nContinuing with signal SIGUSR1.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032breakpoint 2\r\n\r\nBreakpoint 2, \r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nhandle_USR1\r\n\032\032frame-args\r\n \\(\r\n\032\032arg-begin\r\nsig\r\n\032\032arg-name-end\r\n=\r\n\032\032arg-value -\r\n$decimal\r\n\032\032arg-end\r\n\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n${srcdir}/${subdir}/${srcfile}\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n.*\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source.*annota1.c:.*:.*:beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
+ { pass "send SIGUSR1" }
+ -re ".*$gdb_prompt$" { fail "send SIGUSR1" }
+ timeout { fail "send SIGUSR1 (timeout)" }
+}
+
+
+#
+# test:
+# annotate-signal-handler-caller
+#
+verbose "match_max local is: [match_max]"
+verbose "match_max default is: [match_max -d]"
+# This is necessary because a 2000 buffer is not enought to get everything
+# up to the prompt ad the test gets a timeout.
+match_max 3000
+verbose "match_max now is: [match_max]"
+send_gdb "backtrace\n"
+gdb_expect {
+ -re "frame-begin 0 $hex\r\n#0.*frame-end.*frame-begin 1 $hex\r\n#1.*(\032\032signal-handler-caller\r\n.signal handler called.\r\n\r\n)*\032\032frame-end\r\n\r\n\032\032frame-begin 2 $hex\r\n#2.*(frame-begin 3 $hex\r\n#3.*)*frame-end.*$gdb_prompt$" {
+ pass "backtrace @ signal handler"
+ }
+ -re ".*$gdb_prompt$" { fail "backtrace @ signal handler" }
+ timeout { fail "backtrace @ signal handler (timeout)" }
+}
+
+#
+# delete all the breakpoints
+#
+send_gdb "delete 1\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n$gdb_prompt$" \
+ { pass "delete bp 1" }
+ -re ".*$gdb_prompt$" { fail "delete bp 1" }
+ timeout { fail "delete bp 1 (timeout)" }
+}
+
+send_gdb "delete 2\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n$gdb_prompt$" \
+ { pass "delete bp 2" }
+ -re ".*$gdb_prompt$" { fail "delete bp 2 " }
+ timeout { fail "delete bp 2 (timeout)" }
+}
+
+send_gdb "delete 3\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n$gdb_prompt$" \
+ { pass "delete bp 3" }
+ -re ".*$gdb_prompt$" { fail "delete bp 3" }
+ timeout { fail "delete bp 3 (timeout)" }
+}
+
+#
+# break at main, after value is initialized. This is in preparation
+# to test the annotate output for the display command.
+#
+send_gdb "break main\n"
+gdb_expect {
+ -re "post-prompt.*\032\032breakpoints-invalid.*Breakpoint 4 at $hex: file ${srcdir}/${subdir}/${srcfile}, line $main_line.*$gdb_prompt$" \
+ { pass "break at 28" }
+ -re ".*$gdb_prompt$" { fail "break at 28" }
+ timeout { fail "break at 28 (timeout)" }
+}
+
+#
+# display the value; test:
+# annotate-display-begin
+# annotate-display-number-end
+# annotate-display-format
+# annotate-display-expression
+# annotate-display-expression-end
+# annotate-display-end
+# FIXME: annotate-display-value not tested
+#
+send_gdb "display value\n"
+gdb_expect {
+ -re "post-prompt\r\n\r\n\032\032display-begin\r\n1\r\n\032\032display-number-end\r\n: \r\n\032\032display-format\r\n\r\n\032\032display-expression\r\nvalue\r\n\032\032display-expression-end\r\n = \r\n\032\032display-expression\r\n7\r\n\r\n\032\032display-end\r\n$gdb_prompt$" \
+ { pass "set up display" }
+ -re ".*$gdb_prompt$" { fail "set up display" }
+ timeout { fail "set up display (timeout)" }
+}
+
+
+# should ask query. Test annotate-query.
+# we don't care about anything else here, only the query.
+
+send_gdb "run\n"
+gdb_expect {
+ -re "pre-query.*already.*\\(y or n\\).*query\r\n" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re ".*post-query.*$gdb_prompt$" \
+ { pass "re-run" }
+ -re ".*$gdb_prompt$" { fail "re-run" }
+ timeout { fail "re-run (timeout)" }
+ }
+ }
+ -re ".*$gdb_prompt$" { fail "re-run" }
+ timeout { fail "re-run (timeout)" }
+}
+
+#
+# Test that breakpoints-invalid is issued once and only once for
+# breakpoint ignore count changes, after annotation stopped.
+#
+send_gdb "break 46\n"
+gdb_expect {
+ -re "Breakpoint 5 at $hex: file .*$srcfile, line 46.*$gdb_prompt$" {
+ pass "break at 46"
+ }
+ -re ".*$gdb_prompt$" { fail "break at 46" }
+ timeout { fail "break at 46 (timeout)" }
+}
+
+send_gdb "ignore 5 4\n"
+gdb_expect {
+ -re "Will ignore next 4 crossings of breakpoint 5.*$gdb_prompt$" {
+ pass "ignore 5 4"
+ }
+ -re ".*$gdb_prompt$" { fail "ignore 5 4" }
+ timeout { fail "ignore 5 4 (timeout)" }
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re ".*$srcfile:46:.*\032\032stopped\r\n\r\n\032\032breakpoints-invalid\r\n$gdb_prompt$" {
+ pass "annotate ignore count change"
+ }
+ -re ".*$gdb_prompt$" { fail "annotate ignore count change" }
+ timeout { fail "annotate ignore count change (timeout)" }
+}
+
+# check that ignore command is working, or the above can provide
+# misleading assurance ...
+
+send_gdb "next\n"
+gdb_expect {
+ -re "$gdb_prompt$" {}
+ timeout { fail "next to exit loop" }
+}
+
+send_gdb "next\n"
+gdb_expect {
+ -re ".*$srcfile:49:.*$gdb_prompt$" {
+ pass "breakpoint ignore count"
+ }
+ -re ".*$gdb_prompt$" { fail "breakpoint ignore count" }
+ timeout { fail "breakpoint ignore count (timeout)" }
+}
+
+#
+# Send a signal that is not handled; test:
+# annotate-signalled
+# annotate-signal-name
+# annotate-signal-name-end
+# annotate-signal-string
+# annotate-signal-string-end
+# FIXME: annotate-signal not tested (requires that the inferior be
+# stopped by a "random" signal)
+#
+# SIGTRAP signals are dropped before they get to the inferior process
+# on hpux11. In theory, this behaivor can be controlled by setting
+# TTEO_NORM_SIGTRAP in the inferior, but doing so did not cause
+# the signal to be properly delivered.
+#
+# It has been verified that other signals will be delivered. However,
+# rather than twiddle the test, I choose to leave it as-is as it
+# exposes an interesting failure on hpux11.
+setup_xfail hppa*-*-hpux11*
+send_gdb "signal SIGTRAP\n"
+gdb_expect {
+ -re ".*\032\032post-prompt\r\nContinuing with signal SIGTRAP.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032signalled\r\n\r\nProgram terminated with signal \r\n\032\032signal-name\r\nSIGTRAP\r\n\032\032signal-name-end\r\n, \r\n\032\032signal-string\r\nTrace.breakpoint trap\r\n\032\032signal-string-end\r\n.\r\nThe program no longer exists.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
+ { pass "signal sent" }
+ -re ".*$gdb_prompt$" { fail "signal sent" }
+ timeout { fail "signal sent (timeout)" }
+}
+
+
+# Check for production of a core file
+# and remove it!
+
+set exec_output [remote_exec build "ls core"]
+
+if [ regexp "core not found" $exec_output] {
+ pass "No core dumped"
+} else {
+ if [ regexp "No such file or directory" $exec_output] {
+ pass "No core dumped"
+ } else {
+ remote_exec build "rm -f core"
+ pass "Core dumped and removed"
+ }
+}
+
+# restore the original prompt for the rest of the testsuite
+
+set gdb_prompt $old_gdb_prompt
diff --git a/gdb/testsuite/gdb.base/arithmet.exp b/gdb/testsuite/gdb.base/arithmet.exp
new file mode 100644
index 00000000000..6e7e6852530
--- /dev/null
+++ b/gdb/testsuite/gdb.base/arithmet.exp
@@ -0,0 +1,117 @@
+# Copyright 1998, 1999, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+# Rewritten to use gdb_test by Michael Chastain (chastain@redhat.com)
+
+# This file is part of the gdb testsuite
+#
+# tests for correctness of arithmetic operators, associativity and precedence
+# with integer type variables
+#
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "int-type"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+#
+# test expressions with "int" types
+#
+
+gdb_test "set variable x=14" ""
+gdb_test "set variable y=2" ""
+gdb_test "set variable z=2" ""
+gdb_test "set variable w=3" ""
+
+gdb_test "print x" "14"
+gdb_test "print y" "2"
+gdb_test "print z" "2"
+gdb_test "print w" "3"
+
+gdb_test "print x+y" "16"
+gdb_test "print x-y" "12"
+gdb_test "print x*y" "28"
+gdb_test "print x/y" "7"
+gdb_test "print x%y" "0"
+
+# x y z w
+# 14 2 2 3
+
+# Test associativity of +, -, *, % ,/
+
+gdb_test "print x+y+z" "18"
+gdb_test "print x-y-z" "10"
+gdb_test "print x*y*z" "56"
+gdb_test "print x/y/z" "3"
+gdb_test "print x%y%z" "0"
+
+# test precedence rules on pairs of arithmetic operators
+
+gdb_test "set variable x=10" ""
+gdb_test "set variable y=4" ""
+
+# x y z w
+# 10 4 2 3
+
+gdb_test "print x+y-z" "12"
+gdb_test "print x+y*z" "18"
+gdb_test "print x+y%w" "11"
+gdb_test "print x+y/w" "11"
+gdb_test "print x-y*z" "2"
+gdb_test "print x-y%z" "10"
+gdb_test "print x-y/z" "8"
+gdb_test "print x*y/z" "20"
+gdb_test "print x*y%w" "1"
+gdb_test "print x/y%w" "2"
+
+# test use of parentheses to enforce different order of evaluation
+
+gdb_test "print x-(y+w)" "3"
+gdb_test "print x/(y*w)" "0"
+gdb_test "print x-(y/w)" "9"
+gdb_test "print (x+y)*w" "42"
diff --git a/gdb/testsuite/gdb.base/assign.exp b/gdb/testsuite/gdb.base/assign.exp
new file mode 100644
index 00000000000..4bd15c38e05
--- /dev/null
+++ b/gdb/testsuite/gdb.base/assign.exp
@@ -0,0 +1,446 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This file is part of the gdb testsuite
+#
+# tests for all the assignemnt operators
+# with mixed types and with int type variables
+#
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "all-types"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+gdb_test "next" "return 0;" "continuing after dummy()"
+
+send_gdb "print v_int=57\n"
+gdb_expect {
+ -re ".*57.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*57.*$gdb_prompt $" {
+ pass "v_int=57"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int=57" }
+ timeout { fail "(timeout) v_int=57" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int=57" }
+ timeout { fail "(timeout) v_int=57" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+send_gdb "print v_int+=57\n"
+gdb_expect {
+ -re ".*63.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*63.*$gdb_prompt $" {
+ pass "v_int+=57"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=57" }
+ timeout { fail "(timeout) v_int+=57" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=57" }
+ timeout { fail "(timeout) v_int+=57" }
+ }
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+send_gdb "print v_int-=57\n"
+gdb_expect {
+ -re ".*-51.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*-51.*$gdb_prompt $" {
+ pass "v_int-=57"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int-=57" }
+ timeout { fail "(timeout) v_int-=57" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int-=57" }
+ timeout { fail "(timeout) v_int-=57" }
+ }
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+send_gdb "print v_int*=5\n"
+gdb_expect {
+ -re ".*30.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*30.*$gdb_prompt $" {
+ pass "v_int*=5"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int*=5" }
+ timeout { fail "(timeout) v_int*=5" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int*=5" }
+ timeout { fail "(timeout) v_int*=5" }
+ }
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+send_gdb "print v_int/=4\n"
+gdb_expect {
+ -re ".*1.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*1.*$gdb_prompt $" {
+ pass "v_int/=4"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int/=4" }
+ timeout { fail "(timeout) v_int/=4" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int/=4" }
+ timeout { fail "(timeout) v_int/=4" }
+ }
+
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+send_gdb "print v_int%=4\n"
+gdb_expect {
+ -re ".*2.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*2.*$gdb_prompt $" {
+ pass "v_int%=4"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int%=4" }
+ timeout { fail "(timeout) v_int%=4" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int%=4" }
+ timeout { fail "(timeout) v_int%=4" }
+ }
+
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+
+send_gdb "print v_int+=v_char\n"
+gdb_expect {
+ -re ".*71.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*71.*$gdb_prompt $" {
+ pass "v_int+=char"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_char" }
+ timeout { fail "(timeout) v_int+=v_char" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_char" }
+ timeout { fail "(timeout) v_int+=v_char" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+
+send_gdb "print v_int+=v_signed_char\n"
+gdb_expect {
+ -re ".*72.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*72.*$gdb_prompt $" {
+ pass "v_int+=signed_char"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_signed_char" }
+ timeout { fail "(timeout) v_int+=v_signed_char" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_signed_char" }
+ timeout { fail "(timeout) v_int+=v_signed_char" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+
+send_gdb "print v_int+=v_unsigned_char\n"
+gdb_expect {
+ -re ".*73.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*73.*$gdb_prompt $" {
+ pass "v_int+=unsigned_char"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_char" }
+ timeout { fail "(timeout) v_int+=v_unsigned_char" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_char" }
+ timeout { fail "(timeout) v_int+=v_unsigned_char" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+
+send_gdb "print v_int+=v_short\n"
+gdb_expect {
+ -re ".*9.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*9.*$gdb_prompt $" {
+ pass "v_int+=short"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_short" }
+ timeout { fail "(timeout) v_int+=v_short" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_short" }
+ timeout { fail "(timeout) v_int+=v_short" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+
+send_gdb "print v_int+=v_signed_short\n"
+gdb_expect {
+ -re ".*10.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*10.*$gdb_prompt $" {
+ pass "v_int+=signed_short"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_signed_short" }
+ timeout { fail "(timeout) v_int+=v_signed_short" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_signed_short" }
+ timeout { fail "(timeout) v_int+=v_signed_short" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+
+send_gdb "print v_int+=v_unsigned_short\n"
+gdb_expect {
+ -re ".*11.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*11.*$gdb_prompt $" {
+ pass "v_int=+unsigned_short"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_short" }
+ timeout { fail "(timeout) v_int+=v_unsigned_short" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_short" }
+ timeout { fail "(timeout) v_int+=v_unsigned_short" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+
+send_gdb "print v_int+=v_signed_int\n"
+gdb_expect {
+ -re ".*13.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*13.*$gdb_prompt $" {
+ pass "v_int+=signed_int"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_signed_int" }
+ timeout { fail "(timeout) v_int+=v_signed_int" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_signed_int" }
+ timeout { fail "(timeout) v_int+=v_signed_int" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+
+send_gdb "print v_int+=v_unsigned_int\n"
+gdb_expect {
+ -re ".*14.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*14.*$gdb_prompt $" {
+ pass "v_int+=unsigned_int"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_int" }
+ timeout { fail "(timeout) v_int+=v_unsigned_int" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_int" }
+ timeout { fail "(timeout) v_int+=v_unsigned_int" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+
+send_gdb "print v_int+=v_long\n"
+gdb_expect {
+ -re ".*15.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*15.*$gdb_prompt $" {
+ pass "v_int+=long"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_long" }
+ timeout { fail "(timeout) v_int+=v_long" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_long" }
+ timeout { fail "(timeout) v_int+=v_long" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+
+send_gdb "print v_int+=v_signed_long\n"
+gdb_expect {
+ -re ".*16.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*16.*$gdb_prompt $" {
+ pass "v_int+=signed_long"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_signed_long" }
+ timeout { fail "(timeout) v_int+=v_signed_long" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_signed_long" }
+ timeout { fail "(timeout) v_int+=v_signed_long" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+send_gdb "print v_int+=v_unsigned_long\n"
+gdb_expect {
+ -re ".*17.*$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*17.*$gdb_prompt $" {
+ pass "v_int+=unsigned_long"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_long" }
+ timeout { fail "(timeout) v_int+=v_unsigned_long" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_unsigned_long" }
+ timeout { fail "(timeout) v_int+=v_unsigned_long" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+send_gdb "print v_int+=v_float\n"
+gdb_expect {
+ -re ".*106\r\n$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*106\r\n$gdb_prompt $" {
+ pass "v_int+=v_float"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_float" }
+ timeout { fail "(timeout) v_int+=v_float" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_float" }
+ timeout { fail "(timeout) v_int+=v_float" }
+ }
+
+
+gdb_test "set variable v_int = 6" "" "set v_int to 6"
+
+
+send_gdb "print v_int+=v_double\n"
+gdb_expect {
+ -re ".*206\r\n$gdb_prompt $" {
+ send_gdb "print v_int\n"
+ gdb_expect {
+ -re ".*206\r\n$gdb_prompt $" {
+ pass "v_int+=double"
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_double" }
+ timeout { fail "(timeout) v_int+=v_double" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "v_int+=v_signed_long" }
+ timeout { fail "(timeout) v_int+=v_double" }
+ }
+
+
diff --git a/gdb/testsuite/gdb.base/async.c b/gdb/testsuite/gdb.base/async.c
new file mode 100644
index 00000000000..0d9c8752b70
--- /dev/null
+++ b/gdb/testsuite/gdb.base/async.c
@@ -0,0 +1,48 @@
+
+
+#ifdef PROTOTYPES
+int
+foo (void)
+#else
+int
+foo ()
+#endif
+{
+ int x, y;
+
+ x = 5;
+ y = 3;
+
+ return x + y;
+}
+
+#ifdef PROTOTYPES
+int
+main (void)
+#else
+int
+main ()
+#endif
+{
+ int y, z;
+
+ y = 2;
+ z = 9;
+ y = foo ();
+ z = y;
+ y = y + 2;
+ y = baz ();
+ return 0;
+}
+
+
+#ifdef PROTOTYPES
+int
+baz (void)
+#else
+int
+baz ()
+#endif
+{
+ return 5;
+}
diff --git a/gdb/testsuite/gdb.base/async.exp b/gdb/testsuite/gdb.base/async.exp
new file mode 100644
index 00000000000..d135cfdb19d
--- /dev/null
+++ b/gdb/testsuite/gdb.base/async.exp
@@ -0,0 +1,153 @@
+# Copyright 1999
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "async"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+########################################
+##
+## Don't do any of these tests until we reach consensus on this file.
+##
+return 0
+########################################
+
+set board [target_info name]
+set current_target [target_info gdb_protocol]
+if { $current_target == "remote" } {
+ unset_board_info "gdb_protocol"
+ set_board_info "gdb_protocol" "async"
+ } else {
+ return 0
+ }
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+#
+# set it up at a breakpoint so we can play with it
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+gdb_test "break baz" "" ""
+
+#
+# Make sure we get a 'completed' message when the target is done.
+#
+gdb_test "set display-exec-done on" "" ""
+
+
+send_gdb "next&\n"
+gdb_expect {
+ -re "^next&\r\n$gdb_prompt.*z = 9.*completed\.\r\n" { pass "next &" }
+ -re "$gdb_prompt.*completed\.$" { fail "next &" }
+ timeout { fail "(timeout) next &" }
+}
+
+send_gdb "step&\n"
+gdb_expect {
+ -re "^step&\r\n$gdb_prompt.*y = foo \\(\\).*completed\.\r\n" { pass "step &" }
+ -re "$gdb_prompt.*completed\.$" { fail "step &" }
+ timeout { fail "(timeout) step &" }
+}
+
+send_gdb "step&\n"
+gdb_expect {
+ -re "^step&\r\n$gdb_prompt foo \\(\\) at .*async.c.*x = 5.*completed\.\r\n" \
+ { pass "step &" }
+ -re "$gdb_prompt.*completed\.$" { fail "step &" }
+ timeout { fail "(timeout) step &" }
+}
+
+send_gdb "stepi&\n"
+gdb_expect {
+ -re "^stepi&\r\n$gdb_prompt.*$hex.*x = 5.*completed\.\r\n" { pass "stepi &" }
+ -re "$gdb_prompt.*completed\.$" { fail "stepi &" }
+ timeout { fail "(timeout) stepi &" }
+}
+
+send_gdb "nexti&\n"
+gdb_expect {
+ -re "^nexti&\r\n$gdb_prompt.*y = 3.*completed\.\r\n" { pass "nexti &" }
+ -re "$gdb_prompt.*completed\.$" { fail "nexti &" }
+ timeout { fail "(timeout) nexti &" }
+}
+
+send_gdb "finish&\n"
+gdb_expect {
+ -re "^finish&\r\nRun till exit from #0 foo \\(\\) at.*async.c.*\r\n$gdb_prompt.*$hex in main \\(\\) at.*async.c.*y = foo \\(\\).*Value returned is.*= 8.*completed\.\r\n" \
+ { pass "finish &" }
+ -re "$gdb_prompt.*completed\.$" { fail "finish &" }
+ timeout { fail "(timeout) finish &" }
+}
+
+send_gdb "jump 33&\n"
+gdb_expect {
+ -re "^jump 33&.*Continuing at $hex.*$gdb_prompt.*Breakpoint 2, baz \\(\\) at.*async.c.*return 5.*completed\.\r\n" \
+ { pass "jump &" }
+ -re ".*$gdb_prompt.*completed\.$" { fail "jump &" }
+ timeout { fail "(timeout) jump &" }
+}
+
+send_gdb "until 35&\n"
+gdb_expect {
+ -re "^until 35&.*$gdb_prompt.*$hex in main \\(\\) at.*async.c.*y = baz \\(\\).*completed\.\r\n" \
+ { pass "until &" }
+ -re "$gdb_prompt.*completed\.$" { fail "until &" }
+ timeout { fail "(timeout) until &" }
+}
+
+gdb_test "set display-exec-done off" "" ""
+
+unset_board_info "gdb_protocol"
+set_board_info "gdb_protocol" "remote"
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.base/attach.c b/gdb/testsuite/gdb.base/attach.c
new file mode 100644
index 00000000000..0041b4732d2
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach.c
@@ -0,0 +1,20 @@
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop
+ is exited when & if the variable 'should_exit' is non-zero. (It
+ is initialized to zero in this program, so the loop will never
+ exit unless/until gdb sets the variable to non-zero.)
+ */
+#include <stdio.h>
+
+int should_exit = 0;
+
+int main ()
+{
+ int local_i = 0;
+
+ while (! should_exit)
+ {
+ local_i++;
+ }
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/attach.exp b/gdb/testsuite/gdb.base/attach.exp
new file mode 100644
index 00000000000..2b341af009f
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach.exp
@@ -0,0 +1,432 @@
+# Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+set prms_id 0
+set bug_id 0
+
+# On HP-UX 11.0, this test is causing a process running the program
+# "attach" to be left around spinning. Until we figure out why, I am
+# commenting out the test to avoid polluting tiamat (our 11.0 nightly
+# test machine) with these processes. RT
+#
+# Setting the magic bit in the target app should work. I added a
+# "kill", and also a test for the R3 register warning. JB
+if { [istarget "hppa*-*-hpux*"] } {
+ return 0
+}
+
+# are we on a target board
+if [is_remote target] then {
+ return 0
+}
+
+set testfile "attach"
+set srcfile ${testfile}.c
+set srcfile2 ${testfile}2.c
+set binfile ${objdir}/${subdir}/${testfile}
+set binfile2 ${objdir}/${subdir}/${testfile}2
+set cleanupfile ${objdir}/${subdir}/${testfile}.awk
+
+#execute_anywhere "rm -f ${binfile} ${binfile2}"
+remote_exec build "rm -f ${binfile} ${binfile2}"
+# For debugging this test
+#
+#log_user 1
+
+# Clean out any old files from past runs.
+#
+remote_exec build "${cleanupfile}"
+
+# build the first test case
+#
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Because we can't attach over nfs, copy binfile to /tmp/${binfile}.${pid}
+# and replace binfile with a symbolic link
+
+ set pid [pid]
+ exec /bin/cp -f ${binfile} /tmp/attach1.${pid}
+ exec rm -f ${binfile}
+ set binfile /tmp/attach1.${pid}
+# exec ln -s /tmp/attach1.${pid} ${binfile}
+
+# Build the in-system-call test
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Because we can't attach over nfs, copy binfile2 to /tmp/${binfile2}.${pid}
+# and replace binfile2 with a symbolic link
+
+ set pid [pid]
+ exec cp -f ${binfile2} /tmp/attach2.${pid}
+ exec rm -f ${binfile2}
+ set binfile2 /tmp/attach2.${pid}
+# exec ln -s /tmp/attach2.${pid} ${binfile2}
+
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+proc do_attach_tests {} {
+ global gdb_prompt
+ global binfile
+ global srcfile
+ global testfile
+ global objdir
+ global subdir
+ global timeout
+
+ # Start the program running and then wait for a bit, to be sure
+ # that it can be attached to.
+ #
+ set testpid [eval exec $binfile &]
+ exec sleep 2
+
+ # Verify that we cannot attach to nonsense.
+ #
+ send_gdb "attach abc\n"
+ gdb_expect {
+ -re ".*Illegal process-id: abc.*$gdb_prompt $"\
+ {pass "attach to nonsense is prohibited"}
+ -re "Attaching to.*$gdb_prompt $"\
+ {fail "attach to nonsense is prohibited (bogus pid allowed)"}
+ -re "$gdb_prompt $" {fail "attach to nonsense is prohibited"}
+ timeout {fail "(timeout) attach to nonsense is prohibited"}
+ }
+
+ # Verify that we cannot attach to what appears to be a valid
+ # process ID, but is a process that doesn't exist. (I don't
+ # believe any process is ever assigned #0, at least on HPUX.)
+ #
+ send_gdb "attach 0\n"
+ gdb_expect {
+ # This reponse is expected on HP-UX 10.20 (i.e., ptrace-based).
+ -re "Attaching to.*, process 0.*No such process.*$gdb_prompt $"\
+ {pass "attach to nonexistent process is prohibited"}
+ # This response is expected on HP-UX 11.0 (i.e., ttrace-based).
+ -re "Attaching to.*, process 0 failed.*Hint.*$gdb_prompt $"\
+ {pass "attach to nonexistent process is prohibited"}
+ -re "Attaching to.*, process 0.*denied.*$gdb_prompt $"\
+ {pass "attach to nonexistent process is prohibited"}
+ -re "$gdb_prompt $" {fail "attach to nonexistent process is prohibited"}
+ timeout {fail "(timeout) attach to nonexistent process is prohibited"}
+ }
+
+ # Verify that we can attach to the process by first giving its
+ # executable name via the file command, and using attach with
+ # the process ID.
+ #
+ # (Actually, the test system appears to do this automatically
+ # for us. So, we must also be prepared to be asked if we want
+ # to discard an existing set of symbols.)
+ #
+ send_gdb "file $binfile\n"
+ gdb_expect {
+ -re "Load new symbol table from.*y or n.*$" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "Reading symbols from $binfile\.\.\.*done.*$gdb_prompt $"\
+ {pass "(re)set file, before attach1"}
+ -re "$gdb_prompt $" {fail "(re)set file, before attach1"}
+ timeout {fail "(timeout) (re)set file, before attach1"}
+ }
+ }
+ -re "Reading symbols from $binfile\.\.\.*done.*$gdb_prompt $"\
+ {pass "set file, before attach1"}
+ -re "$gdb_prompt $" {fail "set file, before attach1"}
+ timeout {fail "(timeout) set file, before attach1"}
+ }
+
+ send_gdb "attach $testpid\n"
+ gdb_expect {
+ -re "Attaching to program.*$binfile, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $"\
+ {pass "attach1, after setting file"}
+ -re "$gdb_prompt $" {fail "attach1, after setting file"}
+ timeout {fail "(timeout) attach1, after setting file"}
+ }
+
+ # Verify that we can "see" the variable "should_exit" in the
+ # program, and that it is zero.
+ #
+ send_gdb "print should_exit\n"
+ gdb_expect {
+ -re ".* = 0.*$gdb_prompt $"\
+ {pass "after attach1, print should_exit"}
+ -re "$gdb_prompt $" {fail "after attach1, print should_exit"}
+ timeout {fail "(timeout) after attach1, print should_exit"}
+ }
+
+ # Detach the process.
+ #
+ send_gdb "detach\n"
+ gdb_expect {
+ -re "Detaching from program: .*$binfile.*$gdb_prompt $"\
+ {pass "attach1 detach"}
+ -re "$gdb_prompt $" {fail "attach1 detach"}
+ timeout {fail "(timeout) attach1 detach"}
+ }
+
+ # Wait a bit for gdb to finish detaching
+ #
+ exec sleep 5
+
+ # Purge the symbols from gdb's brain. (We want to be certain
+ # the next attach, which won't be preceded by a "file" command,
+ # is really getting the executable file without our help.)
+ #
+ set old_timeout $timeout
+ set timeout 15
+ send_gdb "file\n"
+ gdb_expect {
+ -re ".*gdb internal error.*$" {
+ fail "Internal error, prob. Memory corruption"
+ }
+ -re "No executable file now.*Discard symbol table.*y or n.*$" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "No symbol file now.*$gdb_prompt $"\
+ {pass "attach1, purging symbols after detach"}
+ -re "$gdb_prompt $" {fail "attach1, purging symbols after detach"}
+ timeout {fail "(timeout) attach1, purging symbols after detach"}
+ }
+ }
+ -re "$gdb_prompt $" {fail "attach1, purging file after detach"}
+ timeout {
+ fail "(timeout) attach1, purging file after detach"
+ }
+ }
+ set timeout $old_timeout
+
+ # Verify that we can attach to the process just by giving the
+ # process ID.
+ #
+ send_gdb "attach $testpid\n"
+ gdb_expect {
+ -re "Attaching to process $testpid.*Reading symbols from $binfile.*main.*at .*$gdb_prompt $"\
+ {pass "attach2"}
+ -re "$gdb_prompt $" {fail "attach2"}
+ timeout {fail "(timeout) attach2"}
+ }
+
+ # Verify that we can modify the variable "should_exit" in the
+ # program.
+ #
+ send_gdb "set should_exit=1\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "after attach2, set should_exit"}
+ timeout {fail "(timeout) after attach2, set should_exit"}
+ }
+
+ # Verify that the modification really happened.
+ #
+ send_gdb "tbreak 19\n"
+ gdb_expect {
+ -re "Breakpoint .*at.*$srcfile, line 19.*$gdb_prompt $"\
+ {pass "after attach2, set tbreak postloop"}
+ -re "$gdb_prompt $" {fail "after attach2, set tbreak postloop"}
+ timeout {fail "(timeout) after attach2, set tbreak postloop"}
+ }
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "main.*at.*$srcfile:19.*$gdb_prompt $"\
+ {pass "after attach2, reach tbreak postloop"}
+ -re "$gdb_prompt $" {fail "after attach2, reach tbreak postloop"}
+ timeout {fail "(timeout) after attach2, reach tbreak postloop"}
+ }
+
+ # Allow the test process to exit, to cleanup after ourselves.
+ #
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Program exited normally.*$gdb_prompt $"\
+ {pass "after attach2, exit"}
+ -re "$gdb_prompt $" {fail "after attach2, exit"}
+ timeout {fail "(timeout) after attach2, exit"}
+ }
+
+ # Make sure we don't leave a process around to confuse
+ # the next test run (and prevent the compile by keeping
+ # the text file busy), in case the "set should_exit" didn't
+ # work.
+ #
+ remote_exec build "kill -9 ${testpid}"
+ # Start the program running and then wait for a bit, to be sure
+ # that it can be attached to.
+ #
+ set testpid [eval exec $binfile &]
+ exec sleep 2
+
+ # Verify that we can attach to the process, and find its a.out
+ # when we're cd'd to some directory that doesn't contain the
+ # a.out. (We use the source path set by the "dir" command.)
+ #
+ send_gdb "dir ${objdir}/${subdir}\n"
+ gdb_expect {
+ -re ".*Source directories searched: .*$gdb_prompt $"\
+ {pass "set source path"}
+ -re "$gdb_prompt $" {fail "set source path"}
+ timeout {fail "(timeout) set source path"}
+ }
+
+ send_gdb "cd /tmp\n"
+ gdb_expect {
+ -re ".*Working directory /tmp.*$gdb_prompt $"\
+ {pass "cd away from process' a.out"}
+ -re "$gdb_prompt $" {fail "cd away from process' a.out"}
+ timeout {fail "(timeout) cd away from process' a.out"}
+ }
+
+ # Explicitly flush out any knowledge of the previous attachment.
+ send_gdb "symbol\n"
+ gdb_expect {
+ -re ".*Discard symbol table from.*y or n. $"\
+ {send_gdb "y\n"
+ gdb_expect {
+ -re ".*No symbol file now.*$gdb_prompt $"\
+ {pass "before attach3, flush symbols"}
+ -re "$gdb_prompt $" {fail "before attach3, flush symbols"}
+ timeout {fail "(timeout) before attach3, flush symbols"}
+ }
+ }
+ -re ".*No symbol file now.*$gdb_prompt $"\
+ {pass "before attach3, flush symbols"}
+ -re "$gdb_prompt $" {fail "before attach3, flush symbols"}
+ timeout {fail "(timeout) before attach3, flush symbols"}
+ }
+ send_gdb "exec\n"
+ gdb_expect {
+ -re ".*No executable file now.*$gdb_prompt $"\
+ {pass "before attach3, flush exec"}
+ -re "$gdb_prompt $" {fail "before attach3, flush exec"}
+ timeout {fail "(timeout) before attach3, flush exec"}
+ }
+
+ send_gdb "attach $testpid\n"
+ gdb_expect {
+ -re "Attaching to process $testpid.*Reading symbols from $binfile.*main.*at .*$gdb_prompt $"\
+ {pass "attach when process' a.out not in cwd"}
+ -re "$gdb_prompt $" {fail "attach when process' a.out not in cwd"}
+ timeout {fail "(timeout) attach when process' a.out not in cwd"}
+ }
+
+ send_gdb "kill\n"
+ gdb_expect {
+ -re ".*Kill the program being debugged.*y or n. $"\
+ {send_gdb "y\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "after attach3, exit"}
+ timeout {fail "(timeout) after attach3, exit"}
+ }
+ }
+ -re "$gdb_prompt $" {fail "after attach3, exit"}
+ timeout {fail "(timeout) after attach3, exit"}
+ }
+}
+
+proc do_call_attach_tests {} {
+ global gdb_prompt
+ global binfile2
+
+ # Start the program running and then wait for a bit, to be sure
+ # that it can be attached to.
+ #
+ set testpid [eval exec $binfile2 &]
+ exec sleep 2
+
+ # Attach
+ #
+ gdb_test "file $binfile2" ".*" "force switch to gdb64, if necessary"
+ send_gdb "attach $testpid\n"
+ gdb_expect {
+ -re ".*warning: reading register.*I.*O error.*$gdb_prompt $" {
+ fail "attach call, read register 3 error"
+ }
+ -re "Attaching to.*process $testpid.*libc.*$gdb_prompt $" {
+ pass "attach call"
+ }
+ -re "$gdb_prompt $" {fail "attach call"}
+ timeout {fail "(timeout) attach call"}
+ }
+
+ # See if other registers are problems
+ #
+ send_gdb "i r r3\n"
+ gdb_expect {
+ -re ".*warning: reading register.*$gdb_prompt $" {
+ pass "CHFts23490: known bug"
+ }
+ -re ".*r3.*$gdb_prompt $" {
+ pass "Bug fixed, Yayyy!"
+ }
+ timeout { fail "timeout on info reg" }
+ }
+
+ # Get rid of the process
+ #
+ gdb_test "p should_exit = 1" ".*"
+ gdb_test "c" ".*Program exited normally.*"
+
+ # Be paranoid
+ #
+ remote_exec build "kill -9 ${testpid}"
+
+}
+
+
+# Start with a fresh gdb
+#
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# This is a test of gdb's ability to attach to a running process.
+#
+do_attach_tests
+
+# Test attaching when the target is inside a system call
+#
+gdb_exit
+gdb_start
+
+# this seems not necessary. - guo
+#
+# # Since we have moved the executable to /tmp, it will be hard for gdb
+# # to find the object file/executable to read the symbols. This is
+# # a known limitation. We try and get the name of the executable the
+# # process is running from a variety of methods, but none is foolproof.
+# # Using "dir" will get us the symbols.
+#
+# gdb_test "dir ./gdb.base" ".*" "set up directory before attach"
+gdb_reinitialize_dir $srcdir/$subdir
+do_call_attach_tests
+
+# Cleanup the files placed in /tmp and the symlinks
+ remote_exec build "rm -f ${binfile} ${binfile2} /tmp/attach1.${pid} /tmp/attach2.${pid}"
+
+return 0
diff --git a/gdb/testsuite/gdb.base/attach2.c b/gdb/testsuite/gdb.base/attach2.c
new file mode 100644
index 00000000000..a78037ed387
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach2.c
@@ -0,0 +1,24 @@
+/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop
+ is exited when & if the variable 'should_exit' is non-zero. (It
+ is initialized to zero in this program, so the loop will never
+ exit unless/until gdb sets the variable to non-zero.)
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int should_exit = 0;
+
+int main ()
+{
+ int local_i = 0;
+
+ sleep( 10 ); /* System call causes register fetch to fail */
+ /* This is a known HPUX "feature" */
+ while (! should_exit)
+ {
+ local_i++;
+ }
+ return (0);
+}
diff --git a/gdb/testsuite/gdb.base/average.c b/gdb/testsuite/gdb.base/average.c
new file mode 100644
index 00000000000..e1695cea58c
--- /dev/null
+++ b/gdb/testsuite/gdb.base/average.c
@@ -0,0 +1,46 @@
+/* This is a sample program for the HP WDB debugger. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef PROTOTYPES
+extern int sum(int *, int, int);
+#else
+extern int sum();
+#endif
+
+#define num 10
+
+static int my_list[num] = {3,4,2,0,2,1,8,3,6,7};
+
+#ifdef PROTOTYPES
+void print_average(int *list, int low, int high)
+#else
+void print_average(list, low, high)
+int *list, low, high;
+#endif
+ {
+ int total = 0, num_elements = 0, average = 0;
+ total = sum(list, low, high);
+ num_elements = high - low; /* note this is an off-by-one bug */
+
+ average = total / num_elements;
+ printf("%10.d\n", average);
+ }
+
+#ifdef PROTOTYPES
+int main(void)
+#else
+main ()
+#endif
+{
+ char c;
+ int first = 0, last = 0;
+ last = num-1;
+
+ /* Try two test cases. */
+ print_average (my_list, first, last);
+ print_average (my_list, first, last - 3);
+
+ exit(0);
+}
diff --git a/gdb/testsuite/gdb.base/bar.c b/gdb/testsuite/gdb.base/bar.c
new file mode 100644
index 00000000000..dd0bf923a3d
--- /dev/null
+++ b/gdb/testsuite/gdb.base/bar.c
@@ -0,0 +1,9 @@
+static int barx = 'b' + 'a' + 'r';
+
+int bar (int x)
+{
+ if (x)
+ return barx;
+ else
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/baz.c b/gdb/testsuite/gdb.base/baz.c
new file mode 100644
index 00000000000..8da4ffa47a1
--- /dev/null
+++ b/gdb/testsuite/gdb.base/baz.c
@@ -0,0 +1,9 @@
+static int bazx = 'b' + 'a' + 'z';
+
+int baz (int x)
+{
+ if (x)
+ return bazx;
+ else
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/bitfields.c b/gdb/testsuite/gdb.base/bitfields.c
new file mode 100644
index 00000000000..bd411f7b647
--- /dev/null
+++ b/gdb/testsuite/gdb.base/bitfields.c
@@ -0,0 +1,194 @@
+/* Test program to test bit field operations */
+
+/* For non-ANSI compilers, use plain ints for the signed bit fields. However,
+ whether they actually end up signed or not is implementation defined, so
+ this may cause some tests to fail. But at least we can still compile
+ the test program and run the tests... */
+
+#if !defined(__STDC__) && !defined(__cplusplus)
+#define signed /**/
+#endif
+
+struct fields
+{
+ unsigned char uc ;
+ signed int s1 : 1;
+ unsigned int u1 : 1;
+ signed int s2 : 2;
+ unsigned int u2 : 2;
+ signed int s3 : 3;
+ unsigned int u3 : 3;
+ signed int s9 : 9;
+ unsigned int u9 : 9;
+ signed char sc ;
+} flags;
+
+void break1 ()
+{
+}
+
+void break2 ()
+{
+}
+
+void break3 ()
+{
+}
+
+void break4 ()
+{
+}
+
+void break5 ()
+{
+}
+
+void break6 ()
+{
+}
+
+void break7 ()
+{
+}
+
+void break8 ()
+{
+}
+
+void break9 ()
+{
+}
+
+void break10 ()
+{
+}
+
+/* This is used by bitfields.exp to determine if the target understands
+ signed bitfields. */
+int i;
+
+int main ()
+{
+ /* For each member, set that member to 1, allow gdb to verify that the
+ member (and only that member) is 1, and then reset it back to 0. */
+
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ flags.uc = 1;
+ break1 ();
+ flags.uc = 0;
+
+ flags.s1 = -1;
+ break1 ();
+ flags.s1 = 0;
+
+ flags.u1 = 1;
+ break1 ();
+ flags.u1 = 0;
+
+ flags.s2 = 1;
+ break1 ();
+ flags.s2 = 0;
+
+ flags.u2 = 1;
+ break1 ();
+ flags.u2 = 0;
+
+ flags.s3 = 1;
+ break1 ();
+ flags.s3 = 0;
+
+ flags.u3 = 1;
+ break1 ();
+ flags.u3 = 0;
+
+ flags.s9 = 1;
+ break1 ();
+ flags.s9 = 0;
+
+ flags.u9 = 1;
+ break1 ();
+ flags.u9 = 0;
+
+ flags.sc = 1;
+ break1 ();
+ flags.sc = 0;
+
+ /* Fill alternating fields with all 1's and verify that none of the bits
+ "bleed over" to the other fields. */
+
+ flags.uc = 0xFF;
+ flags.u1 = 0x1;
+ flags.u2 = 0x3;
+ flags.u3 = 0x7;
+ flags.u9 = 0x1FF;
+ break2 ();
+ flags.uc = 0;
+ flags.u1 = 0;
+ flags.u2 = 0;
+ flags.u3 = 0;
+ flags.u9 = 0;
+
+ flags.s1 = -1;
+ flags.s2 = -1;
+ flags.s3 = -1;
+ flags.s9 = -1;
+ flags.sc = 0xFF;
+ break2 ();
+ flags.s1 = 0;
+ flags.s2 = 0;
+ flags.s3 = 0;
+ flags.s9 = 0;
+ flags.sc = 0;
+
+ /* Fill the unsigned fields with the maximum positive value and verify
+ that the values are printed correctly. */
+
+ /* Maximum positive values */
+ flags.u1 = 0x1;
+ flags.u2 = 0x3;
+ flags.u3 = 0x7;
+ flags.u9 = 0x1FF;
+ break3 ();
+ flags.u1 = 0;
+ flags.u2 = 0;
+ flags.u3 = 0;
+ flags.u9 = 0;
+
+ /* Fill the signed fields with the maximum positive value, then the maximally
+ negative value, then -1, and verify in each case that the values are
+ printed correctly. */
+
+ /* Maximum positive values */
+ flags.s1 = 0x0;
+ flags.s2 = 0x1;
+ flags.s3 = 0x3;
+ flags.s9 = 0xFF;
+ break4 ();
+
+ /* Maximally negative values */
+ flags.s1 = -0x1;
+ flags.s2 = -0x2;
+ flags.s3 = -0x4;
+ flags.s9 = -0x100;
+ /* Extract bitfield value so that bitfield.exp can check if the target
+ understands signed bitfields. */
+ i = flags.s9;
+ break4 ();
+
+ /* -1 */
+ flags.s1 = -1;
+ flags.s2 = -1;
+ flags.s3 = -1;
+ flags.s9 = -1;
+ break4 ();
+
+ flags.s1 = 0;
+ flags.s2 = 0;
+ flags.s3 = 0;
+ flags.s9 = 0;
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/bitfields.exp b/gdb/testsuite/gdb.base/bitfields.exp
new file mode 100644
index 00000000000..148eec84cfc
--- /dev/null
+++ b/gdb/testsuite/gdb.base/bitfields.exp
@@ -0,0 +1,268 @@
+# Copyright 1992, 1994, 1995, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "bitfields"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+#
+# Test bitfield locating and uniqueness.
+# For each member, set that member to 1 and verify that the member (and only
+# that member) is 1, then reset it back to 0.
+#
+
+proc bitfield_uniqueness {} {
+ global decimal
+ global hex
+ global gdb_prompt
+ global srcfile
+
+ if { ! [runto break1] } {
+ gdb_suppress_tests;
+ }
+
+ if [gdb_test "print flags" ".*uc = 1 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*"] {
+ gdb_suppress_tests;
+ }
+ if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #1"] {
+ gdb_suppress_tests;
+ }
+ # Note that we check for s1 as either 1 or -1, so that failure to
+ # treat it correctly as a signed 1bit field (values 0 or -1) while
+ # printing its value does not cause a spurious failure. We do the
+ # signedness preservation test later.
+ if [gdb_test "print flags" ".*uc = 0 .*, s1 = (1|-1), u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s1)"] {
+ gdb_suppress_tests;
+ }
+ if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #2"] {
+ gdb_suppress_tests;
+ }
+ if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u1)"] {
+ gdb_suppress_tests;
+ }
+ if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #3"] {
+ gdb_suppress_tests;
+ }
+ if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s2)"] {
+ gdb_suppress_tests;
+ }
+ if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #4"] {
+ gdb_suppress_tests;
+ }
+ if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 1, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u2)"] {
+ gdb_suppress_tests;
+ }
+ if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #5"] {
+ gdb_suppress_tests;
+ }
+ if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 1, u3 = 0, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (s3)"] {
+ gdb_suppress_tests;
+ }
+ if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #6"] {
+ gdb_suppress_tests;
+ }
+ if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 1, s9 = 0, u9 = 0, sc = 0.*" "bitfield uniqueness (u3)"] {
+ gdb_suppress_tests
+ }
+ if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #7"] {
+ gdb_suppress_tests
+ }
+ if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 1, u9 = 0, sc = 0.*" "bitfield uniqueness (s9)"] {
+ gdb_suppress_tests
+ }
+ if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #8"] {
+ gdb_suppress_tests
+ }
+ if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 1, sc = 0.*" "bitfield uniqueness (u9)"] {
+ gdb_suppress_tests
+ }
+ if [gdb_test "cont" "Break.*break1 \\(\\) at .*$srcfile:$decimal.*" "continuing to break1 #9"] {
+ gdb_suppress_tests
+ }
+ if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 0, s2 = 0, u2 = 0, s3 = 0, u3 = 0, s9 = 0, u9 = 0, sc = 1.*" "bitfield uniqueness (sc)"] {
+ gdb_suppress_tests
+ }
+ # Hmmmm?
+ gdb_stop_suppressing_tests;
+}
+
+
+#
+# Test bitfield containment.
+# Fill alternating fields with all 1's and verify that none of the bits
+# "bleed over" to the other fields.
+#
+
+proc bitfield_containment {} {
+ global decimal
+ global hex
+ global gdb_prompt
+ global srcfile
+
+ delete_breakpoints
+
+ if { ![runto break2] } {
+ gdb_suppress_tests
+ }
+
+ if [gdb_test "print/x flags" "= {uc = 0xff, s1 = 0x0, u1 = 0x1, s2 = 0x0, u2 = 0x3, s3 = 0x0, u3 = 0x7, s9 = 0x0, u9 = 0x1ff, sc = 0x0}" "bitfield containment #1"] {
+ gdb_suppress_tests
+ }
+
+ if [gdb_test "cont" "Break.*break2 \\(\\) at .*$srcfile:$decimal.*" "continuing to break2"] {
+ gdb_suppress_tests
+ }
+
+ # If program is compiled with Sun CC, then these print out as their
+ # actual sizes; if compiled with gcc, they print out as 0xffffffff
+ # (which strikes me as bogus, but accept it at least for now).
+ if [gdb_test "print/x flags" "= {uc = 0x0, s1 = 0x(1|f*), u1 = 0x0, s2 = 0x(3|f*), u2 = 0x0, s3 = 0x(7|f*), u3 = 0x0, s9 = 0x(1ff|f*), u9 = 0x0, sc = 0xff}" "bitfield containment #2"] {
+ gdb_suppress_tests
+ }
+ gdb_stop_suppressing_tests;
+}
+
+# Test unsigned bitfields for unsignedness and range.
+# Fill the unsigned fields with the maximum positive value and verify that
+# the values are printed correctly.
+
+proc bitfield_unsignedness {} {
+ global decimal
+ global hex
+ global gdb_prompt
+ global srcfile
+
+ delete_breakpoints
+
+ if { ![runto break3] } {
+ gdb_suppress_tests
+ }
+
+ if [gdb_test "print flags" ".*uc = 0 .*, s1 = 0, u1 = 1, s2 = 0, u2 = 3, s3 = 0, u3 = 7, s9 = 0, u9 = 511, sc = 0.*" "unsigned bitfield ranges"] {
+ gdb_suppress_tests
+ }
+ gdb_stop_suppressing_tests;
+}
+
+#
+# Test signed bitfields for signedness and range.
+# Fill the signed fields with the maximum positive value, then the maximally
+# negative value, then -1, and verify in each case that the values are
+# printed correctly.
+#
+
+proc bitfield_signedness {} {
+ global decimal
+ global hex
+ global gdb_prompt
+ global srcfile
+
+ delete_breakpoints
+
+ if { ! [runto break4] } {
+ gdb_suppress_tests
+ }
+
+ if [gdb_test "print flags" "= {uc = 0 .*, s1 = 0, u1 = 0, s2 = 1, u2 = 0, s3 = 3, u3 = 0, s9 = 255, u9 = 0, sc = 0 .*}" "signed bitfields, max positive values"] {
+ gdb_suppress_tests
+ }
+
+ if [gdb_test "cont" "Break.*break4 \\(\\) at .*$srcfile:$decimal.*" "continuing to break4 #1"] {
+ gdb_suppress_tests
+ }
+
+ # Determine if the target has signed bitfields so we can xfail the
+ # the signed bitfield tests if it doesn't.
+ send_gdb "print i\n"
+ gdb_expect {
+ -re ".* = -256.*$gdb_prompt $" {
+ pass "determining signed-ness of bitfields"
+ }
+ -re ".* = 256.*$gdb_prompt $" {
+ pass "determining signed-ness of bitfields"
+ setup_xfail "*-*-*"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "determining signed-ness of bitfields"
+ gdb_suppress_tests
+ }
+ default {
+ fail "determining signed-ness of bitfields" ;
+ gdb_suppress_tests;
+ }
+ }
+
+ if [gdb_test "print flags" ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -2, u2 = 0, s3 = -4, u3 = 0, s9 = -256, u9 = 0, sc = 0.*" "signed bitfields, max negative values"] {
+ gdb_suppress_tests
+ }
+
+ if [gdb_test "cont" "Break.*break4 \\(\\) at .*$srcfile:$decimal.*" "continuing to break4 #2"] {
+ gdb_suppress_tests
+ }
+
+ if [gdb_test "print flags" ".*uc = 0 .*, s1 = -1, u1 = 0, s2 = -1, u2 = 0, s3 = -1, u3 = 0, s9 = -1, u9 = 0, sc = 0.*" "signed bitfields with -1"] {
+ gdb_suppress_tests
+ }
+ # Hmmmm???
+ gdb_stop_suppressing_tests;
+}
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
+
+bitfield_uniqueness
+if [istarget "mips-idt-*"] then {
+ # Restart because IDT/SIM runs out of file descriptors.
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+}
+bitfield_containment
+if [istarget "mips-idt-*"] then {
+ # Restart because IDT/SIM runs out of file descriptors.
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+}
+bitfield_unsignedness
+if [istarget "mips-idt-*"] then {
+ # Restart because IDT/SIM runs out of file descriptors.
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+}
+bitfield_signedness
diff --git a/gdb/testsuite/gdb.base/bitops.exp b/gdb/testsuite/gdb.base/bitops.exp
new file mode 100644
index 00000000000..607ab7787d8
--- /dev/null
+++ b/gdb/testsuite/gdb.base/bitops.exp
@@ -0,0 +1,365 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This file is part of the gdb testsuite
+#
+# tests expressions with bitwise operators, and some
+# logical operators
+# Does not use a target program
+#
+
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+
+send_gdb "print !1\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of !1"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !1" }
+ timeout { fail "(timeout) print value of !1" }
+ }
+
+
+send_gdb "print !0\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print value of !0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !0" }
+ timeout { fail "(timeout) print value of !0" }
+ }
+
+
+send_gdb "print !100\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of !100"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !100" }
+ timeout { fail "(timeout) print value of !100" }
+ }
+
+
+send_gdb "print !1000\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of !1000"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !1000" }
+ timeout { fail "(timeout) print value of !1000" }
+ }
+
+
+send_gdb "print !10\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of !10"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !10" }
+ timeout { fail "(timeout) print value of !10" }
+ }
+
+
+send_gdb "print !2\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of !2 "
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !2" }
+ timeout { fail "(timeout) print value of !2" }
+ }
+
+
+send_gdb "print 10 | 5\n"
+gdb_expect {
+ -re ".\[0-9\]* = 15.*$gdb_prompt $" {
+ pass "print value of 10 | 5"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 10 | 5" }
+ timeout { fail "(timeout) print value of 10 | 5" }
+ }
+
+
+send_gdb "print 10 & 5\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of 10 & 5"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 10 & 5" }
+ timeout { fail "(timeout) print value of 10 & 5" }
+ }
+
+
+send_gdb "print 10 ^ 5\n"
+gdb_expect {
+ -re ".\[0-9\]* = 15.*$gdb_prompt $" {
+ pass "print value of 10 ^ 5"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 10 ^ 5" }
+ timeout { fail "(timeout) print value of 10 ^ 5" }
+ }
+
+
+send_gdb "print -!0\n"
+gdb_expect {
+ -re ".\[0-9\]* = -1.*$gdb_prompt $" {
+ pass "print value of -!0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of -!0" }
+ timeout { fail "(timeout) print value of -!0" }
+ }
+
+
+send_gdb "print ~-!0\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of ~-!0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of ~-!0" }
+ timeout { fail "(timeout) print value of ~-!0" }
+ }
+
+
+
+send_gdb "print 3 * 2 / 4.0 * 2.0\n"
+gdb_expect {
+ -re ".\[0-9\]* = 3.*$gdb_prompt $" {
+ pass "print value of 3 * 2 / 4.0 * 2.0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 3 * 2 / 4.0 * 2.0" }
+ timeout { fail "(timeout) print value of 3 * 2 / 4.0 * 2.0" }
+ }
+
+
+send_gdb "print 8 << 2 >> 4\n"
+gdb_expect {
+ -re ".\[0-9\]* = 2.*$gdb_prompt $" {
+ pass "print value of 8 << 2 >> 4"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 8 << 2 >> 4" }
+ timeout { fail "(timeout) print value of 8 << 2 >> 4" }
+ }
+
+
+send_gdb "print -1 < 0 > 1\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of -1 < 0 > 1"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of -1 < 0 > 1" }
+ timeout { fail "(timeout) print value of -1 < 0 > 1" }
+ }
+
+
+send_gdb "print 15 ^ 10 ^ 5 ^ 7\n"
+gdb_expect {
+ -re ".\[0-9\]* = 7.*$gdb_prompt $" {
+ pass "print value of 15 ^ 10 ^ 5 ^ 7"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 15 ^ 10 ^ 5 ^ 7" }
+ timeout { fail "(timeout) print value of 15 ^ 10 ^ 5 ^ 7" }
+ }
+
+
+send_gdb "print 3.5 < 4.0\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print value of 3.5 < 4.0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 3.5 < 4.0" }
+ timeout { fail "(timeout) print value of 3.5 < 4.0" }
+ }
+
+
+send_gdb "print 3.5 < -4.0\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of 3.5 < -4.0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 3.5 < -4.0" }
+ timeout { fail "(timeout) print value of 3.5 < -4.0" }
+ }
+
+
+send_gdb "print 2 > -3\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print value of 2 > -3"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 2 > -3" }
+ timeout { fail "(timeout) print value of 2 > -3" }
+ }
+
+
+send_gdb "print -3>4\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of -3>4"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of -3>4" }
+ timeout { fail "(timeout) print value of -3>4" }
+ }
+
+
+send_gdb "print (-3 > 4)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of (-3 > 4)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (-3 > 4)" }
+ timeout { fail "(timeout) print value of (-3 > 4)" }
+ }
+
+
+send_gdb "print 3>=2.5\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print value of 3>=2.5"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 3>=2.5" }
+ timeout { fail "(timeout) print value of 3>=2.5" }
+ }
+
+
+send_gdb "print 3>=4.5\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of 3>=4.5"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 3>=4.5" }
+ timeout { fail "(timeout) print value of 3>=4.5" }
+ }
+
+
+send_gdb "print 3==3.0\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print value of 3==3.0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 3==3.0" }
+ timeout { fail "(timeout) print value of 3==3.0" }
+ }
+
+
+send_gdb "print 3==4.0\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of 3==4.0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 3==4.0" }
+ timeout { fail "(timeout) print value of 3==4.0" }
+ }
+
+
+send_gdb "print 3!=3.0\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of 3!=3.0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 3!=3.0" }
+ timeout { fail "(timeout) print value of 3!=3.0" }
+ }
+
+
+send_gdb "print 3!=5.0\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print value of 3!=5.0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 3!=5.0" }
+ timeout { fail "(timeout) print value of 3!=5.0" }
+ }
+
+
+send_gdb "print 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2" }
+ timeout { fail "(timeout) print value of 0 || 1 && 0 | 0 ^ 0 == 8 > 128 >>1 +2 *2" }
+ }
+
+
+send_gdb "print 1.0 || 0\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print value of 1.0 || 0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 1.0 || 0" }
+ timeout { fail "(timeout) print value of 1.0 || 0" }
+ }
+
+
+send_gdb "print 0.0 || 1.0\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print value of 0.0 || 1.0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 0.0 || 1.0" }
+ timeout { fail "(timeout) print value of 0.0 || 1.0" }
+ }
+
+
+send_gdb "print 0.0 || 0\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of 0.0 || 0"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 0.0 || 0" }
+ timeout { fail "(timeout) print value of 0.0 || 0" }
+ }
+
+
+send_gdb "print 0 || 1 && 0 | 0 ^ 0 == 8\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of 0 || 1 && 0 | 0 ^ 0 == 8"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 0 || 1 && 0 | 0 ^ 0 == 8" }
+ timeout { fail "(timeout) print value of 0 || 1 && 0 | 0 ^ 0 == 8" }
+ }
+
+
+send_gdb "print 0 == 8 > 128 >> 1 + 2 * 2\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of 0 == 8 > 128 >> 1 + 2 * 2"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of 0 == 8 > 128 >> 1 + 2 * 2" }
+ timeout { fail "(timeout) print value of 0 == 8 > 128 >> 1 + 2 * 2" }
+ }
+
diff --git a/gdb/testsuite/gdb.base/branches.c b/gdb/testsuite/gdb.base/branches.c
new file mode 100644
index 00000000000..df3b7c052be
--- /dev/null
+++ b/gdb/testsuite/gdb.base/branches.c
@@ -0,0 +1,113 @@
+/* Tests for single stepping through various branch conditions */
+
+int noscramble(int a)
+{
+ return a ;
+}
+
+int echo(int a)
+{ return noscramble(a) ; }
+
+int equaltest(int a,int b)
+{ int retval ;
+ if (a == b)
+ retval = noscramble(1) ;
+ else retval = noscramble(0) ;
+ return retval ;
+}
+
+int neqtest(int a , int b)
+{ int retval ;
+ if (a != b)
+ retval = echo(1) ;
+ else retval = echo(2) ;
+ return retval ;
+}
+int zerotest(int a )
+{ int retval ;
+ a = echo(a) ;
+ if (a ==0)
+ retval = echo(1) ;
+ else
+ retval = echo(0) ;
+ retval = echo(retval) ;
+ return retval ;
+}
+
+int zerotest2(int a)
+{
+ return (a==0) ;
+}
+
+int nonzerotest(int a)
+{
+ int retval ;
+ if (a != 0)
+ retval = echo(0) ;
+ else retval = echo(1) ;
+ return retval ;
+}
+
+int whiletest(int a)
+{
+ while (a > 0)
+ {
+ a-- ;
+ }
+ return 0 ;
+}
+int whiletest2(int a)
+{
+ while (a > 0)
+ {
+ a = noscramble(a) ;
+ a-- ;
+ }
+ return a ;
+}
+
+int decr(int x) { return x - 1 ; }
+
+int while3(int a)
+{
+ int b = a ;
+ while (a == b)
+ {
+ a = echo(a) ;
+ b = decr(b) ;
+ }
+ return a ;
+}
+
+void done (int x) { }
+
+int main()
+{
+ int a,b,c,d ;
+ done(1) ;
+ a = echo(123456) ;
+ b = echo(123456) ;
+ c = echo(56789) ;
+ d = echo(0) ;
+#if 1
+ equaltest(a,b) ;
+ done(7) ;
+ equaltest(a,c) ;
+ done(8) ;
+ whiletest(3) ; /* worked */
+ done(3) ;
+ while3(3) ;
+ done(6) ;
+#endif
+ neqtest(a,b) ;
+ neqtest(a,b) ;
+ neqtest(a,c) ;
+ zerotest(d) ;
+ zerotest(a) ;
+ done(5) ;
+ nonzerotest(d) ;
+ done(4) ;
+ nonzerotest(a) ;
+ done(111) ;
+ return 1 ;
+}
diff --git a/gdb/testsuite/gdb.base/break.c b/gdb/testsuite/gdb.base/break.c
new file mode 100644
index 00000000000..9e458b316bb
--- /dev/null
+++ b/gdb/testsuite/gdb.base/break.c
@@ -0,0 +1,131 @@
+#ifdef vxworks
+
+# include <stdio.h>
+
+/* VxWorks does not supply atoi. */
+static int
+atoi (z)
+ char *z;
+{
+ int i = 0;
+
+ while (*z >= '0' && *z <= '9')
+ i = i * 10 + (*z++ - '0');
+ return i;
+}
+
+/* I don't know of any way to pass an array to VxWorks. This function
+ can be called directly from gdb. */
+
+vxmain (arg)
+char *arg;
+{
+ char *argv[2];
+
+ argv[0] = "";
+ argv[1] = arg;
+ main (2, argv, (char **) 0);
+}
+
+#else /* ! vxworks */
+# include <stdio.h>
+# include <stdlib.h>
+#endif /* ! vxworks */
+
+/*
+ * The following functions do nothing useful. They are included simply
+ * as places to try setting breakpoints at. They are explicitly
+ * "one-line functions" to verify that this case works (some versions
+ * of gcc have or have had problems with this).
+ */
+
+#ifdef PROTOTYPES
+int marker1 (void) { return (0); }
+int marker2 (int a) { return (1); }
+void marker3 (char *a, char *b) {}
+void marker4 (long d) {}
+#else
+int marker1 () { return (0); }
+int marker2 (a) int a; { return (1); }
+void marker3 (a, b) char *a, *b; {}
+void marker4 (d) long d; {}
+#endif
+
+/*
+ * This simple classical example of recursion is useful for
+ * testing stack backtraces and such.
+ */
+
+#ifdef PROTOTYPES
+int factorial(int);
+
+int
+main (int argc, char **argv, char **envp)
+#else
+int
+main (argc, argv, envp)
+int argc;
+char *argv[], **envp;
+#endif
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */
+ fprintf (stderr, "usage: factorial <number>\n");
+ return 1;
+ }
+ printf ("%d\n", factorial (atoi ("6")));
+
+ marker1 ();
+ marker2 (43);
+ marker3 ("stack", "trace");
+ marker4 (177601976L);
+ argc = (argc == 12345); /* This is silly, but we can step off of it */
+ return argc;
+}
+
+#ifdef PROTOTYPES
+int factorial (int value)
+#else
+int factorial (value)
+int value;
+#endif
+{
+ if (value > 1) {
+ value *= factorial (value - 1);
+ }
+ return (value);
+}
+
+#ifdef PROTOTYPES
+int multi_line_if_conditional (int a, int b, int c)
+#else
+int multi_line_if_conditional (a, b, c)
+ int a, b, c;
+#endif
+{
+ if (a
+ && b
+ && c)
+ return 0;
+ else
+ return 1;
+}
+
+#ifdef PROTOTYPES
+int multi_line_while_conditional (int a, int b, int c)
+#else
+int multi_line_while_conditional (a, b, c)
+ int a, b, c;
+#endif
+{
+ while (a
+ && b
+ && c)
+ {
+ a--, b--, c--;
+ }
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp
new file mode 100644
index 00000000000..e3aa922bc50
--- /dev/null
+++ b/gdb/testsuite/gdb.base/break.exp
@@ -0,0 +1,949 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "break"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+#
+# test simple breakpoint setting commands
+#
+
+# Test deleting all breakpoints when there are none installed,
+# GDB should not prompt for confirmation.
+# Note that gdb-init.exp provides a "delete_breakpoints" proc
+# for general use elsewhere.
+
+send_gdb "delete breakpoints\n"
+gdb_expect {
+ -re "Delete all breakpoints.*$" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {
+ fail "Delete all breakpoints when none (unexpected prompt)"
+ }
+ timeout { fail "Delete all breakpoints when none (timeout after unexpected prompt)" }
+ }
+ }
+ -re ".*$gdb_prompt $" { pass "Delete all breakpoints when none" }
+ timeout { fail "Delete all breakpoints when none (timeout)" }
+}
+
+#
+# test break at function
+#
+gdb_test "break main" \
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint function"
+
+#
+# test break at quoted function
+#
+gdb_test "break \"marker2\"" \
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint quoted function"
+
+#
+# test break at function in file
+#
+gdb_test "break $srcfile:factorial" \
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint function in file"
+
+#
+# test break at line number
+#
+# Note that the default source file is the last one whose source text
+# was printed. For native debugging, before we've executed the
+# program, this is the file containing main, but for remote debugging,
+# it's wherever the processor was stopped when we connected to the
+# board. So, to be sure, we do a list command.
+#
+gdb_test "list main" \
+ ".*main \\(argc, argv, envp\\).*" \
+ "use `list' to establish default source file"
+gdb_test "break 79" \
+ "Breakpoint.*at.* file .*$srcfile, line 79\\." \
+ "breakpoint line number"
+
+#
+# test duplicate breakpoint
+#
+gdb_test "break 79" \
+ "Note: breakpoint \[0-9\]+ also set at pc.*Breakpoint \[0-9\]+ at.* file .*$srcfile, line 79\\." \
+ "breakpoint duplicate"
+
+#
+# test break at line number in file
+#
+gdb_test "break $srcfile:85" \
+ "Breakpoint.*at.* file .*$srcfile, line 85\\." \
+ "breakpoint line number in file"
+
+
+#
+# Test putting a break at the start of a multi-line if conditional.
+# Verify the breakpoint was put at the start of the conditional.
+#
+gdb_test "break multi_line_if_conditional" \
+ "Breakpoint.*at.* file .*$srcfile, line 109\\." \
+ "breakpoint at start of multi line if conditional"
+
+gdb_test "break multi_line_while_conditional" \
+ "Breakpoint.*at.* file .*$srcfile, line 124\\." \
+ "breakpoint at start of multi line while conditional"
+
+#
+# check to see what breakpoints are set
+#
+if [target_info exists gdb_stub] {
+ set main_line 72
+} else {
+ set main_line 75
+}
+
+if {$hp_aCC_compiler} {
+ set proto "\\(int\\)"
+} else {
+ set proto ""
+}
+gdb_test "info break" \
+ "Num Type\[ \]+Disp Enb Address\[ \]+What.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in marker2 at .*$srcfile:4\[49\].*
+\[0-9\]+\[\t \]+breakpoint keep y.* in factorial$proto at .*$srcfile:96.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:79.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:79.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:85.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_if_conditional at .*$srcfile:109.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_while_conditional at .*$srcfile:124" \
+ "breakpoint info"
+
+
+# FIXME: The rest of this test doesn't work with anything that can't
+# handle arguments.
+# Huh? There doesn't *appear* to be anything that passes arguments
+# below.
+if [istarget "mips-idt-*"] then {
+ return
+}
+
+#
+# run until the breakpoint at main is hit. For non-stubs-using targets.
+#
+if ![target_info exists use_gdb_stub] {
+ if [istarget "*-*-vxworks*"] then {
+ send_gdb "run vxmain \"2\"\n"
+ set timeout 120
+ verbose "Timeout is now $timeout seconds" 2
+ } else {
+ send_gdb "run\n"
+ }
+ gdb_expect {
+ -re "The program .* has been started already.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:75.*75\[\t \]+if .argc.* \{.*$gdb_prompt $"\
+ { pass "run until function breakpoint" }
+ -re ".*$gdb_prompt $" { fail "run until function breakpoint" }
+ timeout { fail "run until function breakpoint (timeout)" }
+ }
+} else {
+ if ![target_info exists gdb_stub] {
+ gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:75.*75\[\t \]+if .argc.*\{.*" "stub continue"
+ }
+}
+
+#
+# run until the breakpoint at a line number
+#
+gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:79.*79\[\t \]+printf.*factorial.*" \
+ "run until breakpoint set at a line number"
+
+#
+# Run until the breakpoint set in a function in a file
+#
+for {set i 6} {$i >= 1} {incr i -1} {
+ gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, factorial \\(value=$i\\) at .*$srcfile:96.*96\[\t \]+.*if .value > 1. \{.*" \
+ "run until file:function($i) breakpoint"
+}
+
+#
+# Run until the breakpoint set at a quoted function
+#
+gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile:4\[49\].*" \
+ "run until quoted breakpoint"
+#
+# run until the file:function breakpoint at a line number in a file
+#
+gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:85.*85\[\t \]+argc = \\(argc == 12345\\);.*" \
+ "run until file:linenum breakpoint"
+
+# Test break at offset +1
+
+gdb_test "break +1" \
+ "Breakpoint.*at.* file .*$srcfile, line 86\\." \
+ "breakpoint offset +1"
+
+# Check to see if breakpoint is hit when stepped onto
+
+gdb_test "step" \
+ ".*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:86.*86\[\t \]+return argc;" \
+ "step onto breakpoint"
+
+#
+# delete all breakpoints so we can start over, course this can be a test too
+#
+delete_breakpoints
+
+#
+# test temporary breakpoint at function
+#
+
+gdb_test "tbreak main" "Breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function"
+
+#
+# test break at function in file
+#
+
+gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "Temporary breakpoint function in file"
+
+#
+# test break at line number
+#
+send_gdb "tbreak 79\n"
+gdb_expect {
+ -re "Breakpoint.*at.* file .*$srcfile, line 79.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" }
+ -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number #1" }
+ timeout { fail "breakpoint line number #1 (timeout)" }
+}
+
+gdb_test "tbreak 75" "Breakpoint.*at.* file .*$srcfile, line 75.*" "Temporary breakpoint line number #2"
+
+#
+# test break at line number in file
+#
+send_gdb "tbreak $srcfile:85\n"
+gdb_expect {
+ -re "Breakpoint.*at.* file .*$srcfile, line 85.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" }
+ -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" }
+ timeout { fail "Temporary breakpoint line number in file #1 (timeout)" }
+}
+
+gdb_test "tbreak $srcfile:81" "Breakpoint.*at.* file .*$srcfile, line 81.*" "Temporary breakpoint line number in file #2"
+
+#
+# check to see what breakpoints are set (temporary this time)
+#
+gdb_test "info break" "Num Type.*Disp Enb Address.*What.*\[\r\n\]
+\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:$main_line.*\[\r\n\]
+\[0-9\]+\[\t \]+breakpoint del.*y.*in factorial$proto at .*$srcfile:96.*\[\r\n\]
+\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:79.*\[\r\n\]
+\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:75.*\[\r\n\]
+\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:85.*\[\r\n\]
+\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:81.*" \
+ "Temporary breakpoint info"
+
+
+#***********
+
+# Verify that catchpoints for fork, vfork and exec don't trigger
+# inappropriately. (There are no calls to those system functions
+# in this test program.)
+#
+if ![runto_main] then { fail "break tests suppressed" }
+
+send_gdb "catch\n"
+gdb_expect {
+ -re "Catch requires an event name.*$gdb_prompt $"\
+ {pass "catch requires an event name"}
+ -re "$gdb_prompt $"\
+ {fail "catch requires an event name"}
+ timeout {fail "(timeout) catch requires an event name"}
+}
+
+
+set name "set catch fork, never expected to trigger"
+send_gdb "catch fork\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\]* .fork..*$gdb_prompt $"
+ {pass $name}
+ -re "Catch of fork not yet implemented.*$gdb_prompt $"
+ {pass $name}
+ -re "$gdb_prompt $"
+ {fail $name}
+ timeout {fail "(timeout) $name"}
+}
+
+
+set name "set catch vfork, never expected to trigger"
+send_gdb "catch vfork\n"
+
+# If we are on HP-UX 10.20, we expect an error message to be
+# printed if we type "catch vfork" at the gdb gdb_prompt. This is
+# because on HP-UX 10.20, we cannot catch vfork events.
+
+if [istarget "hppa*-hp-hpux10.20"] then {
+ gdb_expect {
+ -re "Catch of vfork events not supported on HP-UX 10.20..*$gdb_prompt $"
+ {pass $name}
+ -re "$gdb_prompt $"
+ {fail $name}
+ timeout {fail "(timeout) $name"}
+ }
+} else {
+ gdb_expect {
+ -re "Catchpoint \[0-9\]* .vfork..*$gdb_prompt $"
+ {pass $name}
+ -re "Catch of vfork not yet implemented.*$gdb_prompt $"
+ {pass $name}
+ -re "$gdb_prompt $"
+ {fail $name}
+ timeout {fail "(timeout) $name"}
+ }
+}
+
+set name "set catch exec, never expected to trigger"
+send_gdb "catch exec\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\]* .exec..*$gdb_prompt $"
+ {pass $name}
+ -re "Catch of exec not yet implemented.*$gdb_prompt $"
+ {pass $name}
+ -re "$gdb_prompt $" {fail $name}
+ timeout {fail "(timeout) $name"}
+}
+
+# Verify that "until <location>" works. (This is really just syntactic
+# sugar for "tbreak <location>; continue".)
+#
+send_gdb "until 79\n"
+gdb_expect {
+ -re "main .* at .*:79.*$gdb_prompt $"\
+ {pass "until 79"}
+ -re "$gdb_prompt $"\
+ {fail "until 79"}
+ timeout {fail "(timeout) until 79"}
+}
+
+# Verify that a malformed "until" is gracefully caught.
+#
+send_gdb "until 80 then stop\n"
+gdb_expect {
+ -re "Junk at end of arguments..*$gdb_prompt $"\
+ {pass "malformed until"}
+ -re "$gdb_prompt $"\
+ {fail "malformed until"}
+ timeout {fail "(timeout) malformed until"}
+}
+
+# Verify that GDB responds gracefully when asked to set a breakpoint
+# on a nonexistent source line.
+#
+send_gdb "break 999\n"
+gdb_expect {
+ -re "No line 999 in file .*$gdb_prompt $"\
+ {pass "break on non-existent source line"}
+ -re "$gdb_prompt $"\
+ {fail "break on non-existent source line"}
+ timeout {fail "(timeout) break on non-existent source line"}
+}
+
+# Verify that GDB allows one to just say "break", which is treated
+# as the "default" breakpoint. Note that GDB gets cute when printing
+# the informational message about other breakpoints at the same
+# location. We'll hit that bird with this stone too.
+#
+send_gdb "break\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*.*$gdb_prompt $"\
+ {pass "break on default location, 1st time"}
+ -re "$gdb_prompt $"\
+ {fail "break on default location, 1st time"}
+ timeout {fail "(timeout) break on default location, 1st time"}
+}
+
+send_gdb "break\n"
+gdb_expect {
+ -re "Note: breakpoint \[0-9\]* also set at .*Breakpoint \[0-9\]*.*$gdb_prompt $"\
+ {pass "break on default location, 2nd time"}
+ -re "$gdb_prompt $"\
+ {fail "break on default location, 2nd time"}
+ timeout {fail "(timeout) break on default location, 2nd time"}
+}
+
+send_gdb "break\n"
+gdb_expect {
+ -re "Note: breakpoints \[0-9\]* and \[0-9\]* also set at .*Breakpoint \[0-9\]*.*$gdb_prompt $"\
+ {pass "break on default location, 3rd time"}
+ -re "$gdb_prompt $"\
+ {fail "break on default location, 3rd time"}
+ timeout {fail "(timeout) break on default location, 3rd time"}
+}
+
+send_gdb "break\n"
+gdb_expect {
+ -re "Note: breakpoints \[0-9\]*, \[0-9\]* and \[0-9\]* also set at .*Breakpoint \[0-9\]*.*$gdb_prompt $"\
+ {pass "break on default location, 4th time"}
+ -re "$gdb_prompt $"\
+ {fail "break on default location, 4th time"}
+ timeout {fail "(timeout) break on default location, 4th time"}
+}
+
+# Verify that a "silent" breakpoint can be set, and that GDB is indeed
+# "silent" about its triggering.
+#
+if ![runto_main] then { fail "break tests suppressed" }
+
+send_gdb "break 79\n"
+gdb_expect {
+ -re "Breakpoint (\[0-9\]*) at .*, line 79.*$gdb_prompt $"\
+ {pass "set to-be-silent break 79"}
+ -re "$gdb_prompt $"\
+ {fail "set to-be-silent break 79"}
+ timeout {fail "(timeout) set to-be-silent break 79"}
+}
+
+send_gdb "commands $expect_out(1,string)\n"
+send_gdb "silent\n"
+send_gdb "end\n"
+gdb_expect {
+ -re ".*$gdb_prompt $"\
+ {pass "set silent break 79"}
+ timeout {fail "(timeout) set silent break 79"}
+}
+
+send_gdb "info break $expect_out(1,string)\n"
+gdb_expect {
+ -re "\[0-9\]*\[ \t\]*breakpoint.*:79\r\n\[ \t\]*silent.*$gdb_prompt $"\
+ {pass "info silent break 79"}
+ -re "$gdb_prompt $"\
+ {fail "info silent break 79"}
+ timeout {fail "(timeout) info silent break 79"}
+}
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing.\r\n$gdb_prompt $"\
+ {pass "hit silent break 79"}
+ -re "$gdb_prompt $"\
+ {fail "hit silent break 79"}
+ timeout {fail "(timeout) hit silent break 79"}
+}
+send_gdb "bt\n"
+gdb_expect {
+ -re "#0 main .* at .*:79.*$gdb_prompt $"\
+ {pass "stopped for silent break 79"}
+ -re "$gdb_prompt $"\
+ {fail "stopped for silent break 79"}
+ timeout {fail "(timeout) stopped for silent break 79"}
+}
+
+# Verify that GDB can at least parse a breakpoint with the
+# "thread" keyword. (We won't attempt to test here that a
+# thread-specific breakpoint really triggers appropriately.
+# The gdb.threads subdirectory contains tests for that.)
+#
+send_gdb "break 80 thread 999\n"
+gdb_expect {
+ -re "Unknown thread 999.*$gdb_prompt $"\
+ {pass "thread-specific breakpoint on non-existent thread disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "thread-specific breakpoint on non-existent thread disallowed"}
+ timeout {fail "(timeout) thread-specific breakpoint on non-existent thread disallowed"}
+}
+send_gdb "break 80 thread foo\n"
+gdb_expect {
+ -re "Junk after thread keyword..*$gdb_prompt $"\
+ {pass "thread-specific breakpoint on bogus thread ID disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "thread-specific breakpoint on bogus thread ID disallowed"}
+ timeout {fail "(timeout) thread-specific breakpoint on bogus thread ID disallowed"}
+}
+
+# Verify that GDB responds gracefully to a breakpoint command with
+# trailing garbage.
+#
+send_gdb "break 80 foo\n"
+gdb_expect {
+ -re "Junk at end of arguments..*$gdb_prompt $"\
+ {pass "breakpoint with trailing garbage disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "breakpoint with trailing garbage disallowed"}
+ timeout {fail "(timeout) breakpoint with trailing garbage disallowed"}
+}
+
+# Verify that GDB responds gracefully to a "clear" command that has
+# no matching breakpoint. (First, get us off the current source line,
+# which we know has a breakpoint.)
+#
+send_gdb "next\n"
+gdb_expect {
+ -re ".*$gdb_prompt $"\
+ {pass "step over breakpoint"}
+ timeout {fail "(timeout) step over breakpoint"}
+}
+send_gdb "clear 81\n"
+gdb_expect {
+ -re "No breakpoint at 81..*$gdb_prompt $"\
+ {pass "clear line has no breakpoint disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "clear line has no breakpoint disallowed"}
+ timeout {fail "(timeout) clear line has no breakpoint disallowed"}
+}
+send_gdb "clear\n"
+gdb_expect {
+ -re "No breakpoint at this line..*$gdb_prompt $"\
+ {pass "clear current line has no breakpoint disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "clear current line has no breakpoint disallowed"}
+ timeout {fail "(timeout) clear current line has no breakpoint disallowed"}
+}
+
+# Verify that we can set and clear multiple breakpoints.
+#
+# We don't test that it deletes the correct breakpoints. We do at
+# least test that it deletes more than one breakpoint.
+#
+gdb_test "break marker3" "Breakpoint.*at.*" "break marker3 #1"
+gdb_test "break marker3" "Breakpoint.*at.*" "break marker3 #2"
+gdb_test "clear marker3" {Deleted breakpoints [0-9]+ [0-9]+.*}
+
+# Verify that a breakpoint can be set via a convenience variable.
+#
+send_gdb "set \$foo=81\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "set convenience variable \$foo to 81"}
+ timeout {fail "(timeout) set convenience variable \$foo to 81"}
+}
+send_gdb "break \$foo\n"
+gdb_expect {
+ -re "Breakpoint (\[0-9\]*) at .*, line 81.*$gdb_prompt $"\
+ {pass "set breakpoint via convenience variable"}
+ -re "$gdb_prompt $"\
+ {fail "set breakpoint via convenience variable"}
+ timeout {fail "(timeout) set breakpoint via convenience variable"}
+}
+
+# Verify that GDB responds gracefully to an attempt to set a
+# breakpoint via a convenience variable whose type is not integer.
+#
+send_gdb "set \$foo=81.5\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "set convenience variable \$foo to 81.5"}
+ timeout {fail "(timeout) set convenience variable \$foo to 81.5"}
+}
+send_gdb "break \$foo\n"
+gdb_expect {
+ -re "Convenience variables used in line specs must have integer values..*$gdb_prompt $"\
+ {pass "set breakpoint via non-integer convenience variable disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "set breakpoint via non-integer convenience variable disallowed"}
+ timeout {fail "(timeout) set breakpoint via non-integer convenience variable disallowed"}
+}
+
+# Verify that we can set and trigger a breakpoint in a user-called function.
+#
+send_gdb "break marker2\n"
+gdb_expect {
+ -re "Breakpoint (\[0-9\]*) at .*, line 4\[49\].*$gdb_prompt $"\
+ {pass "set breakpoint on to-be-called function"}
+ -re "$gdb_prompt $"\
+ {fail "set breakpoint on to-be-called function"}
+ timeout {fail "(timeout) set breakpoint on to-be-called function"}
+}
+send_gdb "print marker2(99)\n"
+gdb_expect {
+ -re "The program being debugged stopped while in a function called from GDB.\r\nWhen the function .marker2$proto. is done executing, GDB will silently\r\nstop .instead of continuing to evaluate the expression containing\r\nthe function call...*$gdb_prompt $"\
+ {pass "hit breakpoint on called function"}
+ -re "$gdb_prompt $"\
+ {fail "hit breakpoint on called function"}
+ timeout {fail "(timeout) hit breakpoint on called function"}
+}
+
+# As long as we're stopped (breakpointed) in a called function,
+# verify that we can successfully backtrace & such from here.
+#
+# In this and the following test, the _sr4export check apparently is needed
+# for hppa*-*-hpux.
+#
+send_gdb "bt\n"
+gdb_expect {
+ -re "#0\[ \t\]*($hex in )?marker2.*:4\[49\]\r\n#1.*_sr4export.*$gdb_prompt $"\
+ {pass "backtrace while in called function"}
+ -re "#0\[ \t\]*($hex in )?marker2.*:4\[49\]\r\n#1.*function called from gdb.*$gdb_prompt $"\
+ {pass "backtrace while in called function"}
+ -re "$gdb_prompt $"\
+ {fail "backtrace while in called function"}
+ timeout {fail "(timeout) backtrace while in called function"}
+}
+
+# Return from the called function. For remote targets, it's important to do
+# this before runto_main, which otherwise may silently stop on the dummy
+# breakpoint inserted by GDB at the program's entry point.
+#
+send_gdb "finish\n"
+gdb_expect {
+ -re "Run till exit from .*marker2.* at .*4\[49\]\r\n.* in _sr4export.*$gdb_prompt $"\
+ {pass "finish from called function"}
+ -re "Run till exit from .*marker2.* at .*4\[49\]\r\n.*function called from gdb.*$gdb_prompt $"\
+ {pass "finish from called function"}
+ -re "Run till exit from .*marker2.* at .*4\[49\]\r\n.*Value returned.*$gdb_prompt $"\
+ {pass "finish from called function"}
+ -re "$gdb_prompt $"\
+ {fail "finish from called function"}
+ timeout {fail "(timeout) finish from called function"}
+}
+
+# Verify that GDB responds gracefully to a "finish" command with
+# arguments.
+#
+if ![runto_main] then { fail "break tests suppressed" }
+
+send_gdb "finish 123\n"
+gdb_expect {
+ -re "The \"finish\" command does not take any arguments.\r\n$gdb_prompt $"\
+ {pass "finish with arguments disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "finish with arguments disallowed"}
+ timeout {fail "(timeout) finish with arguments disallowed"}
+}
+
+# Verify that GDB responds gracefully to a request to "finish" from
+# the outermost frame. On a stub that never exits, this will just
+# run to the stubs routine, so we don't get this error... Thus the
+# second condition.
+#
+
+send_gdb "finish\n"
+gdb_expect {
+ -re "\"finish\" not meaningful in the outermost frame.\r\n$gdb_prompt $"\
+ {pass "finish from outermost frame disallowed"}
+ -re "Run till exit from.*\r\n$gdb_prompt $" {
+ pass "finish from outermost frame disallowed"
+ }
+ -re "$gdb_prompt $"\
+ {fail "finish from outermost frame disallowed"}
+ timeout {fail "(timeout) finish from outermost frame disallowed"}
+}
+
+# Verify that we can explicitly ask GDB to stop on all shared library
+# events, and that it does so.
+#
+if [istarget "hppa*-*-hpux*"] then {
+ if ![runto_main] then { fail "break tests suppressed" }
+
+ send_gdb "set stop-on-solib-events 1\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "set stop-on-solib-events"}
+ timeout {fail "(timeout) set stop-on-solib-events"}
+ }
+
+ send_gdb "run\n"
+ gdb_expect {
+ -re ".*Start it from the beginning.*y or n. $"\
+ {send_gdb "y\n"
+ gdb_expect {
+ -re ".*Stopped due to shared library event.*$gdb_prompt $"\
+ {pass "triggered stop-on-solib-events"}
+ -re "$gdb_prompt $"\
+ {fail "triggered stop-on-solib-events"}
+ timeout {fail "(timeout) triggered stop-on-solib-events"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "rerun for stop-on-solib-events"}
+ timeout {fail "(timeout) rerun for stop-on-solib-events"}
+ }
+
+ send_gdb "set stop-on-solib-events 0\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "reset stop-on-solib-events"}
+ timeout {fail "(timeout) reset stop-on-solib-events"}
+ }
+}
+
+# Hardware breakpoints are unsupported on HP-UX. Verify that GDB
+# gracefully responds to requests to create them.
+#
+if [istarget "hppa*-*-hpux*"] then {
+ if ![runto_main] then { fail "break tests suppressed" }
+
+ send_gdb "hbreak\n"
+ gdb_expect {
+ -re "No hardware breakpoint support in the target.*$gdb_prompt $"\
+ {pass "hw breaks disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "hw breaks disallowed"}
+ timeout {fail "(timeout) hw breaks disallowed"}
+ }
+
+ send_gdb "thbreak\n"
+ gdb_expect {
+ -re "No hardware breakpoint support in the target.*$gdb_prompt $"\
+ {pass "temporary hw breaks disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "temporary hw breaks disallowed"}
+ timeout {fail "(timeout) temporary hw breaks disallowed"}
+ }
+}
+
+#********
+
+
+#
+# Test "next" over recursive function call.
+#
+
+proc test_next_with_recursion {} {
+ global gdb_prompt
+ global decimal
+ global binfile
+
+ if [target_info exists use_gdb_stub] {
+ # Reload the program.
+ delete_breakpoints
+ gdb_load ${binfile};
+ } else {
+ # FIXME: should be using runto
+ gdb_test "kill" "" "kill program" "Kill the program being debugged.*y or n. $" "y"
+
+ delete_breakpoints
+ }
+
+ gdb_test "break factorial" "Breakpoint $decimal at .*" "break at factorial"
+
+ # Run until we call factorial with 6
+
+ if [istarget "*-*-vxworks*"] then {
+ send_gdb "run vxmain \"6\"\n"
+ } else {
+ gdb_run_cmd
+ }
+ gdb_expect {
+ -re "Break.* factorial .value=6. .*$gdb_prompt $" {}
+ -re ".*$gdb_prompt $" {
+ fail "run to factorial(6)";
+ gdb_suppress_tests;
+ }
+ timeout { fail "run to factorial(6) (timeout)" ; gdb_suppress_tests }
+ }
+
+ # Continue until we call factorial recursively with 5.
+
+ if [gdb_test "continue" \
+ "Continuing.*Break.* factorial .value=5. .*" \
+ "continue to factorial(5)"] then { gdb_suppress_tests }
+
+ # Do a backtrace just to confirm how many levels deep we are.
+
+ if [gdb_test "backtrace" \
+ "#0\[ \t\]+ factorial .value=5..*" \
+ "backtrace from factorial(5)"] then { gdb_suppress_tests }
+
+ # Now a "next" should position us at the recursive call, which
+ # we will be performing with 4.
+
+ if [gdb_test "next" \
+ ".* factorial .value - 1.;.*" \
+ "next to recursive call"] then { gdb_suppress_tests }
+
+ # Disable the breakpoint at the entry to factorial by deleting them all.
+ # The "next" should run until we return to the next line from this
+ # recursive call to factorial with 4.
+ # Buggy versions of gdb will stop instead at the innermost frame on
+ # the line where we are trying to "next" to.
+
+ delete_breakpoints
+
+ if [istarget "mips*tx39-*"] {
+ set timeout 60
+ }
+ # We used to set timeout here for all other targets as well. This
+ # is almost certainly wrong. The proper timeout depends on the
+ # target system in use, and how we communicate with it, so there
+ # is no single value appropriate for all targets. The timeout
+ # should be established by the Dejagnu config file(s) for the
+ # board, and respected by the test suite.
+ #
+ # For example, if I'm running GDB over an SSH tunnel talking to a
+ # portmaster in California talking to an ancient 68k board running
+ # a crummy ROM monitor (a situation I can only wish were
+ # hypothetical), then I need a large timeout. But that's not the
+ # kind of knowledge that belongs in this file.
+
+ gdb_test next "\[0-9\]*\[\t \]+return \\(value\\);.*" \
+ "next over recursive call"
+
+ # OK, we should be back in the same stack frame we started from.
+ # Do a backtrace just to confirm.
+
+ set result [gdb_test "backtrace" \
+ "#0\[ \t\]+ factorial .value=120.*\r\n#1\[ \t\]+ \[0-9a-fx\]+ in factorial .value=6..*" \
+ "backtrace from factorial(5.1)"]
+ if { $result != 0 } { gdb_suppress_tests }
+
+ if [target_info exists gdb,noresults] { gdb_suppress_tests }
+ gdb_continue_to_end "recursive next test"
+ gdb_stop_suppressing_tests;
+}
+
+test_next_with_recursion
+
+
+#********
+
+# build a new file with optimization enabled so that we can try breakpoints
+# on targets with optimized prologues
+
+set binfileo2 ${objdir}/${subdir}/${testfile}o2
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfileo2}" executable {debug additional_flags="-O2" }] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfileo2}] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfileo2}
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+#
+# test break at function
+#
+gdb_test "break main" \
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint function, optimized file"
+
+#
+# test break at function
+#
+gdb_test "break marker4" \
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint small function, optimized file"
+
+#
+# run until the breakpoint at main is hit. For non-stubs-using targets.
+#
+if ![target_info exists use_gdb_stub] {
+ if [istarget "*-*-vxworks*"] then {
+ send_gdb "run vxmain \"2\"\n"
+ set timeout 120
+ verbose "Timeout is now $timeout seconds" 2
+ } else {
+ send_gdb "run\n"
+ }
+ gdb_expect {
+ -re "The program .* has been started already.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:75.*75\[\t \]+if .argc.* \{.*$gdb_prompt $"\
+ { pass "run until function breakpoint, optimized file" }
+ -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$gdb_prompt $"\
+ { pass "run until function breakpoint, optimized file (code motion)" }
+ -re ".*$gdb_prompt $" { fail "run until function breakpoint, optimized file" }
+ timeout { fail "run until function breakpoint, optimized file (timeout)" }
+ }
+} else {
+ if ![target_info exists gdb_stub] {
+ gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:75.*75\[\t \]+if .argc.*\{.*" "stub continue, optimized file"
+ }
+}
+
+#
+# run until the breakpoint at a small function
+#
+
+#
+# Add a second pass pattern. The behavior differs here between stabs
+# and dwarf for one-line functions. Stabs preserves two line symbols
+# (one before the prologue and one after) with the same line number,
+# but dwarf regards these as duplicates and discards one of them.
+# Therefore the address after the prologue (where the breakpoint is)
+# has no exactly matching line symbol, and GDB reports the breakpoint
+# as if it were in the middle of a line rather than at the beginning.
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile:51\[\r\n\]+51\[\t \]+void marker4.*" {
+ pass "run until breakpoint set at small function, optimized file"
+ }
+ -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile:51\[\r\n\]+51\[\t \]+void marker4.*" {
+ pass "run until breakpoint set at small function, optimized file"
+ }
+ -re ".*$gdb_prompt " {
+ fail "run until breakpoint set at small function, optimized file"
+ }
+ timeout {
+ fail "run until breakpoint set at small function, optimized file (timeout)"
+ }
+}
+
+
+# Reset the default arguments for VxWorks
+if [istarget "*-*-vxworks*"] {
+ set timeout 10
+ verbose "Timeout is now $timeout seconds" 2
+ send_gdb "set args main\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+}
diff --git a/gdb/testsuite/gdb.base/call-ar-st.c b/gdb/testsuite/gdb.base/call-ar-st.c
new file mode 100644
index 00000000000..d903f0d3f6b
--- /dev/null
+++ b/gdb/testsuite/gdb.base/call-ar-st.c
@@ -0,0 +1,1339 @@
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/**************************************************************************
+ * TESTS :
+ * -- function arguments that are enumerated types
+ * -- small structure arguments ( <= 64 bits )
+ * -- stored in registers
+ * -- stored on the stack
+ * -- large structure arguments ( > 64 bits )
+ * -- stored in registers
+ * -- stored on the stack
+ * -- array arguments
+ * -- caller is a leaf routine :
+ * -- use the call command from within an init routine (i.e.
+ * init_bit_flags, init_bit_flags_combo, init_array_rep)
+ * -- caller doesn't have enough space for all the function arguments :
+ * -- call print_long_arg_list from inside print_small_structs
+ ***************************************************************************/
+
+/* Some enumerated types -- used to test that the structureal data type is
+ * retrieved for function arguments with typedef data types.
+ */
+typedef int id_int;
+
+typedef enum {
+ BLACK,
+ BLUE,
+ BROWN,
+ ECRUE,
+ GOLD,
+ GRAY,
+ GREEN,
+ IVORY,
+ MAUVE,
+ ORANGE,
+ PINK,
+ PURPLE,
+ RED,
+ SILVER,
+ TAN,
+ VIOLET,
+ WHITE,
+ YELLOW} colors;
+
+/* A large structure (> 64 bits) used to test passing large structures as
+ * parameters
+ */
+
+struct array_rep_info_t {
+ int next_index[10];
+ int values[10];
+ int head;
+};
+
+/*****************************************************************************
+ * Small structures ( <= 64 bits). These are used to test passing small
+ * structures as parameters and test argument size promotion.
+ *****************************************************************************/
+
+ /* 64 bits
+ */
+struct small_rep_info_t {
+ int value;
+ int head;
+};
+
+/* 6 bits : really fits in 8 bits and is promoted to 32 bits
+ */
+struct bit_flags_t {
+ unsigned alpha :1;
+ unsigned beta :1;
+ unsigned gamma :1;
+ unsigned delta :1;
+ unsigned epsilon :1;
+ unsigned omega :1;
+};
+
+/* 22 bits : really fits in 40 bits and is promoted to 64 bits
+ */
+struct bit_flags_combo_t {
+ unsigned alpha :1;
+ unsigned beta :1;
+ char ch1;
+ unsigned gamma :1;
+ unsigned delta :1;
+ char ch2;
+ unsigned epsilon :1;
+ unsigned omega :1;
+};
+
+/* 64 bits
+ */
+struct one_double_t {
+ double double1;
+};
+
+/* 64 bits
+ */
+struct two_floats_t {
+ float float1;
+ float float2;
+};
+
+/* 16 bits : promoted to 32 bits
+ */
+struct two_char_t {
+ char ch1;
+ char ch2;
+};
+
+/* 24 bits : promoted to 32 bits
+ */
+struct three_char_t {
+ char ch1;
+ char ch2;
+ char ch3;
+};
+
+/* 40 bits : promoted to 64 bits
+ */
+struct five_char_t {
+ char ch1;
+ char ch2;
+ char ch3;
+ char ch4;
+ char ch5;
+};
+
+/* 40 bits : promoted to 64 bits
+ */
+struct int_char_combo_t {
+ int int1;
+ char ch1;
+};
+
+/*****************************************************************
+ * PRINT_STUDENT_ID_SHIRT_COLOR :
+ * IN id_int student -- enumerated type
+ * IN colors shirt -- enumerated type
+ *****************************************************************/
+#ifdef PROTOTYPES
+void print_student_id_shirt_color (id_int student, colors shirt)
+#else
+void print_student_id_shirt_color ( student, shirt )
+ id_int student;
+ colors shirt;
+#endif
+{
+
+ printf("student id : %d\t", student);
+ printf("shirt color : ");
+ switch (shirt) {
+ case BLACK : printf("BLACK\n");
+ break;
+ case BLUE : printf("BLUE\n");
+ break;
+ case BROWN : printf("BROWN\n");
+ break;
+ case ECRUE : printf("ECRUE\n");
+ break;
+ case GOLD : printf("GOLD\n");
+ break;
+ case GRAY : printf("GRAY\n");
+ break;
+ case GREEN : printf("GREEN\n");
+ break;
+ case IVORY : printf("IVORY\n");
+ break;
+ case MAUVE : printf("MAUVE\n");
+ break;
+ case ORANGE : printf("ORANGE\n");
+ break;
+ case PINK : printf("PINK\n");
+ break;
+ case PURPLE : printf("PURPLE\n");
+ break;
+ case RED : printf("RED\n");
+ break;
+ case SILVER : printf("SILVER\n");
+ break;
+ case TAN : printf("TAN\n");
+ break;
+ case VIOLET : printf("VIOLET\n");
+ break;
+ case WHITE : printf("WHITE\n");
+ break;
+ case YELLOW : printf("YELLOW\n");
+ break;
+ }
+}
+
+/*****************************************************************
+ * PRINT_CHAR_ARRAY :
+ * IN char array_c[] -- character array
+ *****************************************************************/
+#ifdef PROTOTYPES
+void print_char_array (char array_c[])
+#else
+void print_char_array ( array_c )
+ char array_c[];
+#endif
+{
+
+ int index;
+
+ printf("array_c :\n");
+ printf("=========\n\n");
+ for (index = 0; index < 120; index++) {
+ printf("%1c", array_c[index]);
+ if ((index%50) == 0) printf("\n");
+ }
+ printf("\n\n");
+}
+
+/*****************************************************************
+ * PRINT_DOUBLE_ARRAY :
+ * IN double array_d[] -- array of doubles
+ *****************************************************************/
+#ifdef PROTOTYPES
+void print_double_array (double array_d[])
+#else
+void print_double_array (array_d)
+ double array_d[];
+#endif
+{
+
+ int index;
+
+ printf("array_d :\n");
+ printf("=========\n\n");
+ for (index = 0; index < 9; index++) {
+ printf("%f ", array_d[index]);
+ if ((index%8) == 0) printf("\n");
+ }
+ printf("\n\n");
+}
+
+/*****************************************************************
+ * PRINT_FLOAT_ARRAY:
+ * IN float array_f[] -- array of floats
+ *****************************************************************/
+#ifdef PROTOTYPES
+void print_float_array (float array_f[])
+#else
+void print_float_array ( array_f )
+ float array_f[];
+#endif
+{
+
+ int index;
+
+ printf("array_f :\n");
+ printf("=========\n\n");
+ for (index = 0; index < 15; index++) {
+ printf("%f ", array_f[index]);
+ if ((index%8) == 0) printf("\n");
+
+ }
+ printf("\n\n");
+}
+
+/*****************************************************************
+ * PRINT_INT_ARRAY:
+ * IN int array_i[] -- array of integers
+ *****************************************************************/
+#ifdef PROTOTYPES
+void print_int_array (int array_i[])
+#else
+void print_int_array ( array_i )
+ int array_i[];
+#endif
+{
+
+ int index;
+
+ printf("array_i :\n");
+ printf("=========\n\n");
+ for (index = 0; index < 50; index++) {
+ printf("%d ", array_i[index]);
+ if ((index%8) == 0) printf("\n");
+ }
+ printf("\n\n");
+
+}
+
+/*****************************************************************
+ * PRINT_ALL_ARRAYS:
+ * IN int array_i[] -- array of integers
+ * IN char array_c[] -- array of characters
+ * IN float array_f[] -- array of floats
+ * IN double array_d[] -- array of doubles
+ *****************************************************************/
+#ifdef PROTOTYPES
+void print_all_arrays(int array_i[], char array_c[], float array_f[], double array_d[])
+#else
+void print_all_arrays( array_i, array_c, array_f, array_d )
+ int array_i[];
+ char array_c[];
+ float array_f[];
+ double array_d[];
+#endif
+{
+ print_int_array(array_i);
+ print_char_array(array_c);
+ print_float_array(array_f);
+ print_double_array(array_d);
+}
+
+/*****************************************************************
+ * LOOP_COUNT :
+ * A do nothing function. Used to provide a point at which calls can be made.
+ *****************************************************************/
+void loop_count () {
+
+ int index;
+
+ for (index=0; index<4; index++);
+}
+
+/*****************************************************************
+ * COMPUTE_WITH_SMALL_STRUCTS :
+ * A do nothing function. Used to provide a point at which calls can be made.
+ * IN int seed
+ *****************************************************************/
+#ifdef PROTOTYPES
+void compute_with_small_structs (int seed)
+#else
+void compute_with_small_structs ( seed )
+ int seed;
+#endif
+{
+
+ struct small_rep_info_t array[4];
+ int index;
+
+ for (index = 0; index < 4; index++) {
+ array[index].value = index*seed;
+ array[index].head = (index+1)*seed;
+ }
+
+ for (index = 1; index < 4; index++) {
+ array[index].value = array[index].value + array[index-1].value;
+ array[index].head = array[index].head + array[index-1].head;
+ }
+}
+
+/*****************************************************************
+ * INIT_BIT_FLAGS :
+ * Initializes a bit_flags_t structure. Can call this function see
+ * the call command behavior when integer arguments do not fit into
+ * registers and must be placed on the stack.
+ * OUT struct bit_flags_t *bit_flags -- structure to be filled
+ * IN unsigned a -- 0 or 1
+ * IN unsigned b -- 0 or 1
+ * IN unsigned g -- 0 or 1
+ * IN unsigned d -- 0 or 1
+ * IN unsigned e -- 0 or 1
+ * IN unsigned o -- 0 or 1
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_bit_flags (struct bit_flags_t *bit_flags, unsigned a, unsigned b, unsigned g, unsigned d, unsigned e, unsigned o)
+#else
+void init_bit_flags ( bit_flags, a, b, g, d, e, o )
+struct bit_flags_t *bit_flags;
+unsigned a;
+unsigned b;
+unsigned g;
+unsigned d;
+unsigned e;
+unsigned o;
+#endif
+{
+
+ bit_flags->alpha = a;
+ bit_flags->beta = b;
+ bit_flags->gamma = g;
+ bit_flags->delta = d;
+ bit_flags->epsilon = e;
+ bit_flags->omega = o;
+}
+
+/*****************************************************************
+ * INIT_BIT_FLAGS_COMBO :
+ * Initializes a bit_flags_combo_t structure. Can call this function
+ * to see the call command behavior when integer and character arguments
+ * do not fit into registers and must be placed on the stack.
+ * OUT struct bit_flags_combo_t *bit_flags_combo -- structure to fill
+ * IN unsigned a -- 0 or 1
+ * IN unsigned b -- 0 or 1
+ * IN char ch1
+ * IN unsigned g -- 0 or 1
+ * IN unsigned d -- 0 or 1
+ * IN char ch2
+ * IN unsigned e -- 0 or 1
+ * IN unsigned o -- 0 or 1
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_bit_flags_combo (struct bit_flags_combo_t *bit_flags_combo, unsigned a, unsigned b, char ch1, unsigned g, unsigned d, char ch2, unsigned e, unsigned o)
+#else
+void init_bit_flags_combo ( bit_flags_combo, a, b, ch1, g, d, ch2, e, o )
+ struct bit_flags_combo_t *bit_flags_combo;
+ unsigned a;
+ unsigned b;
+ char ch1;
+ unsigned g;
+ unsigned d;
+ char ch2;
+ unsigned e;
+ unsigned o;
+#endif
+{
+
+ bit_flags_combo->alpha = a;
+ bit_flags_combo->beta = b;
+ bit_flags_combo->ch1 = ch1;
+ bit_flags_combo->gamma = g;
+ bit_flags_combo->delta = d;
+ bit_flags_combo->ch2 = ch2;
+ bit_flags_combo->epsilon = e;
+ bit_flags_combo->omega = o;
+}
+
+
+/*****************************************************************
+ * INIT_ONE_DOUBLE :
+ * OUT struct one_double_t *one_double -- structure to fill
+ * IN double init_val
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_one_double (struct one_double_t *one_double, double init_val)
+#else
+void init_one_double ( one_double, init_val )
+ struct one_double_t *one_double;
+ double init_val;
+#endif
+{
+
+ one_double->double1 = init_val;
+}
+
+/*****************************************************************
+ * INIT_TWO_FLOATS :
+ * OUT struct two_floats_t *two_floats -- structure to be filled
+ * IN float init_val1
+ * IN float init_val2
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_two_floats (struct two_floats_t *two_floats, float init_val1, float init_val2)
+#else
+void init_two_floats ( two_floats, init_val1, init_val2 )
+ struct two_floats_t *two_floats;
+ float init_val1;
+ float init_val2;
+#endif
+{
+ two_floats->float1 = init_val1;
+ two_floats->float2 = init_val2;
+}
+
+/*****************************************************************
+ * INIT_TWO_CHARS :
+ * OUT struct two_char_t *two_char -- structure to be filled
+ * IN char init_val1
+ * IN char init_val2
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_two_chars (struct two_char_t *two_char, char init_val1, char init_val2)
+#else
+void init_two_chars ( two_char, init_val1, init_val2 )
+ struct two_char_t *two_char;
+ char init_val1;
+ char init_val2;
+#endif
+{
+
+ two_char->ch1 = init_val1;
+ two_char->ch2 = init_val2;
+}
+
+/*****************************************************************
+ * INIT_THREE_CHARS :
+ * OUT struct three_char_t *three_char -- structure to be filled
+ * IN char init_val1
+ * IN char init_val2
+ * IN char init_val3
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_three_chars (struct three_char_t *three_char, char init_val1, char init_val2, char init_val3)
+#else
+void init_three_chars ( three_char, init_val1, init_val2, init_val3 )
+ struct three_char_t *three_char;
+ char init_val1;
+ char init_val2;
+ char init_val3;
+#endif
+{
+
+ three_char->ch1 = init_val1;
+ three_char->ch2 = init_val2;
+ three_char->ch3 = init_val3;
+}
+
+/*****************************************************************
+ * INIT_FIVE_CHARS :
+ * OUT struct five_char_t *five_char -- structure to be filled
+ * IN char init_val1
+ * IN char init_val2
+ * IN char init_val3
+ * IN char init_val4
+ * IN char init_val5
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_five_chars (struct five_char_t *five_char, char init_val1, char init_val2, char init_val3, char init_val4, char init_val5)
+#else
+void init_five_chars ( five_char, init_val1, init_val2, init_val3,init_val4,init_val5 )
+ struct five_char_t *five_char;
+ char init_val1;
+ char init_val2;
+ char init_val3;
+ char init_val4;
+ char init_val5;
+#endif
+{
+ five_char->ch1 = init_val1;
+ five_char->ch2 = init_val2;
+ five_char->ch3 = init_val3;
+ five_char->ch4 = init_val4;
+ five_char->ch5 = init_val5;
+}
+
+/*****************************************************************
+ * INIT_INT_CHAR_COMBO :
+ * OUT struct int_char_combo_t *combo -- structure to be filled
+ * IN int init_val1
+ * IN char init_val2
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_int_char_combo (struct int_char_combo_t *combo, int init_val1, char init_val2)
+#else
+void init_int_char_combo ( combo, init_val1, init_val2 )
+ struct int_char_combo_t *combo;
+ int init_val1;
+ char init_val2;
+#endif
+{
+
+ combo->int1 = init_val1;
+ combo->ch1 = init_val2;
+}
+
+/*****************************************************************
+ * INIT_STRUCT_REP :
+ * OUT struct small_rep_into_t *small_struct -- structure to be filled
+ * IN int seed
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_struct_rep(struct small_rep_info_t *small_struct, int seed)
+#else
+void init_struct_rep( small_struct, seed )
+ struct small_rep_info_t *small_struct;
+ int seed;
+#endif
+{
+
+ small_struct->value = 2 + (seed*2);
+ small_struct->head = 0;
+}
+
+/*****************************************************************
+ * INIT_SMALL_STRUCTS :
+ * Takes all the small structures as input and calls the appropriate
+ * initialization routine for each structure
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_small_structs (
+ struct small_rep_info_t *struct1,
+ struct small_rep_info_t *struct2,
+ struct small_rep_info_t *struct3,
+ struct small_rep_info_t *struct4,
+ struct bit_flags_t *flags,
+ struct bit_flags_combo_t *flags_combo,
+ struct three_char_t *three_char,
+ struct five_char_t *five_char,
+ struct int_char_combo_t *int_char_combo,
+ struct one_double_t *d1,
+ struct one_double_t *d2,
+ struct one_double_t *d3,
+ struct two_floats_t *f1,
+ struct two_floats_t *f2,
+ struct two_floats_t *f3)
+#else
+void init_small_structs (struct1, struct2, struct3,struct4,flags,flags_combo,
+three_char, five_char,int_char_combo, d1, d2,d3,f1,f2,f3)
+ struct small_rep_info_t *struct1;
+ struct small_rep_info_t *struct2;
+ struct small_rep_info_t *struct3;
+ struct small_rep_info_t *struct4;
+ struct bit_flags_t *flags;
+ struct bit_flags_combo_t *flags_combo;
+ struct three_char_t *three_char;
+ struct five_char_t *five_char;
+ struct int_char_combo_t *int_char_combo;
+ struct one_double_t *d1;
+ struct one_double_t *d2;
+ struct one_double_t *d3;
+ struct two_floats_t *f1;
+ struct two_floats_t *f2;
+ struct two_floats_t *f3;
+#endif
+{
+
+ init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
+ (unsigned)0, (unsigned)1, (unsigned)0 );
+ init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y',
+ (unsigned)1, (unsigned)0, 'n',
+ (unsigned)1, (unsigned)0 );
+ init_three_chars(three_char, 'a', 'b', 'c');
+ init_five_chars(five_char, 'l', 'm', 'n', 'o', 'p');
+ init_int_char_combo(int_char_combo, 123, 'z');
+ init_struct_rep(struct1, 2);
+ init_struct_rep(struct2, 4);
+ init_struct_rep(struct3, 5);
+ init_struct_rep(struct4, 6);
+ init_one_double ( d1, 10.5);
+ init_one_double ( d2, -3.375);
+ init_one_double ( d3, 675.09375);
+ init_two_floats ( f1, 45.234, 43.6);
+ init_two_floats ( f2, 78.01, 122.10);
+ init_two_floats ( f3, -1232.345, -199.21);
+}
+
+/*****************************************************************
+ * PRINT_TEN_DOUBLES :
+ * ?????????????????????????????
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_ten_doubles (
+ double d1,
+ double d2,
+ double d3,
+ double d4,
+ double d5,
+ double d6,
+ double d7,
+ double d8,
+ double d9,
+ double d10)
+#else
+void print_ten_doubles ( d1, d2, d3, d4, d5, d6, d7, d8, d9, d10 )
+ double d1;
+ double d2;
+ double d3;
+ double d4;
+ double d5;
+ double d6;
+ double d7;
+ double d8;
+ double d9;
+ double d10;
+#endif
+{
+
+ printf("Two Doubles : %f\t%f\n", d1, d2);
+ printf("Two Doubles : %f\t%f\n", d3, d4);
+ printf("Two Doubles : %f\t%f\n", d5, d6);
+ printf("Two Doubles : %f\t%f\n", d7, d8);
+ printf("Two Doubles : %f\t%f\n", d9, d10);
+}
+
+/*****************************************************************
+ * PRINT_BIT_FLAGS :
+ * IN struct bit_flags_t bit_flags
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_bit_flags (struct bit_flags_t bit_flags)
+#else
+void print_bit_flags ( bit_flags )
+struct bit_flags_t bit_flags;
+#endif
+{
+
+ if (bit_flags.alpha) printf("alpha\n");
+ if (bit_flags.beta) printf("beta\n");
+ if (bit_flags.gamma) printf("gamma\n");
+ if (bit_flags.delta) printf("delta\n");
+ if (bit_flags.epsilon) printf("epsilon\n");
+ if (bit_flags.omega) printf("omega\n");
+}
+
+/*****************************************************************
+ * PRINT_BIT_FLAGS_COMBO :
+ * IN struct bit_flags_combo_t bit_flags_combo
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo)
+#else
+void print_bit_flags_combo ( bit_flags_combo )
+ struct bit_flags_combo_t bit_flags_combo;
+#endif
+{
+
+ if (bit_flags_combo.alpha) printf("alpha\n");
+ if (bit_flags_combo.beta) printf("beta\n");
+ if (bit_flags_combo.gamma) printf("gamma\n");
+ if (bit_flags_combo.delta) printf("delta\n");
+ if (bit_flags_combo.epsilon) printf("epsilon\n");
+ if (bit_flags_combo.omega) printf("omega\n");
+ printf("ch1: %c\tch2: %c\n", bit_flags_combo.ch1, bit_flags_combo.ch2);
+}
+
+/*****************************************************************
+ * PRINT_ONE_DOUBLE :
+ * IN struct one_double_t one_double
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_one_double (struct one_double_t one_double)
+#else
+void print_one_double ( one_double )
+struct one_double_t one_double;
+#endif
+{
+
+ printf("Contents of one_double_t: \n\n");
+ printf("%f\n", one_double.double1);
+}
+
+/*****************************************************************
+ * PRINT_TWO_FLOATS :
+ * IN struct two_floats_t two_floats
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_two_floats (struct two_floats_t two_floats)
+#else
+void print_two_floats ( two_floats )
+struct two_floats_t two_floats;
+#endif
+{
+
+ printf("Contents of two_floats_t: \n\n");
+ printf("%f\t%f\n", two_floats.float1, two_floats.float2);
+}
+
+/*****************************************************************
+ * PRINT_TWO_CHARS :
+ * IN struct two_char_t two_char
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_two_chars (struct two_char_t two_char)
+#else
+void print_two_chars ( two_char )
+struct two_char_t two_char;
+#endif
+{
+
+ printf("Contents of two_char_t: \n\n");
+ printf("%c\t%c\n", two_char.ch1, two_char.ch2);
+}
+
+/*****************************************************************
+ * PRINT_THREE_CHARS :
+ * IN struct three_char_t three_char
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_three_chars (struct three_char_t three_char)
+#else
+void print_three_chars ( three_char )
+struct three_char_t three_char;
+#endif
+{
+
+ printf("Contents of three_char_t: \n\n");
+ printf("%c\t%c\t%c\n", three_char.ch1, three_char.ch2, three_char.ch3);
+}
+
+/*****************************************************************
+ * PRINT_FIVE_CHARS :
+ * IN struct five_char_t five_char
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_five_chars (struct five_char_t five_char)
+#else
+void print_five_chars ( five_char )
+struct five_char_t five_char;
+#endif
+{
+
+ printf("Contents of five_char_t: \n\n");
+ printf("%c\t%c\t%c\t%c\t%c\n", five_char.ch1, five_char.ch2,
+ five_char.ch3, five_char.ch4,
+ five_char.ch5);
+}
+
+/*****************************************************************
+ * PRINT_INT_CHAR_COMBO :
+ * IN struct int_char_combo_t int_char_combo
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_int_char_combo (struct int_char_combo_t int_char_combo)
+#else
+void print_int_char_combo ( int_char_combo )
+struct int_char_combo_t int_char_combo;
+#endif
+{
+
+ printf("Contents of int_char_combo_t: \n\n");
+ printf("%d\t%c\n", int_char_combo.int1, int_char_combo.ch1);
+}
+
+/*****************************************************************
+ * PRINT_STRUCT_REP :
+ * The last parameter must go onto the stack rather than into a register.
+ * This is a good function to call to test small structures.
+ * IN struct small_rep_info_t struct1
+ * IN struct small_rep_info_t struct2
+ * IN struct small_rep_info_t struct3
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_struct_rep(
+ struct small_rep_info_t struct1,
+ struct small_rep_info_t struct2,
+ struct small_rep_info_t struct3)
+#else
+void print_struct_rep( struct1, struct2, struct3)
+ struct small_rep_info_t struct1;
+ struct small_rep_info_t struct2;
+ struct small_rep_info_t struct3;
+#endif
+{
+
+
+ printf("Contents of struct1: \n\n");
+ printf("%10d%10d\n", struct1.value, struct1.head);
+ printf("Contents of struct2: \n\n");
+ printf("%10d%10d\n", struct2.value, struct2.head);
+ printf("Contents of struct3: \n\n");
+ printf("%10d%10d\n", struct3.value, struct3.head);
+
+}
+
+/*****************************************************************
+ * SUM_STRUCT_PRINT :
+ * The last two parameters must go onto the stack rather than into a register.
+ * This is a good function to call to test small structures.
+ * IN struct small_rep_info_t struct1
+ * IN struct small_rep_info_t struct2
+ * IN struct small_rep_info_t struct3
+ * IN struct small_rep_info_t struct4
+ ****************************************************************/
+#ifdef PROTOTYPES
+void sum_struct_print (
+ int seed,
+ struct small_rep_info_t struct1,
+ struct small_rep_info_t struct2,
+ struct small_rep_info_t struct3,
+ struct small_rep_info_t struct4)
+#else
+void sum_struct_print ( seed, struct1, struct2, struct3, struct4)
+ int seed;
+ struct small_rep_info_t struct1;
+ struct small_rep_info_t struct2;
+ struct small_rep_info_t struct3;
+ struct small_rep_info_t struct4;
+#endif
+{
+ int sum;
+
+ printf("Sum of the 4 struct values and seed : \n\n");
+ sum = seed + struct1.value + struct2.value + struct3.value + struct4.value;
+ printf("%10d\n", sum);
+}
+
+/*****************************************************************
+ * PRINT_SMALL_STRUCTS :
+ * This is a good function to call to test small structures.
+ * All of the small structures of odd sizes (40 bits, 8bits, etc.)
+ * are pushed onto the stack.
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_small_structs (
+ struct small_rep_info_t struct1,
+ struct small_rep_info_t struct2,
+ struct small_rep_info_t struct3,
+ struct small_rep_info_t struct4,
+ struct bit_flags_t flags,
+ struct bit_flags_combo_t flags_combo,
+ struct three_char_t three_char,
+ struct five_char_t five_char,
+ struct int_char_combo_t int_char_combo,
+ struct one_double_t d1,
+ struct one_double_t d2,
+ struct one_double_t d3,
+ struct two_floats_t f1,
+ struct two_floats_t f2,
+ struct two_floats_t f3)
+#else
+void print_small_structs ( struct1, struct2, struct3, struct4, flags,
+flags_combo, three_char, five_char, int_char_combo, d1, d2,d3,f1,f2,f3)
+ struct small_rep_info_t struct1;
+ struct small_rep_info_t struct2;
+ struct small_rep_info_t struct3;
+ struct small_rep_info_t struct4;
+ struct bit_flags_t flags;
+ struct bit_flags_combo_t flags_combo;
+ struct three_char_t three_char;
+ struct five_char_t five_char;
+ struct int_char_combo_t int_char_combo;
+ struct one_double_t d1;
+ struct one_double_t d2;
+ struct one_double_t d3;
+ struct two_floats_t f1;
+ struct two_floats_t f2;
+ struct two_floats_t f3;
+#endif
+{
+ print_bit_flags(flags);
+ print_bit_flags_combo(flags_combo);
+ print_three_chars(three_char);
+ print_five_chars(five_char);
+ print_int_char_combo(int_char_combo);
+ sum_struct_print(10, struct1, struct2, struct3, struct4);
+ print_struct_rep(struct1, struct2, struct3);
+ print_one_double(d1);
+ print_one_double(d2);
+ print_one_double(d3);
+ print_two_floats(f1);
+ print_two_floats(f2);
+ print_two_floats(f3);
+}
+
+/*****************************************************************
+ * PRINT_LONG_ARG_LIST :
+ * This is a good function to call to test small structures.
+ * The first two parameters ( the doubles ) go into registers. The
+ * remaining arguments are pushed onto the stack. Depending on where
+ * print_long_arg_list is called from, the size of the argument list
+ * may force more space to be pushed onto the stack as part of the callers
+ * frame.
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_long_arg_list (
+ double a,
+ double b,
+ int c,
+ int d,
+ int e,
+ int f,
+ struct small_rep_info_t struct1,
+ struct small_rep_info_t struct2,
+ struct small_rep_info_t struct3,
+ struct small_rep_info_t struct4,
+ struct bit_flags_t flags,
+ struct bit_flags_combo_t flags_combo,
+ struct three_char_t three_char,
+ struct five_char_t five_char,
+ struct int_char_combo_t int_char_combo,
+ struct one_double_t d1,
+ struct one_double_t d2,
+ struct one_double_t d3,
+ struct two_floats_t f1,
+ struct two_floats_t f2,
+ struct two_floats_t f3)
+#else
+void print_long_arg_list ( a, b, c, d, e, f, struct1, struct2, struct3,
+struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1,d2,d3,
+f1, f2, f3 )
+ double a;
+ double b;
+ int c;
+ int d;
+ int e;
+ int f;
+ struct small_rep_info_t struct1;
+ struct small_rep_info_t struct2;
+ struct small_rep_info_t struct3;
+ struct small_rep_info_t struct4;
+ struct bit_flags_t flags;
+ struct bit_flags_combo_t flags_combo;
+ struct three_char_t three_char;
+ struct five_char_t five_char;
+ struct int_char_combo_t int_char_combo;
+ struct one_double_t d1;
+ struct one_double_t d2;
+ struct one_double_t d3;
+ struct two_floats_t f1;
+ struct two_floats_t f2;
+ struct two_floats_t f3;
+#endif
+{
+ printf("double : %f\n", a);
+ printf("double : %f\n", b);
+ printf("int : %d\n", c);
+ printf("int : %d\n", d);
+ printf("int : %d\n", e);
+ printf("int : %d\n", f);
+ print_small_structs( struct1, struct2, struct3, struct4, flags, flags_combo,
+ three_char, five_char, int_char_combo, d1, d2, d3,
+ f1, f2, f3);
+}
+
+
+#ifdef PROTOTYPES
+void print_one_large_struct (struct array_rep_info_t linked_list1)
+#else
+void print_one_large_struct( linked_list1 )
+ struct array_rep_info_t linked_list1;
+#endif
+{
+
+ /* printf("Contents of linked list1: \n\n");
+ printf("Element Value | Index of Next Element\n");
+ printf("-------------------------------------\n");
+ printf(" | \n");*/
+ /*for (index = 0; index < 10; index++) {*/
+
+ printf("%10d%10d\n", linked_list1.values[0],
+ linked_list1.next_index[0]);
+ /*}*/
+}
+
+/*****************************************************************
+ * PRINT_ARRAY_REP :
+ * The three structure parameters should fit into registers.
+ * IN struct array_rep_info_t linked_list1
+ * IN struct array_rep_info_t linked_list2
+ * IN struct array_rep_info_t linked_list3
+ ****************************************************************/
+#ifdef PROTOTYPES
+void print_array_rep(
+ struct array_rep_info_t linked_list1,
+ struct array_rep_info_t linked_list2,
+ struct array_rep_info_t linked_list3)
+#else
+void print_array_rep( linked_list1, linked_list2, linked_list3 )
+ struct array_rep_info_t linked_list1;
+ struct array_rep_info_t linked_list2;
+ struct array_rep_info_t linked_list3;
+#endif
+{
+
+ int index;
+
+ printf("Contents of linked list1: \n\n");
+ printf("Element Value | Index of Next Element\n");
+ printf("-------------------------------------\n");
+ printf(" | \n");
+ for (index = 0; index < 10; index++) {
+
+ printf("%10d%10d\n", linked_list1.values[index],
+ linked_list1.next_index[index]);
+ }
+
+ printf("Contents of linked list2: \n\n");
+ printf("Element Value | Index of Next Element\n");
+ printf("-------------------------------------\n");
+ printf(" | \n");
+ for (index = 0; index < 10; index++) {
+
+ printf("%10d%10d\n", linked_list2.values[index],
+ linked_list2.next_index[index]);
+ }
+
+ printf("Contents of linked list3: \n\n");
+ printf("Element Value | Index of Next Element\n");
+ printf("-------------------------------------\n");
+ printf(" | \n");
+ for (index = 0; index < 10; index++) {
+
+ printf("%10d%10d\n", linked_list3.values[index],
+ linked_list3.next_index[index]);
+ }
+
+}
+
+/*****************************************************************
+ * SUM_ARRAY_PRINT :
+ * The last structure parameter must be pushed onto the stack
+ * IN int seed
+ * IN struct array_rep_info_t linked_list1
+ * IN struct array_rep_info_t linked_list2
+ * IN struct array_rep_info_t linked_list3
+ * IN struct array_rep_info_t linked_list4
+ ****************************************************************/
+#ifdef PROTOTYPES
+void sum_array_print (
+ int seed,
+ struct array_rep_info_t linked_list1,
+ struct array_rep_info_t linked_list2,
+ struct array_rep_info_t linked_list3,
+ struct array_rep_info_t linked_list4)
+#else
+void sum_array_print ( seed, linked_list1, linked_list2, linked_list3,linked_list4)
+ int seed;
+ struct array_rep_info_t linked_list1;
+ struct array_rep_info_t linked_list2;
+ struct array_rep_info_t linked_list3;
+ struct array_rep_info_t linked_list4;
+#endif
+{
+ int index;
+ int sum;
+
+ printf("Sum of 4 arrays, by element (add in seed as well): \n\n");
+ printf("Seed: %d\n", seed);
+ printf("Element Index | Sum \n");
+ printf("-------------------------\n");
+ printf(" | \n");
+
+ for (index = 0; index < 10; index++) {
+
+ sum = seed + linked_list1.values[index] + linked_list2.values[index] +
+ linked_list3.values[index] + linked_list4.values[index];
+ printf("%10d%10d\n", index, sum);
+ }
+}
+
+/*****************************************************************
+ * INIT_ARRAY_REP :
+ * IN struct array_rep_info_t *linked_list
+ * IN int seed
+ ****************************************************************/
+#ifdef PROTOTYPES
+void init_array_rep(
+ struct array_rep_info_t *linked_list,
+ int seed)
+#else
+void init_array_rep( linked_list, seed )
+ struct array_rep_info_t *linked_list;
+ int seed;
+#endif
+{
+
+ int index;
+
+ for (index = 0; index < 10; index++) {
+
+ linked_list->values[index] = (2*index) + (seed*2);
+ linked_list->next_index[index] = index + 1;
+ }
+ linked_list->head = 0;
+}
+
+
+int main () {
+
+ /* variables for array and enumerated type testing
+ */
+ static char char_array[121];
+ static double double_array[9];
+ static float float_array[15];
+ static int integer_array[50];
+ static int index;
+ static id_int student_id = 23;
+ static colors my_shirt = YELLOW;
+
+ /* variables for large structure testing
+ */
+ static int number = 10;
+ static struct array_rep_info_t *list1;
+ static struct array_rep_info_t *list2;
+ static struct array_rep_info_t *list3;
+ static struct array_rep_info_t *list4;
+
+ /* variables for testing a very long argument list
+ */
+ static double a;
+ static double b;
+ static int c;
+ static int d;
+ static int e;
+ static int f;
+
+ /* variables for testing a small structures and a very long argument list
+ */
+ static struct small_rep_info_t *struct1;
+ static struct small_rep_info_t *struct2;
+ static struct small_rep_info_t *struct3;
+ static struct small_rep_info_t *struct4;
+ static struct bit_flags_t *flags;
+ static struct bit_flags_combo_t *flags_combo;
+ static struct three_char_t *three_char;
+ static struct five_char_t *five_char;
+ static struct int_char_combo_t *int_char_combo;
+ static struct one_double_t *d1;
+ static struct one_double_t *d2;
+ static struct one_double_t *d3;
+ static struct two_floats_t *f1;
+ static struct two_floats_t *f2;
+ static struct two_floats_t *f3;
+
+ /* Initialize arrays
+ */
+ for (index = 0; index < 120; index++) {
+ if ((index%2) == 0) char_array[index] = 'Z';
+ else char_array[index] = 'a';
+ }
+ char_array[120] = '\0';
+
+ for (index = 0; index < 9; index++) {
+ double_array[index] = index*23.4567;
+ }
+
+ for (index = 0; index < 15; index++) {
+ float_array[index] = index/7.02;
+ }
+
+ for (index = 0; index < 50; index++) {
+ integer_array[index] = -index;
+ }
+
+ /* Print arrays
+ */
+ print_char_array(char_array);
+ print_double_array(double_array);
+ print_float_array(float_array);
+ print_student_id_shirt_color(student_id, my_shirt);
+ print_int_array(integer_array);
+ print_all_arrays(integer_array, char_array, float_array, double_array);
+
+ /* Allocate space for large structures
+ */
+ list1 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t));
+ list2 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t));
+ list3 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t));
+ list4 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t));
+
+ /* Initialize large structures
+ */
+ init_array_rep(list1, 2);
+ init_array_rep(list2, 4);
+ init_array_rep(list3, 5);
+ init_array_rep(list4, 10);
+ printf("HELLO WORLD\n");
+ printf("BYE BYE FOR NOW\n");
+ printf("VERY GREEN GRASS\n");
+
+ /* Print large structures
+ */
+ sum_array_print(10, *list1, *list2, *list3, *list4);
+ print_array_rep(*list1, *list2, *list3);
+ print_one_large_struct(*list1);
+
+ /* Allocate space for small structures
+ */
+ struct1 = (struct small_rep_info_t *)malloc(sizeof(struct small_rep_info_t));
+ struct2 = (struct small_rep_info_t *)malloc(sizeof(struct small_rep_info_t));
+ struct3 = (struct small_rep_info_t *)malloc(sizeof(struct small_rep_info_t));
+ struct4 = (struct small_rep_info_t *)malloc(sizeof(struct small_rep_info_t));
+ flags = (struct bit_flags_t *)malloc(sizeof(struct bit_flags_t));
+ flags_combo = (struct bit_flags_combo_t *)malloc(sizeof(struct bit_flags_combo_t));
+ three_char = (struct three_char_t *)malloc(sizeof(struct three_char_t));
+ five_char = (struct five_char_t *)malloc(sizeof(struct five_char_t));
+ int_char_combo = (struct int_char_combo_t *)malloc(sizeof(struct int_char_combo_t));
+
+ d1 = (struct one_double_t *)malloc(sizeof(struct one_double_t));
+ d2 = (struct one_double_t *)malloc(sizeof(struct one_double_t));
+ d3 = (struct one_double_t *)malloc(sizeof(struct one_double_t));
+
+ f1 = (struct two_floats_t *)malloc(sizeof(struct two_floats_t));
+ f2 = (struct two_floats_t *)malloc(sizeof(struct two_floats_t));
+ f3 = (struct two_floats_t *)malloc(sizeof(struct two_floats_t));
+
+ /* Initialize small structures
+ */
+ init_small_structs ( struct1, struct2, struct3, struct4, flags,
+ flags_combo, three_char, five_char, int_char_combo,
+ d1, d2, d3, f1, f2, f3);
+
+ /* Print small structures
+ */
+ print_small_structs ( *struct1, *struct2, *struct3, *struct4, *flags,
+ *flags_combo, *three_char, *five_char, *int_char_combo,
+ *d1, *d2, *d3, *f1, *f2, *f3);
+
+ /* Print a very long arg list
+ */
+ a = 22.25;
+ b = 33.375;
+ c = 0;
+ d = -25;
+ e = 100;
+ f = 2345;
+
+ print_long_arg_list ( a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4,
+ *flags, *flags_combo, *three_char, *five_char, *int_char_combo,
+ *d1, *d2, *d3, *f1, *f2, *f3);
+
+ /* Initialize small structures
+ */
+ init_one_double ( d1, 1.11111);
+ init_one_double ( d2, -345.34);
+ init_one_double ( d3, 546464.2);
+ init_two_floats ( f1, 0.234, 453.1);
+ init_two_floats ( f2, 78.345, 23.09);
+ init_two_floats ( f3, -2.345, 1.0);
+ init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
+ (unsigned)0, (unsigned)1, (unsigned)0 );
+ init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y',
+ (unsigned)1, (unsigned)0, 'n',
+ (unsigned)1, (unsigned)0 );
+ init_three_chars(three_char, 'x', 'y', 'z');
+ init_five_chars(five_char, 'h', 'e', 'l', 'l', 'o');
+ init_int_char_combo(int_char_combo, 13, '!');
+ init_struct_rep(struct1, 10);
+ init_struct_rep(struct2, 20);
+ init_struct_rep(struct3, 30);
+ init_struct_rep(struct4, 40);
+
+ compute_with_small_structs(35);
+ loop_count();
+ printf("HELLO WORLD\n");
+ printf("BYE BYE FOR NOW\n");
+ printf("VERY GREEN GRASS\n");
+
+ /* Print small structures
+ */
+ print_one_double(*d1);
+ print_one_double(*d2);
+ print_one_double(*d3);
+ print_two_floats(*f1);
+ print_two_floats(*f2);
+ print_two_floats(*f3);
+ print_bit_flags(*flags);
+ print_bit_flags_combo(*flags_combo);
+ print_three_chars(*three_char);
+ print_five_chars(*five_char);
+ print_int_char_combo(*int_char_combo);
+ sum_struct_print(10, *struct1, *struct2, *struct3, *struct4);
+ print_struct_rep(*struct1, *struct2, *struct3);
+
+ return 0;
+}
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.base/call-ar-st.exp b/gdb/testsuite/gdb.base/call-ar-st.exp
new file mode 100644
index 00000000000..d9bb350f8d1
--- /dev/null
+++ b/gdb/testsuite/gdb.base/call-ar-st.exp
@@ -0,0 +1,705 @@
+# Copyright 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "call-ar-st"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Test depends on printf, which the sparclet stub doesn't support.
+if { [istarget "sparclet-*-*"] } {
+ return 0;
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+# Some targets can't call functions, so don't even bother with this
+# test.
+if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ continue
+}
+
+set oldtimeout $timeout
+set timeout [expr "$timeout + 60"]
+
+# Set the current language to C. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_c {} {
+ global gdb_prompt
+
+ send_gdb "set language c\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language c (timeout)" ; return 0; }
+ }
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"c\".*$gdb_prompt $" {
+ pass "set language to \"c\""
+ return 1
+ }
+ -re ".*$gdb_prompt $" {
+ fail "setting language to \"c\""
+ return 0
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return 0
+ }
+ }
+}
+
+source ${binfile}.ci
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+#go -until 1209
+gdb_test "tbreak 1209" \
+ "Breakpoint \[0-9\]+.*file.*$srcfile, line 1209.*" \
+ "tbreakpoint line 1209"
+
+gdb_test continue \
+"Continuing\\..*main \\(\\) at.*$srcfile:1209.*" \
+"run until breakpoint set at a line"
+
+
+#call print_double_array(double_array)
+if {![gdb_skip_float_test "print print_double_array(double_array)"] && \
+ ![gdb_skip_stdio_test "print print_double_array(double_array)"] } {
+ send_gdb "print print_double_array(double_array)\n"
+ gdb_expect_list "print print_double_array(double_array)" ".*$gdb_prompt $" {
+ "\[ \t\r\n\]+array_d :"
+ "\[ \t\r\n\]+========="
+ "\[ \t\r\n\]+0.000000"
+ "\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
+ "\[ \t\r\n\]+"
+ }
+}
+
+#call print_char_array(char_array)
+
+if ![gdb_skip_stdio_test "print_char_array(char_array)"] {
+ send_gdb "print print_char_array(char_array)\n"
+ gdb_expect_list "print print_char_array(char_array)" ".*$gdb_prompt $" {
+ "\[ \t\r\n\]+array_c :"
+ "\[ \t\r\n\]+========="
+ "\[ \t\r\n\]+\[ \t\r\n\]+Z"
+ "\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ"
+ "\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ"
+ "\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa\[ \t\r\n\]+\[ \t\r\n\]+"
+ }
+}
+
+
+
+
+#go -until 1216
+gdb_test "tbreak 1216" \
+"Breakpoint.*file.*$srcfile, line 1216.*" \
+"tbreakpoint line 1216"
+
+if ![gdb_skip_stdio_test "continue to 1216"] {
+ send_gdb "continue\n"
+ gdb_expect_list "continue to 1216" ".*$gdb_prompt $" {
+ "\[ \t\r\n\]+array_c :"
+ "\[ \t\r\n\]+========="
+ "\[ \t\r\n\]+\[ \t\r\n\]+Z"
+ "\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ"
+ "\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ"
+ "\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa"
+ "\[ \t\r\n\]+main.*at.*:1216"
+ "\[ \t\r\n\]+1216.*print_double_array\\(double_array\\)"
+ }
+} else {
+ gdb_test "continue" "" ""
+}
+
+# I am disabling this test, because it takes too long. I verified by
+# hand that it works, feel free to check for yourself.
+#call print_all_arrays(integer_array, char_array, float_array, double_array)
+#send_gdb "print print_all_arrays(integer_array, char_array, float_array, double_array)\n"
+#gdb_expect {
+# -re ".*array_i :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+0\[ \t\r\n\]+-1 -2 -3 -4 -5 -6 -7 -8\[ \t\r\n\]+-9 -10 -11 -12 -13 -14 -15 -16\[ \t\r\n\]+-17 -18 -19 -20 -21 -22 -23 -24\[ \t\r\n\]+-25 -26 -27 -28 -29 -30 -31 -32\[ \t\r\n\]+-33 -34 -35 -36 -37 -38 -39 -40\[ \t\r\n\]+-41 -42 -43 -44 -45 -46 -47 -48\[ \t\r\n\]+-49\[ \t\r\n\]+\[ \t\r\n\]+array_c :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+Z\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZ\[ \t\r\n\]+aZaZaZaZaZaZaZaZaZa\[ \t\r\n\]+\[ \t\r\n\]+array_f :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+0.000000\[ \t\r\n\]+0.142450 0.284900 0.427350 0.569801 0.712251 0.854701 0.997151 1.139601\[ \t\r\n\]+1.282051 1.424501 1.566952 1.709402 1.851852 1.994302\[ \t\r\n\]+\[ \t\r\n\]+array_d :\[ \t\r\n\]+=========\[ \t\r\n\]+\[ \t\r\n\]+0.000000\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600\[ \t\r\n\]+211.110300 234.567000 258.023700 281.480400 304.937100 328.393800 351.850500 375.307200\[ \t\r\n\]+398.763900 422.220600 445.677300 469.134000 492.590700 516.047400 539.504100 562.960800\[ \t\r\n\]+586.41750 609.874200 633.330900 656.787600 680.244300 703.701000 727.157700 750.614400\[ \t\r\n\]+774.071100 797.527800 820.984500 844.441200 867.897900 891.354600 914.811300 938.268000\[ \t\r\n\]+961.724700 985.181400 1008.638100 1032.094800 1055.551500 1079.008200 1102.464900 1125.921600\[ \t\r\n\]+1149.378300 1172.835000 1196.291700 1219.748400 1243.205100 1266.661800 1290.118500 1313.575200\[ \t\r\n\]+1337.031900 1360.488600 1383.945300 1407.402000 1430.858700 1454.315400 1477.772100 1501.228800\[ \t\r\n\]+1524.685500 1548.142200 1571.598900 1595.055600 1618.512300 1641.969000 1665.425700 1688.882400\[ \t\r\n\]+1712.339100 1735.795800 1759.252500 1782.709200 1806.165900 1829.622600 1853.079300 1876.536000\[ \t\r\n\]+1899.992700 1923.449400 1946.906100 1970.362800 1993.819500 2017.276200 2040.732900 2064.189600\[ \t\r\n\]+2087.646300 2111.103000 2134.559700 2158.016400 2181.473100 2204.929800 2228.386500 2251.843200\[ \t\r\n\]+2275.299900 2298.756600 2322.213300.*$gdb_prompt $" {
+# pass "print print_all_arrays(integer_array, char_array, float_array, double_array)"
+# }
+# -re ".*$gdb_prompt $" { fail "print print_all_arrays(integer_array, char_array, float_array, double_array)" }
+# timeout { fail "(timeout) print print_all_arrays(integer_array, char_array, float_array, double_array)" }
+# }
+
+#set timeout $oldtimeout
+#go -until 1220
+gdb_test "tbreak 1220" \
+ "Breakpoint.* file .*$srcfile, line 1220.*" \
+ "tbreakpoint line 1220"
+
+if {![gdb_skip_float_test "continuing to breakpoint 1220"] && \
+ ![gdb_skip_stdio_test "continuing to breakpoint 1220"] } {
+ send_gdb "continue\n"
+ gdb_expect_list "continuing to breakpoint 1220" ".*$gdb_prompt $" {
+ "Continuing\\."
+ "\[ \t\r\n\]+array_d :"
+ "\[ \t\r\n\]+========="
+ "\[ \t\r\n\]+0.000000"
+ "\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
+ "\[ \t\r\n\]+"
+ ".*array_f :"
+ ".*student id :\[\t \]+.*YELLOW"
+ ".*array_i :"
+ ".*main \\(\\) at .*call-ar-st.c:1220\[ \t\r\n\]+.*print_all_arrays\\(integer_array, char_array, float_array, double_array\\)."
+ }
+} else {
+ gdb_test "continue" "" ""
+}
+
+#step
+send_gdb "step\n"
+gdb_expect {
+ -re "print_all_arrays \\(array_i=, array_c=.ZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZaZa., array_f=, array_d=\\) at .*call-ar-st.c:306\[ \t\r\n\]+306.*print_int_array\\(array_i\\);.*$gdb_prompt $" {pass "step inside print_all_arrays"}
+ -re ".*$gdb_prompt $" { fail "step inside print_all_arrays" }
+ timeout { fail "step inside print_all_arrays (timeout)" }
+}
+
+
+#step -over
+if ![gdb_skip_stdio_test "next over print_int_array in print_all_arrays"] {
+ send_gdb "next\n"
+ gdb_expect {
+ -re "array_i :.*307.*print_char_array.*$gdb_prompt $" {
+ pass "next over print_int_array in print-all_arrays"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "next over print_int_array in print-all_arrays"
+ }
+ timeout {
+ fail "next over print_int_array in print-all_arrays (timeout)"
+ }
+ }
+} else {
+ gdb_test "next" "" ""
+}
+
+#call print_double_array(array_d)
+if {![gdb_skip_float_test "print print_double_array(array_d)"] && \
+ ![gdb_skip_stdio_test "print print_double_array(array_d)"] } {
+ send_gdb "print print_double_array(array_d)\n"
+ gdb_expect_list "print print_double_array(array_d)" ".*$gdb_prompt $" {
+ "array_d :"
+ "\[ \t\r\n\]+========="
+ "\[ \t\r\n\]+\[ \t\r\n\]+0.000000"
+ "\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
+ "\[ \t\r\n\]+"
+ }
+}
+
+#go -until 1236
+gdb_test "tbreak 1236" \
+"Breakpoint.* file .*$srcfile, line 1236.*" \
+"tbreakpoint line 1236"
+
+if {![gdb_skip_float_test "continuing to 1236"] && \
+ ![gdb_skip_stdio_test "continuing to 1236"] } {
+ send_gdb "continue\n"
+ gdb_expect_list "continuing to 1236" ".*$gdb_prompt $" {
+ "Continuing\\..*array_c"
+ ".*array_f"
+ "\[ \t\r\n\]+array_d :"
+ "\[ \t\r\n\]+========="
+ "\[ \t\r\n\]+0.000000"
+ "\[ \t\r\n\]+23.456700 46.913400 70.370100 93.826800 117.283500 140.740200 164.196900 187.653600"
+ "\[ \t\r\n\]+.*HELLO WORLD.*main \\(\\) at .*call-ar-st.c:1236.*printf\\(.BYE BYE FOR NOW.n.\\)."
+ }
+} else {
+ gdb_test "continue" "" ""
+}
+
+
+#call sum_array_print(10, *list1, *list2, *list3, *list4)
+
+if ![gdb_skip_stdio_test "print sum_array_print(...)"] {
+ send_gdb "print sum_array_print(10, *list1, *list2, *list3, *list4)\n"
+ gdb_expect {
+ -re ".*Sum of 4 arrays, by element \\(add in seed as well\\):\[ \t\r\n\]+Seed: 10\[ \t\r\n\]+Element Index . Sum\[ \t\r\n\]+-------------------------\[ \t\r\n\]+.*\[ \t\]+0\[ \t\]+52\[ \t\r\n\]+1\[ \t\]+60\[ \t\r\n\]+2\[ \t\]+68\[ \t\r\n\]+3\[ \t\]+76\[ \t\r\n\]+4\[ \t\]+84\[ \t\r\n\]+5\[ \t\]+92\[ \t\r\n\]+6\[ \t\]+100\[ \t\r\n\]+7\[ \t\]+108\[ \t\r\n\]+8\[ \t\]+116\[ \t\r\n\]+9\[ \t\]+124\[ \t\r\n\]+.*$gdb_prompt $" {
+ pass "print sum_array_print(10, *list1, *list2, *list3, *list4)"
+ }
+ -re ".*$gdb_prompt $" { fail "print sum_array_print(10, *list1, *list2, *list3, *list4)" }
+ timeout { fail "(timeout) print sum_array_print(10, *list1, *list2, *list3, *list4)" }
+ }
+}
+
+#step over
+if ![gdb_skip_stdio_test "next to 1237"] {
+ send_gdb "next\n"
+ gdb_expect {
+ -re ".*BYE BYE FOR NOW.*1237.*printf\\(.VERY GREEN GRASS.n.\\);.*$gdb_prompt $" { pass "next to 1237"}
+ -re ".*$gdb_prompt $" { fail "next to 1237" }
+ timeout { fail "next to 1237(timeout)" }
+ }
+} else {
+ gdb_test "next" "" ""
+}
+
+#call print_array_rep(\*list1, \*list2, \*list3)
+
+if ![gdb_skip_stdio_test "print print_array_rep(...)"] {
+ send_gdb "print print_array_rep(\*list1, \*list2, \*list3)\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ pass "print print_array_rep(*list1, *list2, *list3)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "print print_array_rep(*list1, *list2, *list3)"
+ }
+ timeout {
+ fail "(timeout) print print_array_rep(*list1, *list2, *list3)"
+ }
+ }
+}
+
+#go -until 1241
+gdb_test "tbreak 1241" \
+ "Breakpoint..* file .*$srcfile, line 1241.*" \
+ "tbreakpoint line 1241"
+
+send_gdb "continue\n"
+gdb_expect {
+ -re ".*main \\(\\) at .*call-ar-st.c:1241\r\n1241\[\t \]+sum_array_print\\(10, \\*list1, \\*list2, \\*list3, \\*list4\\);.*$gdb_prompt $" {
+ pass "continue to 1241"}
+ -re ".*$gdb_prompt $" { fail "continue to 1241"}
+ timeout { fail "(timeout) continue to 1241"}
+}
+
+
+
+# Run into sum_array_print, and verify that the arguments were passed
+# accurately.
+#
+# Note that we shouldn't use a `step' here to get into
+# sum_array_print; GCC may emit calls to memcpy to put the arguments
+# in the right place, and a step may end up in memcpy instead. This
+# may itself be a bug, but it's not the one we're trying to catch
+# here. I've added something to step-test.exp for this.
+gdb_test "break sum_array_print" \
+ ".*Breakpoint ${decimal}: file .*call-ar-st.c, line.*" \
+ "set breakpoint in sum_array_print"
+gdb_test "continue" \
+ ".*Breakpoint ${decimal}, sum_array_print \\(seed=10, linked_list1=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .4, 6, 8, 10, 12, 14, 16, 18, 20, 22., head = 0., linked_list2=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .8, 10, 12, 14, 16, 18, 20, 22, 24, 26., head = 0., linked_list3=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .10, 12, 14, 16, 18, 20, 22, 24, 26, 28., head = 0., linked_list4=.next_index = .1, 2, 3, 4, 5, 6, 7, 8, 9, 10., values = .20, 22, 24, 26, 28, 30, 32, 34, 36, 38., head = 0.\\) at .*call-ar-st.c:1105\[ \t\n\r\]+1105.*printf\\(.Sum of 4 arrays, by element \\(add in seed as well\\).*\\);.*" \
+ "check args of sum_array_print"
+
+#call print_array_rep(linked_list1, linked_list2, linked_list3)
+# this calls works from gdb without gdb_expect. But it does seem to hang
+#from within gdb_expect.
+#I comment this out
+#send_gdb "print print_array_rep(linked_list1, linked_list2, linked_list3)\n"
+#gdb_expect {
+# -re ".*Contents of linked list1:\[ \t\n\r\]+Element Value . Index of Next Element\[ \t\n\r\]+-------------------------------------\[ \t\n\r\]+.*\[ \t\n\r\]+.*4.*1\[ \t\n\r\]+.*6.*2\[ \t\n\r\]+.*8.*3\[ \t\n\r\]+.*10.*4\[ \t\n\r\]+.*12.*5\[ \t\n\r\]+.*14.*6\[ \t\n\r\]+.*16.*7\[ \t\n\r\]+.*18.*8\[ \t\n\r\]+.*20.*9\[ \t\n\r\]+.*22.*10\[ \t\n\r\]+Contents of linked list2:\[ \t\n\r\]+Element Value | Index of Next Element\[ \t\n\r\]+-------------------------------------\[ \t\n\r\]+.*\[ \t\n\r\]+.*8.*1\[ \t\n\r\]+.*10.*2\[ \t\n\r\]+.*12.*3\[ \t\n\r\]+.*14.*4\[ \t\n\r\]+.*16.*5\[ \t\n\r\]+.*18.*6\[ \t\n\r\]+.*20.*7\[ \t\n\r\]+.*22.*8\[ \t\n\r\]+.*24.*9\[ \t\n\r\]+.*26.*10\[ \t\n\r\]+Contents of linked list3:\[ \t\n\r\]+Element Value | Index of Next Element\[ \t\n\r\]+-------------------------------------\[ \t\n\r\]+.*\[ \t\n\r\]+.*10.*1\[ \t\n\r\]+.*12.*2\[ \t\n\r\]+.*14.*3\[ \t\n\r\]+.*16.*4\[ \t\n\r\]+.*18.*5\[ \t\n\r\]+.*20.*6\[ \t\n\r\]+.*22.*7\[ \t\n\r\]+.*24.*8\[ \t\n\r\]+.*26.*9\[ \t\n\r\]+.*28.*10\[ \t\n\r\]+.*$gdb_prompt $" {
+# pass "print print_array_rep(linked_list1, linked_list2, linked_list3)"
+# }
+# -re ".*$gdb_prompt $" { fail "print print_array_rep(linked_list1, linked_list2, linked_list3)" }
+# timeout { fail "(timeout) print print_array_rep(linked_list1, linked_list2, linked_list3)" }
+#}
+
+
+#go -until 1281
+gdb_test "tbreak 1281" \
+ "Breakpoint.* file .*call-ar-st.c, line 1281.*" \
+ "tbreakpoint line 1281"
+
+if ![gdb_skip_stdio_test "continuing to 1281"] {
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Continuing\\..*Sum of 4 arrays.*Contents of linked list1.*Contents of two_floats_t.*main \\(\\) at .*call-ar-st.c:1281.*c = 0.*$gdb_prompt $" {
+ pass "continue to 1281"
+ }
+ -re ".*$gdb_prompt $" { fail "continue to 1281"}
+ timeout { fail "(timeout) continue to 1281"}
+ }
+} else {
+ gdb_test "continue" "" ""
+}
+
+#call print_small_structs(*struct1, *struct2, *struct3, *struct4,
+# *flags, *flags_combo, *three_char, *five_char,
+# *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
+
+if {![gdb_skip_float_test "print print_small_structs(...)"] && \
+ ![gdb_skip_stdio_test "print print_small_structs(...)"] } {
+ send_gdb "print print_small_structs(*struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
+ gdb_expect_list "print print_small_structs" ".*$gdb_prompt $" {
+ "\[\t\r\n \]+alpha"
+ "\[\t\r\n \]+gamma"
+ "\[\t\r\n \]+epsilon"
+ "\[\t\r\n \]+alpha"
+ "\[\t\r\n \]+gamma"
+ "\[\t\r\n \]+epsilon"
+ "\[\t\r\n \]+ch1: y[ \t]*ch2: n"
+ "\[\t\r\n \]+Contents of three_char_t:"
+ "\[\t\r\n \]+a[ \t]*b[ \t]*c"
+ "\[\t\r\n \]+Contents of five_char_t:"
+ "\[\t\r\n \]+l[ \t]*m[ \t]*n[ \t]*o[ \t]*p"
+ "\[\t\r\n \]+Contents of int_char_combo_t:"
+ "\[\t\r\n \]+123[ \t]*z"
+ "\[\t\r\n \]+Sum of the 4 struct values and seed :"
+ "\[\t\r\n \]+52"
+ "\[\t\r\n \]+Contents of struct1:"
+ "\[\t\r\n \]+6[ \t]*0"
+ "\[\t\r\n \]+Contents of struct2:"
+ "\[\t\r\n \]+10[ \t]*0"
+ "\[\t\r\n \]+Contents of struct3:"
+ "\[\t\r\n \]+12[ \t]*0"
+ "\[\t\r\n \]+Contents of one_double_t:"
+ "\[\t\r\n \]+10.500000"
+ "\[\t\r\n \]+Contents of one_double_t:"
+ "\[\t\r\n \]+-3.375000"
+ "\[\t\r\n \]+Contents of one_double_t:"
+ "\[\t\r\n \]+675.093750"
+ "\[\t\r\n \]+Contents of two_floats_t:"
+ "\[\t\r\n \]+45.234001[ \t]*43.599998"
+ "\[\t\r\n \]+Contents of two_floats_t:"
+ "\[\t\r\n \]+78.010002[ \t]*122.099998"
+ "\[\t\r\n \]+Contents of two_floats_t:"
+ "\[\t\r\n \]+-1232.344971[ \t]*-199.210007"
+ }
+}
+
+#call compute_with_small_structs(20)
+send_gdb "print compute_with_small_structs(20)\n"
+gdb_expect {
+ -re ".*\[0-9\]+ =.*$gdb_prompt $" {
+ pass "print compute_with_small_structs(20)"
+ }
+ -re ".*$gdb_prompt $" { fail "print compute_with_small_structs(20)" }
+ timeout { fail "(timeout) compute_with_small_structs(20)" }
+ }
+
+
+#call print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098,
+# 3.14, -5678.12345, -0.11111111, 216.97065)
+
+if {![gdb_skip_float_test "print print_ten_doubles(...)"] && \
+ ![gdb_skip_stdio_test "print print_ten_doubles(...)"]} {
+ send_gdb "print print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065)\n"
+ gdb_expect_list "print print_ten_doubles" ".*$gdb_prompt $" {
+ "\[\t\r\n \]+Two Doubles : 123.456000.*123.456000"
+ "\[\t\r\n \]+Two Doubles : -0.120000.*-1.230000"
+ "\[\t\r\n \]+Two Doubles : 343434.800000.*89.098000"
+ "\[\t\r\n \]+Two Doubles : 3.140000.*-5678.123450"
+ "\[\t\r\n \]+Two Doubles : -0.111111.*216.970650"
+ }
+}
+
+#go -until 1286
+gdb_test "tbreak 1286" \
+ "Breakpoint .* file .*call-ar-st.c, line 1286.*" \
+ "tbreakpoint line 1286"
+
+gdb_test continue "Continuing\\..*main \\(.*\\) at.*call-ar-st.c:1286\[\t\r\n \]+1286.*print_long_arg_list \\( a, b, c, d, e, f, .struct1, .struct2, .struct3, .struct4,.*" "continue to 1286"
+
+if { [istarget "hppa*-*-hpux*"] } {
+ #
+ # NOTE:(FIXME)
+ # the aCC demangler cannot demangle the name of a function with >10 args.
+ # so I added a .* after the name of the function, to match the
+ # incredibly long mangled name
+ # (getting aCC's libdemangle.a bundled w/ the system?)
+ # DTS CLLbs16994 coulter 990114
+ #
+ # FIXME: use step for hppa* testing for now
+ # guo 990621
+ #
+ send_gdb "step\n"
+ gdb_expect {
+ -re ".*print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {pass "step into print_long_arg_list"}
+ -re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
+ timeout { fail "step into print_long_arg_list (timeout)" }
+ }
+} else {
+
+ # We can't just assume that a "step" will get us into
+ # print_long_arg_list here,either.
+ gdb_test "tbreak print_long_arg_list" \
+ "Breakpoint .* file .*call-ar-st.c, line .*" \
+ "tbreak in print_long_arg_list after stepping into memcpy"
+ # The short match case below handles cases where a buffer
+ # overflows or something, and expect can't deal with the full
+ # line. Perhaps a more elegant solution exists... -sts 1999-08-17
+ send_gdb "continue\n"
+ if {![gdb_skip_float_test "step into print_long_arg_list"]} {
+ gdb_expect {
+ -re ".*print_long_arg_list \\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" { pass "step into print_long_arg_list" }
+ -re ".*print_long_arg_list.*\\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}.*\\) at .*${srcfile}:992\[\r\n\]+992\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {pass "step into print_long_arg_list (short match)"}
+ -re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
+ timeout { fail "step into print_long_arg_list (timeout)" }
+ }
+ } else {
+ # If skipping float tests, don't expect anything in arg list.
+ gdb_expect {
+ -re ".*print_long_arg_list \\(.*\\).*$gdb_prompt $" { pass "step into print_long_arg_list" }
+ -re ".*$gdb_prompt $" { fail "step into print_long_arg_list" }
+ timeout { fail "step into print_long_arg_list (timeout)" }
+ }
+ }
+}
+
+set ws "\[\n\r\t \]+"
+
+#call print_small_structs(struct1, struct2, struct3, struct4, flags,
+# flags_combo, three_char, five_char, int_char_combo,
+# d1, d2, d3, f1, f2, f3)
+
+if {![gdb_skip_float_test "print_small_structs from print_long_arg_list"] && \
+ ![gdb_skip_stdio_test "print_small_structs from print_long_arg_list"] } {
+ # On Solaris, some of the args are passed by ref, others by value,
+ # and GDB gets confused and says "Invalid cast" because it thinks
+ # it has to cast the structure into a pointer to structure. A real
+ # GDB bug, probably for all Sparc configs, but obscure. -sts 1999-08-17.
+ setup_xfail "sparc*-*-solaris*"
+ send_gdb "print print_small_structs(struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3)\n"
+ gdb_expect_list "print print_small_structs from print_long_arg_list" ".*$gdb_prompt $" {
+ "\[\t\r\n \]+alpha"
+ "\[\t\r\n \]+gamma"
+ "\[\t\r\n \]+epsilon"
+ "\[\t\r\n \]+alpha"
+ "\[\t\r\n \]+gamma"
+ "\[\t\r\n \]+epsilon"
+ "\[\t\r\n \]+ch1: y[ \t]*ch2: n"
+ "\[\t\r\n \]+Contents of three_char_t:"
+ "\[\t\r\n \]+a\[ \t\]*b\[ \t\]*c"
+ "\[\t\r\n \]+Contents of five_char_t:"
+ "\[\t\r\n \]+l\[ \t\]*m\[ \t\]*n\[ \t\]*o\[ \t\]*p"
+ "\[\t\r\n \]+Contents of int_char_combo_t:"
+ "\[\t\r\n \]+123\[ \t\]*z"
+ "\[\t\r\n \]+Sum of the 4 struct values and seed :"
+ "\[\t\r\n \]+52"
+ "\[\t\r\n \]+Contents of struct1:"
+ "\[\t\r\n \]+6\[ \t\]*0"
+ "\[\t\r\n \]+Contents of struct2:"
+ "\[\t\r\n \]+10\[ \t\]*0"
+ "\[\t\r\n \]+Contents of struct3:"
+ "\[\t\r\n \]+12\[ \t\]*0"
+ "\[\t\r\n \]+Contents of one_double_t:"
+ "\[\t\r\n \]+10.500000"
+ "\[\t\r\n \]+Contents of one_double_t:"
+ "\[\t\r\n \]+-3.375000"
+ "\[\t\r\n \]+Contents of one_double_t:"
+ "\[\t\r\n \]+675.093750"
+ "\[\t\r\n \]+Contents of two_floats_t:"
+ "\[\t\r\n \]+45.234001\[ \t\]*43.599998"
+ "\[\t\r\n \]+Contents of two_floats_t:"
+ "\[\t\r\n \]+78.010002\[ \t\]*122.099998"
+ "\[\t\r\n \]+Contents of two_floats_t:"
+ "\[\t\r\n \]+-1232.344971\[ \t\]*-199.210007"
+ }
+}
+
+
+#go -until 1300
+gdb_test "tbreak 1300" \
+ "Breakpoint.* file .*call-ar-st.c, line 1300.*" \
+ "tbreakpoint line 1300"
+
+if ![gdb_skip_stdio_test "continuing to 1300"] {
+ gdb_test "continue" "Continuing\\..*Contents of two_floats_t:.*main \\(\\) at.*call-ar-st.c:1300.*1300.*init_bit_flags_combo\\(flags_combo, \\(unsigned\\)1, \\(unsigned\\)0, .y.,.*" \
+ "continue to 1300"
+} else {
+ gdb_test "continue" "" ""
+}
+
+#step
+ send_gdb "step\n"
+ gdb_expect {
+ -re "
+init_bit_flags_combo \\(bit_flags_combo=, a=1, b=0, ch1=121 .y., g=1, d=0, ch2=110 .n., e=1, o=0\\) at .*call-ar-st.c:416\[ \t\n\r\]+416.*bit_flags_combo->alpha = a;.*$gdb_prompt $" {
+ pass "step into init_bit_flags_combo"}
+ -re ".*$gdb_prompt $" { fail "step into init_bit_flags_combo" }
+ timeout { fail "step into init_bit_flags_combo (timeout)" }
+ }
+
+#call print_bit_flags_combo(*bit_flags_combo)
+if ![gdb_skip_stdio_test "continuing to 1300"] {
+ send_gdb "print print_bit_flags_combo(*bit_flags_combo)\n"
+ gdb_expect {
+ -re ".*alpha.*gamma.*epsilon.*ch1: y.*ch2: n.*$gdb_prompt $" {
+ pass "print print_bit_flags_combo from init_bit_flags_combo"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "print print_bit_flags_combo from init_bit_flags_combo"
+ }
+ timeout {
+ fail "(timeout) print_bit_flags_combo from init_bit_flags_combo"
+ }
+ }
+}
+
+
+#go -until 1305
+gdb_test "tbreak 1305" \
+ "Breakpoint.* file .*call-ar-st.c, line 1305.*" \
+ "tbreakpoint line 1305"
+
+gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1305\[\r\n\t \]+1305.*init_int_char_combo\\(int_char_combo, 13, .!.\\);" \
+"continue to 1305"
+
+#call print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
+
+# FIXME:
+# HP aCC demangler currently does not handle hp aCC functions with >10 args
+# DTS CLLbs16994 coulter 990114
+
+if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*" CLLbs16994}
+
+if {![gdb_skip_float_test "print print_long_arg_list"] && \
+ ![gdb_skip_stdio_test "print print_long_arg_list"] } {
+ send_gdb "print print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)\n"
+ gdb_expect_list "print print_long_arg_list" ".*$gdb_prompt $" {
+ "\[ \n\r\t\]+double : 22.250000"
+ "\[ \n\r\t\]+double : 33.375000"
+ "\[ \n\r\t\]+int : 0"
+ "\[ \n\r\t\]+int : -25"
+ "\[ \n\r\t\]+int : 100"
+ "\[ \n\r\t\]+int : 2345"
+ "\[ \n\r\t\]+alpha"
+ "\[ \n\r\t\]+gamma"
+ "\[ \n\r\t\]+epsilon"
+ "\[ \n\r\t\]+ch1: y\[ \t\]+ch2: n"
+ "\[ \n\r\t\]+Contents of three_char_t:"
+ "\[ \n\r\t\]+x\[ \t\]+y\[ \t\]+z"
+ "\[ \n\r\t\]+Contents of five_char_t:"
+ "\[ \n\r\t\]+h\[ \t\]+e\[ \t\]+l\[ \t\]+l\[ \t\]+o"
+ "\[ \n\r\t\]+Contents of int_char_combo_t:"
+ "\[ \n\r\t\]+123\[ \t\]+z"
+ "\[ \n\r\t\]+Sum of the 4 struct values and seed :"
+ "\[ \n\r\t\]+52"
+ "\[ \n\r\t\]+Contents of struct1:"
+ "\[ \n\r\t\]+6\[ \t\]+0"
+ "\[ \n\r\t\]+Contents of struct2:"
+ "\[ \n\r\t\]+10\[ \t\]+0"
+ "\[ \n\r\t\]+Contents of struct3:"
+ "\[ \n\r\t\]+12\[ \t\]+0"
+ "\[ \n\r\t\]+Contents of one_double_t:"
+ "\[ \n\r\t\]+1.111110"
+ "\[ \n\r\t\]+Contents of one_double_t:"
+ "\[ \n\r\t\]+-345.340000"
+ "\[ \n\r\t\]+Contents of one_double_t:"
+ "\[ \n\r\t\]+546464.200000"
+ "\[ \n\r\t\]+Contents of two_floats_t:"
+ "\[ \n\r\t\]+0.234000\[ \t\]+453.100006"
+ "\[ \n\r\t\]+Contents of two_floats_t:"
+ "\[ \n\r\t\]+78.345001\[ \t\]+23.090000"
+ "\[ \n\r\t\]+Contents of two_floats_t:"
+ "\[ \n\r\t\]+-2.345000\[ \t\]+1.000000"
+ }
+}
+
+
+#go -until 1311
+gdb_test "tbreak 1311" \
+ "Breakpoint.* file .*call-ar-st.c, line 1311.*" \
+ "tbreakpoint line 1311"
+
+gdb_test continue "Continuing\\..*main \\(\\) at .*call-ar-st.c:1311\[ \t\n\r\]+1311.*compute_with_small_structs\\(35\\);" \
+"continue to 1311"
+
+
+#call sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)
+if ![gdb_skip_stdio_test "print sum_struct_print(...)"] {
+ send_gdb "print sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)\n"
+ gdb_expect {
+ -re ".*Sum of the 4 struct values and seed :\[ \t\n\r\]+218.*$gdb_prompt $" {
+ pass "print sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "print sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)"
+ }
+ timeout {
+ fail "(timeout) sum_struct_print(10, *struct1, *struct2, *struct3, *struct4)"
+ }
+ }
+}
+
+
+#call print_struct_rep(*struct1, *struct2, *struct3)
+if ![gdb_skip_stdio_test "print print_struct_rep(...)"] {
+ send_gdb "print print_struct_rep(*struct1, *struct2, *struct3)\n"
+ gdb_expect_list "print print_struct_rep(*struct1, *struct2, *struct3)" \
+ ".*$gdb_prompt $" {
+ "\[ \t\n\r\]+Contents of struct1:"
+ "\[ \t\n\r\]+ 22 0"
+ "\[ \t\n\r\]+Contents of struct2:"
+ "\[ \t\n\r\]+ 42 0"
+ "\[ \t\n\r\]+Contents of struct3:"
+ "\[ \t\n\r\]+ 62 0"
+ }
+}
+
+if ![gdb_skip_stdio_test "print print_one_large_struct(...)"] {
+ send_gdb "print print_one_large_struct(*list1)\n"
+ gdb_expect {
+ -re ".* 4 1.*$gdb_prompt $" {
+ pass "print print_one_large_struct(*list1)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "print print_one_large_struct(*list1)"
+ }
+ timeout {
+ fail "(timeout) print_one_large_struct(*list1)"
+ }
+ }
+}
+
+set timeout $oldtimeout
+return
+
diff --git a/gdb/testsuite/gdb.base/call-rt-st.c b/gdb/testsuite/gdb.base/call-rt-st.c
new file mode 100644
index 00000000000..712f70ecbb5
--- /dev/null
+++ b/gdb/testsuite/gdb.base/call-rt-st.c
@@ -0,0 +1,633 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/**************************************************************************
+ * TESTS :
+ * function returning large structures, which go on the stack
+ * functions returning varied sized structs which go on in the registers.
+ ***************************************************************************/
+
+
+/* A large structure (> 64 bits) used to test passing large structures as
+ * parameters
+ */
+
+struct array_rep_info_t {
+ int next_index[10];
+ int values[10];
+ int head;
+};
+
+/*****************************************************************************
+ * Small structures ( <= 64 bits). These are used to test passing small
+ * structures as parameters and test argument size promotion.
+ *****************************************************************************/
+
+ /* 64 bits
+ */
+struct small_rep_info_t {
+ int value;
+ int head;
+};
+
+/* 6 bits : really fits in 8 bits and is promoted to 32 bits
+ */
+struct bit_flags_t {
+ unsigned alpha :1;
+ unsigned beta :1;
+ unsigned gamma :1;
+ unsigned delta :1;
+ unsigned epsilon :1;
+ unsigned omega :1;
+};
+
+/* 22 bits : really fits in 40 bits and is promoted to 64 bits
+ */
+struct bit_flags_combo_t {
+ unsigned alpha :1;
+ unsigned beta :1;
+ char ch1;
+ unsigned gamma :1;
+ unsigned delta :1;
+ char ch2;
+ unsigned epsilon :1;
+ unsigned omega :1;
+};
+
+/* 64 bits
+ */
+struct one_double_t {
+ double double1;
+};
+
+/* 64 bits
+ */
+struct two_floats_t {
+ float float1;
+ float float2;
+};
+
+
+/* 24 bits : promoted to 32 bits
+ */
+struct three_char_t {
+ char ch1;
+ char ch2;
+ char ch3;
+};
+
+/* 40 bits : promoted to 64 bits
+ */
+struct five_char_t {
+ char ch1;
+ char ch2;
+ char ch3;
+ char ch4;
+ char ch5;
+};
+
+/* 40 bits : promoted to 64 bits
+ */
+struct int_char_combo_t {
+ int int1;
+ char ch1;
+};
+
+
+/*****************************************************************
+ * LOOP_COUNT :
+ * A do nothing function. Used to provide a point at which calls can be made.
+ *****************************************************************/
+void loop_count () {
+
+ int index;
+
+ for (index=0; index<4; index++);
+}
+
+/*****************************************************************
+ * INIT_BIT_FLAGS :
+ * Initializes a bit_flags_t structure. Can call this function see
+ * the call command behavior when integer arguments do not fit into
+ * registers and must be placed on the stack.
+ * OUT struct bit_flags_t *bit_flags -- structure to be filled
+ * IN unsigned a -- 0 or 1
+ * IN unsigned b -- 0 or 1
+ * IN unsigned g -- 0 or 1
+ * IN unsigned d -- 0 or 1
+ * IN unsigned e -- 0 or 1
+ * IN unsigned o -- 0 or 1
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_bit_flags (
+struct bit_flags_t *bit_flags,
+unsigned a,
+unsigned b,
+unsigned g,
+unsigned d,
+unsigned e,
+unsigned o)
+#else
+void init_bit_flags (bit_flags,a,b,g,d,e,o)
+struct bit_flags_t *bit_flags;
+unsigned a;
+unsigned b;
+unsigned g;
+unsigned d;
+unsigned e;
+unsigned o;
+#endif
+{
+
+ bit_flags->alpha = a;
+ bit_flags->beta = b;
+ bit_flags->gamma = g;
+ bit_flags->delta = d;
+ bit_flags->epsilon = e;
+ bit_flags->omega = o;
+}
+
+/*****************************************************************
+ * INIT_BIT_FLAGS_COMBO :
+ * Initializes a bit_flags_combo_t structure. Can call this function
+ * to see the call command behavior when integer and character arguments
+ * do not fit into registers and must be placed on the stack.
+ * OUT struct bit_flags_combo_t *bit_flags_combo -- structure to fill
+ * IN unsigned a -- 0 or 1
+ * IN unsigned b -- 0 or 1
+ * IN char ch1
+ * IN unsigned g -- 0 or 1
+ * IN unsigned d -- 0 or 1
+ * IN char ch2
+ * IN unsigned e -- 0 or 1
+ * IN unsigned o -- 0 or 1
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_bit_flags_combo (
+struct bit_flags_combo_t *bit_flags_combo,
+unsigned a,
+unsigned b,
+char ch1,
+unsigned g,
+unsigned d,
+char ch2,
+unsigned e,
+unsigned o)
+#else
+void init_bit_flags_combo (bit_flags_combo, a, b, ch1, g, d, ch2, e, o)
+struct bit_flags_combo_t *bit_flags_combo;
+unsigned a;
+unsigned b;
+char ch1;
+unsigned g;
+unsigned d;
+char ch2;
+unsigned e;
+unsigned o;
+#endif
+{
+
+ bit_flags_combo->alpha = a;
+ bit_flags_combo->beta = b;
+ bit_flags_combo->ch1 = ch1;
+ bit_flags_combo->gamma = g;
+ bit_flags_combo->delta = d;
+ bit_flags_combo->ch2 = ch2;
+ bit_flags_combo->epsilon = e;
+ bit_flags_combo->omega = o;
+}
+
+
+/*****************************************************************
+ * INIT_ONE_DOUBLE :
+ * OUT struct one_double_t *one_double -- structure to fill
+ * IN double init_val
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_one_double ( struct one_double_t *one_double, double init_val)
+#else
+void init_one_double (one_double, init_val)
+struct one_double_t *one_double;
+double init_val;
+#endif
+{
+
+ one_double->double1 = init_val;
+}
+
+/*****************************************************************
+ * INIT_TWO_FLOATS :
+ * OUT struct two_floats_t *two_floats -- structure to be filled
+ * IN float init_val1
+ * IN float init_val2
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_two_floats (
+ struct two_floats_t *two_floats,
+ float init_val1,
+ float init_val2)
+#else
+void init_two_floats (two_floats, init_val1, init_val2)
+struct two_floats_t *two_floats;
+float init_val1;
+float init_val2;
+#endif
+{
+
+ two_floats->float1 = init_val1;
+ two_floats->float2 = init_val2;
+}
+
+/*****************************************************************
+ * INIT_THREE_CHARS :
+ * OUT struct three_char_t *three_char -- structure to be filled
+ * IN char init_val1
+ * IN char init_val2
+ * IN char init_val3
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_three_chars (
+struct three_char_t *three_char,
+char init_val1,
+char init_val2,
+char init_val3)
+#else
+void init_three_chars ( three_char, init_val1, init_val2, init_val3)
+struct three_char_t *three_char;
+char init_val1;
+char init_val2;
+char init_val3;
+#endif
+{
+
+ three_char->ch1 = init_val1;
+ three_char->ch2 = init_val2;
+ three_char->ch3 = init_val3;
+}
+
+/*****************************************************************
+ * INIT_FIVE_CHARS :
+ * OUT struct five_char_t *five_char -- structure to be filled
+ * IN char init_val1
+ * IN char init_val2
+ * IN char init_val3
+ * IN char init_val4
+ * IN char init_val5
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_five_chars (
+struct five_char_t *five_char,
+char init_val1,
+char init_val2,
+char init_val3,
+char init_val4,
+char init_val5)
+#else
+void init_five_chars ( five_char, init_val1, init_val2, init_val3, init_val4, init_val5)
+struct five_char_t *five_char;
+char init_val1;
+char init_val2;
+char init_val3;
+char init_val4;
+char init_val5;
+#endif
+{
+
+ five_char->ch1 = init_val1;
+ five_char->ch2 = init_val2;
+ five_char->ch3 = init_val3;
+ five_char->ch4 = init_val4;
+ five_char->ch5 = init_val5;
+}
+
+/*****************************************************************
+ * INIT_INT_CHAR_COMBO :
+ * OUT struct int_char_combo_t *combo -- structure to be filled
+ * IN int init_val1
+ * IN char init_val2
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_int_char_combo (
+struct int_char_combo_t *combo,
+int init_val1,
+char init_val2)
+#else
+void init_int_char_combo ( combo, init_val1, init_val2)
+struct int_char_combo_t *combo;
+int init_val1;
+char init_val2;
+#endif
+{
+
+ combo->int1 = init_val1;
+ combo->ch1 = init_val2;
+}
+
+/*****************************************************************
+ * INIT_STRUCT_REP :
+ * OUT struct small_rep_into_t *small_struct -- structure to be filled
+ * IN int seed
+ *****************************************************************/
+#ifdef PROTOTYPES
+void init_struct_rep(
+ struct small_rep_info_t *small_struct,
+ int seed)
+#else
+void init_struct_rep( small_struct, seed)
+struct small_rep_info_t *small_struct;
+int seed;
+#endif
+{
+
+ small_struct->value = 2 + (seed*2);
+ small_struct->head = 0;
+}
+
+/*****************************************************************
+ * PRINT_BIT_FLAGS :
+ * IN struct bit_flags_t bit_flags
+ ****************************************************************/
+#ifdef PROTOTYPES
+struct bit_flags_t print_bit_flags (struct bit_flags_t bit_flags)
+#else
+struct bit_flags_t print_bit_flags ( bit_flags)
+struct bit_flags_t bit_flags;
+#endif
+{
+
+ if (bit_flags.alpha) printf("alpha\n");
+ if (bit_flags.beta) printf("beta\n");
+ if (bit_flags.gamma) printf("gamma\n");
+ if (bit_flags.delta) printf("delta\n");
+ if (bit_flags.epsilon) printf("epsilon\n");
+ if (bit_flags.omega) printf("omega\n");
+ return bit_flags;
+
+}
+
+/*****************************************************************
+ * PRINT_BIT_FLAGS_COMBO :
+ * IN struct bit_flags_combo_t bit_flags_combo
+ ****************************************************************/
+#ifdef PROTOTYPES
+struct bit_flags_combo_t print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo)
+#else
+struct bit_flags_combo_t print_bit_flags_combo ( bit_flags_combo )
+struct bit_flags_combo_t bit_flags_combo;
+#endif
+{
+
+ if (bit_flags_combo.alpha) printf("alpha\n");
+ if (bit_flags_combo.beta) printf("beta\n");
+ if (bit_flags_combo.gamma) printf("gamma\n");
+ if (bit_flags_combo.delta) printf("delta\n");
+ if (bit_flags_combo.epsilon) printf("epsilon\n");
+ if (bit_flags_combo.omega) printf("omega\n");
+ printf("ch1: %c\tch2: %c\n", bit_flags_combo.ch1, bit_flags_combo.ch2);
+ return bit_flags_combo;
+
+}
+
+/*****************************************************************
+ * PRINT_ONE_DOUBLE :
+ * IN struct one_double_t one_double
+ ****************************************************************/
+#ifdef PROTOTYPES
+struct one_double_t print_one_double (struct one_double_t one_double)
+#else
+struct one_double_t print_one_double ( one_double )
+struct one_double_t one_double;
+#endif
+{
+
+ printf("Contents of one_double_t: \n\n");
+ printf("%f\n", one_double.double1);
+ return one_double;
+
+}
+
+/*****************************************************************
+ * PRINT_TWO_FLOATS :
+ * IN struct two_floats_t two_floats
+ ****************************************************************/
+#ifdef PROTOTYPES
+struct two_floats_t print_two_floats (struct two_floats_t two_floats)
+#else
+struct two_floats_t print_two_floats ( two_floats )
+struct two_floats_t two_floats;
+#endif
+{
+
+ printf("Contents of two_floats_t: \n\n");
+ printf("%f\t%f\n", two_floats.float1, two_floats.float2);
+ return two_floats;
+
+}
+
+/*****************************************************************
+ * PRINT_THREE_CHARS :
+ * IN struct three_char_t three_char
+ ****************************************************************/
+#ifdef PROTOTYPES
+struct three_char_t print_three_chars (struct three_char_t three_char)
+#else
+struct three_char_t print_three_chars ( three_char )
+struct three_char_t three_char;
+#endif
+{
+
+ printf("Contents of three_char_t: \n\n");
+ printf("%c\t%c\t%c\n", three_char.ch1, three_char.ch2, three_char.ch3);
+ return three_char;
+
+}
+
+/*****************************************************************
+ * PRINT_FIVE_CHARS :
+ * IN struct five_char_t five_char
+ ****************************************************************/
+#ifdef PROTOTYPES
+struct five_char_t print_five_chars (struct five_char_t five_char)
+#else
+struct five_char_t print_five_chars ( five_char )
+struct five_char_t five_char;
+#endif
+{
+
+ printf("Contents of five_char_t: \n\n");
+ printf("%c\t%c\t%c\t%c\t%c\n", five_char.ch1, five_char.ch2,
+ five_char.ch3, five_char.ch4,
+ five_char.ch5);
+ return five_char;
+
+}
+
+/*****************************************************************
+ * PRINT_INT_CHAR_COMBO :
+ * IN struct int_char_combo_t int_char_combo
+ ****************************************************************/
+#ifdef PROTOTYPES
+struct int_char_combo_t print_int_char_combo (struct int_char_combo_t int_char_combo)
+#else
+struct int_char_combo_t print_int_char_combo ( int_char_combo )
+struct int_char_combo_t int_char_combo;
+#endif
+{
+
+ printf("Contents of int_char_combo_t: \n\n");
+ printf("%d\t%c\n", int_char_combo.int1, int_char_combo.ch1);
+ return int_char_combo;
+
+}
+
+/*****************************************************************
+ * PRINT_STRUCT_REP :
+ ****************************************************************/
+#ifdef PROTOTYPES
+struct small_rep_info_t print_struct_rep(struct small_rep_info_t struct1)
+#else
+struct small_rep_info_t print_struct_rep( struct1 )
+struct small_rep_info_t struct1;
+#endif
+{
+
+ printf("Contents of struct1: \n\n");
+ printf("%10d%10d\n", struct1.value, struct1.head);
+ struct1.value =+5;
+
+ return struct1;
+
+
+}
+
+
+#ifdef PROTOTYPES
+struct array_rep_info_t print_one_large_struct(struct array_rep_info_t linked_list1)
+#else
+struct array_rep_info_t print_one_large_struct( linked_list1 )
+struct array_rep_info_t linked_list1;
+#endif
+{
+
+
+ printf("%10d%10d\n", linked_list1.values[0],
+ linked_list1.next_index[0]);
+
+ return linked_list1;
+
+}
+
+/*****************************************************************
+ * INIT_ARRAY_REP :
+ * IN struct array_rep_info_t *linked_list
+ * IN int seed
+ ****************************************************************/
+#ifdef PROTOTYPES
+void init_array_rep(struct array_rep_info_t *linked_list, int seed)
+#else
+void init_array_rep( linked_list, seed )
+struct array_rep_info_t *linked_list;
+int seed;
+#endif
+{
+
+ int index;
+
+ for (index = 0; index < 10; index++) {
+
+ linked_list->values[index] = (2*index) + (seed*2);
+ linked_list->next_index[index] = index + 1;
+ }
+ linked_list->head = 0;
+}
+
+
+int main () {
+
+ /* variables for large structure testing
+ */
+ int number = 10;
+ struct array_rep_info_t *list1;
+
+ /* variables for testing a small structures and a very long argument list
+ */
+ struct small_rep_info_t *struct1;
+ struct bit_flags_t *flags;
+ struct bit_flags_combo_t *flags_combo;
+ struct three_char_t *three_char;
+ struct five_char_t *five_char;
+ struct int_char_combo_t *int_char_combo;
+ struct one_double_t *d1;
+ struct two_floats_t *f3;
+
+
+ /* Allocate space for large structures
+ */
+ list1 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t));
+
+ /* Initialize large structures
+ */
+ init_array_rep(list1, 2);
+
+ /* Print large structures
+ */
+ print_one_large_struct(*list1);
+
+ /* Allocate space for small structures
+ */
+ struct1 = (struct small_rep_info_t *)malloc(sizeof(struct small_rep_info_t));
+ flags = (struct bit_flags_t *)malloc(sizeof(struct bit_flags_t));
+ flags_combo = (struct bit_flags_combo_t *)malloc(sizeof(struct bit_flags_combo_t));
+ three_char = (struct three_char_t *)malloc(sizeof(struct three_char_t));
+ five_char = (struct five_char_t *)malloc(sizeof(struct five_char_t));
+ int_char_combo = (struct int_char_combo_t *)malloc(sizeof(struct int_char_combo_t));
+
+ d1 = (struct one_double_t *)malloc(sizeof(struct one_double_t));
+ f3 = (struct two_floats_t *)malloc(sizeof(struct two_floats_t));
+
+ /* Initialize small structures
+ */
+ init_one_double ( d1, 1.11111);
+ init_two_floats ( f3, -2.345, 1.0);
+ init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1,
+ (unsigned)0, (unsigned)1, (unsigned)0 );
+ init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y',
+ (unsigned)1, (unsigned)0, 'n',
+ (unsigned)1, (unsigned)0 );
+ init_three_chars(three_char, 'x', 'y', 'z');
+ init_five_chars(five_char, 'h', 'e', 'l', 'l', 'o');
+ init_int_char_combo(int_char_combo, 13, '!');
+ init_struct_rep(struct1, 10);
+
+
+ /* Print small structures
+ */
+ print_one_double(*d1);
+ print_two_floats(*f3);
+ print_bit_flags(*flags);
+ print_bit_flags_combo(*flags_combo);
+ print_three_chars(*three_char);
+ print_five_chars(*five_char);
+ print_int_char_combo(*int_char_combo);
+ print_struct_rep(*struct1);
+
+ loop_count();
+
+ return 0;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.base/call-rt-st.exp b/gdb/testsuite/gdb.base/call-rt-st.exp
new file mode 100644
index 00000000000..115dcb3fa7e
--- /dev/null
+++ b/gdb/testsuite/gdb.base/call-rt-st.exp
@@ -0,0 +1,213 @@
+# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# this file tests command line calls with functions returning structures
+# corresponding source file: call_return_struct.c
+
+
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "call-rt-st"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+
+# Test depends on printf, which the sparclet stub doesn't support.
+if { [istarget "sparclet-*-*"] } {
+ return 0;
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+
+
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+# Some targets can't do function calls, so don't even bother with this
+# test.
+if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ continue
+}
+
+# Set the current language to C. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_c {} {
+ global gdb_prompt
+
+ send_gdb "set language c\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language c (timeout)" ; return 0; }
+ }
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"c\".*$gdb_prompt $" {
+ pass "set language to \"c\""
+ return 1
+ }
+ -re ".*$gdb_prompt $" {
+ fail "setting language to \"c\""
+ return 0
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return 0
+ }
+ }
+}
+
+
+
+source ${binfile}.ci
+
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+
+gdb_test "break loop_count" \
+ "Breakpoint.* file .*call-rt-st.c, line 106\\." \
+ "breakpoint loop_count"
+
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\..*Breakpoint.*loop_count \\(\\) at.*call-rt-st.c:106\[ \t\r\n\]+106\[\t \]+for \\(index=0; index.4; index..\\);\[\r\n \]+$gdb_prompt $" {
+ pass "continue to loop_count"}
+ -re ".*$gdb_prompt $" { fail "continue to loop_count"}
+ timeout { fail "(timeout) continue to loop_count"}
+}
+
+send_gdb "finish\n"
+gdb_expect {
+ -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:106\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:617\[ \t\r\n\]+617\[\t \]+return 0;.*$gdb_prompt $" {
+ pass "finish out from loop_count (line 617)"}
+ -re "Run till exit from .0 loop_count \\(\\) at.*call-rt-st.c:106\[ \t\r\n\]+main \\(\\) at.*call-rt-st.c:615\[ \t\r\n\]+615\[\t \]+loop_count.*$gdb_prompt $" {
+ pass "finish out from loop_count (line 615)"}
+ -re ".*$gdb_prompt $" { fail "finish out from loop_count"}
+ timeout { fail "(timeout)finish out from loop_count"}
+}
+
+# Ask GDB to print the value of EXPR, and expect to see the regexp
+# RESULT in the output. If we get back the error message "Function
+# return value unknown", call that an `unsupported' test; on some
+# architectures, it's impossible to find structs returned by value
+# reliably.
+proc print_struct_call { expr result } {
+ global gdb_prompt
+
+ set command "print $expr"
+ send_gdb "${command}\n"
+ gdb_expect {
+ -re "$result\[\r\n\]+$gdb_prompt $" {
+ pass "$command"
+ }
+ -re "Function return value unknown.\[\r\n\]+$gdb_prompt $" {
+ unsupported "$command"
+ }
+ -re "$gdb_prompt $" {
+ fail "$command"
+ }
+ timeout {
+ fail "$command (timeout)"
+ }
+ }
+}
+
+
+if ![gdb_skip_stdio_test "print print_struct_rep(*struct1)"] {
+ print_struct_call "print_struct_rep(*struct1)" \
+ ".*Contents of struct1:\[ \t\n\r\]+22\[ \t\]+0\[ \t\n\r\]+.\[0-9\]+ = \\{value = 5, head = 0\\}"
+}
+
+if ![gdb_skip_stdio_test "print print_one_large_struct(...)"] {
+ print_struct_call "print_one_large_struct(*list1)" \
+ ".*\[ \t\]+4\[ \t\]+1\[ \r\n\]+.\[0-9\]+ = \\{next_index = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\}, values = \\{4, 6, 8, 10, 12, 14, 16, 18, 20, 22\\}, head = 0\\}"
+}
+
+if {![gdb_skip_float_test "print print_one_double(*d1)"] && \
+ ![gdb_skip_stdio_test "print print_one_double(*d1)"] } {
+ print_struct_call "print_one_double(*d1)" \
+ ".*Contents of one_double_t:\[ \r\n\]+1\\.111110\[ \r\n\]+.\[0-9\]+ = \\{double1 = 1\\.111\[0-9\]*\\}"
+}
+
+if {![gdb_skip_float_test "print print_two_floats(*f3)"] && \
+ ![gdb_skip_stdio_test "print print_two_floats(*f3)"] } {
+ print_struct_call "print_two_floats(*f3)" \
+ ".*Contents of two_floats_t:\[ \r\n\]+-2\\.345000\[ \t]+1\\.000000\[ \r\n\]+.\[0-9\]+ = \\{float1 = -2\\.34500003, float2 = 1\\}"
+}
+
+if ![gdb_skip_stdio_test "print print_bit_flags(*flags)"] {
+ print_struct_call "print_bit_flags(*flags)" \
+ ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+.\[0-9\]+ = \\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\\}"
+}
+
+if ![gdb_skip_stdio_test "print print_bit_flags_combo(*flags_combo)"] {
+ print_struct_call "print_bit_flags_combo(*flags_combo)" \
+ ".*alpha\[ \r\n\]+gamma\[ \r\n\]+epsilon\[ \r\n\]+ch1: y\[ \t\]+ch2: n\[ \r\n\]+.\[0-9\]+ = \\{alpha = 1, beta = 0, ch1 = 121 'y', gamma = 1, delta = 0, ch2 = 110 'n', epsilon = 1, omega = 0\\}"
+}
+
+if ![gdb_skip_stdio_test "print print_three_chars(*three_chars)"] {
+ print_struct_call "print_three_chars(*three_char)" \
+ ".*Contents of three_char_t:\[ \r\n\]+x\[ \t\]+y\[ \t\]+z\[ \r\n\]+.\[0-9\]+ = \\{ch1 = 120 'x', ch2 = 121 'y', ch3 = 122 'z'\\}"
+}
+
+if ![gdb_skip_stdio_test "print print_five_chars(*five_chars)"] {
+ print_struct_call "print_five_chars(*five_char)" \
+ ".*Contents of five_char_t:\[ \r\n\]+h\[ \t\]+e\[ \t\]+l\[ \t\]+l\[ \t\]+o\[ \r\n\]+.\[0-9\]+ = \\{ch1 = 104 'h', ch2 = 101 'e', ch3 = 108 'l', ch4 = 108 'l', ch5 = 111 'o'\\}"
+}
+
+if ![gdb_skip_stdio_test "print print_int_char_combo(*int_char_combo)"] {
+ print_struct_call "print_int_char_combo(*int_char_combo)" \
+ ".*Contents of int_char_combo_t:\[ \r\n\]+13\[ \t\]+!\[ \r\n\]+.\[0-9\]+ = \\{int1 = 13, ch1 = 33 '!'\\}"
+}
+
+return
diff --git a/gdb/testsuite/gdb.base/call-strs.c b/gdb/testsuite/gdb.base/call-strs.c
new file mode 100644
index 00000000000..f3bc8da9166
--- /dev/null
+++ b/gdb/testsuite/gdb.base/call-strs.c
@@ -0,0 +1,78 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+char buf[100];
+char bigbuf[1000];
+char * s;
+
+#ifdef PROTOTYPES
+char * str_func1(char *s1)
+#else
+char * str_func1(s1)
+char *s1;
+#endif
+{
+ printf("first string arg is: %s\n", s1);
+ strcpy(bigbuf, s1);
+ return bigbuf;
+}
+
+#ifdef PROTOTYPES
+char * str_func(
+char * s1,
+char * s2,
+char * s3,
+char * s4,
+char * s5,
+char * s6,
+char * s7)
+#else
+char * str_func(s1,
+ s2,
+ s3,
+ s4,
+ s5,
+ s6,
+ s7)
+char * s1;
+char * s2;
+char * s3;
+char * s4;
+char * s5;
+char * s6;
+char * s7;
+#endif
+{
+ printf("first string arg is: %s\n", s1);
+ printf("second string arg is: %s\n", s2);
+ printf("third string arg is: %s\n", s3);
+ printf("fourth string arg is: %s\n", s4);
+ printf("fifth string arg is: %s\n", s5);
+ printf("sixth string arg is: %s\n", s6);
+ printf("seventh string arg is: %s\n", s7);
+ strcpy(bigbuf, s1);
+ strcat(bigbuf, s2);
+ strcat(bigbuf, s3);
+ strcat(bigbuf, s4);
+ strcat(bigbuf, s5);
+ strcat(bigbuf, s6);
+ strcat(bigbuf, s7);
+ return bigbuf;
+}
+
+char *
+link_malloc ()
+{
+ return (char*) malloc (1);
+}
+
+int main()
+{
+ s = &buf[0];
+ strcpy(buf, "test string");
+ str_func("abcd", "efgh", "ijkl", "mnop", "qrst", "uvwx", "yz12");
+ str_func1("abcd");
+ return 0;
+}
+
diff --git a/gdb/testsuite/gdb.base/call-strs.exp b/gdb/testsuite/gdb.base/call-strs.exp
new file mode 100644
index 00000000000..63fc27427fd
--- /dev/null
+++ b/gdb/testsuite/gdb.base/call-strs.exp
@@ -0,0 +1,268 @@
+# Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This test deals with calling functions which have strings as parameters.
+# it plays around with constant strings.
+# the corresponding source file is call-strs.c
+#
+
+#debug strarg
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "call-strs"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Test depends on printf, which the sparclet stub doesn't support.
+if { [istarget "sparclet-*-*"] } {
+ return 0;
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+
+# Some targets can't call functions, so don't even bother with this
+# test.
+if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ continue
+}
+
+# Set the current language to C. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_c {} {
+ global gdb_prompt
+
+ send_gdb "set language c\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language c (timeout)" ; return 0; }
+ }
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"c\".*$gdb_prompt $" {
+ pass "set language to \"c\""
+ return 1
+ }
+ -re ".*$gdb_prompt $" {
+ fail "setting language to \"c\""
+ return 0
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return 0
+ }
+ }
+}
+
+
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
+
+set timeout 120
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+#step
+send_gdb "step\n"
+gdb_expect {
+ -re ".*strcpy\\(buf, \"test string\"\\);.*$gdb_prompt $" {pass "step after assignment to s"}
+ -re ".*$gdb_prompt $" { fail "step after assignment to s" }
+ timeout { fail "step after assignment to s (timeout)" }
+ }
+
+
+#step
+send_gdb "next\n"
+gdb_expect {
+ -re ".*str_func\\(\"abcd\", \"efgh\", \"ijkl\", \"mnop\", \"qrst\", \"uvwx\", \"yz12\"\\);.*$gdb_prompt $" {pass "next over strcpy"}
+ -re ".*$gdb_prompt $" { fail "next over strcpy" }
+ timeout { fail "next over strcpy (timeout)" }
+ }
+
+#print buf
+send_gdb "print buf\n"
+gdb_expect {
+ -re ".*\"test string\",.*repeats 88 times.*$gdb_prompt $" {
+ pass "print buf"
+ }
+ -re ".*$gdb_prompt $" { fail "print buf" }
+ timeout { fail "(timeout) print buf" }
+ }
+
+
+#print s
+send_gdb "print s\n"
+gdb_expect {
+ -re ".*= \"test string\".*$gdb_prompt $" {
+ pass "print s"
+ }
+ -re ".*$gdb_prompt $" { fail "print s" }
+ timeout { fail "(timeout) print sum_array_print(10, *list1, *list2, *list3, *list4)" }
+ }
+
+
+#print str_func1(s)
+if ![gdb_skip_stdio_test "print str_func1(s)"] {
+ send_gdb "print str_func1(s)\n"
+ gdb_expect {
+ -re "first string arg is: test string.*\"test string\".*$gdb_prompt $" {
+ pass "print str_func1(s)"
+ }
+ -re ".*$gdb_prompt $" { fail "print str_func1(s)" }
+ timeout { fail "(timeout) print str_func1(s)" }
+ }
+}
+
+
+#print str_func1("test string")
+if ![gdb_skip_stdio_test "print str_func1(teststring)"] {
+ send_gdb "print str_func1(\"test string\")\n"
+ gdb_expect {
+ -re "first string arg is: test string.*\"test string\".*$gdb_prompt $" {
+ pass "print str_func1(\"test string\")"
+ }
+ -re ".*$gdb_prompt $" { fail "print str_func1(\"test string\")" }
+ timeout { fail "(timeout) print str_func1(\"test string\")" }
+ }
+}
+
+#call str_func1(s)
+if ![gdb_skip_stdio_test "call str_func1(s)"] {
+ send_gdb "call str_func1(s)\n"
+ gdb_expect {
+ -re "first string arg is: test string.*\"test string\".*$gdb_prompt $" {
+ pass "call str_func1(s)"
+ }
+ -re ".*$gdb_prompt $" { fail "call str_func1(s)" }
+ timeout { fail "(timeout) call str_func1(s)" }
+ }
+}
+
+#call str_func1("test string")
+if ![gdb_skip_stdio_test "call str_func1 (...)"] {
+ send_gdb "call str_func1(\"test string\")\n"
+ gdb_expect {
+ -re "first string arg is: test string.*\"test string\".*$gdb_prompt $" {
+ pass "call str_func1(\"test string\")"
+ }
+ -re ".*$gdb_prompt $" { fail "call str_func1(\"test string\")" }
+ timeout { fail "(timeout) call str_func1(\"test string\")" }
+ }
+}
+
+#print str_func1(buf)
+if ![gdb_skip_stdio_test "print str_func1(buf)"] {
+ send_gdb "print str_func1(buf)\n"
+ gdb_expect {
+ -re "first string arg is: test string.*\"test string\".*$gdb_prompt $" {
+ pass "print str_func1(buf)"
+ }
+ -re ".*$gdb_prompt $" { fail "print str_func1(buf)" }
+ timeout { fail "(timeout) print str_func1(buf)" }
+ }
+}
+
+#call str_func1(buf)
+if ![gdb_skip_stdio_test "call str_func1(buf)"] {
+ send_gdb "call str_func1(buf)\n"
+ gdb_expect {
+ -re "first string arg is: test string.*\"test string\".*$gdb_prompt $" {
+ pass "call str_func1(buf)"
+ }
+ -re ".*$gdb_prompt $" { fail "call str_func1(buf)" }
+ timeout { fail "(timeout) call str_func1(buf)" }
+ }
+}
+
+#print str_func("a","b","c","d","e","f","g")
+if ![gdb_skip_stdio_test "print str_func(a,b,c,d,e,f,g)"] {
+ send_gdb "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")\n"
+ gdb_expect {
+ -re "first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]+third string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth string arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh string arg is: g\[ \t\r\n\]+.*= \"abcdefg\".*$gdb_prompt $" {
+ pass "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")"
+ }
+ -re ".*$gdb_prompt $" { fail "print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" }
+ timeout { fail "(timeout) print str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" }
+ }
+}
+
+#call str_func("a","b","c","d","e","f","g")
+if ![gdb_skip_stdio_test "call str_func(a,b,c,d,e,f,g)"] {
+ send_gdb "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")\n"
+ gdb_expect {
+ -re "first string arg is: a\[ \t\r\n\]+second string arg is: b\[ \t\r\n\]+third string arg is: c\[ \t\r\n\]+fourth string arg is: d\[ \t\r\n\]+fifth string arg is: e\[ \t\r\n\]+sixth string arg is: f\[ \t\r\n\]+seventh string arg is: g\[ \t\r\n\]+.*= \"abcdefg\".*$gdb_prompt $" {
+ pass "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")"
+ }
+ -re ".*$gdb_prompt $" { fail "call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" }
+ timeout { fail "(timeout) call str_func(\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\")" }
+ }
+}
+
+#print str_func(s,s,s,s,s,s,s)
+if ![gdb_skip_stdio_test "print str_func(s,s,s,s,s,s,s,s)"] {
+ send_gdb "print str_func(s,s,s,s,s,s,s)\n"
+ gdb_expect {
+ -re "first string arg is: test string\[ \t\r\n\]+second string arg is: test string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test string\[ \t\r\n\]+.*\"test stringtest stringtest stringtest stringtest stringtest stringtest string\".*$gdb_prompt $" {
+ pass "print str_func(s,s,s,s,s,s,s)"
+ }
+ -re ".*$gdb_prompt $" { fail "print str_func(s,s,s,s,s,s,s)" }
+ timeout { fail "(timeout) print str_func(s,s,s,s,s,s,s)" }
+ }
+}
+
+#call str_func(s,s,s,s,s,s,s)
+if ![gdb_skip_stdio_test "call str_func(s,s,s,s,s,s,s,s)"] {
+ send_gdb "call str_func(s,s,s,s,s,s,s)\n"
+ gdb_expect {
+ -re "first string arg is: test string\[ \t\r\n\]+second string arg is: test string\[ \t\r\n\]+third string arg is: test string\[ \t\r\n\]+fourth string arg is: test string\[ \t\r\n\]+fifth string arg is: test string\[ \t\r\n\]+sixth string arg is: test string\[ \t\r\n\]+seventh string arg is: test string\[ \t\r\n\]+.*\"test stringtest stringtest stringtest stringtest stringtest stringtest string\".*$gdb_prompt $" {
+ pass "call str_func(s,s,s,s,s,s,s)"
+ }
+ -re ".*$gdb_prompt $" { fail "call str_func(s,s,s,s,s,s,s)" }
+ timeout { fail "(timeout) call str_func(s,s,s,s,s,s,s)" }
+ }
+}
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.base/callfuncs.c b/gdb/testsuite/gdb.base/callfuncs.c
new file mode 100644
index 00000000000..9917e788d0a
--- /dev/null
+++ b/gdb/testsuite/gdb.base/callfuncs.c
@@ -0,0 +1,371 @@
+/* Support program for testing gdb's ability to call functions
+ in the inferior, pass appropriate arguments to those functions,
+ and get the returned result. */
+
+#ifdef NO_PROTOTYPES
+#define PARAMS(paramlist) ()
+#else
+#define PARAMS(paramlist) paramlist
+#endif
+
+# include <stdlib.h>
+# include <string.h>
+
+char char_val1 = 'a';
+char char_val2 = 'b';
+
+short short_val1 = 10;
+short short_val2 = -23;
+
+int int_val1 = 87;
+int int_val2 = -26;
+
+long long_val1 = 789;
+long long_val2 = -321;
+
+float float_val1 = 3.14159;
+float float_val2 = -2.3765;
+
+double double_val1 = 45.654;
+double double_val2 = -67.66;
+
+#define DELTA (0.001)
+
+char *string_val1 = (char *)"string 1";
+char *string_val2 = (char *)"string 2";
+
+char char_array_val1[] = "carray 1";
+char char_array_val2[] = "carray 2";
+
+struct struct1 {
+ char c;
+ short s;
+ int i;
+ long l;
+ float f;
+ double d;
+ char a[4];
+} struct_val1 = { 'x', 87, 76, 51, 2.1234, 9.876, "foo" };
+
+/* Some functions that can be passed as arguments to other test
+ functions, or called directly. */
+#ifdef PROTOTYPES
+int add (int a, int b)
+#else
+int add (a, b) int a, b;
+#endif
+{
+ return (a + b);
+}
+
+#ifdef PROTOTYPES
+int doubleit (int a)
+#else
+int doubleit (a) int a;
+#endif
+{
+ return (a + a);
+}
+
+int (*func_val1) PARAMS((int,int)) = add;
+int (*func_val2) PARAMS((int)) = doubleit;
+
+/* An enumeration and functions that test for specific values. */
+
+enum enumtype { enumval1, enumval2, enumval3 };
+enum enumtype enum_val1 = enumval1;
+enum enumtype enum_val2 = enumval2;
+enum enumtype enum_val3 = enumval3;
+
+#ifdef PROTOTYPES
+int t_enum_value1 (enum enumtype enum_arg)
+#else
+int t_enum_value1 (enum_arg) enum enumtype enum_arg;
+#endif
+{
+ return (enum_arg == enum_val1);
+}
+
+#ifdef PROTOTYPES
+int t_enum_value2 (enum enumtype enum_arg)
+#else
+int t_enum_value2 (enum_arg) enum enumtype enum_arg;
+#endif
+{
+ return (enum_arg == enum_val2);
+}
+
+#ifdef PROTOTYPES
+int t_enum_value3 (enum enumtype enum_arg)
+#else
+int t_enum_value3 (enum_arg) enum enumtype enum_arg;
+#endif
+{
+ return (enum_arg == enum_val3);
+}
+
+/* A function that takes a vector of integers (along with an explicit
+ count) and returns their sum. */
+
+#ifdef PROTOTYPES
+int sum_args (int argc, int argv[])
+#else
+int sum_args (argc, argv) int argc; int argv[];
+#endif
+{
+ int sumval = 0;
+ int idx;
+
+ for (idx = 0; idx < argc; idx++)
+ {
+ sumval += argv[idx];
+ }
+ return (sumval);
+}
+
+/* Test that we can call functions that take structs and return
+ members from that struct */
+
+#ifdef PROTOTYPES
+char t_structs_c (struct struct1 tstruct) { return (tstruct.c); }
+short t_structs_s (struct struct1 tstruct) { return (tstruct.s); }
+int t_structs_i (struct struct1 tstruct) { return (tstruct.i); }
+long t_structs_l (struct struct1 tstruct) { return (tstruct.l); }
+float t_structs_f (struct struct1 tstruct) { return (tstruct.f); }
+double t_structs_d (struct struct1 tstruct) { return (tstruct.d); }
+char *t_structs_a (struct struct1 tstruct)
+{
+ static char buf[8];
+ strcpy (buf, tstruct.a);
+ return buf;
+}
+#else
+char t_structs_c (tstruct) struct struct1 tstruct; { return (tstruct.c); }
+short t_structs_s (tstruct) struct struct1 tstruct; { return (tstruct.s); }
+int t_structs_i (tstruct) struct struct1 tstruct; { return (tstruct.i); }
+long t_structs_l (tstruct) struct struct1 tstruct; { return (tstruct.l); }
+float t_structs_f (tstruct) struct struct1 tstruct; { return (tstruct.f); }
+double t_structs_d (tstruct) struct struct1 tstruct; { return (tstruct.d); }
+char *t_structs_a (tstruct) struct struct1 tstruct;
+{
+ static char buf[8];
+ strcpy (buf, tstruct.a);
+ return buf;
+}
+#endif
+
+/* Test that calling functions works if there are a lot of arguments. */
+#ifdef PROTOTYPES
+int
+sum10 (int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9)
+#else
+int
+sum10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
+ int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
+#endif
+{
+ return i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9;
+}
+
+/* Test that args are passed in the right order. */
+#ifdef PROTOTYPES
+int
+cmp10 (int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9)
+#else
+int
+cmp10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
+ int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
+#endif
+{
+ return
+ (i0 == 0) && (i1 == 1) && (i2 == 2) && (i3 == 3) && (i4 == 4) &&
+ (i5 == 5) && (i6 == 6) && (i7 == 7) && (i8 == 8) && (i9 == 9);
+}
+
+/* Functions that expect specific values to be passed and return
+ either 0 or 1, depending upon whether the values were
+ passed incorrectly or correctly, respectively. */
+
+#ifdef PROTOTYPES
+int t_char_values (char char_arg1, char char_arg2)
+#else
+int t_char_values (char_arg1, char_arg2)
+char char_arg1, char_arg2;
+#endif
+{
+ return ((char_arg1 == char_val1) && (char_arg2 == char_val2));
+}
+
+int
+#ifdef PROTOTYPES
+t_small_values (char arg1, short arg2, int arg3, char arg4, short arg5,
+ char arg6, short arg7, int arg8, short arg9, short arg10)
+#else
+t_small_values (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
+ char arg1;
+ short arg2;
+ int arg3;
+ char arg4;
+ short arg5;
+ char arg6;
+ short arg7;
+ int arg8;
+ short arg9;
+ short arg10;
+#endif
+{
+ return arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10;
+}
+
+#ifdef PROTOTYPES
+int t_short_values (short short_arg1, short short_arg2)
+#else
+int t_short_values (short_arg1, short_arg2)
+ short short_arg1, short_arg2;
+#endif
+{
+ return ((short_arg1 == short_val1) && (short_arg2 == short_val2));
+}
+
+#ifdef PROTOTYPES
+int t_int_values (int int_arg1, int int_arg2)
+#else
+int t_int_values (int_arg1, int_arg2)
+int int_arg1, int_arg2;
+#endif
+{
+ return ((int_arg1 == int_val1) && (int_arg2 == int_val2));
+}
+
+#ifdef PROTOTYPES
+int t_long_values (long long_arg1, long long_arg2)
+#else
+int t_long_values (long_arg1, long_arg2)
+long long_arg1, long_arg2;
+#endif
+{
+ return ((long_arg1 == long_val1) && (long_arg2 == long_val2));
+}
+
+/* NOTE: THIS FUNCTION MUST NOT BE PROTOTYPED!!!!!
+ There must be one version of "t_float_values" (this one)
+ that is not prototyped, and one (if supported) that is (following).
+ That way GDB can be tested against both cases. */
+
+int t_float_values (float_arg1, float_arg2)
+float float_arg1, float_arg2;
+{
+ return ((float_arg1 - float_val1) < DELTA
+ && (float_arg1 - float_val1) > -DELTA
+ && (float_arg2 - float_val2) < DELTA
+ && (float_arg2 - float_val2) > -DELTA);
+}
+
+int
+#ifdef NO_PROTOTYPES
+/* In this case we are just duplicating t_float_values, but that is the
+ easiest way to deal with either ANSI or non-ANSI. */
+t_float_values2 (float_arg1, float_arg2)
+ float float_arg1, float_arg2;
+#else
+t_float_values2 (float float_arg1, float float_arg2)
+#endif
+{
+ return ((float_arg1 - float_val1) < DELTA
+ && (float_arg1 - float_val1) > -DELTA
+ && (float_arg2 - float_val2) < DELTA
+ && (float_arg2 - float_val2) > -DELTA);
+}
+
+#ifdef PROTOTYPES
+int t_double_values (double double_arg1, double double_arg2)
+#else
+int t_double_values (double_arg1, double_arg2)
+double double_arg1, double_arg2;
+#endif
+{
+ return ((double_arg1 - double_val1) < DELTA
+ && (double_arg1 - double_val1) > -DELTA
+ && (double_arg2 - double_val2) < DELTA
+ && (double_arg2 - double_val2) > -DELTA);
+}
+
+#ifdef PROTOTYPES
+int t_string_values (char *string_arg1, char *string_arg2)
+#else
+int t_string_values (string_arg1, string_arg2)
+char *string_arg1, *string_arg2;
+#endif
+{
+ return (!strcmp (string_arg1, string_val1) &&
+ !strcmp (string_arg2, string_val2));
+}
+
+#ifdef PROTOTYPES
+int t_char_array_values (char char_array_arg1[], char char_array_arg2[])
+#else
+int t_char_array_values (char_array_arg1, char_array_arg2)
+char char_array_arg1[], char_array_arg2[];
+#endif
+{
+ return (!strcmp (char_array_arg1, char_array_val1) &&
+ !strcmp (char_array_arg2, char_array_val2));
+}
+
+
+/* This used to simply compare the function pointer arguments with
+ known values for func_val1 and func_val2. Doing so is valid ANSI
+ code, but on some machines (RS6000, HPPA, others?) it may fail when
+ called directly by GDB.
+
+ In a nutshell, it's not possible for GDB to determine when the address
+ of a function or the address of the function's stub/trampoline should
+ be passed.
+
+ So, to avoid GDB lossage in the common case, we perform calls through the
+ various function pointers and compare the return values. For the HPPA
+ at least, this allows the common case to work.
+
+ If one wants to try something more complicated, pass the address of
+ a function accepting a "double" as one of its first 4 arguments. Call
+ that function indirectly through the function pointer. This would fail
+ on the HPPA. */
+
+#ifdef PROTOTYPES
+int t_func_values (int (*func_arg1)(int, int), int (*func_arg2)(int))
+#else
+int t_func_values (func_arg1, func_arg2)
+int (*func_arg1) PARAMS ((int, int));
+int (*func_arg2) PARAMS ((int));
+#endif
+{
+ return ((*func_arg1) (5,5) == (*func_val1) (5,5)
+ && (*func_arg2) (6) == (*func_val2) (6));
+}
+
+#ifdef PROTOTYPES
+int t_call_add (int (*func_arg1)(int, int), int a, int b)
+#else
+int t_call_add (func_arg1, a, b)
+int (*func_arg1) PARAMS ((int, int));
+int a, b;
+#endif
+{
+ return ((*func_arg1)(a, b));
+}
+
+
+/* Gotta have a main to be able to generate a linked, runnable
+ executable, and also provide a useful place to set a breakpoint. */
+extern void * malloc() ;
+int main ()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ malloc(1);
+ t_double_values(double_val1, double_val2);
+ t_structs_c(struct_val1);
+ return 0 ;
+}
diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp
new file mode 100644
index 00000000000..90f83434f43
--- /dev/null
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
@@ -0,0 +1,441 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+# and modified by Bob Manson. (manson@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "callfuncs"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+if {$hp_aCC_compiler} {
+ set prototypes 1
+} else {
+ set prototypes 0
+}
+
+# Some targets can't do function calls, so don't even bother with this
+# test.
+if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ continue
+}
+
+# Set the current language to C. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_c {} {
+ global gdb_prompt
+
+ send_gdb "set language c\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language c (timeout)" ; return 0; }
+ }
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"c\".*$gdb_prompt $" {
+ pass "set language to \"c\""
+ return 1
+ }
+ -re ".*$gdb_prompt $" {
+ fail "setting language to \"c\""
+ return 0
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return 0
+ }
+ }
+}
+
+# FIXME: Before calling this proc, we should probably verify that
+# we can call inferior functions and get a valid integral value
+# returned.
+# Note that it is OK to check for 0 or 1 as the returned values, because C
+# specifies that the numeric value of a relational or logical expression
+# (computed in the inferior) is 1 for true and 0 for false.
+
+proc do_function_calls {} {
+ global prototypes
+ global gcc_compiled
+ global gdb_prompt
+
+ # We need to up this because this can be really slow on some boards.
+ set timeout 60;
+
+ gdb_test "p t_char_values(0,0)" " = 0"
+ gdb_test "p t_char_values('a','b')" " = 1"
+ gdb_test "p t_char_values(char_val1,char_val2)" " = 1"
+ gdb_test "p t_char_values('a',char_val2)" " = 1"
+ gdb_test "p t_char_values(char_val1,'b')" " = 1"
+
+ gdb_test "p t_short_values(0,0)" " = 0"
+ gdb_test "p t_short_values(10,-23)" " = 1"
+ gdb_test "p t_short_values(short_val1,short_val2)" " = 1"
+ gdb_test "p t_short_values(10,short_val2)" " = 1"
+ gdb_test "p t_short_values(short_val1,-23)" " = 1"
+
+ gdb_test "p t_int_values(0,0)" " = 0"
+ gdb_test "p t_int_values(87,-26)" " = 1"
+ gdb_test "p t_int_values(int_val1,int_val2)" " = 1"
+ gdb_test "p t_int_values(87,int_val2)" " = 1"
+ gdb_test "p t_int_values(int_val1,-26)" " = 1"
+
+ gdb_test "p t_long_values(0,0)" " = 0"
+ gdb_test "p t_long_values(789,-321)" " = 1"
+ gdb_test "p t_long_values(long_val1,long_val2)" " = 1"
+ gdb_test "p t_long_values(789,long_val2)" " = 1"
+ gdb_test "p t_long_values(long_val1,-321)" " = 1"
+
+ if ![target_info exists gdb,skip_float_tests] {
+ gdb_test "p t_float_values(0.0,0.0)" " = 0"
+
+ # These next four tests fail on the mn10300.
+ # The first value is passed in regs, the other in memory.
+ # Gcc emits different stabs for the two parameters; the first is
+ # claimed to be a float, the second a double.
+ # dbxout.c in gcc claims this is the desired behavior.
+ setup_xfail "mn10300-*-*"
+ gdb_test "p t_float_values(3.14159,-2.3765)" " = 1"
+ setup_xfail "mn10300-*-*"
+ gdb_test "p t_float_values(float_val1,float_val2)" " = 1"
+ setup_xfail "mn10300-*-*"
+ gdb_test "p t_float_values(3.14159,float_val2)" " = 1"
+ setup_xfail "mn10300-*-*"
+ gdb_test "p t_float_values(float_val1,-2.3765)" " = 1"
+
+ # Test passing of arguments which might not be widened.
+ # Under stabs, GCC doesn't tell us whether the function was
+ # prototyped or not.
+ if {$gcc_compiled} { setup_xfail_format "stabs" }
+ gdb_test "p t_float_values2(0.0,0.0)" " = 0"
+
+ # Although PR 5318 mentions SunOS specifically, this seems
+ # to be a generic problem on quite a few platforms.
+ if $prototypes then {
+ setup_xfail "sparc-*-*" "mips*-*-*" 5318
+ if {!$gcc_compiled} then {
+ setup_xfail "alpha-dec-osf2*" "i*86-*-sysv4*" 5318
+ }
+ }
+
+ # Under stabs, GCC doesn't tell us whether the function was
+ # prototyped or not.
+ if {$gcc_compiled} { setup_xfail_format "stabs" }
+ gdb_test "p t_float_values2(3.14159,float_val2)" " = 1"
+
+ gdb_test "p t_small_values(1,2,3,4,5,6,7,8,9,10)" " = 55"
+
+ gdb_test "p t_double_values(0.0,0.0)" " = 0"
+ gdb_test "p t_double_values(45.654,-67.66)" " = 1"
+ gdb_test "p t_double_values(double_val1,double_val2)" " = 1"
+ gdb_test "p t_double_values(45.654,double_val2)" " = 1"
+ gdb_test "p t_double_values(double_val1,-67.66)" " = 1"
+ }
+
+ gdb_test "p t_string_values(string_val2,string_val1)" " = 0"
+ gdb_test "p t_string_values(string_val1,string_val2)" " = 1"
+ gdb_test "p t_string_values(\"string 1\",\"string 2\")" " = 1"
+ gdb_test "p t_string_values(\"string 1\",string_val2)" " = 1"
+ gdb_test "p t_string_values(string_val1,\"string 2\")" " = 1"
+
+ gdb_test "p t_char_array_values(char_array_val2,char_array_val1)" " = 0"
+ gdb_test "p t_char_array_values(char_array_val1,char_array_val2)" " = 1"
+ gdb_test "p t_char_array_values(\"carray 1\",\"carray 2\")" " = 1"
+ gdb_test "p t_char_array_values(\"carray 1\",char_array_val2)" " = 1"
+ gdb_test "p t_char_array_values(char_array_val1,\"carray 2\")" " = 1"
+
+ gdb_test "p doubleit(4)" " = 8"
+ gdb_test "p add(4,5)" " = 9"
+ gdb_test "p t_func_values(func_val2,func_val1)" " = 0"
+ gdb_test "p t_func_values(func_val1,func_val2)" " = 1"
+
+ # On the rs6000, we need to pass the address of the trampoline routine,
+ # not the address of add itself. I don't know how to go from add to
+ # the address of the trampoline. Similar problems exist on the HPPA,
+ # and in fact can present an unsolvable problem as the stubs may not
+ # even exist in the user's program. We've slightly recoded t_func_values
+ # to avoid such problems in the common case. This may or may not help
+ # the RS6000.
+ setup_xfail "rs6000*-*-*"
+ setup_xfail "powerpc*-*-*"
+ if {![istarget hppa*-*-hpux*]} then {
+ gdb_test "p t_func_values(add,func_val2)" " = 1"
+ }
+
+ setup_xfail "rs6000*-*-*"
+ setup_xfail "powerpc*-*-*"
+ if {![istarget hppa*-*-hpux*]} then {
+ gdb_test "p t_func_values(func_val1,doubleit)" " = 1"
+ }
+
+ setup_xfail "rs6000*-*-*"
+ setup_xfail "powerpc*-*-*"
+ if {![istarget hppa*-*-hpux*]} then {
+ gdb_test "p t_call_add(add,3,4)" " = 7"
+ }
+ gdb_test "p t_call_add(func_val1,3,4)" " = 7"
+
+ gdb_test "p t_enum_value1(enumval1)" " = 1"
+ gdb_test "p t_enum_value1(enum_val1)" " = 1"
+ gdb_test "p t_enum_value1(enum_val2)" " = 0"
+
+ gdb_test "p t_enum_value2(enumval2)" " = 1"
+ gdb_test "p t_enum_value2(enum_val2)" " = 1"
+ gdb_test "p t_enum_value2(enum_val1)" " = 0"
+
+ gdb_test "p sum_args(1,{2})" " = 2"
+ gdb_test "p sum_args(2,{2,3})" " = 5"
+ gdb_test "p sum_args(3,{2,3,4})" " = 9"
+ gdb_test "p sum_args(4,{2,3,4,5})" " = 14"
+
+ gdb_test "p sum10 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)" " = 55"
+
+ gdb_test "p cmp10 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)" " = 1"
+
+ gdb_test "p t_structs_c(struct_val1)" "= 120 'x'" \
+ "call inferior func with struct - returns char"
+ gdb_test "p t_structs_s(struct_val1)" "= 87" \
+ "call inferior func with struct - returns short"
+ gdb_test "p t_structs_i(struct_val1)" "= 76" \
+ "call inferior func with struct - returns int"
+ gdb_test "p t_structs_l(struct_val1)" "= 51" \
+ "call inferior func with struct - returns long"
+ gdb_test "p t_structs_f(struct_val1)" "= 2.12.*" \
+ "call inferior func with struct - returns float"
+ gdb_test "p t_structs_d(struct_val1)" "= 9.87.*" \
+ "call inferior func with struct - returns double"
+ gdb_test "p t_structs_a(struct_val1)" "= (.unsigned char .. )?\"foo\"" \
+ "call inferior func with struct - returns char *"
+}
+
+# Procedure to get current content of all registers.
+global all_registers_content
+set all_registers_content ""
+proc do_get_all_registers { } {
+ global gdb_prompt
+ global expect_out
+ global all_registers_content
+
+ set all_registers_content ""
+ send_gdb "info all-registers\n"
+ gdb_expect {
+ -re "info all-registers\r\n(.*)$gdb_prompt $" {
+ set all_registers_content $expect_out(1,string)
+ }
+ default {}
+ }
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "set print sevenbit-strings" ""
+gdb_test "set print address off" ""
+gdb_test "set width 0" ""
+
+if { $hp_aCC_compiler } {
+ # Do not set language explicitly to 'C'. This will cause aCC
+ # tests to fail because promotion rules are different. Just let
+ # the language be set to the default.
+
+ if { ![runto_main] } {
+ gdb_suppress_tests;
+ }
+
+ # However, turn off overload-resolution for aCC. Having it on causes
+ # a lot of failures.
+
+ gdb_test "set overload-resolution 0" ".*"
+} else {
+ if { ![set_lang_c] } {
+ gdb_suppress_tests;
+ } else {
+ if { ![runto_main] } {
+ gdb_suppress_tests;
+ }
+ }
+}
+
+get_debug_format
+
+# Make sure that malloc gets called and that the floating point unit
+# is initialized via a call to t_double_values.
+gdb_test "next" "t_double_values\\(double_val1, double_val2\\);.*" \
+ "next to t_double_values"
+gdb_test "next" "t_structs_c\\(struct_val1\\);.*" \
+ "next to t_structs_c"
+
+# Save all register contents.
+do_get_all_registers
+set old_reg_content $all_registers_content
+
+# Perform function calls.
+do_function_calls
+
+# Check if all registers still have the same value.
+do_get_all_registers
+set new_reg_content $all_registers_content
+if ![string compare $old_reg_content $new_reg_content] then {
+ pass "gdb function calls preserve register contents"
+} else {
+ set old_reg_content $all_registers_content
+ fail "gdb function calls preserve register contents"
+}
+
+# Set breakpoint at a function we will call from gdb.
+gdb_breakpoint add
+
+# Call function (causing a breakpoint hit in the call dummy) and do a continue,
+# make sure we are back at main and still have the same register contents.
+gdb_test "print add(4,5)" \
+ "The program being debugged stopped while.*" \
+ "stop at breakpoint in call dummy function"
+gdb_test "continue" "Continuing.*" "continue from call dummy breakpoint"
+if ![gdb_test "bt 2" \
+ "#0 main.*" \
+ "bt after continuing from call dummy breakpoint"] then {
+ do_get_all_registers
+ set new_reg_content $all_registers_content
+ if ![string compare $old_reg_content $new_reg_content] then {
+ pass "continue after stop in call dummy preserves register contents"
+ } else {
+ fail "continue after stop in call dummy preserves register contents"
+ }
+}
+
+# Call function (causing a breakpoint hit in the call dummy) and do a finish,
+# make sure we are back at main and still have the same register contents.
+gdb_test "print add(4,5)" "The program being debugged stopped while.*" ""
+gdb_test "finish" \
+ "Value returned is .* = 9" \
+ "finish from call dummy breakpoint returns correct value"
+if ![gdb_test "bt 2" \
+ "#0 main.*" \
+ "bt after finishing from call dummy breakpoint"] then {
+ do_get_all_registers
+ set new_reg_content $all_registers_content
+ if ![string compare $old_reg_content $new_reg_content] then {
+ pass "finish after stop in call dummy preserves register contents"
+ } else {
+ fail "finish after stop in call dummy preserves register contents"
+ }
+}
+
+# Call function (causing a breakpoint hit in the call dummy) and do a return
+# with a value, make sure we are back at main with the same register contents.
+gdb_test "print add(4,5)" "The program being debugged stopped while.*" ""
+if ![gdb_test "return 7" \
+ "#0 main.*" \
+ "back at main after return from call dummy breakpoint" \
+ "Make add return now. .y or n.*" \
+ "y"] then {
+ do_get_all_registers
+ set new_reg_content $all_registers_content
+ if ![string compare $old_reg_content $new_reg_content] then {
+ pass "return after stop in call dummy preserves register contents"
+ } else {
+ fail "return after stop in call dummy preserves register contents"
+ }
+}
+
+# Call function (causing a breakpoint hit in the call dummy), and
+# call another function from the call dummy frame (thereby setting up
+# several nested call dummy frames). Test that backtrace and finish
+# work when several call dummies are nested.
+gdb_breakpoint sum10
+gdb_breakpoint t_small_values
+gdb_test "print add(2,3)" "The program being debugged stopped while.*" \
+ "stop at nested call level 1"
+gdb_test "backtrace" \
+ "\#0 add \\(a=2, b=3\\).*\#1 <function called from gdb>.*\#2 main.*" \
+ "backtrace at nested call level 1"
+gdb_test "print add(4,5)" "The program being debugged stopped while.*" \
+ "stop at nested call level 2"
+gdb_test "backtrace" \
+ "\#0 add \\(a=4, b=5\\).*\#1 <function called from gdb>.*\#2 add \\(a=2, b=3\\).*\#3 <function called from gdb>.*\#4 main.*" \
+ "backtrace at nested call level 2"
+gdb_test "print sum10(2,4,6,8,10,12,14,16,18,20)" \
+ "The program being debugged stopped while.*" \
+ "stop at nested call level 3"
+gdb_test "backtrace" \
+ "\#0 sum10 \\(i0=2, i1=4, i2=6, i3=8, i4=10, i5=12, i6=14, i7=16, i8=18, i9=20\\).*\#1 <function called from gdb>.*\#2 add \\(a=4, b=5\\).*\#3 <function called from gdb>.*\#4 add \\(a=2, b=3\\).*\#5 <function called from gdb>.*\#6 main.*" \
+ "backtrace at nested call level 3"
+gdb_test "print t_small_values(1,3,5,7,9,11,13,15,17,19)" \
+ "The program being debugged stopped while.*" \
+ "stop at nested call level 4"
+gdb_test "backtrace" \
+ "\#0 t_small_values \\(arg1=1 '.001', arg2=3, arg3=5, arg4=7 '.a', arg5=9, arg6=11 '.v', arg7=13, arg8=15, arg9=17, arg10=19\\).*\#2 sum10 \\(i0=2, i1=4, i2=6, i3=8, i4=10, i5=12, i6=14, i7=16, i8=18, i9=20\\).*\#3 <function called from gdb>.*\#4 add \\(a=4, b=5\\).*\#5 <function called from gdb>.*\#6 add \\(a=2, b=3\\).*\#7 <function called from gdb>.*\#8 main.*" \
+ "backtrace at nested call level 4"
+gdb_test "finish" "Value returned is .* = 100" \
+ "Finish from nested call level 4"
+gdb_test "backtrace" \
+ "\#0 sum10 \\(i0=2, i1=4, i2=6, i3=8, i4=10, i5=12, i6=14, i7=16, i8=18, i9=20\\).*\#1 <function called from gdb>.*\#2 add \\(a=4, b=5\\).*\#3 <function called from gdb>.*\#4 add \\(a=2, b=3\\).*\#5 <function called from gdb>.*\#6 main.*" \
+ "backtrace after finish from nested call level 4"
+gdb_test "finish" "Value returned is .* = 110" \
+ "Finish from nested call level 3"
+gdb_test "backtrace" \
+ "\#0 add \\(a=4, b=5\\).*\#1 <function called from gdb>.*\#2 add \\(a=2, b=3\\).*\#3 <function called from gdb>.*\#4 main.*" \
+ "backtrace after finish from nested call level 3"
+gdb_test "finish" "Value returned is .* = 9" \
+ "Finish from nested call level 2"
+gdb_test "backtrace" \
+ "\#0 add \\(a=2, b=3\\).*\#1 <function called from gdb>.*\#2 main.*" \
+ "backtrace after finish from nested call level 2"
+gdb_test "finish" "Value returned is .* = 5" \
+ "Finish from nested call level 1"
+gdb_test "backtrace" "\#0 main .*" \
+ "backtrace after finish from nested call level 1"
+
+do_get_all_registers
+set new_reg_content $all_registers_content
+if ![string compare $old_reg_content $new_reg_content] then {
+ pass "nested call dummies preserve register contents"
+} else {
+ fail "nested call dummies preserve register contents"
+}
+
+return 0
+
diff --git a/gdb/testsuite/gdb.base/code-expr.exp b/gdb/testsuite/gdb.base/code-expr.exp
new file mode 100644
index 00000000000..03cc4effe74
--- /dev/null
+++ b/gdb/testsuite/gdb.base/code-expr.exp
@@ -0,0 +1,395 @@
+# Copyright (C) 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Written by Michael Snyder, Red Hat, Inc., 9/20/2001
+
+# This file is part of the gdb testsuite
+# Tests for type expressions using the new "@code" and "@data" modifiers.
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "cvexpr"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+gdb_test "set print sevenbit-strings" "" ""
+gdb_test "set print address off" "" ""
+gdb_test "set width 0" "" ""
+
+set ws "\[ \t\]*"
+
+#
+# Test casting a scalar to const
+#
+
+gdb_test "whatis (@code char) v_char" \
+ "type = @code char" \
+ "(@code char)"
+gdb_test "whatis (@code signed char) v_signed_char" \
+ "type = @code signed char" \
+ "(@code signed char)"
+gdb_test "whatis (@code unsigned char) v_unsigned_char" \
+ "type = @code (unsigned char|char)" \
+ "(@code unsigned char)"
+gdb_test "whatis (@code short) v_short" \
+ "type = @code (short|short int)" \
+ "(@code short)"
+gdb_test "whatis (@code signed short) v_signed_short" \
+ "type = @code (short|short int|signed short|signed short int)" \
+ "(@code signed short)"
+gdb_test "whatis (@code unsigned short) v_unsigned_short" \
+ "type = @code (unsigned short|short unsigned int)" \
+ "(@code unsigned short)"
+gdb_test "whatis (@code int) v_int" \
+ "type = @code int" \
+ "(@code int)"
+gdb_test "whatis (@code signed int) v_signed_int" \
+ "type = @code (signed int|int)" \
+ "(@code signed int)"
+gdb_test "whatis (@code unsigned int) v_unsigned_int" \
+ "type = @code unsigned int" \
+ "(@code unsigned int)"
+gdb_test "whatis (@code long) v_long" \
+ "type = @code (long|long int)" \
+ "(@code long)"
+gdb_test "whatis (@code signed long) v_signed_long" \
+ "type = @code (signed |)long( int|)" \
+ "(@code signed long)"
+gdb_test "whatis (@code unsigned long) v_unsigned_long" \
+ "type = @code (unsigned long|long unsigned int)" \
+ "(@code unsigned long)"
+gdb_test "whatis (@code long long) v_long_long" \
+ "type = @code long long( int|)" \
+ "(@code long long)"
+gdb_test "whatis (@code signed long long) v_signed_long_long" \
+ "type = @code (signed |)long long( int|)" \
+ "(@code signed long long)"
+gdb_test "whatis (@code unsigned long long) v_unsigned_long_long" \
+ "type = @code (unsigned long long|long long unsigned int)" \
+ "(@code unsigned long long)"
+gdb_test "whatis (@code float) v_float" \
+ "type = @code float" \
+ "(@code float)"
+gdb_test "whatis (@code double) v_double" \
+ "type = @code double" \
+ "(@code double)"
+
+#
+# Test casting a scalar to @data
+#
+
+gdb_test "whatis (@data char) v_char" \
+ "type = @data char" \
+ "(@data char)"
+gdb_test "whatis (@data signed char) v_signed_char" \
+ "type = @data signed char" \
+ "(@data signed char)"
+gdb_test "whatis (@data unsigned char) v_unsigned_char" \
+ "type = @data (unsigned char|char)" \
+ "(@data unsigned char)"
+gdb_test "whatis (@data short) v_short" \
+ "type = @data (short|short int)" \
+ "(@data short)"
+gdb_test "whatis (@data signed short) v_signed_short" \
+ "type = @data (short|short int|signed short|signed short int)" \
+ "(@data signed short)"
+gdb_test "whatis (@data unsigned short) v_unsigned_short" \
+ "type = @data (unsigned short|short unsigned int)" \
+ "(@data unsigned short)"
+gdb_test "whatis (@data int) v_int" \
+ "type = @data int" \
+ "(@data int)"
+gdb_test "whatis (@data signed int) v_signed_int" \
+ "type = @data (signed int|int)" \
+ "(@data signed int)"
+gdb_test "whatis (@data unsigned int) v_unsigned_int" \
+ "type = @data unsigned int" \
+ "(@data unsigned int)"
+gdb_test "whatis (@data long) v_long" \
+ "type = @data (long|long int)" \
+ "(@data long)"
+gdb_test "whatis (@data signed long) v_signed_long" \
+ "type = @data (signed |)long( int|)" \
+ "(@data signed long)"
+gdb_test "whatis (@data unsigned long) v_unsigned_long" \
+ "type = @data (unsigned long|long unsigned int)" \
+ "(@data unsigned long)"
+gdb_test "whatis (@data long long) v_long_long" \
+ "type = @data long long( int|)" \
+ "(@data long long)"
+gdb_test "whatis (@data signed long long) v_signed_long_long" \
+ "type = @data (signed |)long long( int|)" \
+ "(@data signed long long)"
+gdb_test "whatis (@data unsigned long long) v_unsigned_long_long" \
+ "type = @data (unsigned long long|long long unsigned int)" \
+ "(@data unsigned long long)"
+gdb_test "whatis (@data float) v_float" \
+ "type = @data float" \
+ "(@data float)"
+gdb_test "whatis (@data double) v_double" \
+ "type = @data double" \
+ "(@data double)"
+
+#
+# Now put the '@code' and '@data' keywords after the base type.
+#
+
+gdb_test "whatis (char @code) v_char" \
+ "type = @code char" \
+ "(char @code)"
+gdb_test "whatis (signed char @code) v_signed_char" \
+ "type = @code signed char" \
+ "(signed char @code)"
+gdb_test "whatis (unsigned char @code) v_unsigned_char" \
+ "type = @code (unsigned char|char)" \
+ "(unsigned char @code)"
+gdb_test "whatis (short @code) v_short" \
+ "type = @code (short|short int)" \
+ "(short @code)"
+gdb_test "whatis (signed short @code) v_signed_short" \
+ "type = @code (short|short int|signed short|signed short int)" \
+ "(signed short @code)"
+gdb_test "whatis (unsigned short @code) v_unsigned_short" \
+ "type = @code (unsigned short|short unsigned int)" \
+ "(unsigned short @code)"
+gdb_test "whatis (int @code) v_int" \
+ "type = @code int" \
+ "(int @code)"
+gdb_test "whatis (signed int @code) v_signed_int" \
+ "type = @code (signed int|int)" \
+ "(signed int @code)"
+gdb_test "whatis (unsigned int @code) v_unsigned_int" \
+ "type = @code unsigned int" \
+ "(unsigned int @code)"
+gdb_test "whatis (long @code) v_long" \
+ "type = @code (long|long int)" \
+ "(long @code)"
+gdb_test "whatis (signed long @code) v_signed_long" \
+ "type = @code (signed |)long( int|)" \
+ "(signed long @code)"
+gdb_test "whatis (unsigned long @code) v_unsigned_long" \
+ "type = @code (unsigned long|long unsigned int)" \
+ "(unsigned long @code)"
+gdb_test "whatis (long long @code) v_long_long" \
+ "type = @code long long( int|)" \
+ "(long long @code)"
+gdb_test "whatis (signed long long @code) v_signed_long_long" \
+ "type = @code (signed |)long long( int|)" \
+ "(signed long long @code)"
+gdb_test "whatis (unsigned long long @code) v_unsigned_long_long" \
+ "type = @code (unsigned long long|long long unsigned int)" \
+ "(unsigned long long @code)"
+gdb_test "whatis (float @code) v_float" \
+ "type = @code float" \
+ "(float @code)"
+gdb_test "whatis (double @code) v_double" \
+ "type = @code double" \
+ "(double @code)"
+
+gdb_test "whatis (char @data) v_char" \
+ "type = @data char" \
+ "(char @data)"
+gdb_test "whatis (signed char @data) v_signed_char" \
+ "type = @data signed char" \
+ "(signed char @data)"
+gdb_test "whatis (unsigned char @data) v_unsigned_char" \
+ "type = @data (unsigned char|char)" \
+ "(unsigned char @data)"
+gdb_test "whatis (short @data) v_short" \
+ "type = @data (short|short int)" \
+ "(short @data)"
+gdb_test "whatis (signed short @data) v_signed_short" \
+ "type = @data (short|short int|signed short|signed short int)" \
+ "(signed short @data)"
+gdb_test "whatis (unsigned short @data) v_unsigned_short" \
+ "type = @data (unsigned short|short unsigned int)" \
+ "(unsigned short @data)"
+gdb_test "whatis (int @data) v_int" \
+ "type = @data int" \
+ "(int @data)"
+gdb_test "whatis (signed int @data) v_signed_int" \
+ "type = @data (signed int|int)" \
+ "(signed int @data)"
+gdb_test "whatis (unsigned int @data) v_unsigned_int" \
+ "type = @data unsigned int" \
+ "(unsigned int @data)"
+gdb_test "whatis (long @data) v_long" \
+ "type = @data (long|long int)" \
+ "(long @data)"
+gdb_test "whatis (signed long @data) v_signed_long" \
+ "type = @data (signed |)long( int|)" \
+ "(signed long @data)"
+gdb_test "whatis (unsigned long @data) v_unsigned_long" \
+ "type = @data (unsigned long|long unsigned int)" \
+ "(unsigned long @data)"
+gdb_test "whatis (long long @data) v_long_long" \
+ "type = @data long long( int|)" \
+ "(long long @data)"
+gdb_test "whatis (signed long long @data) v_signed_long_long" \
+ "type = @data (signed |)long long( int|)" \
+ "(signed long long @data)"
+gdb_test "whatis (unsigned long long @data) v_unsigned_long_long" \
+ "type = @data (unsigned long long|long long unsigned int)" \
+ "(unsigned long long @data)"
+gdb_test "whatis (float @data) v_float" \
+ "type = @data float" \
+ "(float @data)"
+gdb_test "whatis (double @data) v_double" \
+ "type = @data double" \
+ "(double @data)"
+
+#
+# enums
+#
+
+gdb_test "whatis (@code enum misordered) v_misordered" \
+ "type = @code enum misordered" \
+ "(@code enum misordered)"
+gdb_test "whatis (enum misordered @code) v_misordered" \
+ "type = @code enum misordered" \
+ "(enum misordered @code)"
+gdb_test "whatis (@data enum misordered) v_misordered" \
+ "type = @data enum misordered" \
+ "(@data enum misordered)"
+gdb_test "whatis (enum misordered @data) v_misordered" \
+ "type = @data enum misordered" \
+ "(enum misordered @data)"
+
+#
+# Pointers
+#
+
+gdb_test "whatis (@code int *) v_int_pointer" \
+ "type = @code int${ws}\\*" \
+ "(@code int *)"
+gdb_test "whatis (int @code *) v_int_pointer" \
+ "type = @code int${ws}\\*" \
+ "(int @code *)"
+gdb_test "whatis (int * @code) v_int_pointer" \
+ "type = int \\*${ws}@code" \
+ "(int * @code)"
+gdb_test "whatis (@code int * @code) v_int_pointer" \
+ "type = @code int${ws}\\*${ws}@code" \
+ "(@code int * @code)"
+gdb_test "whatis (int @code * @code) v_int_pointer" \
+ "type = @code int${ws}\\*${ws}@code" \
+ "(int @code * @code)"
+
+gdb_test "whatis (@code int **) v_int_pointer_pointer" \
+ "type = @code int${ws}\\*${ws}\\*" \
+ "(@code int **)"
+gdb_test "whatis (int @code **) v_int_pointer_pointer" \
+ "type = @code int${ws}\\*${ws}\\*" \
+ "(int @code **)"
+gdb_test "whatis (int ** @code) v_int_pointer_pointer" \
+ "type = int \\*${ws}\\*${ws}@code" \
+ "(int ** @code)"
+gdb_test "whatis (@code int * @code *) v_int_pointer_pointer" \
+ "type = @code int${ws}\\*${ws}@code${ws}\\*" \
+ "(@code int * @code *)"
+gdb_test "whatis (int @code * @code *) v_int_pointer_pointer" \
+ "type = @code int${ws}\\*${ws}@code${ws}\\*" \
+ "(int @code * @code *)"
+gdb_test "whatis (@code int * @code * @code) v_int_pointer_pointer" \
+ "type = @code int${ws}\\*${ws}@code${ws}\\*${ws}@code" \
+ "(@code int * @code * @code)"
+gdb_test "whatis (int @code * @code * @code) v_int_pointer_pointer" \
+ "type = @code int${ws}\\*${ws}@code${ws}\\*${ws}@code" \
+ "(int @code * @code * @code)"
+
+#
+# Arrays TODO
+#
+
+#
+# Pointers to arrays, arrays of pointers TODO
+#
+
+#
+# Structs and Unions
+#
+
+gdb_test "whatis (@code struct t_struct) v_struct1" \
+ "type = @code struct t_struct" \
+ "(@code struct t_struct)"
+gdb_test "whatis (@code union t_union) v_union" \
+ "type = @code union t_union" \
+ "(@code union t_union)"
+gdb_test "whatis (struct t_struct @code) v_struct1" \
+ "type = @code struct t_struct" \
+ "(struct t_struct @code)"
+gdb_test "whatis (union t_union @code) v_union" \
+ "type = @code union t_union" \
+ "(union t_union @code)"
+gdb_test "whatis (@code struct t_struct *) &v_struct1" \
+ "type = @code struct t_struct${ws}\\*" \
+ "(@code struct t_struct *)"
+gdb_test "whatis (@code union t_union *) &v_union" \
+ "type = @code union t_union${ws}\\*" \
+ "(@code union t_union *)"
+gdb_test "whatis (struct t_struct @code *) &v_struct1" \
+ "type = @code struct t_struct${ws}\\*" \
+ "(struct t_struct @code *)"
+gdb_test "whatis (union t_union @code *) &v_union" \
+ "type = @code union t_union${ws}\\*" \
+ "(union t_union @code *)"
+gdb_test "whatis (struct t_struct * @code) &v_struct1" \
+ "type = struct t_struct${ws}\\*${ws}@code" \
+ "(struct t_struct * @code)"
+gdb_test "whatis (union t_union * @code) &v_union" \
+ "type = union t_union${ws}\\*${ws}@code" \
+ "(union t_union * @code)"
+gdb_test "whatis (@code struct t_struct * @code) &v_struct1" \
+ "type = @code struct t_struct${ws}\\*${ws}@code" \
+ "(@code struct t_struct * @code)"
+gdb_test "whatis (@code union t_union * @code) &v_union" \
+ "type = @code union t_union${ws}\\*${ws}@code" \
+ "(@code union t_union * @code)"
+gdb_test "whatis (struct t_struct @code * @code) &v_struct1" \
+ "type = @code struct t_struct${ws}\\*${ws}@code" \
+ "(struct t_struct @code * @code)"
+gdb_test "whatis (union t_union @code * @code) &v_union" \
+ "type = @code union t_union${ws}\\*${ws}@code" \
+ "(union t_union @code * @code)"
+
+#
+# Function pointers TODO
+#
+
diff --git a/gdb/testsuite/gdb.base/commands.exp b/gdb/testsuite/gdb.base/commands.exp
new file mode 100644
index 00000000000..dfaf965ca99
--- /dev/null
+++ b/gdb/testsuite/gdb.base/commands.exp
@@ -0,0 +1,456 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1997, 1998, 1999, 2000,
+# 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# test special commands (if, while, etc)
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "run"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/commands
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+delete_breakpoints
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+proc gdbvar_simple_if_test {} {
+ global gdb_prompt
+
+ gdb_test "set \$foo = 0" "" "set foo in gdbvar_simple_if_test"
+ # All this test should do is print 0xdeadbeef once.
+ gdb_test "if \$foo == 1\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" \
+ "\\\$\[0-9\]* = 0xdeadbeef" "gdbvar_simple_if_test #1"
+ # All this test should do is print 0xfeedface once.
+ gdb_test "if \$foo == 0\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" \
+ "\\\$\[0-9\]* = 0xfeedface" "gdbvar_simple_if_test #2"
+}
+
+proc gdbvar_simple_while_test {} {
+ global gdb_prompt
+
+ gdb_test "set \$foo = 5" "" "set foo in gdbvar_simple_while_test"
+ # This test should print 0xfeedface five times.
+ gdb_test "while \$foo > 0\np/x 0xfeedface\nset \$foo -= 1\nend" \
+ "\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
+ "gdbvar_simple_while_test #1"
+}
+
+proc gdbvar_complex_if_while_test {} {
+ global gdb_prompt
+
+ gdb_test "set \$foo = 4" "" "set foo in gdbvar complex_if_while_test"
+ # This test should alternate between 0xdeadbeef and 0xfeedface two times.
+ gdb_test "while \$foo > 0\nset \$foo -= 1\nif \(\$foo % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend" \
+ "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
+ "gdbvar_complex_if_while_test #1"
+}
+
+proc progvar_simple_if_test {} {
+ global gdb_prompt
+
+ if [target_info exists noargs] {
+ verbose "Skipping progvar_simple_if_test because of noargs."
+ return
+ }
+
+ if { ![runto factorial] } then { gdb_suppress_tests; }
+ # Don't depend upon argument passing, since most simulators don't
+ # currently support it. Bash value variable to be what we want.
+ gdb_test "p value=5" "" "set value to 5 in progvar_simple_if_test #1"
+ # All this test should do is print 0xdeadbeef once.
+ gdb_test "if value == 1\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" \
+ "\\\$\[0-9\]* = 0xdeadbeef" \
+ "progvar_simple_if_test #1"
+ # All this test should do is print 0xfeedface once.
+ gdb_test "if value == 5\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" \
+ "\\\$\[0-9\]* = 0xfeedface" \
+ "progvar_simple_if_test #2"
+ gdb_stop_suppressing_tests;
+}
+
+proc progvar_simple_while_test {} {
+ global gdb_prompt
+
+ if [target_info exists noargs] {
+ verbose "Skipping progvar_simple_while_test because of noargs."
+ return
+ }
+
+ gdb_test "set args 5" "" "set args in progvar_simple_while_test"
+ if { ![runto factorial] } then { gdb_suppress_tests }
+ # Don't depend upon argument passing, since most simulators don't
+ # currently support it. Bash value variable to be what we want.
+ gdb_test "p value=5" "" "set value to 5 in progvar_simple_if_test #2"
+ # This test should print 0xfeedface five times.
+ gdb_test "while value > 0\np/x 0xfeedface\nset value -= 1\nend" \
+ "\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
+ "progvar_simple_while_test #1"
+ gdb_stop_suppressing_tests;
+}
+
+proc progvar_complex_if_while_test {} {
+ global gdb_prompt
+
+ if [target_info exists noargs] {
+ verbose "Skipping progvar_simple_if_while_test because of noargs."
+ return
+ }
+
+ gdb_test "set args 4" "" "set args in progvar_complex_if_while_test"
+ if { ![runto factorial] } then { gdb_suppress_tests }
+ # Don't depend upon argument passing, since most simulators don't
+ # currently support it. Bash value variable to be what we want.
+ gdb_test "p value=4" "" "set value to 4 in progvar_simple_if_test"
+ # This test should alternate between 0xdeadbeef and 0xfeedface two times.
+ gdb_test "while value > 0\nset value -= 1\nif \(value % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend" \
+ "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
+ "progvar_complex_if_while_test #1"
+ gdb_stop_suppressing_tests;
+}
+
+proc if_while_breakpoint_command_test {} {
+ if [target_info exists noargs] {
+ verbose "Skipping if_while_breakpoint_command_test because of noargs."
+ return
+ }
+
+ gdb_test "set args 5" "" "set args in if_while_breakpoint_command_test"
+ if { ![runto factorial] } then { gdb_suppress_tests }
+ # Don't depend upon argument passing, since most simulators don't
+ # currently support it. Bash value variable to be what we want.
+ gdb_test "p value=5" "" "set value to 5 in progvar_simple_if_test"
+ delete_breakpoints
+ gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #1"
+
+ send_gdb "commands\n"
+ gdb_expect {
+ -re "End with" {
+ pass "commands in if_while_breakpoint_command_test"
+ }
+ default {
+ fail "(timeout or eof) commands in if_while_breakpoint_command_test"
+ }
+ }
+ # This test should alternate between 0xdeadbeef and 0xfeedface two times.
+ gdb_test "while value > 0\nset value -= 1\nif \(value % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend\nend" \
+ "" \
+ "commands part 2 in if_while_breakpoint_command_test"
+ gdb_test "continue" \
+ "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
+ "if_while_breakpoint_command_test #1"
+ gdb_test "info break" \
+ "while.*set.*if.*p/x.*else.*p/x.*end.*" \
+ "info break in if_while_breakpoint_command_test"
+ gdb_stop_suppressing_tests;
+}
+
+# Test that we can run the inferior from breakpoint commands.
+#
+# The expected behavior is that all commands after the first "step"
+# shall be ignored. See the gdb manual, "Break Commands",
+# subsection "Breakpoint command lists".
+
+proc infrun_breakpoint_command_test {} {
+ if [target_info exists noargs] {
+ verbose "Skipping infrun_breakpoint_command_test because of noargs."
+ return
+ }
+
+ gdb_test "set args 6" "" "set args in infrun_breakpoint_command_test"
+ if { ![runto factorial] } then { gdb_suppress_tests }
+ # Don't depend upon argument passing, since most simulators don't
+ # currently support it. Bash value variable to be what we want.
+ gdb_test "p value=6" "" "set value to 6 in progvar_simple_if_test #1"
+ delete_breakpoints
+ gdb_test "break factorial if value == 5" "Breakpoint.*at.*"
+
+# infrun_breakpoint_command_test - This test was broken into two parts
+# to get around a synchronization problem in expect.
+# part1: issue the gdb command "commands"
+# part2: send the list of commands
+ send_gdb "commands\n"
+ gdb_expect {
+ -re "End with" {
+ pass "commands in infrun_breakpoint_command_test #1"
+ }
+ default {
+ fail "(timeout or eof) commands in infrun_breakpoint_command_test"
+ }
+ }
+ gdb_test "step\nstep\nstep\nstep\nend" "" \
+ "commands in infrun_breakpoint_command_test #2"
+
+ gdb_test "continue" \
+ "Continuing.*.*.*Breakpoint \[0-9\]*, factorial \\(value=5\\).*at.*\[0-9\]*\[ \]*if \\(value > 1\\) \{.*\[0-9\]*\[ \]*value \\*= factorial \\(value - 1\\);.*" \
+ "continue in infrun_breakpoint_command_test"
+
+ gdb_stop_suppressing_tests;
+}
+
+proc breakpoint_command_test {} {
+ if [target_info exists noargs] {
+ verbose "Skipping breakpoint_command_test because of noargs."
+ return
+ }
+
+ gdb_test "set args 6" "" "set args in breakpoint_command_test"
+ if { ![runto factorial] } then { gdb_suppress_tests; }
+ # Don't depend upon argument passing, since most simulators don't
+ # currently support it. Bash value variable to be what we want.
+ gdb_test "p value=6" "" "set value to 6 in progvar_simple_if_test #2"
+ delete_breakpoints
+ gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #2"
+ gdb_test "commands\nprintf \"Now the value is %d\\n\", value\nend" \
+ "End with.*" "commands in breakpoint_command_test"
+ gdb_test "continue" \
+ "Breakpoint \[0-9\]*, factorial.*Now the value is 5" \
+ "continue in breakpoint_command_test"
+ gdb_test "print value" " = 5" "print value in breakpoint_command_test"
+ gdb_stop_suppressing_tests;
+}
+
+# Test a simple user defined command (with arguments)
+proc user_defined_command_test {} {
+ global gdb_prompt
+
+ gdb_test "set \$foo = 4" "" "set foo in user_defined_command_test"
+
+ send_gdb "define mycommand\n"
+ gdb_expect {
+ -re "End with" {
+ pass "define mycommand in user_defined_command_test"
+ }
+ default {
+ fail "(timeout or eof) define mycommand in user_defined_command_test"
+ }
+ }
+ # This test should alternate between 0xdeadbeef and 0xfeedface two times.
+ gdb_test "while \$arg0 > 0\nset \$arg0 -= 1\nif \(\$arg0 % 2\) == 1\np/x 0xdeadbeef\nelse\np/x 0xfeedface\nend\nend\nend" \
+ "" \
+ "enter commands in user_defined_command_test"
+
+ gdb_test "mycommand \$foo" \
+ "\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface\[^\n\]*\n\\\$\[0-9\]* = 0xdeadbeef\[^\n\]*\n\\\$\[0-9\]* = 0xfeedface" \
+ "execute user defined command in user_defined_command_test"
+ gdb_test "show user mycommand" \
+ " while \\\$arg0.*set.* if \\\(\\\$arg0.*p/x.* else\[^\n\].*p/x.* end\[^\n\].* end\[^\n\].*" \
+ "display user command in user_defined_command_test"
+}
+
+proc watchpoint_command_test {} {
+ global noargs
+ global gdb_prompt
+
+ if [target_info exists noargs] {
+ verbose "Skipping watchpoint_command_test because of noargs."
+ return
+ }
+
+ gdb_test "set args 6" "" "set args in watchpoint_command_test"
+ if { ![runto factorial] } then { return }
+ delete_breakpoints
+
+ # Verify that we can create a watchpoint, and give it a commands
+ # list that continues the inferior. We set the watchpoint on a
+ # local variable, too, so that it self-deletes when the watched
+ # data goes out of scope.
+ #
+ # What should happen is: Each time the watchpoint triggers, it
+ # continues the inferior. Eventually, the watchpoint will self-
+ # delete, when the watched variable is out of scope. But by that
+ # time, the inferior should have exited. GDB shouldn't crash or
+ # anything untoward as a result of this.
+ #
+ set wp_id -1
+
+ send_gdb "watch local_var\n"
+ gdb_expect {
+ -re ".*\[Ww\]atchpoint (\[0-9\]*): local_var.*$gdb_prompt $" {
+ set wp_id $expect_out(1,string)
+ pass "watch local_var"
+ }
+ -re "$gdb_prompt $"\
+ {fail "watch local_var"}
+ timeout {fail "(timeout) watch local_var"}
+ }
+
+ if {$wp_id == -1} {return}
+
+ send_gdb "commands $wp_id\n"
+ gdb_expect {
+ -re "Type commands for when breakpoint $wp_id is hit, one per line.*>" {
+ pass "begin commands on watch"
+ }
+ -re "$gdb_prompt $" {fail "begin commands on watch"}
+ timeout {fail "(timeout) begin commands on watch"}
+ }
+ send_gdb "print value\n"
+ gdb_expect {
+ -re ">" {pass "add print command to watch"}
+ -re "$gdb_prompt $" {fail "add print command to watch"}
+ timeout {fail "(timeout) add print command to watch"}
+ }
+ send_gdb "continue\n"
+ gdb_expect {
+ -re ">" {pass "add continue command to watch"}
+ -re "$gdb_prompt $" {fail "add continue command to watch"}
+ timeout {fail "(timeout) add continue command to watch"}
+ }
+ send_gdb "end\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "end commands on watch"}
+ timeout {fail "(timeout) end commands on watch"}
+ }
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*run.c:57.*$gdb_prompt $" {
+ pass "continue with watch"
+ }
+ -re "$gdb_prompt $" {fail "continue with watch"}
+ timeout {fail "(timeout) continue with watch"}
+ }
+}
+
+proc test_command_prompt_position {} {
+ global gdb_prompt
+
+ if [target_info exists noargs] {
+ verbose "Skipping test_command_prompt_position because of noargs."
+ return
+ }
+
+ if { ![runto factorial] } then { gdb_suppress_tests; }
+ # Don't depend upon argument passing, since most simulators don't
+ # currently support it. Bash value variable to be what we want.
+ delete_breakpoints
+ gdb_test "break factorial" "Breakpoint.*at.*" "break factorial #3"
+ gdb_test "p value=5" "" "set value to 5 in test_command_prompt_position"
+ # All this test should do is print 0xdeadbeef once.
+ gdb_test "if value == 1\np/x 0xfeedface\nelse\np/x 0xdeadbeef\nend" \
+ "\\\$\[0-9\]* = 0xdeadbeef" \
+ "if test in test_command_prompt_position"
+
+ # Now let's test for the correct position of the '>' in gdb's
+ # prompt for commands. It should be at the beginning of the line,
+ # and not after one space.
+
+ send_gdb "commands\n"
+ gdb_expect {
+ -re "Type commands.*End with.*\[\r\n\]>$" {
+ send_gdb "printf \"Now the value is %d\\n\", value\n"
+ gdb_expect {
+ -re "^printf.*value\r\n>$" {
+ send_gdb "end\n"
+ gdb_expect {
+ -re "^end\r\n$gdb_prompt $" {
+ pass "> OK in test_command_prompt_position"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "some other message in test_command_prompt_position"
+ }
+ timeout {
+ fail "(timeout) 1 in test_command_prompt_position"
+ }
+ }
+ }
+ -re "^ >$" { fail "> not OK in test_command_prompt_position" }
+ -re ".*$gdb_prompt $" {
+ fail "wrong message in test_command_prompt_position"
+ }
+ timeout {
+ fail "(timeout) 2 in test_command_prompt_position "
+ }
+ }
+ }
+ -re "Type commands.*End with.*\[\r\n\] >$" {
+ fail "prompt not OK in test_command_prompt_position"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "commands in test_command_prompt_position"
+ }
+ timeout { fail "(timeout) 3 commands in test_command_prompt_position" }
+ }
+
+ gdb_stop_suppressing_tests;
+}
+
+
+
+proc deprecated_command_test {} {
+ gdb_test "maintenance deprecate blah" "Can't find command.*" \
+ "tried to deprecate non-existing command"
+
+ gdb_test "maintenance deprecate p \"new_p\"" "" "maintenance deprecate p \"new_p\" /1/"
+ gdb_test "p 5" \
+ "Warning: 'p', an alias for the command 'print' is deprecated.*Use 'new_p'.*" \
+ "p deprecated warning, with replacement"
+ gdb_test "p 5" ".\[0-9\]* = 5.*" "Deprecated warning goes away /1/"
+
+ gdb_test "maintenance deprecate p \"new_p\"" "" "maintenance deprecate p \"new_p\" /2/"
+ gdb_test "maintenance deprecate print \"new_print\"" ""
+ gdb_test "p 5" \
+ "Warning: command 'print' \\(p\\) is deprecated.*Use 'new_print'.*" \
+ "both alias and command are deprecated"
+ gdb_test "p 5" ".\[0-9\]* = 5.*" "Deprecated warning goes away /2/"
+
+ gdb_test "maintenance deprecate set remote memory-read-packet-size \"srm\" " \
+ "" \
+ "deprecate long command /1/"
+ gdb_test "set remote memory-read-packet-size" \
+ "Warning: command 'set remote memory-read-packet-size' is deprecated.*Use 'srm'.*" \
+ "long command deprecated /1/"
+
+ gdb_test "maintenance deprecate set remote memory-read-packet-size" \
+ "" \
+ "deprecate long command /2/"
+ gdb_test "set remote memory-read-packet-size" \
+ "Warning: command 'set remote memory-read-packet-size' is deprecated.*No alternative known.*" \
+ "long command deprecated with no alternative /2/"
+
+ gdb_test "maintenance deprecate" \
+ "\"maintenance deprecate\".*" \
+ "deprecate with no arguments"
+}
+
+
+gdbvar_simple_if_test
+gdbvar_simple_while_test
+gdbvar_complex_if_while_test
+progvar_simple_if_test
+progvar_simple_while_test
+progvar_complex_if_while_test
+if_while_breakpoint_command_test
+infrun_breakpoint_command_test
+breakpoint_command_test
+user_defined_command_test
+watchpoint_command_test
+test_command_prompt_position
+deprecated_command_test
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp
new file mode 100644
index 00000000000..332e1697a7f
--- /dev/null
+++ b/gdb/testsuite/gdb.base/completion.exp
@@ -0,0 +1,749 @@
+# Copyright 1998, 1999, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This file is part of the gdb testsuite.
+
+#
+# tests for command completion
+#
+# Here are some useful test cases for completion.
+# They should be tested with both M-? and TAB.
+#
+# "show output-" "radix"
+# "show output" "-radix"
+# "p" ambiguous (commands starting with p--path, print, printf, etc.)
+# "p " ambiguous (all symbols)
+# "info t foo" no completions
+# "info t " no completions
+# "info t" ambiguous ("info target", "info terminal", etc.)
+# "info ajksdlfk" no completions
+# "info ajksdlfk " no completions
+# "info" " "
+# "info " ambiguous (all info commands)
+# "p \"break" unambiguous (completes to filename "break.c")
+# "p \"break." unambiguous (should complete to "break.c" but does not,
+# due to readline limitations)
+# "p 'a" ambiguous (all symbols starting with a)
+# "p b-a" ambiguous (all symbols starting with a)
+# "p b-" ambiguous (all symbols)
+# "file Make" "file" (word break hard to screw up here)
+# "file ../gdb.stabs/we" "ird" (needs to not break word at slash)
+#
+
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+
+global usestubs
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "break"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+gdb_exit
+
+# Don't let a .inputrc file or an existing setting of INPUTRC mess up
+# the test results. Even if /dev/null doesn't exist on the particular
+# platform, the readline library will use the default setting just by
+# failing to open the file. OTOH, opening /dev/null successfully will
+# also result in the default settings being used since nothing will be
+# read from this file.
+global env
+if [info exists env(INPUTRC)] {
+ set old_inputrc $env(INPUTRC)
+}
+set env(INPUTRC) "/dev/null"
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ perror "tests suppressed"
+}
+
+set oldtimeout1 $timeout
+set timeout 30
+
+
+send_gdb "hfgfh\t"
+sleep 1
+gdb_expect {
+ -re "^hfgfh\\\x07$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "Undefined command: \"hfgfh\"\\. Try \"help\"\\..*$gdb_prompt $"\
+ { pass "complete 'hfgfh'"}
+ -re ".*$gdb_prompt $" { fail "complete 'hfgfh'"}
+ timeout {fail "(timeout) complete 'hfgfh'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'hfgfh'" }
+ timeout { fail "(timeout) complete 'hfgfh'" }
+ }
+
+#exp_internal 0
+
+send_gdb "show output\t"
+sleep 1
+gdb_expect {
+ -re "^show output-radix $"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
+ { pass "complete 'show output'"}
+ -re ".*$gdb_prompt $" { fail "complete 'show output'"}
+ timeout {fail "(timeout) complete 'show output'"}
+ }
+ }
+ -re "^show output$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
+ { fail "complete 'show output'"}
+ -re ".*$gdb_prompt $" { fail "complete 'show output'"}
+ timeout { fail "(timeout) complete 'show output'"}
+ }
+
+ }
+
+ -re ".*$gdb_prompt $" { fail "complete 'show output'" }
+ timeout { fail "(timeout) complete 'show output'" }
+ }
+
+
+send_gdb "show output-\t"
+sleep 1
+gdb_expect {
+ -re "^show output-radix $"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
+ { pass "complete 'show output-'"}
+ -re ".*$gdb_prompt $" { fail "complete 'show output-'"}
+ timeout {fail "(timeout) complete 'show output-'"}
+ }
+ }
+ -re "^show output-$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "Default output radix for printing of values is 10\\..*$gdb_prompt $"\
+ { fail "complete 'show output-'"}
+ -re ".*$gdb_prompt $" { fail "complete 'show output-'"}
+ timeout { fail "(timeout) complete 'show output-'"}
+ }
+
+ }
+
+ -re ".*$gdb_prompt $" { fail "complete 'show output-'" }
+ timeout { fail "(timeout) complete 'show output-'" }
+ }
+
+send_gdb "p\t"
+sleep 1
+gdb_expect {
+ -re "^p\\\x07$"\
+ { send_gdb "\n"
+ sleep 1
+ gdb_expect {
+ -re "The history is empty\\..*$gdb_prompt $"\
+ { pass "complete 'p'"}
+ -re ".*$gdb_prompt $" { fail "complete 'p'"}
+ timeout {fail "(timeout) complete 'p' 2"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'p'" }
+ timeout { fail "(timeout) complete 'p' 1" }
+ }
+
+send_gdb "p \t"
+sleep 3
+gdb_expect {
+ -re "^p \\\x07$"\
+ { send_gdb "\n"
+ sleep 1
+ gdb_expect {
+ -re "The history is empty\\..*$gdb_prompt $"\
+ { pass "complete 'p '"}
+ -re ".*$gdb_prompt $" { fail "complete 'p '"}
+ timeout {fail "(timeout) complete 'p ' 1"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'p '" }
+ timeout { fail "(timeout) complete 'p ' 2" }
+ }
+
+
+send_gdb "info t foo\t"
+sleep 1
+gdb_expect {
+ -re "^info t foo\\\x07$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "Ambiguous info command \"t foo\": target, terminal, threads, tp, tracepoints, types\\..*$gdb_prompt $"\
+ { pass "complete 'info t foo'"}
+ -re ".*$gdb_prompt $" { fail "complete 'info t foo'"}
+ timeout {fail "(timeout) complete 'info t foo'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'info t foo'" }
+ timeout { fail "(timeout) complete 'info t foo'" }
+ }
+
+send_gdb "info t\t"
+sleep 1
+gdb_expect {
+ -re "^info t\\\x07$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "Ambiguous info command \"t\": target, terminal, threads, tp, tracepoints, types\\..
+*$gdb_prompt $"\
+ { pass "complete 'info t'"}
+ -re ".*$gdb_prompt $" { fail "complete 'info t'"}
+ timeout {fail "(timeout) complete 'info t'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'info t'" }
+ timeout { fail "(timeout) complete 'info t'" }
+ }
+
+
+send_gdb "info t \t"
+sleep 1
+gdb_expect {
+ -re "^info t \\\x07$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "Ambiguous info command \"t \": target, terminal, threads, tp, tracepoints, types\\..
+*$gdb_prompt $"\
+ { pass "complete 'info t '"}
+ -re ".*$gdb_prompt $" { fail "complete 'info t '"}
+ timeout {fail "(timeout) complete 'info t '"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'info t '" }
+ timeout { fail "(timeout) complete 'info t '" }
+ }
+
+
+send_gdb "info asdfgh\t"
+sleep 1
+gdb_expect {
+ -re "^info asdfgh\\\x07$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "Undefined info command: \"asdfgh\". Try \"help info\"\\..
+*$gdb_prompt $"\
+ { pass "complete 'info asdfgh'"}
+ -re ".*$gdb_prompt $" { fail "complete 'info asdfgh'"}
+ timeout {fail "(timeout) complete 'info asdfgh'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'info asdfgh'" }
+ timeout { fail "(timeout) complete 'info asdfgh'" }
+ }
+
+
+send_gdb "info asdfgh \t"
+sleep 1
+gdb_expect {
+ -re "^info asdfgh \\\x07$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "Undefined info command: \"asdfgh \". Try \"help info\"\\..
+*$gdb_prompt $"\
+ { pass "complete 'info asdfgh '"}
+ -re ".*$gdb_prompt $" { fail "complete 'info asdfgh '"}
+ timeout {fail "(timeout) complete 'info asdfgh '"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'info asdfgh '" }
+ timeout { fail "(timeout) complete 'info asdfgh '" }
+ }
+
+send_gdb "info\t"
+sleep 1
+gdb_expect {
+ -re "^info $"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\n.*info address.*info watchpoints.*\r\n\r\nType \"help info\" followed by info subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
+ { pass "complete 'info'"}
+ -re ".*$gdb_prompt $" { fail "complete 'info'"}
+ timeout {fail "(timeout) complete 'info'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'info'" }
+ timeout { fail "(timeout) complete 'info'" }
+ }
+
+send_gdb "info \t"
+sleep 1
+gdb_expect {
+ -re "^info \\\x07$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "\"info\" must be followed by the name of an info command\\.\r\nList of info subcommands:\r\n\r\n.*info address.*Type \"help info\" followed by info subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
+ { pass "complete 'info '"}
+ -re ".*$gdb_prompt $" { fail "complete 'info '"}
+ timeout {fail "(timeout) complete 'info '"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'info '" }
+ timeout { fail "(timeout) complete 'info '" }
+ }
+
+
+send_gdb "info \t"
+sleep 1
+gdb_expect {
+ -re "^info \\\x07$"\
+ { send_gdb "\t"
+ gdb_expect {
+ -re "address.*types.*$gdb_prompt info $"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "\"info\".*unambiguous\\..*$gdb_prompt $"\
+ { pass "complete (2) 'info '"}
+ -re ".*$gdb_prompt $" { fail "complete (2) 'info '"}
+ timeout {fail "(timeout) complete (2) 'info '"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'info '"}
+ timeout {fail "(timeout) complete (2) 'info '"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'info '" }
+ timeout { fail "(timeout) complete (2) 'info '" }
+ }
+
+
+send_gdb "p \"break\t"
+sleep 1
+gdb_expect {
+ -re "^p \"break\\\x07$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" { fail "complete 'p \"break'"}
+ timeout {fail "(timeout) complete 'p \"break'"}
+ }
+ }
+ -re "^p \"break\\.c\"$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" { pass "complete 'p \"break'"}
+ timeout {fail "(timeout) complete 'p \"break'"}
+ }
+ }
+ -re "^p \"break.*$"
+ { send_gdb "\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" { fail "complete 'p \"break'"}
+ timeout {fail "(timeout) complete 'p \"break'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'p \"break'" }
+ timeout { fail "(timeout) complete 'p \"break'" }
+ }
+
+setup_xfail "*-*-*"
+send_gdb "p \"break.\t"
+sleep 1
+gdb_expect {
+ -re "^p \"break\\.\\\x07$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" { fail "complete 'p \"break.'"}
+ timeout {fail "(timeout) complete 'p \"break.'"}
+ }
+ }
+ -re "^p \"break\\.c\"$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" { pass "complete 'p \"break.'"}
+ timeout {fail "(timeout) complete 'p \"break.'"}
+ }
+ }
+ -re "^p \"break\\..*$"
+ { send_gdb "\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" { fail "complete 'p \"break.'"}
+ timeout {fail "(timeout) complete 'p \"break.'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'p \"break.'" }
+ timeout { fail "(timeout) complete 'p \"break.'" }
+ }
+
+send_gdb "p 'a\t"
+sleep 1
+gdb_expect {
+ -re "^p 'a\\\x07$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $"\
+ { pass "complete 'p \'a'"}
+ -re ".*$gdb_prompt $" { fail "complete 'p \'a'"}
+ timeout {fail "(timeout) complete 'p \'a'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'p \'a'" }
+ timeout { fail "(timeout) complete 'p \'a'" }
+ }
+
+send_gdb "p 'a\t"
+sleep 1
+gdb_expect {
+ -re "^p 'a\\\x07$" {
+ send_gdb "\t"
+ gdb_expect {
+ -re ".*argv.*$gdb_prompt p .a$" {
+ send_gdb "\n"
+ gdb_expect {
+ -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
+ pass "complete (2) 'p \'a'"
+ }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
+ timeout { fail "(timeout) complete (2) 'p \'a'" }
+ }
+ }
+ -re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
+ send_gdb "n"
+ gdb_expect {
+ -re "\\(gdb\\) p 'a$" {
+ send_gdb "\n"
+ gdb_expect {
+ -re "(Invalid character constant\\.|Unmatched single quote\\.).*$gdb_prompt $" {
+ pass "complete (2) 'p \'a'"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "complete (2) 'p \'a'"
+ }
+ timeout { fail "(timeout) complete (2) 'p \'a'" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
+ timeout { fail "(timeout) complete (2) 'p \'a'" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
+ timeout { fail "(timeout) complete (2) 'p \'a'" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'p \'a'" }
+ timeout { fail "(timeout) complete (2) 'p \'a'" }
+}
+
+
+# These tests used to try completing the shorter "p b-a".
+# Unfortunately, on some systems, there are .o files in system
+# libraries which declare static variables named `b'. Of course,
+# those variables aren't really in scope, as far as the compiler is
+# concerned. But GDB deliberately tries to be more liberal: if you
+# enter an identifier that doesn't have any binding in scope, GDB will
+# search all the program's compilation units for a static variable of
+# the given name.
+#
+# This behavior can help avoid a lot of pedantry, so it's usually a
+# good thing. But in this test case, it causes GDB to print the value
+# of some random variable, instead of giving us the "No symbol..."
+# error we were expecting.
+#
+# For example, on S/390 linux, the file s_atan.c in libm.a declares a
+# `b', which is a structure containing an int and a float, so GDB says
+# ``Argument to arithmetic operation not a number or boolean'' instead
+# of ``No symbol ...''.
+#
+# So, I'm hoping that there is no system with a static library variable named
+# `no_var_by_this_name'.
+send_gdb "p no_var_named_this-a\t"
+sleep 1
+gdb_expect {
+ -re "^p no_var_named_this-a\\\x07$" {
+ send_gdb "\n"
+ gdb_expect {
+ -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
+ pass "complete 'p no_var_named_this-a'"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "complete 'p no_var_named_this-a'"
+ }
+ timeout {
+ fail "(timeout) complete 'p no_var_named_this-a'"
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "complete 'p no_var_named_this-a'"
+ }
+ timeout {
+ fail "(timeout) complete 'p no_var_named_this-a'"
+ }
+}
+
+send_gdb "p no_var_named_this-a\t"
+sleep 1
+gdb_expect {
+ -re "^p no_var_named_this-a\\\x07$" {
+ send_gdb "\t"
+ gdb_expect {
+ -re ".*argv.*$gdb_prompt p no_var_named_this-a$" {
+ send_gdb "\n"
+ gdb_expect {
+ -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
+ pass "complete (2) 'p no_var_named_this-a'"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "complete (2) 'p no_var_named_this-a'"
+ }
+ timeout {
+ fail "(timeout) complete (2) 'p no_var_named_this-a'"
+ }
+ }
+ }
+ -re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
+ send_gdb "n"
+ gdb_expect {
+ -re "\\(gdb\\) p no_var_named_this-a$" {
+ send_gdb "\n"
+ gdb_expect {
+ -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
+ pass "complete (2) 'p no_var_named_this-a'"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "complete (2) 'p no_var_named_this-a'"
+ }
+ timeout {
+ fail "(timeout) complete (2) 'p no_var_named_this-a'"
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "complete (2) 'p no_var_named_this-a'"
+ }
+ timeout {
+ fail "(timeout) complete (2) 'p no_var_named_this-a'"
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "complete (2) 'p no_var_named_this-a'"
+ }
+ timeout { fail "(timeout) complete (2) 'p no_var_named_this-a'" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'p no_var_named_this-a'" }
+ timeout { fail "(timeout) complete (2) 'p no_var_named_this-a'" }
+}
+
+send_gdb "p no_var_named_this-\t"
+sleep 1
+gdb_expect {
+ -re "^p no_var_named_this-\\\x07$" {
+ send_gdb "\t"
+ gdb_expect {
+ -re "(There are $decimal possibilities\\. Do you really\r\nwish to see them all.|Display all $decimal possibilities.) \\(y or n\\)$" {
+ send_gdb "n"
+ gdb_expect {
+ -re "\\(gdb\\) p no_var_named_this-$" {
+ send_gdb "\n"
+ gdb_expect {
+ -re "No symbol \"no_var_named_this\" in current context\\..*$gdb_prompt $" {
+ pass "complete (2) 'p no_var_named_this-'"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "complete (2) 'p no_var_named_this-'"
+ }
+ timeout {
+ fail "(timeout) complete (2) 'p no_var_named_this-'"
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "complete (2) 'p no_var_named_this-'"
+ }
+ timeout {
+ fail "(timeout) complete (2) 'p no_var_named_this-'"
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "complete (2) 'p no_var_named_this-'"
+ }
+ timeout { fail "(timeout) complete (2) 'p no_var_named_this-'" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete (2) 'p no_var_named_this-'" }
+ timeout { fail "(timeout) complete (2) 'p no_var_named_this-'" }
+}
+
+
+# The following tests used to simply try to complete `${objdir}/Make',
+# and so on. The problem is that ${objdir} can be very long; the
+# completed filename may be more than eighty characters wide. When
+# this happens, readline tries to manage things, producing output that
+# may make sense on the screen, but is rather hard for our script to
+# recognize.
+#
+# In the case that motivated this change, the (gdb) prompt occupied
+# the leftmost six columns, and `${objdump}/' was seventy-four
+# characters long --- eighty in all. After printing the slash,
+# readline emitted a space, a carriage return, and then `Makefile'
+# (the tab character being received as input after `Make'.
+#
+# Basically, you have to let readline do whatever it's going to do to
+# make the screen look right. If it happens to use a different
+# strategy on Tuesdays to get the cursor in the right place, that's
+# not something the testsuite should care about.
+#
+# So, we avoid long lines. We `cd' to ${objdir} first, and then do
+# the completion relative to the current directory.
+#
+# Note that if we are building in the source tree, then there will be
+# more than one completion for ./Make, so we need to handle that also.
+# A better long term solution might be to create a temporary directory,
+# populate it with a set of known names, and use that directory to
+# test completions.
+
+gdb_test "cd ${objdir}" "Working directory ${objdir}.*" "cd to \${objdir}"
+send_gdb "file ./Make\t"
+sleep 1
+gdb_expect {
+ -re "^file ./Make(\\\x07|)file.*$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "\r\nA program is being debugged already\\. Kill it\\? \\(y or n\\) $"\
+ { send_gdb "n\n"
+ gdb_expect {
+ -re "\r\nProgram not killed\\.\r\n$gdb_prompt $"\
+ { pass "complete 'file ./Make'"}
+ -re ".*$gdb_prompt $" { fail "complete 'file ./Make'"}
+ timeout {fail "(timeout) complete 'file ./Make'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'file ./Make'"}
+ timeout {fail "(timeout) complete 'file ./Make'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'file ./Make'" }
+ timeout { fail "(timeout) complete 'file ./Make'" }
+ }
+
+# ${srcdir} may be a relative path. We want to make sure we end up
+# in the right directory - so make sure we know where it is.
+set mydir [pwd]
+cd ${srcdir}
+set fullsrcdir [pwd]
+cd ${mydir}
+
+gdb_test "cd ${fullsrcdir}" "Working directory ${fullsrcdir}.*" "cd to \${srcdir}"
+send_gdb "file ./gdb.base/compl\t"
+sleep 1
+gdb_expect {
+ -re "^file ./gdb.base/completion\\.exp $"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "\r\nA program is being debugged already\\. Kill it\\? \\(y or n\\) $"
+\
+ { send_gdb "n\n"
+ gdb_expect {
+ -re "\r\nProgram not killed\\.\r\n$gdb_prompt $"\
+ { pass "complete 'file ./gdb.base/compl'"}
+ -re ".*$gdb_prompt $" { fail "complete 'file ./gdb.base/compl'"}
+ timeout {fail "(timeout) complete 'file ./gdb.base/compl'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'file ./gdb.base/compl'"}
+ timeout {fail "(timeout) complete 'file ./gdb.base/compl'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'file ./gdb.base/compl'" }
+ timeout { fail "(timeout) complete 'file ./gdb.base/compl'" }
+ }
+
+send_gdb "info func mark\t"
+sleep 1
+gdb_expect {
+ -re "^info func mark.*er$"\
+ {
+ send_gdb "\t\t"
+ sleep 3
+ gdb_expect {
+ -re "marker1.*$gdb_prompt info func marker$"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "All functions matching regular expression \"marker\":.*File.*break.c:\r\nint marker1\\(\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long int\\);.*$gdb_prompt $"\
+ { pass "complete 'info func mar'"}
+ -re ".*$gdb_prompt $" { fail "complete 'info func mar'"}
+ timeout {fail "(timeout) complete 'info func mar'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'info func mar'"}
+ timeout {fail "(timeout) complete 'info func mar'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'info func mar'" }
+ timeout { fail "(timeout) complete 'info func mar'" }
+ }
+
+
+send_gdb "set follow-fork-mode \t\t"
+sleep 1
+gdb_expect {
+ -re "ask.*child.*parent.*$gdb_prompt set follow-fork-mode $"\
+ { send_gdb "\n"
+ gdb_expect {
+ -re "Requires an argument.*ask.*child.*parent.*$gdb_prompt $"\
+ { pass "complete 'set follow-fork-mode'"}
+ -re "Ambiguous item \"\"\\..*$gdb_prompt $"\
+ { pass "complete 'set follow-fork-mode'"}
+ -re ".*$gdb_prompt $" { fail "complete 'set follow-fork-mode'"}
+ timeout {fail "(timeout) complete 'set follow-fork-mode'"}
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "complete 'set follow-fork-mode'" }
+ timeout { fail "(timeout) complete 'set follow-fork-mode'" }
+ }
+
+# Restore globals modified in this test...
+if [info exists old_inputrc] {
+ set env(INPUTRC) $old_inputrc
+} else {
+ unset env(INPUTRC)
+}
+set timeout $oldtimeout1
+
+return 0
diff --git a/gdb/testsuite/gdb.base/cond-expr.exp b/gdb/testsuite/gdb.base/cond-expr.exp
new file mode 100644
index 00000000000..746873cac8a
--- /dev/null
+++ b/gdb/testsuite/gdb.base/cond-expr.exp
@@ -0,0 +1,122 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This file is part of the gdb testsuite
+
+#
+# test of evaluation of conditional expressions, with constants and
+# variables. Using the print and the whatis command
+# written with the only purpose in mind to cover the holes in the
+# eval.c file
+#
+# source file "int-type.c"
+#
+
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Check to see if we have an executable to test. If not, then either we
+# haven't tried to compile one, or the compilation failed for some reason.
+# In either case, just notify the user and skip the tests in this file.
+
+set testfile "int-type"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+send_gdb "print (2 ? 3 : 4)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 3.*$gdb_prompt $" {
+ pass "print value of cond expr (const true)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of cond expr (const true)" }
+ timeout { fail "(timeout) print value of cond expr (const true)" }
+ }
+
+send_gdb "print (0 ? 3 : 4)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 4.*$gdb_prompt $" {
+ pass "print value of cond expr (const false)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of cond expr (const false)" }
+ timeout { fail "(timeout) print value of cond expr (const false)" }
+ }
+
+gdb_test "set variable x=14" "" "set variable x=14"
+gdb_test "set variable y=2" "" "set variable y=2"
+gdb_test "set variable z=3" "" "set variable z=3"
+
+send_gdb "print (x ? y : z)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 2.*$gdb_prompt $" {
+ pass "print value of cond expr (var true)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of cond expr (var true)" }
+ timeout { fail "(timeout) print value of cond expr (var true)" }
+ }
+
+gdb_test "set variable x=0" "" "set variable x=0"
+
+send_gdb "print (x ? y : z)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 3.*$gdb_prompt $" {
+ pass "print value of cond expr (var false)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of cond expr (var false)" }
+ timeout { fail "(timeout) print value of cond expr (var false)" }
+ }
+
+
+send_gdb "whatis (0 ? 3 : 4)\n"
+gdb_expect {
+ -re "type = int.*$gdb_prompt $" {
+ pass "print whatis of cond expr"
+ }
+ -re ".*$gdb_prompt $" { fail "print whatis of cond expr" }
+ timeout { fail "(timeout) print whatis of cond expr" }
+ }
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.base/condbreak.exp b/gdb/testsuite/gdb.base/condbreak.exp
new file mode 100644
index 00000000000..c234431f15f
--- /dev/null
+++ b/gdb/testsuite/gdb.base/condbreak.exp
@@ -0,0 +1,207 @@
+# Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This test was written by Rich Title.
+# Purpose is to test conditional breakpoints.
+# Modeled after "break.exp".
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+global usestubs
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "break"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+#
+# test break at function
+#
+gdb_test "break main" \
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint function"
+
+#
+# test conditional break at function
+#
+gdb_test "break marker1 if 1==1" \
+ "Breakpoint.*at.* file .*$srcfile, line.*"
+
+gdb_test "delete 2" ""
+
+#
+# test conditional break at line number
+#
+gdb_test "break 79 if 1==1" \
+ "Breakpoint.*at.* file .*$srcfile, line 79\\."
+
+gdb_test "delete 3" ""
+
+#
+# test conditional break at function
+#
+gdb_test "break marker1 if (1==1)" \
+ "Breakpoint.*at.* file .*$srcfile, line.*"
+
+#
+# test conditional break at line number
+#
+gdb_test "break 79 if (1==1)" \
+ "Breakpoint.*at.* file .*$srcfile, line 79\\."
+
+gdb_test "break marker2 if (a==43)" \
+ "Breakpoint.*at.* file .*$srcfile, line.*"
+
+#
+# check to see what breakpoints are set
+#
+
+if {$hp_aCC_compiler} {
+ set marker1_proto "\\(void\\)"
+ set marker2_proto "\\(int\\)"
+} else {
+ set marker1_proto ""
+ set marker2_proto ""
+}
+
+set main_line 75
+gdb_test "info break" \
+ "Num Type\[ \]+Disp Enb Address\[ \]+What.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in marker1$marker1_proto at .*$srcfile:4\[38\].*
+\[\t \]+stop only if 1 == 1.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:79.*
+\[\t \]+stop only if 1 == 1.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in marker2$marker2_proto at .*$srcfile:4\[49\].*
+\[\t \]+stop only if a == 43.*" \
+ "breakpoint info"
+
+
+#
+# run until the breakpoint at main is hit.
+#
+
+
+rerun_to_main
+
+#
+# run until the breakpoint at a line number
+#
+gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:79.*79\[\t \]+printf.*factorial.*" \
+ "run until breakpoint set at a line number"
+
+#
+# run until the breakpoint at marker1
+#
+# If the inferior stops at the first instruction of a source line, GDB
+# won't print the actual PC value; the source line is enough to
+# exactly specify the PC. But if the inferior is instead stopped in
+# the midst of a source line, GDB will include the PC in the
+# breakpoint hit message. This way, GDB always provides the exact
+# stop location, but avoids clutter when possible.
+#
+# Suppose you have a function written completely on one source line, like:
+# int foo (int x) { return 0; }
+# Setting a breakpoint at `foo' actually places the breakpoint after
+# foo's prologue.
+#
+# GCC's STABS writer always emits a line entry attributing the
+# prologue instructions to the line containing the function's open
+# brace, even if the first user instruction is also on that line.
+# This means that, in the case of a one-line function, you will get
+# two line entries in the debug info for the same line: one at the
+# function's entry point, and another at the first user instruction.
+# GDB preserves these duplicated line entries, and prefers the later
+# one; thus, when the program stops after the prologue, at the first
+# user instruction, GDB's search finds the second line entry, decides
+# that the PC is indeed at the beginning of a source line, and doesn't
+# print an address in the breakpoint hit message.
+#
+# GCC's Dwarf2 writer, on the other hand, squeezes out duplicate line
+# entries, so GDB considers the source line to begin at the start of
+# the function's prologue. Thus, if the program stops at the
+# breakpoint, GDB will decide that the PC is not at the beginning of a
+# source line, and will print an address.
+#
+# I think the Dwarf2 writer's behavior is arguably correct, but not
+# helpful. If the user sets a breakpoint at that source line, they
+# want that breakpoint to fall after the prologue. Identifying the
+# prologue's code with the opening brace is nice, but it shouldn't
+# take precedence over real code.
+#
+# Until the Dwarf2 writer gets fixed, I'm going to XFAIL its behavior.
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\..*Breakpoint \[0-9\]+, marker1 \\(\\) at .*$srcfile:4\[38\].*4\[38\]\[\t \]+.*$gdb_prompt $" {
+ pass "run until breakpoint at marker1"
+ }
+ -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker1 \\(\\) at .*$srcfile:4\[38\].*4\[38\]\[\t \]+.*$gdb_prompt $" {
+ xfail "run until breakpoint at marker1"
+ }
+ -re "$gdb_prompt $" {
+ fail "run until breakpoint at marker1"
+ }
+ timeout {
+ fail "(timeout) run until breakpoint at marker1"
+ }
+}
+
+# run until the breakpoint at marker2
+# Same issues here as above.
+setup_xfail hppa2.0w-*-* 11512CLLbs
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\..*Breakpoint \[0-9\]+, marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" {
+ pass "run until breakpoint at marker2"
+ }
+ -re "Continuing\\..*Breakpoint \[0-9\]+, $hex in marker2 \\(a=43\\) at .*$srcfile:4\[49\].*4\[49\]\[\t \]+.*" {
+ xfail "run until breakpoint at marker2"
+ }
+ -re "$gdb_prompt $" {
+ fail "run until breakpoint at marker2"
+ }
+ timeout {
+ fail "(timeout) run until breakpoint at marker2"
+ }
+}
diff --git a/gdb/testsuite/gdb.base/configure b/gdb/testsuite/gdb.base/configure
new file mode 100644
index 00000000000..77d2d144ada
--- /dev/null
+++ b/gdb/testsuite/gdb.base/configure
@@ -0,0 +1,902 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=gdbvars.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:575: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:596: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:614: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.base/configure.in b/gdb/testsuite/gdb.base/configure.in
new file mode 100644
index 00000000000..7c4e397caa2
--- /dev/null
+++ b/gdb/testsuite/gdb.base/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(gdbvars.exp)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.base/consecutive.c b/gdb/testsuite/gdb.base/consecutive.c
new file mode 100644
index 00000000000..bfea4296aec
--- /dev/null
+++ b/gdb/testsuite/gdb.base/consecutive.c
@@ -0,0 +1,20 @@
+/*
+ Purpose of this test: to test breakpoints on consecutive instructions.
+*/
+
+int a[7] = {1, 2, 3, 4, 5, 6, 7};
+
+/* assert: first line of foo has more than one instruction. */
+int foo ()
+{
+ return a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6];
+}
+
+main()
+{
+#ifdef usestubs
+ set_debug_traps ();
+ breakpoint ();
+#endif
+ foo ();
+}
diff --git a/gdb/testsuite/gdb.base/consecutive.exp b/gdb/testsuite/gdb.base/consecutive.exp
new file mode 100644
index 00000000000..b04ae5ae9b8
--- /dev/null
+++ b/gdb/testsuite/gdb.base/consecutive.exp
@@ -0,0 +1,111 @@
+# Copyright 2001
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder. (msnyder@redhat.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# Test breakpoints at consecutive instruction addresses.
+#
+
+set prms_id 0
+set bug_id 0
+
+set testfile "consecutive"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+set nl "\[\r\n\]+"
+
+gdb_breakpoint foo
+gdb_test "continue" "Breakpoint $decimal, foo .*" \
+ "continue to breakpoint in foo"
+
+set bp_addr 0
+set stop_addr 0
+
+send_gdb "x /2i \$pc\n"
+gdb_expect {
+ global hex
+ global nl
+ global bp_addr
+ global gdb_prompt
+
+ -re "$hex.*${nl}($hex).*$gdb_prompt $" {
+ set bp_addr $expect_out(1,string)
+ pass "get breakpoint address for foo"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "get breakpoint address for foo"
+ return 0;
+ }
+ timeout {
+ fail "get breakpoint address for foo (timeout)"
+ return 0;
+ }
+}
+
+gdb_test "break \*$bp_addr" "Breakpoint $decimal at $bp_addr: file .*" \
+ "set bp, 2nd instr"
+
+send_gdb "step\n"
+gdb_expect {
+ -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" {
+ set stop_addr $expect_out(1,string)
+ if [eval expr "$bp_addr == $stop_addr"] then {
+ pass "stopped at bp, 2nd instr"
+ } else {
+ fail "stopped at bp, 2nd instr (wrong address)"
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "stopped at bp, 2nd instr"
+ }
+ timeout {
+ fail "stopped at bp, 2nd instr (timeout)"
+
+ }
+}
+
diff --git a/gdb/testsuite/gdb.base/constvars.c b/gdb/testsuite/gdb.base/constvars.c
new file mode 100644
index 00000000000..b0ce7529ecb
--- /dev/null
+++ b/gdb/testsuite/gdb.base/constvars.c
@@ -0,0 +1,183 @@
+void marker1 (void)
+{
+}
+
+/* misc. function params */
+
+int
+qux1 (const char cc, const char /*&*/ccr, const char *ccp, char *const cpc)
+{
+ return 33;
+}
+
+int
+qux2 (volatile unsigned char vuc, const volatile int cvi,
+ volatile short /*&*/vsr, volatile long *vlp, float *volatile fpv,
+ const volatile signed char *const volatile cvscpcv)
+{
+ return 400;
+}
+
+int
+main (void)
+{
+ char lave = 'B';
+ unsigned char lavish = 10;
+ short lax = 20;
+ unsigned short lecherous = 30;
+ long lechery = 40;
+ unsigned long lectern = 50;
+ float leeway = 60;
+ double legacy = 70;
+ signed char lemonade = 35;
+
+ const char laconic = 'A';
+ const unsigned char laggard = 1;
+ const short lagoon = 2;
+ const unsigned short laity = 3;
+ const long lambent = 4;
+ const unsigned long laminated = 5;
+ const float lampoon = 6;
+ const double languid = 7;
+
+ /* pointers to constant variables */
+
+ const char *legend = &lave;
+ const unsigned char *legerdemain = &lavish;
+ const short *leniency = &lax;
+ const unsigned short *leonine = &lecherous;
+ const long *lesion = &lechery;
+ const unsigned long *lethal = &lectern;
+ const float *lethargic = &leeway;
+ const double *levity = &legacy;
+
+ /* constant pointers to constant variables */
+
+ const char *const lewd = &laconic;
+ const unsigned char *const lexicographer = &laggard;
+ const short *const lexicon = &lagoon;
+ const unsigned short *const liaison = &laity;
+ const long *const libation = &lambent;
+ const unsigned long *const libelous = &laminated;
+ const float *const libertine = &lampoon;
+ const double *const libidinous = &languid;
+
+ /* this is the same as const char * legend .... */
+
+ char const *languish = &laconic;
+ unsigned char const *languor = &laggard;
+ short const *lank = &lagoon;
+ unsigned short const *lapidary = &laity;
+ long const *larceny = &lambent;
+ unsigned long const *largess = &laminated;
+ float const *lascivious = &lampoon;
+ double const *lassitude = &languid;
+
+ /* constant pointers to variable */
+
+ char *const lamprey = &lave;
+ unsigned char *const lariat = &lavish;
+ short *const laudanum = &lax;
+ unsigned short *const lecithin = &lecherous;
+ long *const leviathan = &lechery;
+ unsigned long *const libretto = &lectern;
+ float *const lissome = &leeway;
+ double *const locust = &legacy;
+
+ /* volatile variables */
+
+ volatile char vox = 'X';
+ volatile unsigned char victuals = 13;
+ volatile short vixen = 200;
+ volatile unsigned short vitriol = 300;
+ volatile long vellum = 1000;
+ volatile unsigned long valve = 2000;
+ volatile float vacuity = 3.0;
+ volatile double vertigo = 10.3;
+
+ /* pointers to volatile variables */
+
+ volatile char * vampire = &vox;
+ volatile unsigned char * viper = &victuals;
+ volatile short * vigour = &vixen;
+ volatile unsigned short * vapour = &vitriol;
+ volatile long * ventricle = &vellum;
+ volatile unsigned long * vigintillion = &valve;
+ volatile float * vocation = &vacuity;
+ volatile double * veracity = &vertigo;
+
+ /* volatile pointers to volatile variables */
+
+ volatile char * volatile vapidity = &vox;
+ volatile unsigned char * volatile velocity = &victuals;
+ volatile short * volatile veneer = &vixen;
+ volatile unsigned short * volatile video = &vitriol;
+ volatile long * volatile vacuum = &vellum;
+ volatile unsigned long * volatile veniality = &valve;
+ volatile float * volatile vitality = &vacuity;
+ volatile double * volatile voracity = &vertigo;
+
+ /* const volatile vars */
+
+ const volatile char victor = 'Y';
+ const volatile unsigned char vicar = 11;
+
+ /* pointers to const volatiles */
+
+ const volatile char * victory = &victor;
+ const volatile unsigned char * vicarage = &vicar;
+
+ /* const pointers to volatile vars */
+
+ volatile char * const vein = &vox;
+ volatile unsigned char * const vogue = &victuals;
+
+ /* const pointers to const volatile vars */
+
+ const volatile char * const cavern = &victor;
+ const volatile unsigned char * const coverlet = &vicar;
+
+ /* volatile pointers to const vars */
+
+ const char * volatile caveat = &laconic;
+ const unsigned char * volatile covenant = &laggard;
+
+ /* volatile pointers to const volatile vars */
+
+ const volatile char * volatile vizier = &victor;
+ const volatile unsigned char * volatile vanadium = &vicar;
+
+ /* const volatile pointers */
+
+ char * const volatile vane = &lave;
+ unsigned char * const volatile veldt = &lavish;
+
+ /* const volatile pointers to const vars */
+
+ const char * const volatile cove = &laconic;
+ const unsigned char * const volatile cavity = &laggard;
+
+ /* const volatile pointers to volatile vars */
+
+ volatile char * const volatile vagus = &vox;
+ volatile unsigned char * const volatile vagrancy = &victuals;
+
+ /* const volatile pointers to const volatile */
+
+ const volatile char * const volatile vagary = &victor;
+ const volatile unsigned char * const volatile vendor = &vicar;
+
+ /* misc. references */
+ /*
+ const char & radiation = laconic;
+ volatile signed char & remuneration = lemonade;
+ */
+#ifdef usestubs
+ set_debug_traps ();
+ breakpoint ();
+#endif
+ marker1 ();
+
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/constvars.exp b/gdb/testsuite/gdb.base/constvars.exp
new file mode 100644
index 00000000000..bb062ef5cb9
--- /dev/null
+++ b/gdb/testsuite/gdb.base/constvars.exp
@@ -0,0 +1,283 @@
+# Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# written by Elena Zannoni (elz@apollo.hp.com)
+#
+# This file is part of the gdb testsuite
+#
+# tests for const variables
+# const pointers to vars
+# pointers to const variables
+# const pointers to const vars
+# with mixed types
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "constvars"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+if {$hp_aCC_compiler || $hp_cc_compiler} {
+ set lang "c++"
+} else {
+ set lang ""
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [concat debug $lang]] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+get_debug_format
+
+proc local_compiler_xfail_check { } {
+ global gcc_compiled;
+
+ if {$gcc_compiled} then {
+ if { ![test_debug_format "HP"] \
+ && ![test_debug_format "DWARF 2"] } then {
+ setup_xfail "*-*-*"
+ }
+ }
+}
+
+send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
+
+ send_gdb "cont\n"
+ gdb_expect {
+ -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
+ send_gdb "up\n"
+ gdb_expect {
+ -re ".*main.*$gdb_prompt $" {
+ pass "up from marker1"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "up from marker1"
+ }
+ timeout { fail "up from marker1 (timeout)" }
+ }
+ }
+ -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
+ fail "continue to marker1 (demangling)"
+ send_gdb "up\n"
+ gdb_expect {
+ -re ".*main.*$gdb_prompt $" {
+ pass "up from marker1"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "up from marker1"
+ }
+ timeout { fail "up from marker1 (timeout)" }
+ }
+ }
+ -re "$gdb_prompt $" { fail "continue to marker1" }
+ timeout { fail "(timeout) continue to marker1" }
+ }
+
+# test function parameters
+
+local_compiler_xfail_check
+send_gdb "ptype qux1\n"
+gdb_expect {
+ -re "type = int \\(const char, const char, const char \\*, char \\* const\\).*$gdb_prompt $" {
+ pass "ptype qux1"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype qux1" }
+ timeout { fail "(timeout) ptype qux1" }
+}
+
+# test vars and pointers
+
+proc do_constvar_tests {} {
+ gdb_test "print lave" " = 66 'B'"
+ gdb_test "ptype lave" "type = char"
+ gdb_test "print lavish" " = 10 '\\\\n'"
+ gdb_test "ptype lavish" "type = unsigned char"
+ gdb_test "print lax" " = 20"
+ gdb_test "ptype lax" "type = short.*"
+ gdb_test "print lecherous" " = 30"
+ local_compiler_xfail_check
+ gdb_test "ptype lecherous" "type = (unsigned short|short unsigned)( int)?"
+ gdb_test "print lechery" " = 40"
+ gdb_test "ptype lechery" "type = long.*"
+ gdb_test "print lectern" " = 50"
+ local_compiler_xfail_check
+ gdb_test "ptype lectern" "type = (unsigned long|long unsigned)( int)?"
+ gdb_test "print leeway" " = 60"
+ gdb_test "ptype leeway" "type = float"
+ gdb_test "print legacy" " = 70"
+ gdb_test "ptype legacy" "type = double"
+ gdb_test "print laconic" " = 65 'A'"
+ local_compiler_xfail_check
+ gdb_test "ptype laconic" "type = const char"
+ gdb_test "print laggard" " = 1 '.001'"
+ local_compiler_xfail_check
+ gdb_test "ptype laggard" "type = const unsigned char"
+ gdb_test "print lagoon" " = 2"
+ local_compiler_xfail_check
+ gdb_test "ptype lagoon" "type = const short( int)?"
+ gdb_test "print laity" " = 3"
+ local_compiler_xfail_check
+ gdb_test "ptype laity" "type = const (unsigned short|short unsigned)( int)?"
+ gdb_test "print lambent" " = 4"
+ local_compiler_xfail_check
+ gdb_test "ptype lambent" "type = const long( int)?"
+ gdb_test "print laminated" " = 5"
+ local_compiler_xfail_check
+ gdb_test "ptype laminated" "type = const (unsigned long|long unsigned)( int)?"
+ gdb_test "print lampoon" " = 6"
+ local_compiler_xfail_check
+ gdb_test "ptype lampoon" "type = const float"
+ gdb_test "print languid" " = 7"
+ local_compiler_xfail_check
+ gdb_test "ptype languid" "type = const double"
+ gdb_test "print *legend" " = 66 'B'"
+ local_compiler_xfail_check
+ gdb_test "ptype legend" "type = const char \\*"
+ gdb_test "print *legerdemain" " = 10 '\\\\n'"
+ local_compiler_xfail_check
+ gdb_test "ptype legerdemain" "type = const unsigned char \\*"
+ gdb_test "print *leniency" " = 20"
+ local_compiler_xfail_check
+ gdb_test "ptype leniency" "type = const short( int)? \\*"
+ gdb_test "print *leonine" " = 30"
+ local_compiler_xfail_check
+ gdb_test "ptype leonine" "type = const (unsigned short|short unsigned)( int)? \\*"
+ gdb_test "print *lesion" " = 40"
+ local_compiler_xfail_check
+ gdb_test "ptype lesion" "type = const long( int)? \\*"
+ gdb_test "print *lethal" " = 50"
+ local_compiler_xfail_check
+ gdb_test "ptype lethal" "type = const (unsigned long|long unsigned)( int)? \\*"
+ gdb_test "print *lethargic" " = 60"
+ local_compiler_xfail_check
+ gdb_test "ptype lethargic" "type = const float \\*"
+ gdb_test "print *levity" " = 70"
+ local_compiler_xfail_check
+ gdb_test "ptype levity" "type = const double \\*"
+ gdb_test "print *lewd" " = 65 'A'"
+ local_compiler_xfail_check
+ gdb_test "ptype lewd" "type = const char \\* const"
+ gdb_test "print *lexicographer" " = 1 '.001'"
+ local_compiler_xfail_check
+ gdb_test "ptype lexicographer" "type = const unsigned char \\* const"
+ gdb_test "print *lexicon" " = 2"
+ local_compiler_xfail_check
+ gdb_test "ptype lexicon" "type = const short( int)? \\* const"
+ gdb_test "print *liaison" " = 3"
+ local_compiler_xfail_check
+ gdb_test "ptype liaison" "type = const (unsigned short|short unsigned)( int)? \\* const"
+ gdb_test "print *libation" " = 4"
+ local_compiler_xfail_check
+ gdb_test "ptype libation" "type = const long( int)? \\* const"
+ gdb_test "print *libelous" " = 5"
+ local_compiler_xfail_check
+ gdb_test "ptype libelous" "type = const (unsigned long|long unsigned)( int)? \\* const"
+ gdb_test "print *libertine" " = 6"
+ local_compiler_xfail_check
+ gdb_test "ptype libertine" "type = const float \\* const"
+ gdb_test "print *libidinous" " = 7"
+ local_compiler_xfail_check
+ gdb_test "ptype libidinous" "type = const double \\* const"
+ gdb_test "print *languish" " = 65 'A'"
+ local_compiler_xfail_check
+ gdb_test "ptype languish" "type = const char \\*"
+ gdb_test "print *languor" " = 1 '.001'"
+ local_compiler_xfail_check
+ gdb_test "ptype languor" "type = const unsigned char \\*"
+ gdb_test "print *lank" " = 2"
+ local_compiler_xfail_check
+ gdb_test "ptype lank" "type = const short( int)? \\*"
+ gdb_test "print *lapidary" " = 3"
+ local_compiler_xfail_check
+ gdb_test "ptype lapidary" "type = const (unsigned short|short unsigned)( int)? \\*"
+ gdb_test "print *larceny" " = 4"
+ local_compiler_xfail_check
+ gdb_test "ptype larceny" "type = const long( int)? \\*"
+ gdb_test "print *largess" " = 5"
+ local_compiler_xfail_check
+ gdb_test "ptype largess" "type = const (unsigned long|long unsigned)( int)? \\*"
+ gdb_test "print *lascivious" " = 6"
+ local_compiler_xfail_check
+
+ gdb_test "ptype lascivious" "type = const float \\*"
+ gdb_test "print *lassitude" " = 7"
+ local_compiler_xfail_check
+ gdb_test "ptype lassitude" "type = const double \\*"
+ gdb_test "print *lamprey" " = 66 'B'"
+ local_compiler_xfail_check
+ gdb_test "ptype lamprey" "type = char \\* const"
+ gdb_test "print *lariat" " = 10 '\\\\n'"
+ local_compiler_xfail_check
+ gdb_test "ptype lariat" "type = unsigned char \\* const"
+ gdb_test "print *laudanum" " = 20"
+ local_compiler_xfail_check
+ gdb_test "ptype laudanum" "type = short( int)? \\* const"
+ gdb_test "print *lecithin" " = 30"
+ local_compiler_xfail_check
+ gdb_test "ptype lecithin" "type = (unsigned short|short unsigned)( int)? \\* const"
+ gdb_test "print *leviathan" " = 40"
+ local_compiler_xfail_check
+ gdb_test "ptype leviathan" "type = long( int)? \\* const"
+ gdb_test "print *libretto" " = 50"
+ local_compiler_xfail_check
+ gdb_test "ptype libretto" "type = (unsigned long|long unsigned)( int)? \\* const"
+ gdb_test "print *lissome" " = 60"
+ local_compiler_xfail_check
+ gdb_test "ptype lissome" "type = float \\* const"
+ gdb_test "print *locust" " = 70"
+ local_compiler_xfail_check
+ gdb_test "ptype locust" "type = double \\* const"
+}
+
+do_constvar_tests
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
new file mode 100644
index 00000000000..e25c03c2ea6
--- /dev/null
+++ b/gdb/testsuite/gdb.base/corefile.exp
@@ -0,0 +1,232 @@
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# are we on a target board
+if ![isnative] then {
+ return
+}
+
+set testfile "coremaker"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+# Create a core file named "corefile" rather than just "core", to
+# avoid problems with sys admin types that like to regularly prune all
+# files named "core" from the system.
+#
+# Arbitrarily try setting the core size limit to "unlimited" since
+# this does not hurt on systems where the command does not work and
+# allows us to generate a core on systems where it does.
+#
+# Some systems append "core" to the name of the program; others append
+# the name of the program to "core".
+set found 0
+catch "system \"(cd ${objdir}/${subdir}; ulimit -c unlimited; ${binfile}; true) >/dev/null 2>&1\""
+# remote_exec host "${binfile}"
+foreach i "${objdir}/${subdir}/core ${objdir}/${subdir}/core.coremaker.c ${binfile}.core" {
+ if [remote_file build exists $i] {
+ remote_exec build "mv $i ${objdir}/${subdir}/corefile"
+ set found 1
+ }
+}
+if { $found == 0 } {
+ # The braindamaged HPUX shell quits after the ulimit -c above
+ # without executing ${binfile}. So we try again without the
+ # ulimit here if we didn't find a core file above.
+ # Oh, I should mention that any "braindamaged" non-Unix system has
+ # the same problem. I like the cd bit too, it's really neat'n stuff.
+ catch "system \"(cd ${objdir}/${subdir}; ${binfile}; true) >/dev/null 2>&1\""
+ foreach i "${objdir}/${subdir}/core ${objdir}/${subdir}/core.coremaker.c ${binfile}.core" {
+ if [remote_file build exists $i] {
+ remote_exec build "mv $i ${objdir}/${subdir}/corefile"
+ set found 1
+ }
+ }
+
+ if { $found == 0 } {
+ warning "can't generate a core file - core tests suppressed - check ulimit -c"
+ return 0
+ }
+}
+
+#
+# Test that we can simply startup with a "-core=corefile" command line arg
+# and recognize that the core file is a valid, usable core file.
+# To do this, we must shutdown the currently running gdb and restart
+# with the -core args. We can't use gdb_start because it looks for
+# the first gdb prompt, and the message we are looking for occurs
+# before the first prompt. Also, we can't include GDBFLAGS because
+# if it is empty, this confuses gdb with an empty argument that it
+# grumbles about (said grumbling currently being ignored in gdb_start).
+# **FIXME**
+#
+# Another problem is that on some systems (solaris for example), there
+# is apparently a limit on the length of a fully specified path to
+# the coremaker executable, at about 80 chars. For this case, consider
+# it a pass, but note that the program name is bad.
+
+gdb_exit
+if $verbose>1 then {
+ send_user "Spawning $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile\n"
+}
+
+set oldtimeout $timeout
+set timeout [expr "$timeout + 60"]
+verbose "Timeout is now $timeout seconds" 2
+eval "spawn $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile"
+expect {
+ -re "Couldn't find .* registers in core file.*$gdb_prompt $" {
+ fail "args: -core=corefile (couldn't find regs)"
+ }
+ -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
+ pass "args: -core=corefile"
+ }
+ -re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
+ pass "args: -core=corefile (with bad program name)"
+ }
+ -re ".*registers from core file: File in wrong format.* $" {
+ fail "args: -core=corefile (could not read registers from core file)"
+ }
+ -re ".*$gdb_prompt $" { fail "args: -core=corefile" }
+ timeout { fail "(timeout) starting with -core" }
+}
+
+
+#
+# Test that startup with both an executable file and -core argument.
+# See previous comments above, they are still applicable.
+#
+
+close;
+
+if $verbose>1 then {
+ send_user "Spawning $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile\n"
+}
+
+
+eval "spawn $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile";
+expect {
+ -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
+ pass "args: execfile -core=corefile"
+ }
+ -re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
+ pass "args: execfile -core=corefile (with bad program name)"
+ }
+ -re ".*registers from core file: File in wrong format.* $" {
+ fail "args: execfile -core=corefile (could not read registers from core file)"
+ }
+ -re ".*$gdb_prompt $" { fail "args: execfile -core=corefile" }
+ timeout { fail "(timeout) starting with -core" }
+}
+set timeout $oldtimeout
+verbose "Timeout is now $timeout seconds" 2
+
+close;
+
+# Now restart normally.
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Test basic corefile recognition via core-file command.
+
+send_gdb "core-file $objdir/$subdir/corefile\n"
+gdb_expect {
+ -re ".* program is being debugged already.*y or n. $" {
+ # gdb_load may connect us to a gdbserver.
+ send_gdb "y\n"
+ exp_continue;
+ }
+ -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
+ pass "core-file command"
+ }
+ -re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
+ pass "core-file command (with bad program name)"
+ }
+ -re ".*registers from core file: File in wrong format.* $" {
+ fail "core-file command (could not read registers from core file)"
+ }
+ -re ".*$gdb_prompt $" { fail "core-file command" }
+ timeout { fail "(timeout) core-file command" }
+}
+
+# Test correct mapping of corefile sections by printing some variables.
+
+gdb_test "print coremaker_data" "\\\$$decimal = 202"
+gdb_test "print coremaker_bss" "\\\$$decimal = 10"
+gdb_test "print coremaker_ro" "\\\$$decimal = 201"
+
+gdb_test "print func2::coremaker_local" "\\\$$decimal = \\{0, 1, 2, 3, 4\\}"
+
+# Somehow we better test the ability to read the registers out of the core
+# file correctly. I don't think the other tests do this.
+
+gdb_test "bt" "abort.*func2.*func1.*main.*" "backtrace in corefile.exp"
+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp"
+
+# Test ability to read mmap'd data
+
+gdb_test "x/8bd buf1" ".*:.*0.*1.*2.*3.*4.*5.*6.*7" "accessing original mmap data in core file"
+setup_xfail "*-*-sunos*" "*-*-ultrix*" "*-*-aix*"
+send_gdb "x/8bd buf2\n"
+gdb_expect {
+ -re ".*:.*0.*1.*2.*3.*4.*5.*6.*7.*$gdb_prompt $" {
+ pass "accessing mmapped data in core file"
+ }
+ -re "0x\[f\]*:.*Cannot access memory at address 0x\[f\]*.*$gdb_prompt $" {
+ fail "accessing mmapped data (mapping failed at runtime)"
+ }
+ -re "0x.*:.*Cannot access memory at address 0x.*$gdb_prompt $" {
+ fail "accessing mmapped data (mapping address not found in core file)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "accessing mmapped data (incorrect data found in core file)"
+ }
+ timeout {
+ fail "accessing mmapped data (timeout)"
+ }
+}
+
+# test reinit_frame_cache
+
+gdb_load ${binfile}
+setup_xfail "*-*-*" CLLbs17002
+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\)" "up in corefile.exp (reinit)"
+
+gdb_test "core" "No core file now."
diff --git a/gdb/testsuite/gdb.base/coremaker.c b/gdb/testsuite/gdb.base/coremaker.c
new file mode 100644
index 00000000000..4bb16d46aa4
--- /dev/null
+++ b/gdb/testsuite/gdb.base/coremaker.c
@@ -0,0 +1,122 @@
+/* Simple little program that just generates a core dump from inside some
+ nested function calls. */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#ifndef __STDC__
+#define const /**/
+#endif
+
+#define MAPSIZE (8 * 1024)
+
+/* Don't make these automatic vars or we will have to walk back up the
+ stack to access them. */
+
+char *buf1;
+char *buf2;
+
+int coremaker_data = 1; /* In Data section */
+int coremaker_bss; /* In BSS section */
+
+const int coremaker_ro = 201; /* In Read-Only Data section */
+
+/* Note that if the mapping fails for any reason, we set buf2
+ to -1 and the testsuite notices this and reports it as
+ a failure due to a mapping error. This way we don't have
+ to test for specific errors when running the core maker. */
+
+void
+mmapdata ()
+{
+ int j, fd;
+
+ /* Allocate and initialize a buffer that will be used to write
+ the file that is later mapped in. */
+
+ buf1 = (char *) malloc (MAPSIZE);
+ for (j = 0; j < MAPSIZE; ++j)
+ {
+ buf1[j] = j;
+ }
+
+ /* Write the file to map in */
+
+ fd = open ("coremmap.data", O_CREAT | O_RDWR, 0666);
+ if (fd == -1)
+ {
+ perror ("coremmap.data open failed");
+ buf2 = (char *) -1;
+ return;
+ }
+ write (fd, buf1, MAPSIZE);
+
+ /* Now map the file into our address space as buf2 */
+
+ buf2 = (char *) mmap (0, MAPSIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
+ if (buf2 == (char *) -1)
+ {
+ perror ("mmap failed");
+ return;
+ }
+
+ /* Verify that the original data and the mapped data are identical.
+ If not, we'd rather fail now than when trying to access the mapped
+ data from the core file. */
+
+ for (j = 0; j < MAPSIZE; ++j)
+ {
+ if (buf1[j] != buf2[j])
+ {
+ fprintf (stderr, "mapped data is incorrect");
+ buf2 = (char *) -1;
+ return;
+ }
+ }
+}
+
+void
+func2 ()
+{
+ int coremaker_local[5];
+ int i;
+
+#ifdef SA_FULLDUMP
+ /* Force a corefile that includes the data section for AIX. */
+ {
+ struct sigaction sa;
+
+ sigaction (SIGABRT, (struct sigaction *)0, &sa);
+ sa.sa_flags |= SA_FULLDUMP;
+ sigaction (SIGABRT, &sa, (struct sigaction *)0);
+ }
+#endif
+
+ /* Make sure that coremaker_local doesn't get optimized away. */
+ for (i = 0; i < 5; i++)
+ coremaker_local[i] = i;
+ coremaker_bss = 0;
+ for (i = 0; i < 5; i++)
+ coremaker_bss += coremaker_local[i];
+ coremaker_data = coremaker_ro + 1;
+ abort ();
+}
+
+void
+func1 ()
+{
+ func2 ();
+}
+
+int main ()
+{
+ mmapdata ();
+ func1 ();
+ return 0;
+}
+
diff --git a/gdb/testsuite/gdb.base/coremaker2.c b/gdb/testsuite/gdb.base/coremaker2.c
new file mode 100644
index 00000000000..94f9d000f48
--- /dev/null
+++ b/gdb/testsuite/gdb.base/coremaker2.c
@@ -0,0 +1,58 @@
+/* Simple little program that just generates a core dump from inside some
+ nested function calls. Keep this as self contained as possible, I.E.
+ use no environment resources other than possibly abort(). */
+
+#ifndef __STDC__
+#define const /**/
+#endif
+
+#ifndef HAVE_ABORT
+#define HAVE_ABORT 1
+#endif
+
+#if HAVE_ABORT
+#define ABORT abort()
+#else
+#define ABORT {char *invalid = 0; *invalid = 0xFF;}
+#endif
+
+/* Don't make these automatic vars or we will have to walk back up the
+ stack to access them. */
+
+char *buf1;
+char *buf2;
+
+int coremaker_data = 1; /* In Data section */
+int coremaker_bss; /* In BSS section */
+
+const int coremaker_ro = 201; /* In Read-Only Data section */
+
+void
+func2 (int x)
+{
+ int coremaker_local[5];
+ int i;
+ static int y;
+
+ /* Make sure that coremaker_local doesn't get optimized away. */
+ for (i = 0; i < 5; i++)
+ coremaker_local[i] = i;
+ coremaker_bss = 0;
+ for (i = 0; i < 5; i++)
+ coremaker_bss += coremaker_local[i];
+ coremaker_data = coremaker_ro + 1;
+ y = 10 * x;
+ ABORT;
+}
+
+void
+func1 (int x)
+{
+ func2 (x * 2);
+}
+
+int main ()
+{
+ func1 (10);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/cvexpr.c b/gdb/testsuite/gdb.base/cvexpr.c
new file mode 100644
index 00000000000..587120928e4
--- /dev/null
+++ b/gdb/testsuite/gdb.base/cvexpr.c
@@ -0,0 +1,434 @@
+/* Copyright (C) 2001 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+
+/*
+ * Initial set of typed variables borrowed from ptype.c
+ */
+
+#if !defined (__STDC__) && !defined (_AIX)
+#define signed /**/
+#endif
+
+char v_char;
+signed char v_signed_char;
+unsigned char v_unsigned_char;
+
+short v_short;
+signed short v_signed_short;
+unsigned short v_unsigned_short;
+
+int v_int;
+signed int v_signed_int;
+unsigned int v_unsigned_int;
+
+long v_long;
+signed long v_signed_long;
+unsigned long v_unsigned_long;
+
+long long v_long_long;
+signed long long v_signed_long_long;
+unsigned long long v_unsigned_long_long;
+
+float v_float;
+double v_double;
+
+/*
+ * Now some derived types, which are arrays, functions-returning,
+ * pointers, structures, unions, and enumerations.
+ */
+
+/**** arrays *******/
+
+char v_char_array[2];
+signed char v_signed_char_array[2];
+unsigned char v_unsigned_char_array[2];
+
+short v_short_array[2];
+signed short v_signed_short_array[2];
+unsigned short v_unsigned_short_array[2];
+
+int v_int_array[2];
+signed int v_signed_int_array[2];
+unsigned int v_unsigned_int_array[2];
+
+long v_long_array[2];
+signed long v_signed_long_array[2];
+unsigned long v_unsigned_long_array[2];
+
+float v_float_array[2];
+double v_double_array[2];
+
+/* PR 3742 */
+typedef char t_char_array[];
+
+/**** pointers *******/
+
+char *v_char_pointer;
+signed char *v_signed_char_pointer;
+unsigned char *v_unsigned_char_pointer;
+
+short *v_short_pointer;
+signed short *v_signed_short_pointer;
+unsigned short *v_unsigned_short_pointer;
+
+int *v_int_pointer;
+signed int *v_signed_int_pointer;
+unsigned int *v_unsigned_int_pointer;
+
+long *v_long_pointer;
+signed long *v_signed_long_pointer;
+unsigned long *v_unsigned_long_pointer;
+
+float *v_float_pointer;
+double *v_double_pointer;
+
+char **v_char_pointer_pointer;
+signed char **v_signed_char_pointer_pointer;
+unsigned char **v_unsigned_char_pointer_pointer;
+
+short **v_short_pointer_pointer;
+signed short **v_signed_short_pointer_pointer;
+unsigned short **v_unsigned_short_pointer_pointer;
+
+int **v_int_pointer_pointer;
+signed int **v_signed_int_pointer_pointer;
+unsigned int **v_unsigned_int_pointer_pointer;
+
+long **v_long_pointer_pointer;
+signed long **v_signed_long_pointer_pointer;
+unsigned long **v_unsigned_long_pointer_pointer;
+
+float **v_float_pointer_pointer;
+double **v_double_pointer_pointer;
+
+/**** pointers to arrays, arrays of pointers *******/
+
+char *v_char_array_pointer[2];
+signed char *v_signed_char_array_pointer[2];
+unsigned char *v_unsigned_char_array_pointer[2];
+
+short *v_short_array_pointer[2];
+signed short *v_signed_short_array_pointer[2];
+unsigned short *v_unsigned_short_array_pointer[2];
+
+int *v_int_array_pointer[2];
+signed int *v_signed_int_array_pointer[2];
+unsigned int *v_unsigned_int_array_pointer[2];
+
+long *v_long_array_pointer[2];
+signed long *v_signed_long_array_pointer[2];
+unsigned long *v_unsigned_long_array_pointer[2];
+
+float *v_float_array_pointer[2];
+double *v_double_array_pointer[2];
+
+char (*v_char_pointer_array)[2];
+signed char (*v_signed_char_pointer_array)[2];
+unsigned char (*v_unsigned_char_pointer_array)[2];
+
+short (*v_short_pointer_array)[2];
+signed short (*v_signed_short_pointer_array)[2];
+unsigned short (*v_unsigned_short_pointer_array)[2];
+
+int (*v_int_pointer_array)[2];
+signed int (*v_signed_int_pointer_array)[2];
+unsigned int (*v_unsigned_int_pointer_array)[2];
+
+long (*v_long_pointer_array)[2];
+signed long (*v_signed_long_pointer_array)[2];
+unsigned long (*v_unsigned_long_pointer_array)[2];
+
+float (*v_float_pointer_array)[2];
+double (*v_double_pointer_array)[2];
+
+
+/**** structs *******/
+
+struct t_struct {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_struct1;
+
+struct t_struct *v_t_struct_p;
+
+struct {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_struct2;
+
+/* typedef'd struct without a tag. */
+typedef struct {
+ double v_double_member;
+ int v_int_member;
+} t_struct3;
+/* GCC seems to want a variable of this type, or else it won't put out
+ a symbol. */
+t_struct3 v_struct3;
+
+/**** unions *******/
+
+union t_union {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_union;
+
+union {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_union2;
+
+/* typedef'd union without a tag. */
+typedef union {
+ double v_double_member;
+ int v_int_member;
+} t_union3;
+/* GCC seems to want a variable of this type, or else it won't put out
+ a symbol. */
+t_union3 v_union3;
+
+/**** Enumerations *******/
+
+enum
+/* Work around the bug for compilers which don't put out the right stabs. */
+#if __GNUC__ < 2 && !defined (_AIX)
+primary1_tag
+#endif
+{red1, green1, blue1} primary1;
+
+enum {red, green, blue} primary;
+enum colors {yellow, purple, pink} nonprimary;
+
+enum {chevy, ford} clunker;
+enum cars {bmw, porsche} sportscar;
+
+#undef FALSE
+#undef TRUE
+typedef enum {FALSE, TRUE} boolean;
+boolean v_boolean;
+/*note: aCC has bool type predefined with 'false' and 'true'*/
+typedef enum bvals {my_false, my_true} boolean2;
+boolean2 v_boolean2;
+
+enum misordered {two = 2, one = 1, zero = 0, three = 3};
+
+/* Seems like we need a variable of this type to get the type to be put
+ in the executable, at least for AIX xlc. */
+enum misordered v_misordered = three;
+
+/**** Function pointers *******/
+
+char (*v_char_func) (int, int*);
+signed char (*v_signed_char_func) (int, int*);
+unsigned char (*v_unsigned_char_func) (int, int*);
+
+short (*v_short_func) (int, int*);
+signed short (*v_signed_short_func) (int, int*);
+unsigned short (*v_unsigned_short_func) (int, int*);
+
+int (*v_int_func) (int, int*);
+signed int (*v_signed_int_func) (int, int*);
+unsigned int (*v_unsigned_int_func) (int, int*);
+
+long (*v_long_func) (int, int*);
+signed long (*v_signed_long_func) (int, int*);
+unsigned long (*v_unsigned_long_func) (int, int*);
+
+long long (*v_long_long_func) (int, int*);
+signed long long (*v_signed_long_long_func) (int, int*);
+unsigned long long (*v_unsigned_long_long_func) (int, int*);
+
+float (*v_float_func) (int, int*);
+double (*v_double_func) (int, int*);
+
+void use (void *p)
+{
+}
+
+int main ()
+{
+ use (&v_char);
+ use (&v_signed_char);
+ use (&v_unsigned_char);
+
+ use (&v_short);
+ use (&v_signed_short);
+ use (&v_unsigned_short);
+
+ use (&v_int);
+ use (&v_signed_int);
+ use (&v_unsigned_int);
+
+ use (&v_long);
+ use (&v_signed_long);
+ use (&v_unsigned_long);
+
+ use (&v_long_long);
+ use (&v_signed_long_long);
+ use (&v_unsigned_long_long);
+
+ use (&v_float);
+ use (&v_double);
+
+ use (v_char_array);
+ use (v_signed_char_array);
+ use (v_unsigned_char_array);
+
+ use (v_short_array);
+ use (v_signed_short_array);
+ use (v_unsigned_short_array);
+
+ use (v_int_array);
+ use (v_signed_int_array);
+ use (v_unsigned_int_array);
+
+ use (v_long_array);
+ use (v_signed_long_array);
+ use (v_unsigned_long_array);
+
+ use (v_float_array);
+ use (v_double_array);
+
+ use (v_char_pointer);
+ use (v_signed_char_pointer);
+ use (v_unsigned_char_pointer);
+
+ use (v_short_pointer);
+ use (v_signed_short_pointer);
+ use (v_unsigned_short_pointer);
+
+ use (v_int_pointer);
+ use (v_signed_int_pointer);
+ use (v_unsigned_int_pointer);
+
+ use (v_long_pointer);
+ use (v_signed_long_pointer);
+ use (v_unsigned_long_pointer);
+
+ use (v_float_pointer);
+ use (v_double_pointer);
+
+ use (v_char_pointer_pointer);
+ use (v_signed_char_pointer_pointer);
+ use (v_unsigned_char_pointer_pointer);
+
+ use (v_short_pointer_pointer);
+ use (v_signed_short_pointer_pointer);
+ use (v_unsigned_short_pointer_pointer);
+
+ use (v_int_pointer_pointer);
+ use (v_signed_int_pointer_pointer);
+ use (v_unsigned_int_pointer_pointer);
+
+ use (v_long_pointer_pointer);
+ use (v_signed_long_pointer_pointer);
+ use (v_unsigned_long_pointer_pointer);
+
+ use (v_float_pointer_pointer);
+ use (v_double_pointer_pointer);
+
+ use (v_char_array_pointer);
+ use (v_signed_char_array_pointer);
+ use (v_unsigned_char_array_pointer);
+
+ use (v_short_array_pointer);
+ use (v_signed_short_array_pointer);
+ use (v_unsigned_short_array_pointer);
+
+ use (v_int_array_pointer);
+ use (v_signed_int_array_pointer);
+ use (v_unsigned_int_array_pointer);
+
+ use (v_long_array_pointer);
+ use (v_signed_long_array_pointer);
+ use (v_unsigned_long_array_pointer);
+
+ use (v_float_array_pointer);
+ use (v_double_array_pointer);
+
+ use (v_char_pointer_array);
+ use (v_signed_char_pointer_array);
+ use (v_unsigned_char_pointer_array);
+
+ use (v_short_pointer_array);
+ use (v_signed_short_pointer_array);
+ use (v_unsigned_short_pointer_array);
+
+ use (v_int_pointer_array);
+ use (v_signed_int_pointer_array);
+ use (v_unsigned_int_pointer_array);
+
+ use (v_long_pointer_array);
+ use (v_signed_long_pointer_array);
+ use (v_unsigned_long_pointer_array);
+
+ use (v_float_pointer_array);
+ use (v_double_pointer_array);
+
+ use (&v_struct1);
+ use (&v_struct2);
+ use (&v_struct3);
+
+ use (&v_union);
+ use (&v_union2);
+ use (&v_union3);
+
+ use (&v_boolean);
+ use (&v_boolean2);
+ use (&v_misordered);
+
+ use (v_char_func);
+ use (v_signed_char_func);
+ use (v_unsigned_char_func);
+
+ use (v_short_func);
+ use (v_signed_short_func);
+ use (v_unsigned_short_func);
+
+ use (v_int_func);
+ use (v_signed_int_func);
+ use (v_unsigned_int_func);
+
+ use (v_long_func);
+ use (v_signed_long_func);
+ use (v_unsigned_long_func);
+
+ use (v_long_long_func);
+ use (v_signed_long_long_func);
+ use (v_unsigned_long_long_func);
+
+ use (v_float_func);
+ use (v_double_func);
+}
diff --git a/gdb/testsuite/gdb.base/cvexpr.exp b/gdb/testsuite/gdb.base/cvexpr.exp
new file mode 100644
index 00000000000..56afb9dd229
--- /dev/null
+++ b/gdb/testsuite/gdb.base/cvexpr.exp
@@ -0,0 +1,510 @@
+# Copyright (C) 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Written by Michael Snyder, Red Hat, Inc., 9/20/2001
+
+# This file is part of the gdb testsuite
+# Tests for type expressions using const and volatile keywords.
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "cvexpr"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+gdb_test "set print sevenbit-strings" "" ""
+gdb_test "set print address off" "" ""
+gdb_test "set width 0" "" ""
+
+set ws "\[ \t\]*"
+
+#
+# Test casting a scalar to const
+#
+
+gdb_test "whatis (const char) v_char" \
+ "type = const char" \
+ "(const char)"
+gdb_test "whatis (const signed char) v_signed_char" \
+ "type = const signed char" \
+ "(const signed char)"
+gdb_test "whatis (const unsigned char) v_unsigned_char" \
+ "type = const (unsigned char|char)" \
+ "(const unsigned char)"
+gdb_test "whatis (const short) v_short" \
+ "type = const (short|short int)" \
+ "(const short)"
+gdb_test "whatis (const signed short) v_signed_short" \
+ "type = const (short|short int|signed short|signed short int)" \
+ "(const signed short)"
+gdb_test "whatis (const unsigned short) v_unsigned_short" \
+ "type = const (unsigned short|short unsigned int)" \
+ "(const unsigned short)"
+gdb_test "whatis (const int) v_int" \
+ "type = const int" \
+ "(const int)"
+gdb_test "whatis (const signed int) v_signed_int" \
+ "type = const (signed int|int)" \
+ "(const signed int)"
+gdb_test "whatis (const unsigned int) v_unsigned_int" \
+ "type = const unsigned int" \
+ "(const unsigned int)"
+gdb_test "whatis (const long) v_long" \
+ "type = const (long|long int)" \
+ "(const long)"
+gdb_test "whatis (const signed long) v_signed_long" \
+ "type = const (signed |)long( int|)" \
+ "(const signed long)"
+gdb_test "whatis (const unsigned long) v_unsigned_long" \
+ "type = const (unsigned long|long unsigned int)" \
+ "(const unsigned long)"
+gdb_test "whatis (const long long) v_long_long" \
+ "type = const long long( int|)" \
+ "(const long long)"
+gdb_test "whatis (const signed long long) v_signed_long_long" \
+ "type = const (signed |)long long( int|)" \
+ "(const signed long long)"
+gdb_test "whatis (const unsigned long long) v_unsigned_long_long" \
+ "type = const (unsigned long long|long long unsigned int)" \
+ "(const unsigned long long)"
+gdb_test "whatis (const float) v_float" \
+ "type = const float" \
+ "(const float)"
+gdb_test "whatis (const double) v_double" \
+ "type = const double" \
+ "(const double)"
+
+#
+# Test casting a scalar to volatile
+#
+
+gdb_test "whatis (volatile char) v_char" \
+ "type = volatile char" \
+ "(volatile char)"
+gdb_test "whatis (volatile signed char) v_signed_char" \
+ "type = volatile signed char" \
+ "(volatile signed char)"
+gdb_test "whatis (volatile unsigned char) v_unsigned_char" \
+ "type = volatile (unsigned char|char)" \
+ "(volatile unsigned char)"
+gdb_test "whatis (volatile short) v_short" \
+ "type = volatile (short|short int)" \
+ "(volatile short)"
+gdb_test "whatis (volatile signed short) v_signed_short" \
+ "type = volatile (short|short int|signed short|signed short int)" \
+ "(volatile signed short)"
+gdb_test "whatis (volatile unsigned short) v_unsigned_short" \
+ "type = volatile (unsigned short|short unsigned int)" \
+ "(volatile unsigned short)"
+gdb_test "whatis (volatile int) v_int" \
+ "type = volatile int" \
+ "(volatile int)"
+gdb_test "whatis (volatile signed int) v_signed_int" \
+ "type = volatile (signed int|int)" \
+ "(volatile signed int)"
+gdb_test "whatis (volatile unsigned int) v_unsigned_int" \
+ "type = volatile unsigned int" \
+ "(volatile unsigned int)"
+gdb_test "whatis (volatile long) v_long" \
+ "type = volatile (long|long int)" \
+ "(volatile long)"
+gdb_test "whatis (volatile signed long) v_signed_long" \
+ "type = volatile (signed |)long( int|)" \
+ "(volatile signed long)"
+gdb_test "whatis (volatile unsigned long) v_unsigned_long" \
+ "type = volatile (unsigned long|long unsigned int)" \
+ "(volatile unsigned long)"
+gdb_test "whatis (volatile long long) v_long_long" \
+ "type = volatile long long( int|)" \
+ "(volatile long long)"
+gdb_test "whatis (volatile signed long long) v_signed_long_long" \
+ "type = volatile (signed |)long long( int|)" \
+ "(volatile signed long long)"
+gdb_test "whatis (volatile unsigned long long) v_unsigned_long_long" \
+ "type = volatile (unsigned long long|long long unsigned int)" \
+ "(volatile unsigned long long)"
+gdb_test "whatis (volatile float) v_float" \
+ "type = volatile float" \
+ "(volatile float)"
+gdb_test "whatis (volatile double) v_double" \
+ "type = volatile double" \
+ "(volatile double)"
+
+#
+# Combine const and volatile
+#
+
+gdb_test "whatis (const volatile int) v_int" \
+ "type = const volatile int" \
+ "(const volatile int)"
+gdb_test "whatis (volatile const int) v_int" \
+ "type = const volatile int" \
+ "(volatile const int)"
+gdb_test "whatis (const int volatile) v_int" \
+ "type = const volatile int" \
+ "(const int volatile)"
+gdb_test "whatis (volatile int const) v_int" \
+ "type = const volatile int" \
+ "(volatile int const)"
+gdb_test "whatis (int const volatile) v_int" \
+ "type = const volatile int" \
+ "(int const volatile)"
+gdb_test "whatis (int volatile const) v_int" \
+ "type = const volatile int" \
+ "(int volatile const)"
+
+gdb_test "whatis (const volatile int *) v_int_pointer" \
+ "type = const volatile int${ws}\\*" \
+ "(const volatile int *)"
+gdb_test "whatis (volatile const int *) v_int_pointer" \
+ "type = const volatile int${ws}\\*" \
+ "(volatile const int *)"
+gdb_test "whatis (const int volatile *) v_int_pointer" \
+ "type = const volatile int${ws}\\*" \
+ "(const int volatile)"
+gdb_test "whatis (volatile int const *) v_int_pointer" \
+ "type = const volatile int${ws}\\*" \
+ "(volatile int const *)"
+gdb_test "whatis (int const volatile *) v_int_pointer" \
+ "type = const volatile int${ws}\\*" \
+ "(int const volatile *)"
+gdb_test "whatis (int volatile const *) v_int_pointer" \
+ "type = const volatile int${ws}\\*" \
+ "(int volatile const *)"
+gdb_test "whatis (int * const volatile) v_int_pointer" \
+ "type = int${ws}\\*${ws}const volatile" \
+ "(int * const volatile)"
+gdb_test "whatis (int * volatile const) v_int_pointer" \
+ "type = int${ws}\\*${ws}const volatile" \
+ "(int * volatile const)"
+
+
+#
+# Put 'signed' and 'unsigned' before const/volatile (FIXME)
+#
+
+#gdb_test "whatis (signed const char) v_signed_char" \
+# "type = const char" \
+# "(signed const char)"
+#gdb_test "whatis (unsigned const char) v_unsigned_char" \
+# "type = const (unsigned char|char)" \
+# "(unsigned const char)"
+#gdb_test "whatis (signed const short) v_signed_short" \
+# "type = const (short|short int|signed short|signed short int)" \
+# "(signed const short)"
+#gdb_test "whatis (unsigned const short) v_unsigned_short" \
+# "type = const (unsigned short|short unsigned int)" \
+# "(unsigned const short)"
+#gdb_test "whatis (signed const int) v_signed_int" \
+# "type = const (signed int|int)" \
+# "(signed const int)"
+#gdb_test "whatis (unsigned const int) v_unsigned_int" \
+# "type = const unsigned int" \
+# "(unsigned const int)"
+#gdb_test "whatis (signed const long) v_signed_long" \
+# "type = const (signed |)long( int|)" \
+# "(signed const long)"
+#gdb_test "whatis (unsigned const long) v_unsigned_long" \
+# "type = const (unsigned long|long unsigned int)" \
+# "(unsigned const long)"
+#gdb_test "whatis (signed const long long) v_signed_long_long" \
+# "type = const (signed |)long long( int|)" \
+# "(signed const long long)"
+#gdb_test "whatis (unsigned const long long) v_unsigned_long_long" \
+# "type = const (unsigned long long|long long unsigned int)" \
+# "(const unsigned long long)"
+
+#gdb_test "whatis (signed volatile char) v_signed_char" \
+# "type = volatile char" \
+# "(signed volatile char)"
+#gdb_test "whatis (unsigned volatile char) v_unsigned_char" \
+# "type = volatile (unsigned char|char)" \
+# "(unsigned volatile char)"
+#gdb_test "whatis (signed volatile short) v_signed_short" \
+# "type = volatile (short|short int|signed short|signed short int)" \
+# "(signed volatile short)"
+#gdb_test "whatis (unsigned volatile short) v_unsigned_short" \
+# "type = volatile (unsigned short|short unsigned int)" \
+# "(unsigned volatile short)"
+#gdb_test "whatis (signed volatile int) v_signed_int" \
+# "type = volatile (signed int|int)" \
+# "(signed volatile int)"
+#gdb_test "whatis (unsigned volatile int) v_unsigned_int" \
+# "type = volatile unsigned int" \
+# "(unsigned volatile int)"
+#gdb_test "whatis (signed volatile long) v_signed_long" \
+# "type = volatile (signed |)long( int|)" \
+# "(signed volatile long)"
+#gdb_test "whatis (unsigned volatile long) v_unsigned_long" \
+# "type = volatile (unsigned long|long unsigned int)" \
+# "(unsigned volatile long)"
+#gdb_test "whatis (signed volatile long long) v_signed_long_long" \
+# "type = volatile (signed |)long long( int|)" \
+# "(signed volatile long long)"
+#gdb_test "whatis (unsigned volatile long long) v_unsigned_long_long" \
+# "type = volatile (unsigned long long|long long unsigned int)" \
+# "(unsigned volatile long long)"
+
+#
+# Now put the 'const' and 'volatile' keywords after the base type.
+#
+
+gdb_test "whatis (char const) v_char" \
+ "type = const char" \
+ "(char const)"
+gdb_test "whatis (signed char const) v_signed_char" \
+ "type = const signed char" \
+ "(signed char const)"
+gdb_test "whatis (unsigned char const) v_unsigned_char" \
+ "type = const (unsigned char|char)" \
+ "(unsigned char const)"
+gdb_test "whatis (short const) v_short" \
+ "type = const (short|short int)" \
+ "(short const)"
+gdb_test "whatis (signed short const) v_signed_short" \
+ "type = const (short|short int|signed short|signed short int)" \
+ "(signed short const)"
+gdb_test "whatis (unsigned short const) v_unsigned_short" \
+ "type = const (unsigned short|short unsigned int)" \
+ "(unsigned short const)"
+gdb_test "whatis (int const) v_int" \
+ "type = const int" \
+ "(int const)"
+gdb_test "whatis (signed int const) v_signed_int" \
+ "type = const (signed int|int)" \
+ "(signed int const)"
+gdb_test "whatis (unsigned int const) v_unsigned_int" \
+ "type = const unsigned int" \
+ "(unsigned int const)"
+gdb_test "whatis (long const) v_long" \
+ "type = const (long|long int)" \
+ "(long const)"
+gdb_test "whatis (signed long const) v_signed_long" \
+ "type = const (signed |)long( int|)" \
+ "(signed long const)"
+gdb_test "whatis (unsigned long const) v_unsigned_long" \
+ "type = const (unsigned long|long unsigned int)" \
+ "(unsigned long const)"
+gdb_test "whatis (long long const) v_long_long" \
+ "type = const long long( int|)" \
+ "(long long const)"
+gdb_test "whatis (signed long long const) v_signed_long_long" \
+ "type = const (signed |)long long( int|)" \
+ "(signed long long const)"
+gdb_test "whatis (unsigned long long const) v_unsigned_long_long" \
+ "type = const (unsigned long long|long long unsigned int)" \
+ "(unsigned long long const)"
+gdb_test "whatis (float const) v_float" \
+ "type = const float" \
+ "(float const)"
+gdb_test "whatis (double const) v_double" \
+ "type = const double" \
+ "(double const)"
+
+gdb_test "whatis (char volatile) v_char" \
+ "type = volatile char" \
+ "(char volatile)"
+gdb_test "whatis (signed char volatile) v_signed_char" \
+ "type = volatile signed char" \
+ "(signed char volatile)"
+gdb_test "whatis (unsigned char volatile) v_unsigned_char" \
+ "type = volatile (unsigned char|char)" \
+ "(unsigned char volatile)"
+gdb_test "whatis (short volatile) v_short" \
+ "type = volatile (short|short int)" \
+ "(short volatile)"
+gdb_test "whatis (signed short volatile) v_signed_short" \
+ "type = volatile (short|short int|signed short|signed short int)" \
+ "(signed short volatile)"
+gdb_test "whatis (unsigned short volatile) v_unsigned_short" \
+ "type = volatile (unsigned short|short unsigned int)" \
+ "(unsigned short volatile)"
+gdb_test "whatis (int volatile) v_int" \
+ "type = volatile int" \
+ "(int volatile)"
+gdb_test "whatis (signed int volatile) v_signed_int" \
+ "type = volatile (signed int|int)" \
+ "(signed int volatile)"
+gdb_test "whatis (unsigned int volatile) v_unsigned_int" \
+ "type = volatile unsigned int" \
+ "(unsigned int volatile)"
+gdb_test "whatis (long volatile) v_long" \
+ "type = volatile (long|long int)" \
+ "(long volatile)"
+gdb_test "whatis (signed long volatile) v_signed_long" \
+ "type = volatile (signed |)long( int|)" \
+ "(signed long volatile)"
+gdb_test "whatis (unsigned long volatile) v_unsigned_long" \
+ "type = volatile (unsigned long|long unsigned int)" \
+ "(unsigned long volatile)"
+gdb_test "whatis (long long volatile) v_long_long" \
+ "type = volatile long long( int|)" \
+ "(long long volatile)"
+gdb_test "whatis (signed long long volatile) v_signed_long_long" \
+ "type = volatile (signed |)long long( int|)" \
+ "(signed long long volatile)"
+gdb_test "whatis (unsigned long long volatile) v_unsigned_long_long" \
+ "type = volatile (unsigned long long|long long unsigned int)" \
+ "(unsigned long long volatile)"
+gdb_test "whatis (float volatile) v_float" \
+ "type = volatile float" \
+ "(float volatile)"
+gdb_test "whatis (double volatile) v_double" \
+ "type = volatile double" \
+ "(double volatile)"
+
+#
+# enums
+#
+
+gdb_test "whatis (const enum misordered) v_misordered" \
+ "type = const enum misordered" \
+ "(const enum misordered)"
+gdb_test "whatis (enum misordered const) v_misordered" \
+ "type = const enum misordered" \
+ "(enum misordered const)"
+gdb_test "whatis (volatile enum misordered) v_misordered" \
+ "type = volatile enum misordered" \
+ "(volatile enum misordered)"
+gdb_test "whatis (enum misordered volatile) v_misordered" \
+ "type = volatile enum misordered" \
+ "(enum misordered volatile)"
+
+#
+# Pointers
+#
+
+gdb_test "whatis (const int *) v_int_pointer" \
+ "type = const int${ws}\\*" \
+ "(const int *)"
+gdb_test "whatis (int const *) v_int_pointer" \
+ "type = const int${ws}\\*" \
+ "(int const *)"
+gdb_test "whatis (int * const) v_int_pointer" \
+ "type = int \\*${ws}const" \
+ "(int * const)"
+gdb_test "whatis (const int * const) v_int_pointer" \
+ "type = const int${ws}\\*${ws}const" \
+ "(const int * const)"
+gdb_test "whatis (int const * const) v_int_pointer" \
+ "type = const int${ws}\\*${ws}const" \
+ "(int const * const)"
+
+gdb_test "whatis (const int **) v_int_pointer_pointer" \
+ "type = const int${ws}\\*${ws}\\*" \
+ "(const int **)"
+gdb_test "whatis (int const **) v_int_pointer_pointer" \
+ "type = const int${ws}\\*${ws}\\*" \
+ "(int const **)"
+gdb_test "whatis (int ** const) v_int_pointer_pointer" \
+ "type = int \\*${ws}\\*${ws}const" \
+ "(int ** const)"
+gdb_test "whatis (const int * const *) v_int_pointer_pointer" \
+ "type = const int${ws}\\*${ws}const${ws}\\*" \
+ "(const int * const *)"
+gdb_test "whatis (int const * const *) v_int_pointer_pointer" \
+ "type = const int${ws}\\*${ws}const${ws}\\*" \
+ "(int const * const *)"
+gdb_test "whatis (const int * const * const) v_int_pointer_pointer" \
+ "type = const int${ws}\\*${ws}const${ws}\\*${ws}const" \
+ "(const int * const * const)"
+gdb_test "whatis (int const * const * const) v_int_pointer_pointer" \
+ "type = const int${ws}\\*${ws}const${ws}\\*${ws}const" \
+ "(int const * const * const)"
+
+#
+# Arrays TODO
+#
+
+#
+# Pointers to arrays, arrays of pointers TODO
+#
+
+#
+# Structs and Unions
+#
+
+gdb_test "whatis (const struct t_struct) v_struct1" \
+ "type = const struct t_struct" \
+ "(const struct t_struct)"
+gdb_test "whatis (const union t_union) v_union" \
+ "type = const union t_union" \
+ "(const union t_union)"
+gdb_test "whatis (struct t_struct const) v_struct1" \
+ "type = const struct t_struct" \
+ "(struct t_struct const)"
+gdb_test "whatis (union t_union const) v_union" \
+ "type = const union t_union" \
+ "(union t_union const)"
+gdb_test "whatis (const struct t_struct *) &v_struct1" \
+ "type = const struct t_struct${ws}\\*" \
+ "(const struct t_struct *)"
+gdb_test "whatis (const union t_union *) &v_union" \
+ "type = const union t_union${ws}\\*" \
+ "(const union t_union *)"
+gdb_test "whatis (struct t_struct const *) &v_struct1" \
+ "type = const struct t_struct${ws}\\*" \
+ "(struct t_struct const *)"
+gdb_test "whatis (union t_union const *) &v_union" \
+ "type = const union t_union${ws}\\*" \
+ "(union t_union const *)"
+gdb_test "whatis (struct t_struct * const) &v_struct1" \
+ "type = struct t_struct${ws}\\*${ws}const" \
+ "(struct t_struct * const)"
+gdb_test "whatis (union t_union * const) &v_union" \
+ "type = union t_union${ws}\\*${ws}const" \
+ "(union t_union * const)"
+gdb_test "whatis (const struct t_struct * const) &v_struct1" \
+ "type = const struct t_struct${ws}\\*${ws}const" \
+ "(const struct t_struct * const)"
+gdb_test "whatis (const union t_union * const) &v_union" \
+ "type = const union t_union${ws}\\*${ws}const" \
+ "(const union t_union * const)"
+gdb_test "whatis (struct t_struct const * const) &v_struct1" \
+ "type = const struct t_struct${ws}\\*${ws}const" \
+ "(struct t_struct const * const)"
+gdb_test "whatis (union t_union const * const) &v_union" \
+ "type = const union t_union${ws}\\*${ws}const" \
+ "(union t_union const * const)"
+
+#
+# Function pointers TODO
+#
+
diff --git a/gdb/testsuite/gdb.base/d10v.ld b/gdb/testsuite/gdb.base/d10v.ld
new file mode 100644
index 00000000000..3c4c38a3c9c
--- /dev/null
+++ b/gdb/testsuite/gdb.base/d10v.ld
@@ -0,0 +1,155 @@
+OUTPUT_FORMAT("elf32-d10v", "elf32-d10v",
+ "elf32-d10v")
+OUTPUT_ARCH(d10v)
+ENTRY(_start)
+ SEARCH_DIR(/usr/cygnus/d10v-961230/H-sparc-sun-sunos4.1//lib);
+/* Do we need any of these for elf?
+ __DYNAMIC = 0; */
+SECTIONS
+{
+ /* Overlay sections: */
+ .ovly0 0x01010000 : AT (0x12010000) { foo.o(.text) }
+ .ovly1 0x01010000 : AT (0x12011000) { bar.o(.text) }
+ .ovly2 0x01011000 : AT (0x12012000) { baz.o(.text) }
+ .ovly3 0x01011000 : AT (0x12013000) { grbx.o(.text) }
+ .data00 0x00001000 : AT (0x12014000) { foo.o(.data) }
+ .data01 0x00001000 : AT (0x12015000) { bar.o(.data) }
+ .data02 0x00002000 : AT (0x12016000) { baz.o(.data) }
+ .data03 0x00002000 : AT (0x12017000) { grbx.o(.data) }
+ /* Read-only sections, merged into data segment: */
+ . = 0x00000004;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .rel.text : { *(.rel.text) }
+ .rela.text : { *(.rela.text) }
+ .rel.data : { *(.rel.data) }
+ .rela.data : { *(.rela.data) }
+ .rel.rodata : { *(.rel.rodata) }
+ .rela.rodata : { *(.rela.rodata) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.bss : { *(.rel.bss) }
+ .rela.bss : { *(.rela.bss) }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .plt : { *(.plt) }
+ .rodata : { *(.rodata) *(.gnu.linkonce.r*) }
+ .rodata1 : { *(.rodata1) }
+ /* Adjust the address for the data segment. */
+ . = ALIGN(4);
+ .data :
+ {
+ *(.data)
+ *(.gnu.linkonce.d*)
+ _ovly_table = .;
+ LONG(ABSOLUTE(ADDR(.ovly0)));
+ LONG(SIZEOF(.ovly0));
+ LONG(LOADADDR(.ovly0));
+ LONG(0);
+ LONG(ABSOLUTE(ADDR(.ovly1)));
+ LONG(SIZEOF(.ovly1));
+ LONG(LOADADDR(.ovly1));
+ LONG(0);
+ LONG(ABSOLUTE(ADDR(.ovly2)));
+ LONG(SIZEOF(.ovly2));
+ LONG(LOADADDR(.ovly2));
+ LONG(0);
+ LONG(ABSOLUTE(ADDR(.ovly3)));
+ LONG(SIZEOF(.ovly3));
+ LONG(LOADADDR(.ovly3));
+ LONG(0);
+ LONG(ABSOLUTE(ADDR(.data00)));
+ LONG(SIZEOF(.data00));
+ LONG(LOADADDR(.data00));
+ LONG(0);
+ LONG(ABSOLUTE(ADDR(.data01)));
+ LONG(SIZEOF(.data01));
+ LONG(LOADADDR(.data01));
+ LONG(0);
+ LONG(ABSOLUTE(ADDR(.data02)));
+ LONG(SIZEOF(.data02));
+ LONG(LOADADDR(.data02));
+ LONG(0);
+ LONG(ABSOLUTE(ADDR(.data03)));
+ LONG(SIZEOF(.data03));
+ LONG(LOADADDR(.data03));
+ LONG(0);
+ _novlys = .;
+ LONG((_novlys - _ovly_table) / 16);
+ CONSTRUCTORS
+ }
+ .data1 : { *(.data1) }
+ .ctors :
+ {
+ *(.ctors)
+ }
+ .dtors :
+ {
+ *(.dtors)
+ }
+ .got : { *(.got.plt) *(.got) }
+ .dynamic : { *(.dynamic) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata : { *(.sdata) }
+ _edata = .;
+ PROVIDE (edata = .);
+ __bss_start = .;
+ .sbss : { *(.sbss) *(.scommon) }
+ .bss :
+ {
+ *(.dynbss)
+ *(.bss)
+ *(COMMON)
+ }
+ _end = . ;
+ PROVIDE (end = .);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the .debug DWARF section are relative to the beginning of the
+ section so we begin .debug at 0. It's not clear yet what needs to happen
+ for the others. */
+ .debug 0 : { *(.debug) }
+ .debug_info 0 : { *(.debug_info) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_frame 0 : { *(.debug_frame) }
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ .line 0 : { *(.line) }
+ /* These must appear regardless of . */
+ /* Hmmm, there's got to be a better way. This sets the stack to the
+ top of the simulator memory (i.e. top of 64K data space). */
+ .stack 0x00007FFE : { _stack = .; *(.stack) }
+ .text 0x1000000 :
+ {
+ *(.init)
+ *(.fini)
+ *(.text)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.gnu.linkonce.t*)
+ } =0
+ _etext = .;
+ PROVIDE (etext = .);
+}
diff --git a/gdb/testsuite/gdb.base/d10vovly.c b/gdb/testsuite/gdb.base/d10vovly.c
new file mode 100644
index 00000000000..bdb90feae6b
--- /dev/null
+++ b/gdb/testsuite/gdb.base/d10vovly.c
@@ -0,0 +1,225 @@
+
+/*
+ * Ovlymgr.c -- Runtime Overlay Manager for the GDB testsuite.
+ */
+
+#include "ovlymgr.h"
+
+/* Local functions and data: */
+
+extern unsigned long _ovly_table[][4];
+extern unsigned long _novlys __attribute__ ((section (".data")));
+enum ovly_index { VMA, SIZE, LMA, MAPPED};
+
+static void ovly_copy (unsigned long dst, unsigned long src, long size);
+
+/* Flush the data and instruction caches at address START for SIZE bytes.
+ Support for each new port must be added here. */
+/* FIXME: Might be better to have a standard libgloss function that
+ ports provide that we can then use. Use libgloss instead of newlib
+ since libgloss is the one intended to handle low level system issues.
+ I would suggest something like _flush_cache to avoid the user's namespace
+ but not be completely obscure as other things may need this facility. */
+
+static void
+FlushCache (void)
+{
+#ifdef __M32R__
+ volatile char *mspr = (char *) 0xfffffff7;
+ *mspr = 1;
+#endif
+}
+
+/* OverlayLoad:
+ * Copy the overlay into its runtime region,
+ * and mark the overlay as "mapped".
+ */
+
+bool
+OverlayLoad (unsigned long ovlyno)
+{
+ unsigned long i;
+
+ if (ovlyno < 0 || ovlyno >= _novlys)
+ exit (-1); /* fail, bad ovly number */
+
+ if (_ovly_table[ovlyno][MAPPED])
+ return TRUE; /* this overlay already mapped -- nothing to do! */
+
+ for (i = 0; i < _novlys; i++)
+ if (i == ovlyno)
+ _ovly_table[i][MAPPED] = 1; /* this one now mapped */
+ else if (_ovly_table[i][VMA] == _ovly_table[ovlyno][VMA])
+ _ovly_table[i][MAPPED] = 0; /* this one now un-mapped */
+
+ ovly_copy (_ovly_table[ovlyno][VMA],
+ _ovly_table[ovlyno][LMA],
+ _ovly_table[ovlyno][SIZE]);
+
+ FlushCache ();
+
+ return TRUE;
+}
+
+/* OverlayUnload:
+ * Copy the overlay back into its "load" region.
+ * Does NOT mark overlay as "unmapped", therefore may be called
+ * more than once for the same mapped overlay.
+ */
+
+bool
+OverlayUnload (unsigned long ovlyno)
+{
+ if (ovlyno < 0 || ovlyno >= _novlys)
+ exit (-1); /* fail, bad ovly number */
+
+ if (!_ovly_table[ovlyno][MAPPED])
+ exit (-1); /* error, can't copy out a segment that's not "in" */
+
+ ovly_copy (_ovly_table[ovlyno][LMA],
+ _ovly_table[ovlyno][VMA],
+ _ovly_table[ovlyno][SIZE]);
+
+ return TRUE;
+}
+
+#ifdef __D10V__
+#define IMAP0 (*(short *)(0xff00))
+#define IMAP1 (*(short *)(0xff02))
+#define DMAP (*(short *)(0xff04))
+
+static void
+D10VTranslate (unsigned long logical,
+ short *dmap,
+ unsigned long **addr)
+{
+ unsigned long physical;
+ unsigned long seg;
+ unsigned long off;
+
+ /* to access data, we use the following mapping
+ 0x00xxxxxx: Logical data address segment (DMAP translated memory)
+ 0x01xxxxxx: Logical instruction address segment (IMAP translated memory)
+ 0x10xxxxxx: Physical data memory segment (On-chip data memory)
+ 0x11xxxxxx: Physical instruction memory segment (On-chip insn memory)
+ 0x12xxxxxx: Phisical unified memory segment (Unified memory)
+ */
+
+ /* Addresses must be correctly aligned */
+ if (logical & (sizeof (**addr) - 1))
+ exit (-1);
+
+ /* If the address is in one of the two logical address spaces, it is
+ first translated into a physical address */
+ seg = (logical >> 24);
+ off = (logical & 0xffffffL);
+ switch (seg)
+ {
+ case 0x00: /* in logical data address segment */
+ if (off <= 0x7fffL)
+ physical = (0x10L << 24) + off;
+ else
+ /* Logical address out side of on-chip segment, not
+ supported */
+ exit (-1);
+ break;
+ case 0x01: /* in logical instruction address segment */
+ {
+ short map;
+ if (off <= 0x1ffffL)
+ map = IMAP0;
+ else if (off <= 0x3ffffL)
+ map = IMAP1;
+ else
+ /* Logical address outside of IMAP[01] segment, not
+ supported */
+ exit (-1);
+ if (map & 0x1000L)
+ {
+ /* Instruction memory */
+ physical = (0x11L << 24) | off;
+ }
+ else
+ {
+ /* Unified memory */
+ physical = ((map & 0x7fL) << 17) + (off & 0x1ffffL);
+ if (physical > 0xffffffL)
+ /* Address outside of unified address segment */
+ exit (-1);
+ physical |= (0x12L << 24);
+ }
+ break;
+ }
+ case 0x10:
+ case 0x11:
+ case 0x12:
+ physical = logical;
+ break;
+ default:
+ exit (-1); /* error */
+ }
+
+ seg = (physical >> 24);
+ off = (physical & 0xffffffL);
+ switch (seg)
+ {
+ case 0x10: /* dst is a 15 bit offset into the on-chip memory */
+ *dmap = 0;
+ *addr = (long *) (0x0000 + ((short)off & 0x7fff));
+ break;
+ case 0x11: /* dst is an 18-bit offset into the on-chip
+ instruction memory */
+ *dmap = 0x1000L | ((off & 0x3ffffL) >> 14);
+ *addr = (long *) (0x8000 + ((short)off & 0x3fff));
+ break;
+ case 0x12: /* dst is a 24-bit offset into unified memory */
+ *dmap = off >> 14;
+ *addr = (long *) (0x8000 + ((short)off & 0x3fff));
+ break;
+ default:
+ exit (-1); /* error */
+ }
+}
+#endif /* __D10V__ */
+
+static void
+ovly_copy (unsigned long dst, unsigned long src, long size)
+{
+#ifdef __M32R__
+ memcpy ((void *) dst, (void *) src, size);
+ return;
+#endif /* M32R */
+
+#ifdef __D10V__
+ unsigned long *s, *d, tmp;
+ short dmap_src, dmap_dst;
+ short dmap_save;
+
+ /* all section sizes should by multiples of 4 bytes */
+ dmap_save = DMAP;
+
+ D10VTranslate (src, &dmap_src, &s);
+ D10VTranslate (dst, &dmap_dst, &d);
+
+ while (size > 0)
+ {
+ /* NB: Transfer 4 byte (long) quantites, problems occure
+ when only two bytes are transfered */
+ DMAP = dmap_src;
+ tmp = *s;
+ DMAP = dmap_dst;
+ *d = tmp;
+ d++;
+ s++;
+ size -= sizeof (tmp);
+ src += sizeof (tmp);
+ dst += sizeof (tmp);
+ if ((src & 0x3fff) == 0)
+ D10VTranslate (src, &dmap_src, &s);
+ if ((dst & 0x3fff) == 0)
+ D10VTranslate (dst, &dmap_dst, &d);
+ }
+ DMAP = dmap_save;
+#endif /* D10V */
+}
+
diff --git a/gdb/testsuite/gdb.base/dbx.exp b/gdb/testsuite/gdb.base/dbx.exp
new file mode 100644
index 00000000000..161333c8ea3
--- /dev/null
+++ b/gdb/testsuite/gdb.base/dbx.exp
@@ -0,0 +1,340 @@
+# Copyright 1998, 1999, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile1 "average"
+set testfile2 "sum"
+set testfile "dbx-test"
+set binfile1 ${objdir}/${subdir}/${testfile1}
+set binfile2 ${objdir}/${subdir}/${testfile2}
+set binfile ${objdir}/${subdir}/${testfile}
+
+
+
+if { [gdb_compile "${srcdir}/${subdir}/average.c" "${binfile1}.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/sum.c" "${binfile2}.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${binfile1}.o ${binfile2}.o" ${binfile} executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+#
+# start gdb -- start gdb running, default procedure
+#
+proc dbx_gdb_start { } {
+ global verbose
+ global GDB
+ global GDBFLAGS
+ global prompt
+ global spawn_id
+ global timeout
+ verbose "Spawning $GDB -nw $GDBFLAGS"
+
+ if { [which $GDB] == 0 } then {
+ perror "$GDB does not exist."
+ exit 1
+ }
+
+ set oldtimeout $timeout
+ set timeout [expr "$timeout + 60"]
+ eval "spawn $GDB -nw -dbx $GDBFLAGS"
+ gdb_expect {
+ -re ".*\r\n$gdb_prompt $" {
+ verbose "GDB initialized."
+ }
+ -re "$prompt $" {
+ perror "GDB never initialized."
+ return -1
+ }
+ timeout {
+ perror "(timeout) GDB never initialized."
+ return -1
+ }
+ }
+ set timeout $oldtimeout
+ # force the height to "unlimited", so no pagers get used
+ send_gdb "set height 0\n"
+ gdb_expect {
+ -re ".*$prompt $" {
+ verbose "Setting height to 0." 2
+ }
+ timeout {
+ warning "Couldn't set the height to 0."
+ }
+ }
+ # force the width to "unlimited", so no wraparound occurs
+ send_gdb "set width 0\n"
+ gdb_expect {
+ -re ".*$prompt $" {
+ verbose "Setting width to 0." 2
+ }
+ timeout {
+ warning "Couldn't set the width to 0."
+ }
+ }
+}
+
+
+proc dbx_reinitialize_dir { subdir } {
+ global gdb_prompt
+
+ send_gdb "use\n"
+ gdb_expect {
+ -re "Reinitialize source path to empty.*y or n. " {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "Source directories searched.*$gdb_prompt $" {
+ send_gdb "use $subdir\n"
+ gdb_expect {
+ -re "Source directories searched.*$gdb_prompt $" {
+ verbose "Dir set to $subdir"
+ }
+ -re ".*$gdb_prompt $" {
+ perror "Dir \"$subdir\" failed."
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ perror "Dir \"$subdir\" failed."
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ perror "Dir \"$subdir\" failed."
+ }
+ }
+}
+
+# In "testsuite/config/unix-gdb.exp", the routine "gdb_load"
+# is defined as "gdb_file_cmd". The binding of "gdb_file_cmd"
+# is done at invocation time. Before this file is processed,
+# it binds to the definition in "testsuite/lib/gdb.exp"; after
+# this file is processed, it binds to this definition.
+# TCL lets us overrides a previous routine definition without a
+# warning (isn't that special?).
+#
+# This means that tests before use "file" to load a target, and
+# tests afterwards use the pair "symbol-file" "exec-file".
+#
+# I'm leaving it as it is for now because at the moment it
+# is the only test we have of the use of the combination of
+# "symbol-file" and "exec-file" to load a debugging target (the
+# other definition uses "file".
+#
+# Symbol-file and exec-file should be tested explicitly, not
+# as a side effect of running a particular test (in this case,
+# "testsuite/gdb.compat/dbx.exp").
+#
+# CM: Renamed the procedure so it does not override the orginal file name.
+# Having the test suite change behavior depending on the tests run makes
+# it extremely difficult to reproduce errors. I've also added a
+# "dbx_gdb_load" procedure. This and only this test will call these
+# procedures now. I also added an "expect" to the "send exec-file" line.
+# The "expect" waits for a prompt to appear. Otherwise, if the tests run
+# too quickly, the caller could send another command before the prompt
+# of this command returns, causing the test to get out of sync and fail
+# seemingly randomly or only on a loaded system.
+#
+# Problem is, though, that the testsuite config files can override the definition of
+# gdb_load (without notice, as was mentioned above). Unfortunately, the gdb_load proc
+# that was copied into this test was a copy of the unix native version.
+#
+# The real problem that we're attempting to solve is how to load an exec and symbol
+# file into gdb for a dbx session. So why not just override gdb_file_cmd with the
+# right sequence of events, allowing gdb_load to do its normal thing? This way
+# remotes and simulators will work, too.
+#
+# [drow 2002-03-30]: We can restore the old gdb_file_cmd afterwards, though.
+set old_gdb_file_cmd_args [info args gdb_file_cmd]
+set old_gdb_file_cmd_body [info body gdb_file_cmd]
+
+proc gdb_file_cmd {arg} {
+ global verbose
+ global loadpath
+ global loadfile
+ global GDB
+ global gdb_prompt
+ global spawn_id
+ upvar timeout timeout
+
+ if [is_remote host] {
+ set arg [remote_download host $arg];
+ if { $arg == "" } {
+ error "download failed"
+ return -1;
+ }
+ }
+
+ send_gdb "symbol-file $arg\n"
+ gdb_expect {
+ -re "Detected 64-bit symbol file.\r\nInvoking.*gdb64.*$gdb_prompt $" {
+ verbose "\t\tLoaded $arg into the $GDB"
+ send_gdb "exec-file $arg\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ verbose "\t\tLoaded $arg with new symbol table into $GDB"
+ return 0
+ }
+ timeout {
+ perror "(timeout) Couldn't load $arg"
+ return -1
+ }
+ }
+ return 0
+ }
+ -re "Reading symbols from.*done.*$gdb_prompt $" {
+ verbose "\t\tLoaded $arg into the $GDB"
+ send_gdb "exec-file $arg\n"
+ gdb_expect {
+ -re "A program is being debugged already.*Kill it.*y or n. $" {
+ send_gdb "y\n"
+ verbose "\t\tKilling previous program being debugged"
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {
+ verbose "\t\tLoaded $arg with new symbol table into $GDB"
+ return 0
+ }
+ timeout {
+ perror "(timeout) Couldn't load $arg"
+ return -1
+ }
+ }
+ return 0
+ }
+ -re "has no symbol-table.*$gdb_prompt $" {
+ perror "$arg wasn't compiled with \"-g\""
+ return -1
+ }
+ -re "Load new symbol table from \".*\".*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re ".*No such file or directory.*$gdb_prompt $" {
+ perror "($arg) No such file or directory\n"
+ return -1
+ }
+ -re "$gdb_prompt $" {
+ perror "couldn't load $arg into $GDB."
+ return -1
+ }
+ timeout {
+ perror "couldn't load $arg into $GDB (timed out)."
+ return -1
+ }
+ eof {
+ # This is an attempt to detect a core dump, but seems not to
+ # work. Perhaps we need to match .* followed by eof, in which
+ # expect does not seem to have a way to do that.
+ perror "couldn't load $arg into $GDB (end of file)."
+ return -1
+ }
+ }
+}
+
+#
+#test_breakpoints
+#
+proc test_breakpoints { } {
+ gdb_test "stop in main" "Breakpoint.*at.*: file.*average\.c, line 38\."
+ gdb_test "status" "Num.*Type.*Disp.*Enb.*Address.*What\r\n1\[ \r\]+breakpoint\[ \r\]+keep y.*in main at.*average\.c:38.*"
+ gdb_test "stop at 43" "Breakpoint.*at.*: file.*average\.c, line 43.*"
+ gdb_test "stop in 43" "Usage: stop in <function . address>"
+ gdb_test "stop at main" "Usage: stop at <line>"
+}
+
+#
+#test_assign
+#
+proc test_assign { } {
+ global decimal
+ global gdb_prompt
+
+ gdb_run_cmd
+ gdb_expect 30 {
+ -re "Break.* at .*:$decimal.*$gdb_prompt $" { pass "running to main" }
+ -re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in .*$gdb_prompt $" { pass "running to main" }
+ -re "$gdb_prompt $" { fail "running to main" }
+ timeout { fail "running to main (timeout)" }
+ }
+ send_gdb "assign first=1\n"
+ gdb_expect {
+ -re "No symbol \"first\" in current context.*$" { fail "assign first" }
+ "$gdb_prompt $" { pass "assign first" }
+ timeout { fail "assign first (timeout)" }
+ }
+ gdb_test "print first" ".1 = 1"
+}
+
+#
+#test_whereis
+#
+proc test_whereis { } {
+ gdb_test "whereis my_list" "All variables matching regular expression \"my_list\":\r\n\r\nFile.*average\.c:\r\nstatic int my_list\\\[10\\\];"
+}
+
+#
+#test_func
+#
+proc test_func { } {
+ gdb_test "cont" "" "cont 1"
+ gdb_test "step" ""
+ # This always fails, but it's not clear why. -sts 1999-08-17
+ setup_xfail "*-*-*"
+ gdb_test "func sum" "'sum' not within current stack frame\."
+ gdb_test "stop in sum" "Breakpoint.*at.*: file.*sum\.c, line 11\."
+ gdb_test "cont" "" "cont 2"
+ # This always fails, but it's not clear why. -sts 1999-08-17
+ setup_xfail "*-*-*"
+ gdb_test "func print_average" ".*in print_average.*\\(list=.*, low=0, high=6\\).*at.*average\.c:24\r\n24\[ \t\]+total = sum\\(list, low, high\\);"
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+global GDBFLAGS
+set saved_gdbflags $GDBFLAGS
+
+set GDBFLAGS "$GDBFLAGS --dbx"
+gdb_start
+dbx_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+test_breakpoints
+test_assign
+test_whereis
+gdb_test "file average.c:1" "1\[ \t\]+/. This is a sample program.*"
+test_func
+
+#exit and cleanup
+gdb_exit
+
+set GDBFLAGS $saved_gdbflags
+eval proc gdb_file_cmd {$old_gdb_file_cmd_args} {$old_gdb_file_cmd_body}
+
+return 0
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
new file mode 100644
index 00000000000..ea8ba503c6b
--- /dev/null
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -0,0 +1,818 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Start with a fresh gdb
+
+gdb_exit
+gdb_start
+
+set timeout 60
+
+#
+# test default actions of gdb commands
+#
+
+#load_lib gdb.exp
+
+gdb_test "add-symbol-file" "add-symbol-file takes a file name and an address" "add-symbol-file"
+
+# test append
+gdb_test "append" "\"append\" must be followed by a subcommand\.\[\r\n\]+List of append subcommands:.*"
+gdb_test "append binary" "\"append binary\" must be followed by a subcommand\.\[\r\n\]+List of append binary subcommands:.*"
+gdb_test "append memory" "Missing filename\."
+gdb_test "append value" "Missing filename\."
+gdb_test "append binary memory" "Missing filename\."
+gdb_test "append binary value" "Missing filename\."
+
+setup_xfail "mips-idt-*"
+send_gdb "attach\n"
+gdb_expect {
+ -re "Argument required .(process-id|program) to attach.*$gdb_prompt $"\
+ { pass "attach" }
+ -re "You can't do that when your target is `None'.*$gdb_prompt $"\
+ { pass "attach" }
+ -re "You can't do that without a process to debug.*$gdb_prompt $"\
+ { pass "attach" }
+ -re "Don't know how to attach. Try \"help target\"..*$gdb_prompt $"\
+ { pass "attach" }
+ -re "Kill it. .y or n." {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "$gdb_prompt $" { fail "attach" }
+ timeout { fail "(timeout) attach" }
+}
+
+if ![target_info exists use_gdb_stub] {
+ gdb_test "break" "No default breakpoint address now." "break"
+ foreach i "b br bre brea" {
+ gdb_test $i "No default breakpoint address now." "break \"$i\" abbreviation"
+ }
+
+
+ setup_xfail "mips-idt-*"
+ gdb_test "backtrace" "No stack."
+
+ # ba and bac are no longer unique command prefixes. So these tests
+ # elict an error from GDB.
+ # GDB needs to be fixed to map unique alias here for ba bac.
+ #
+ foreach i "bt ba bac" {
+ setup_xfail "mips-idt-*"
+ gdb_test $i "No stack." "backtrace \"$i\" abbreviation"
+ }
+} else {
+ warning "Skipping backtrace and break tests because of GDB stub."
+}
+
+# This works on the MIPS IDT board, but confuses future tests.
+if ![istarget "mips-idt-*"] then {
+ gdb_test "continue" "The program is not being run." "continue"
+ gdb_test "c" "The program is not being run." "continue \"c\" abbreviation"
+}
+
+#test call
+gdb_test "call" "The history is empty..*" "call"
+
+
+#test catch
+gdb_test "catch" "Catch requires an event name..*" "catch"
+
+#test cd
+gdb_test "cd" "Argument required .new working directory.*" "cd"
+
+#test clear
+gdb_test "clear" "No source file specified..*" "clear"
+
+#test commands
+gdb_test "commands" "No breakpoint number 0..*" "commands"
+
+#test condition
+gdb_test "condition" "Argument required .breakpoint number.*" "condition"
+
+#test core-file
+gdb_test "core-file" "No core file now.|GDB can't read core files on this machine." "core-file"
+#test delete "d" abbreviation
+gdb_test "d" "" "delete \"d\" abbreviation"
+#test delete
+gdb_test "delete" "" "delete"
+#test define
+gdb_test "define" "Argument required \[(\]name of command to define\[)\]." "define"
+#test delete breakpoints
+gdb_test "delete breakpoints" "" "delete breakpoints"
+#test delete display
+# FIXME -- need to dump full output to detailed log
+send_gdb "delete display\n"
+gdb_expect {
+ -re "Delete all auto-display expressions.*y or n. $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "$gdb_prompt $" { pass "delete display prompt" }
+ timeout { fail "(timeout) delete display prompt" }
+ }
+ }
+ timeout { fail "(timeout) delete display prompt" }
+
+}
+
+#test detach
+gdb_test "detach" "" "detach"
+
+if [istarget "h8300-*-hms"] then {
+ gdb_exit
+ gdb_start
+}
+
+#test directory
+# FIXME -- need to dump full output to detailed log
+
+send_gdb "directory\n"
+gdb_expect {
+ -re "Reinitialize source path to empty.*y or n. $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "Source directories searched: .cdir:.cwd.*$gdb_prompt $"\
+ { pass "directory prompt" }
+ timeout { fail "(timeout) directory prompt" }
+ }
+ }
+}
+
+#test disable "dis" abbreviation
+gdb_test "dis" "" "disable \"dis\" abbreviation"
+#test disable "disa" abbreviation
+gdb_test "disa" "" "disable \"disa\" abbreviation"
+#test disable
+gdb_test "disable" "" "disable"
+#test disable breakpoints
+gdb_test "disable breakpoints" "" "disable breakpoints"
+#test disable display
+gdb_test "disable display" "" "disable display"
+#test disassemble
+gdb_test "disassemble" "No frame selected." "disassemble"
+#test display
+gdb_test "display" "" "display"
+#test do
+gdb_test "do" "No stack." "do"
+#test document
+gdb_test "document" "Argument required .name of command to define.*" "document"
+#test down
+gdb_test "down" "No stack.*" "down"
+#test down-silently
+gdb_test "down-silently" "No stack." "down-silently"
+# test dump
+gdb_test "dump" "\"dump\" must be followed by a subcommand\.\[\r\n\]+List of dump subcommands:.*"
+gdb_test "dump binary" "\"dump binary\" must be followed by a subcommand\.\[\r\n\]+List of dump binary subcommands:.*"
+gdb_test "dump ihex" "\"dump ihex\" must be followed by a subcommand\.\[\r\n\]+List of dump ihex subcommands:.*"
+gdb_test "dump memory" "Missing filename\."
+gdb_test "dump srec" "\"dump srec\" must be followed by a subcommand\.\[\r\n\]+List of dump srec subcommands:.*"
+gdb_test "dump tekhex" "\"dump tekhex\" must be followed by a subcommand\.\[\r\n\]+List of dump tekhex subcommands:.*"
+gdb_test "dump value" "Missing filename\."
+gdb_test "dump binary memory" "Missing filename\."
+gdb_test "dump binary value" "Missing filename\."
+gdb_test "dump ihex memory" "Missing filename\."
+gdb_test "dump ihex value" "Missing filename\."
+gdb_test "dump srec memory" "Missing filename\."
+gdb_test "dump srec value" "Missing filename\."
+gdb_test "dump tekhex memory" "Missing filename\."
+gdb_test "dump tekhex value" "Missing filename\."
+#test echo
+gdb_test "echo" "" "echo"
+#test enable breakpoints delete
+gdb_test "enable breakpoints delete" "Argument required .one or more breakpoint numbers.*" "enable breakpoints delete"
+#test enable breakpoints once
+gdb_test "enable breakpoints once" "Argument required .one or more breakpoint numbers.*" "enable breakpoints once"
+#test enable breakpoints
+gdb_test "enable breakpoints" "" "enable breakpoints"
+#test enable delete
+gdb_test "enable delete" "Argument required .one or more breakpoint numbers.*" "enable delete"
+#test enable display
+gdb_test "enable display" "" "enable display"
+#test enable once
+gdb_test "enable once" "Argument required .one or more breakpoint numbers.*" "enable once"
+#test enable
+gdb_test "enable" "" "enable"
+#test exec-file
+send_gdb "exec-file\n"
+gdb_expect {
+ -re "No executable file now..*$gdb_prompt $" {
+ pass "exec-file"
+ }
+ -re "exec-file.*A program is being debugged already. Kill it. .y or n.*$" {
+ send_gdb "n\n"
+ if $verbose>1 then {
+ send_user "\tDidn't kill program being debugged\n"
+ }
+ gdb_expect -re "$gdb_prompt $" { }
+ pass "exec-file"
+ }
+ -re "$gdb_prompt $" { fail "exec-file" }
+ timeout { fail "(timeout) exec-file" }
+}
+
+#test frame "f" abbreviation
+gdb_test "f" "No stack." "frame \"f\" abbreviation"
+#test frame
+gdb_test "frame" "No stack." "frame"
+#test fg
+gdb_test "fg" "The program is not being run." "fg"
+# FIXME: fg kills the udi connection
+#test file
+send_gdb "file\n"
+gdb_expect {
+ -re "No executable file now..*$gdb_prompt $"\
+ { pass "file" }
+ -re ".*A program is being debugged already. Kill it. .y or n.*$" {
+ send_gdb "n\n"
+ if $verbose>1 then {
+ send_user "\t\tDidn't kill program being debugged\n"
+ }
+ gdb_expect -re "$gdb_prompt $" { }
+ pass "file"
+ }
+ -re ".*$gdb_prompt $" { fail "file" }
+ timeout { fail "(timeout) file" }
+}
+
+#test finish
+gdb_test "finish" "The program is not running." "finish"
+#test forward-search
+# The message here comes from the regexp library, not gdb, and so can
+# vary on different systems.
+gdb_test "forward-search" "No previous regular expression.*|There is no previous regular expression.*" "forward-search"
+#test gcore
+send_gdb "gcore\n"
+gdb_expect {
+ -re "You can\'t do that without a process to debug.*$gdb_prompt $" {
+ pass "gcore"
+ }
+ -re "Undefined command: .*$gdb_prompt $" {
+ pass "gcore"
+ }
+ default { fail "gcore" }
+}
+send_gdb "generate-core-file\n"
+gdb_expect {
+ -re "You can\'t do that without a process to debug.*$gdb_prompt $" {
+ pass "generate-core-file"
+ }
+ -re "Undefined command: .*$gdb_prompt $" {
+ pass "generate-core-file"
+ }
+ default { fail "generate-core-file" }
+}
+#test help "h" abbreviation
+gdb_test "h" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "help \"h\" abbreviation"
+#test help
+gdb_test "help" "List of classes of commands:(\[^\r\n\]*\[\r\n\])+aliases -- Aliases of other commands(\[^\r\n\]*\[\r\n\])+breakpoints -- Making program stop at certain points(\[^\r\n\]*\[\r\n\])+data -- Examining data(\[^\r\n\]*\[\r\n\])+files -- Specifying and examining files(\[^\r\n\]*\[\r\n\])+obscure -- Obscure features(\[^\r\n\]*\[\r\n\])+running -- Running the program(\[^\r\n\]*\[\r\n\])+stack -- Examining the stack(\[^\r\n\]*\[\r\n\])+status -- Status inquiries(\[^\r\n\]*\[\r\n\])+support -- Support facilities(\[^\r\n\]*\[\r\n\])+user-defined -- User-defined commands(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by a class name for a list of commands in that class.(\[^\r\n\]*\[\r\n\])+Type \"help\" followed by command name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "help"
+#test handle
+gdb_test "handle" "Argument required .signal to handle.*" "handle"
+#test info "i" abbreviation
+gdb_test "i" "\"info\" must be followed by the name of an info command.(\[^\r\n\]*\[\r\n\])+List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by info subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "info \"i\" abbreviation"
+#test info
+gdb_test "info" "\"info\" must be followed by the name of an info command.(\[^\r\n\]*\[\r\n\])+List of info subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help info\" followed by info subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "info"
+#test ignore
+gdb_test "ignore" "Argument required .a breakpoint number.*" "ignore"
+#test info address
+gdb_test "info address" "Argument required." "info address"
+#test info all-registers
+gdb_test "info all-registers" "The program has no registers now." "info all-registers"
+#test info args
+gdb_test "info args" "No frame selected." "info args"
+#test info bogus-gdb-command
+gdb_test "info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\". Try \"help info\".*" "info bogus-gdb-command"
+#test info breakpoints
+gdb_test "info breakpoints" "No breakpoints or watchpoints." "info breakpoints"
+#test info catch
+gdb_test "info catch" "You can't do that without a process to debug." "info catch"
+#test info copying
+# FIXME -- doesn't work worth a shit
+#send_gdb "info copying"
+# -re "GNU GENERAL PUBLIC LICENSE.*#of preserving the free status of all derivatives of our free software and.*#of promoting the sharing and reuse of software generally."#
+gdb_test "info copying"
+# }
+#
+#
+#test info display
+gdb_test "info display" "There are no auto-display expressions now." "info display"
+#test info frame "f" abbreviation
+gdb_test "info f" "No stack.*|No selected frame.*" "info frame \"f\" abbreviation"
+#test info frame
+gdb_test "info frame" "No stack.|No selected frame." "info frame"
+#test info files
+gdb_test "info files" "" "info files"
+#test info float
+if { [istarget "arm*-*-*"] || \
+ [istarget "xscale*-*-*"] || \
+ [istarget "strongarm*-*-*"] } then {
+ gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float"
+} elseif [istarget "i\[3456\]86-*-*"] then {
+ gdb_test "info float" "R7:.*Status Word:.*Opcode:.*" "info float"
+} else {
+ gdb_test "info float" "No floating point info available for this processor." "info float"
+}
+#test info functions
+gdb_test "info functions" "All defined functions:" "info functions"
+#test info locals
+gdb_test "info locals" "No frame selected." "info locals"
+#test info program
+gdb_test "info program" "The program being debugged is not being run." "info program"
+#test info registers
+gdb_test "info registers" "The program has no registers now." "info registers"
+#test info stack "s" abbreviation
+gdb_test "info s" "No stack." "info stack \"s\" abbreviation"
+#test info stack
+gdb_test "info stack" "No stack." "info stack"
+#test info set
+# FIXME -- needs to match the entire output
+# FIXME -- on native solaris 2.8, this test fails due to this line:
+# prompt: Gdb's prompt is "(gdb) ".^M
+gdb_test "info set" "confirm: Whether to confirm potentially dangerous operations is o\[a-z\]*.(\[^\r\n\]*\[\r\n\])+history filename: The filename in which to record the command history is (\[^\r\n\]*\[\r\n\])+listsize: Number of source lines gdb will list by default is 10.*" "info set"
+gdb_test "info symbol" "Argument required .address.."
+#test info source
+gdb_test "info source" "No current source file..*" "info source"
+#test info sources
+gdb_test "info sources" "No symbol table is loaded. Use the \"file\" command.*" "info sources"
+#test info target
+gdb_test "info target" "" "info target"
+#test info terminal
+gdb_test "info terminal" "No saved terminal information." "info terminal"
+#test info types
+gdb_test "info types" "All defined types:" "info types"
+#test info variables
+gdb_test "info variables" "All defined variables:" "info variables"
+#test info warranty
+gdb_test "info warranty" "NO WARRANTY(\[^\r\n\]*\[\r\n\])+ *11. *BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY(\[^\r\n\]*\[\r\n\])+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN(\[^\r\n\]*\[\r\n\])+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES(\[^\r\n\]*\[\r\n\])+PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED(\[^\r\n\]*\[\r\n\])+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF(\[^\r\n\]*\[\r\n\])+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS(\[^\r\n\]*\[\r\n\])+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE(\[^\r\n\]*\[\r\n\])+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,(\[^\r\n\]*\[\r\n\])+REPAIR OR CORRECTION.(\[^\r\n\]*\[\r\n\])+ *12. *IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING(\[^\r\n\]*\[\r\n\])+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR(\[^\r\n\]*\[\r\n\])+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,(\[^\r\n\]*\[\r\n\])+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING(\[^\r\n\]*\[\r\n\])+OUT OF THE USE OR INABILITY TO USE THE PROGRAM .INCLUDING BUT NOT LIMITED(\[^\r\n\]*\[\r\n\])+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY(\[^\r\n\]*\[\r\n\])+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER(\[^\r\n\]*\[\r\n\])+PROGRAMS., EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE(\[^\r\n\]*\[\r\n\])+POSSIBILITY OF SUCH DAMAGES.*" "info warranty"
+#test info watchpoints
+gdb_test "info watchpoints" "No breakpoints or watchpoints." "info watchpoints"
+#test inspect
+gdb_test "inspect" "The history is empty." "inspect"
+#test jump
+gdb_test "jump" "The program is not being run." "jump"
+#test kill
+gdb_test "kill" "The program is not being run." "kill"
+#test list "l" abbreviation
+gdb_test "l" "No symbol table is loaded. Use the \"file\" command.*" "list \"l\" abbreviation"
+#test list
+gdb_test "list" "No symbol table is loaded. Use the \"file\" command.*" "list"
+#test load
+# The ``takes a file name'' case is for vxgdb.
+# The ``Use the "file" command'' case is for newer GDB versions which try
+# to deduce the filename from the exec file.
+gdb_test "load" "You can't do that when your target is `None'.*|The load command takes a file name.*|Must specify at least a file name with the load command.*|.*Use the .file. or .exec-file. command.*" "load"
+#test next "n" abbreviation
+gdb_test "n" "The program is not being run." "next \"n\" abbreviation"
+#test next
+gdb_test "next" "The program is not being run." "next"
+#test nexti "ni" abbreviation
+gdb_test "ni" "The program is not being run." "nexti \"ni\" abbreviation"
+#test nexti
+gdb_test "nexti" "The program is not being run." "nexti"
+#test output
+gdb_test "output" "Argument required .expression to compute.*" "output"
+
+#test overlay
+gdb_test "overlay" "\"overlay\" must be followed by the name of .*"
+#test a non-existant overlay subcommand
+gdb_test "overlay on" "Undefined overlay command.* Try \"help overlay\"."
+gdb_test "overlay manual" "" "overlay manual #1"
+gdb_test "overlay auto" ""
+gdb_test "overlay off" ""
+gdb_test "overlay list" "No sections are mapped."
+gdb_test "overlay map" "Overlay debugging not enabled.*" "overlay map #1"
+gdb_test "overlay unmap" "Overlay debugging not enabled.*" "overlay unmap #1"
+gdb_test "overlay manual" "" "overlay manual #2"
+gdb_test "overlay map" "Argument required: name of an overlay section." "overlay map #2"
+gdb_test "overlay unmap" "Argument required: name of an overlay section." "overlay unmap #2"
+
+#test print "p" abbreviation
+gdb_test "p" "The history is empty." "print \"p\" abbreviation"
+#test print
+gdb_test "print" "The history is empty." "print"
+#test printf
+gdb_test "printf" "Argument required .format-control string and values to print.*" "printf"
+#test ptype
+gdb_test "ptype" "The history is empty." "ptype"
+#test pwd
+gdb_test "pwd" "Working directory .*" "pwd"
+
+#test run "r" abbreviation
+if [istarget "*-*-vxworks*"] then {
+ gdb_test "set args" "" ""
+
+ gdb_test "r" "Starting program: .*
+You must specify a function name to run, and arguments if any"\
+ "run \"r\" abbreviation"
+ gdb_test "set args main" "" ""
+
+} else {
+ send_gdb "r\n"
+ gdb_expect {
+ -re "Starting program: .*
+You can't do that when your target is `None'.*$gdb_prompt $"\
+ { pass "run \"r\" abbreviation" }
+ -re "Starting program: .*
+No executable file specified.*
+Use the \"file\" or \"exec-file\" command.*$gdb_prompt $"\
+ { pass "run \"r\" abbreviation" }
+ -re "Starting program: .*
+No image loaded into target.*$gdb_prompt $"\
+ { pass "run \"r\" abbreviation" }
+ -re "Starting program: .*
+No program loaded.*$gdb_prompt $"\
+ { pass "run \"r\" abbreviation" }
+ -re "Don't know how to run. Try \"help target\"..*$gdb_prompt $"\
+ { pass "run \"r\" abbreviation" }
+ -re ".*$gdb_prompt $" { fail "run \"r\" abbreviation" }
+ timeout { fail "(timeout) run \"r\" abbreviation" }
+ }
+}
+
+#test run
+if [istarget "*-*-vxworks*"] then {
+ gdb_test "set args" "" ""
+
+ gdb_test "run" "Starting program: .*
+You must specify a function name to run, and arguments if any"
+ gdb_test "set args main" "" ""
+
+} else {
+ send_gdb "run\n"
+ gdb_expect {
+ -re "Starting program:.*You can't do that when your target is `None'.*$gdb_prompt $" { pass "run" }
+ -re "Starting program: .*
+No executable file specified.*
+Use the \"file\" or \"exec-file\" command.*$gdb_prompt $"\
+ { pass "run" }
+ -re "Starting program: .*
+No image loaded into target.*$gdb_prompt $"\
+ { pass "run" }
+ -re "Starting program: .*
+No program loaded.*$gdb_prompt $"\
+ { pass "run \"r\" abbreviation" }
+ -re "Don't know how to run. Try \"help target\"..*$gdb_prompt $"\
+ { pass "run" }
+ -re ".*$gdb_prompt $" { fail "run" }
+ timeout { fail "(timeout) run" }
+ }
+}
+
+#test rbreak
+gdb_test "rbreak" "" "rbreak"
+
+# test restore
+gdb_test "restore" "You can't do that without a process to debug\."
+
+#test return
+# The middle case accomodated the obsolete a29k, where doing the "ni"
+# above causes an initial stack to be created.
+gdb_test "return" "No selected frame..*" "return" "Make .* return now.*y or n. $" "y"
+
+
+#test reverse-search
+gdb_test "reverse-search" "No previous regular expression.*|There is no previous regular expression.*" "reverse-search"
+#test step "s" abbreviation
+gdb_test "s" "The program is not being run." "step \"s\" abbreviation #1"
+#test step
+gdb_test "step" "The program is not being run." "step #1"
+#test search
+gdb_test "search" "No previous regular expression.*|There is no previous regular expression.*" "search"
+#test section
+gdb_test "section" "Must specify section name and its virtual address.*" "section"
+#test set annotate
+gdb_test "set annotate" "Argument required .integer to set it to.*" "set annotate"
+#test set args
+gdb_test "set args" "" "set args"
+#test set check "c" abbreviation
+gdb_test "set c" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check \"c\" abbreviation"
+#test set check "ch" abbreviation
+gdb_test "set ch" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check \"ch\" abbreviation"
+#test set check
+gdb_test "set check" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check"
+#test set check range
+gdb_test "set check range" "" "set check range"
+#test set check type
+gdb_test "set check type" "" "set check type"
+#test set complaints
+gdb_test "set complaints" "Argument required .integer to set it to.*" "set complaints"
+#test set confirm
+gdb_test "set confirm" "" "set confirm"
+# Don't test set editing. What if we're talking to a gdb that
+# won't do editing correctly while we're talking to it?
+# gdb_test "set editing" "" "set editing"
+
+#test set environment
+gdb_test "set environment" "Argument required .environment variable and value.*" "set environment"
+#test set height
+gdb_test "set height" "Argument required .integer to set it to.*" "set height"
+#test set history expansion
+gdb_test "set history expansion" "" "set history expansion"
+#test set history filename
+gdb_test "set history filename" "Argument required .filename to set it to.*" "set history filename"
+#test set history save
+gdb_test "set history save" "" "set history save"
+#test set history size
+gdb_test "set history size" "Argument required .integer to set it to.*" "set history size"
+#test set history
+gdb_test "set history" "\"set history\" must be followed by the name of a history subcommand.(\[^\r\n\]*\[\r\n\])+List of set history subcommands:(\[^\r\n\]*\[\r\n\])+set history expansion -- Set history expansion on command input(\[^\r\n\]*\[\r\n\])+set history filename -- Set the filename in which to record the command history(\[^\r\n\]*\[\r\n\])+set history save -- Set saving of the history record on exit(\[^\r\n\]*\[\r\n\])+set history size -- Set the size of the command history(\[^\r\n\]*\[\r\n\])+Type \"help set history\" followed by set history subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set history"
+#test set language
+gdb_test "set language" "The currently understood settings are:(\[^\r\n\]*\[\r\n\])+local or auto *Automatic setting based on source file(\[^\r\n\]*\[\r\n\])+c *Use the C language(\[^\r\n\]*\[\r\n\])+c\[+\]+ *Use the C\[+\]+ language(\[^\r\n\]*\[\r\n\])+modula-2 *Use the Modula-2 language.*" "set language"
+#test set listsize
+gdb_test "set listsize" "Argument required .integer to set it to.*" "set listsize"
+#test set print "p" abbreviation
+gdb_test "set p" "\"set print\" must be followed by the name of a print subcommand.(\[^\r\n\]*\[\r\n\])+List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"p\" abbreviation"
+#test set print "pr" abbreviation
+gdb_test "set pr" "\"set print\" must be followed by the name of a print subcommand.(\[^\r\n\]*\[\r\n\])+List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print \"pr\" abbreviation"
+#test set print
+gdb_test "set print" "\"set print\" must be followed by the name of a print subcommand.(\[^\r\n\]*\[\r\n\])+List of set print subcommands:(\[^\r\n\]*\[\r\n\])+Type \"help set print\" followed by set print subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set print"
+#test set print address
+gdb_test "set print address" "" "set print address"
+#test set print array
+gdb_test "set print array" "" "set print array"
+#test set print asm-demangle
+gdb_test "set print asm-demangle" "" "set print asm-demangle"
+#test set print demangle
+gdb_test "set print demangle" "" "set print demangle"
+#test set print elements
+gdb_test "set print elements" "Argument required .integer to set it to.*" "set print elements"
+#test set print object
+gdb_test "set print object" "" "set print object"
+#test set print pretty
+gdb_test "set print pretty" "" "set print pretty"
+#test set print sevenbit-strings
+gdb_test "set print sevenbit-strings" "" "set print sevenbit-strings"
+#test set print union
+gdb_test "set print union" "" "set print union"
+#test set print vtbl
+gdb_test "set print vtbl" "" "set print vtbl"
+# FIXME -- need a test for "set prompt"
+#test set radix
+gdb_test "set radix" "Input and output radices now set to decimal 10, hex a, octal 12.*" "set radix"
+#test set symbol-reloading
+gdb_test "set symbol-reloading" "" "set symbol-reloading"
+#test set variable
+gdb_test "set variable" "Argument required .expression to compute.*" "set variable"
+#test set verbose
+gdb_test "set verbose" "" "set verbose"
+#test set width
+gdb_test "set width" "Argument required .integer to set it to.*" "set width"
+#test set write
+# This is only supported on targets which use exec.o.
+gdb_test "set write" "" "set write"
+#test set
+gdb_test "set" "Argument required .expression to compute.*" "set"
+#test shell echo Hi dad!
+gdb_test "shell echo Hi dad!" "Hi dad!" "shell echo Hi dad!"
+#test show annotate
+gdb_test "show annotate" "Annotation_level is 0." "show annotate"
+#test show args
+gdb_test "show args" "Argument list to give program being debugged when it is started is \"\"." "show args"
+#test show check "c" abbreviation
+gdb_test "show c" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Type checking is \"auto; currently off\".*" "show check \"c\" abbreviation"
+#test show check "ch" abbreviation
+gdb_test "show ch" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Type checking is \"auto; currently off\"." "show check \"ch\" abbreviation"
+#test show check
+gdb_test "show check" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Type checking is \"auto; currently off\"." "show check"
+#test show check range
+gdb_test "show check range" "Range checking is \"auto; currently off\"." "show check range"
+#test show check type
+gdb_test "show check type" "Type checking is \"auto; currently off\"." "show check type"
+#test show commands
+gdb_test "show commands" "" "show commands"
+#test show complaints
+gdb_test "show complaints" "Max number of complaints about incorrect symbols is 0." "show complaints"
+#test show confirm
+gdb_test "show confirm" "Whether to confirm potentially dangerous operations is o\[a-z\]*." "show confirm"
+#test show convenience
+gdb_test "show convenience" "No debugger convenience variables now defined.(\[^\r\n\]*\[\r\n\])+Convenience variables have names starting with \".\";(\[^\r\n\]*\[\r\n\])+use \"set\" as in \"set .foo = 5\" to define them." "show convenience"
+#test show directories
+gdb_test "show directories" "Source directories searched: .cdir:.cwd" "show directories"
+#test show editing
+gdb_test "show editing" "Editing of command lines as they are typed is o\[a-z\]*." "show editing"
+#test show height
+gdb_test "show height" "Number of lines gdb thinks are in a page is.*" "show height"
+#test show history expansion
+gdb_test "show history expansion" "History expansion on command input is o\[a-z\]*.*" "show history expansion"
+#test show history filename
+gdb_test "show history filename" "The filename in which to record the command history is.*.gdb_history.*" "show history filename"
+#test show history save
+gdb_test "show history save" "Saving of the history record on exit is on." "show history save"
+#test show history size
+gdb_test "show history size" "The size of the command history is.*" "show history size"
+#test show history
+gdb_test "show history" "expansion: *History expansion on command input is o(\[^\r\n\]*\[\r\n\])+filename: *The filename in which to record the command history is.*.gdb_history(\[^\r\n\]*\[\r\n\])+save: *Saving of the history record on exit is o(\[^\r\n\]*\[\r\n\])+size: * The size of the command history is.*" "show history"
+#test show language
+gdb_test "show language" "The current source language is \"auto; currently c\"." "show language"
+#test show listsize
+gdb_test "show listsize" "Number of source lines gdb will list by default is 10." "show listsize"
+#test show print "p" abbreviation
+gdb_test "show p" ".*" "show p"
+#test show print "pr" abbreviation
+gdb_test "show pr" ".*" "show pr"
+#test show print
+gdb_test "show print" "" "show print"
+#test show paths
+gdb_test "show paths" "Executable and object file path:.*" "show paths"
+#test show print address
+gdb_test "show print address" "Printing of addresses is on." "show print address"
+#test show print array
+gdb_test "show print array" "Prettyprinting of arrays is on." "show print array"
+#test show print asm-demangle
+gdb_test "show print asm-demangle" "Demangling of C\[+\]+ names in disassembly listings is on." "show print asm-demangle"
+#test show print demangle
+gdb_test "show print demangle" "Demangling of encoded C\[+\]+ names when displaying symbols is on." "show print demangle"
+#test show print elements
+gdb_test "show print elements" "Limit on string chars or array elements to print is 200." "show print elements"
+#test show print object
+gdb_test "show print object" "Printing of object's derived type based on vtable info is on." "show print object"
+#test show print pretty
+gdb_test "show print pretty" "Prettyprinting of structures is on." "show print pretty"
+#test show print sevenbit-strings
+gdb_test "show print sevenbit-strings" "Printing of 8-bit characters in strings as .nnn is on." "show print sevenbit-strings"
+#test show print union
+gdb_test "show print union" "Printing of unions interior to structures is on." "show print union"
+#test show print vtbl
+gdb_test "show print vtbl" "Printing of C\[+\]+ virtual function tables is on." "show print vtbl"
+#test show prompt
+# In the FAIL case, can't just look for $gdb_prompt because that will match
+# the output, rather than the prompt. So look for $gdb_prompt at the start
+# of a line.
+gdb_test "show prompt" "Gdb's prompt is \"$gdb_prompt \".*" "show prompt"
+#test show radix
+gdb_test "show radix" "Input and output radices set to decimal 10, hex a, octal 12." "show radix"
+#test show symbol-reloading
+gdb_test "show symbol-reloading" "Dynamic symbol table reloading multiple times in one run is on." "show symbol-reloading"
+#test show user
+gdb_test "show user" "" "show user"
+#test show values
+gdb_test "show values" "" "show values"
+#test show verbose
+gdb_test "show verbose" "Verbose printing of informational messages is o.*|Verbosity is off.*" "show verbose"
+#test show version
+gdb_test "show version" "GNU gdb \[0-9\.\]*(\[^\r\n\]*\[\r\n\])+Copyright \[0-9\]* Free Software Foundation, Inc(\[^\r\n\]*\[\r\n\])+GDB is free software, covered by the GNU General Public License, and you are(\[^\r\n\]*\[\r\n\])+welcome to change it and/or distribute copies of it under certain conditions(\[^\r\n\]*\[\r\n\])+Type \"show copying\" to see the conditions(\[^\r\n\]*\[\r\n\])+There is absolutely no warranty for GDB. Type \"show warranty\" for details(\[^\r\n\]*\[\r\n\])+This GDB was configured as .*|GDB is free software and you are welcome to distribute copies of it(\[^\r\n\]*\[\r\n\])+ under certain conditions; type \"show copying\" to see the conditions.(\[^\r\n\]*\[\r\n\])+There is absolutely no warranty for GDB; type \"show warranty\" for details.(\[^\r\n\]*\[\r\n\])+GDB.*Copyright \[0-9\]* Free Software Foundation, Inc.*" "show version"
+#test show width
+gdb_test "show width" "Number of characters gdb thinks are in a line is.*" "show width"
+#test show write
+# This is only supported on targets which use exec.o.
+gdb_test "show write" "Writing into executable and core files is o.*" "show write"
+#test show
+gdb_test "show" "confirm: *Whether to confirm potentially dangerous operations is on.(\[^\r\n\]*\[\r\n\])+history filename: *The filename in which to record the command history is (\[^\r\n\]*\[\r\n\])+history save: *Saving of the history record on exit is on.(\[^\r\n\]*\[\r\n\])+history size: *The size of the command history is(\[^\r\n\]*\[\r\n\])+listsize: *Number of source lines gdb will list by default is 10(\[^\r\n]*\[\r\n\])+print elements: *Limit on string chars or array elements to print is 200..*" "show"
+#test stepi "si" abbreviation
+gdb_test "si" "The program is not being run." "stepi \"si\" abbreviation"
+#test stepi
+gdb_test "stepi" "The program is not being run." "stepi"
+#test signal
+gdb_test "signal" "The program is not being run." "signal"
+#test source
+gdb_test "source" "source command requires pathname of file to source..*|No such file or directory.*" "source"
+#test step "s" abbreviation
+gdb_test "s" "The program is not being run." "step \"s\" abbreviation #2"
+#test step
+gdb_test "step" "The program is not being run." "step #2"
+#test symbol-file
+gdb_test "symbol-file" "" "symbol-file"
+
+#test target child
+gdb_test "target child" "Use the \"run\" command to start a Unix child process.*|Undefined target command: \"child\". *Try \"help target\".*" "target child"
+
+#test target procfs
+gdb_test "target procfs" "Use the \"run\" command to start a Unix child process.*|Undefined target command: \"procfs\". *Try \"help target\".*" "target procfs"
+
+#test target core
+send_gdb "target core\n"
+gdb_expect {
+ -re "No core file specified..*$gdb_prompt $" { pass "target core" }
+ -re ".*A program is being debugged already. Kill it. .y or n.*$" {
+ send_gdb "n\n"
+ if $verbose>1 then {
+ send_user "\t\tDidn't kill program being debugged\n"
+ }
+ gdb_expect -re "$gdb_prompt $" { }
+ pass "target core"
+ }
+ -re "Undefined target command: \"core\". Try \"help target\"..*$gdb_prompt $" { pass "target core" }
+ -re ".*$gdb_prompt $" { fail "target core" }
+ timeout { fail "(timeout) target core" }
+}
+
+#test target exec
+send_gdb "target exec\n"
+gdb_expect {
+ -re "No executable file now..*$gdb_prompt $"\
+ { pass "target exec" }
+ -re ".*A program is being debugged already. Kill it. .y or n.*$" {
+ send_gdb "n\n"
+ if $verbose>1 then {
+ send_user "\t\tDidn't kill program being debugged\n"
+ }
+ gdb_expect -re "$gdb_prompt $" { }
+ pass "target exec"
+ }
+ -re ".*$gdb_prompt $" { fail "target exec" }
+ timeout { fail "(timeout) target exec" }
+ }
+
+#test target remote
+if ![istarget "*-*-udi*"] then {
+ send_gdb "target remote\n"
+ gdb_expect {
+ -re "To open a remote debug connection, you need to specify what.*serial.*device is attached to the remote system.*.e.g. .*$gdb_prompt $"\
+ { pass "target remote" }
+ -re ".*A program is being debugged already. Kill it. .y or n.*$" {
+ send_gdb "n\n"
+ if $verbose>1 then {
+ send_user "\t\tDidn't kill program being debugged\n"
+ }
+ gdb_expect -re "$gdb_prompt $" { }
+ pass "target remote"
+ }
+ -re ".*$gdb_prompt $" { fail "target remote" }
+ timeout { fail "(timeout) target remote" }
+ }
+}
+
+#test target
+gdb_test "target" "Argument required .target name.*" "target"
+#test tbreak
+gdb_test "tbreak" "No default breakpoint address now." "tbreak"
+#test tty
+gdb_test "tty" "Argument required .terminal name for running target process.*" "tty"
+#test until "u" abbreviation
+gdb_test "u" "The program is not running." "until \"u\" abbreviation"
+#test until
+gdb_test "until" "The program is not running." "until"
+#test undisplay
+# FIXME -- need to dump full output to detailed log
+send_gdb "undisplay\n"
+gdb_expect {
+ -re "Delete all auto-display expressions.*y or n. $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "$gdb_prompt $" { pass "undisplay prompt" }
+ timeout { fail "(timeout) (timeout) undisplay prompt" }
+ }
+ }
+ timeout { fail "(timeout) (timeout) undisplay prompt" }
+}
+
+#test unset environment
+send_gdb "unset environment\n"
+gdb_expect {
+ -re "Delete all environment variables?.*y or n. $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "$gdb_prompt $" { pass "unset environmentprompt" }
+ timeout {
+ fail "(timeout) (timeout) unset environment prompt"
+ }
+ }
+ }
+ timeout {
+ fail "(timeout) (timeout) unset environment prompt"
+ }
+}
+
+#test unset
+gdb_test "unset" "\"unset\" must be followed by the name of an unset subcommand.(\[^\r\n\]*\[\r\n\])+List of unset subcommands:(\[^\r\n\]*\[\r\n\])+unset environment -- Cancel environment variable VAR for the program(\[^\r\n\]*\[\r\n\])+Type \"help unset\" followed by unset subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "unset"
+#test up
+#test up-silently
+gdb_test "up-silently" "No stack." "up-silently"
+#test watch
+gdb_test "watch" "Argument required .expression to compute.*" "watch"
+#test whatis
+gdb_test "whatis" "The history is empty." "whatis"
+#test where
+gdb_test "where" "No stack." "where"
+#test x
+#The case in which it prints a number is for vxgdb.
+send_gdb "x\n"
+gdb_expect {
+ -re "0x0:.*Cannot access memory at address 0x0..*$gdb_prompt $" {
+ pass "x"
+ }
+ -re "0x0:.*Error accessing memory address 0x0:.*$gdb_prompt $" {
+ pass "x"
+ }
+ -re ".*$gdb_prompt $" { fail "x" }
+ timeout { fail "(timeout) x" }
+}
+
+gdb_exit
diff --git a/gdb/testsuite/gdb.base/define.exp b/gdb/testsuite/gdb.base/define.exp
new file mode 100644
index 00000000000..06ea1c0f4f8
--- /dev/null
+++ b/gdb/testsuite/gdb.base/define.exp
@@ -0,0 +1,304 @@
+# Copyright 1998, 1999, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni. (ezannoni@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+global usestubs
+
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "break"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then { fail "define tests suppressed" }
+
+# Verify that GDB allows a user to define their very own commands.
+#
+send_gdb "define nextwhere\n"
+gdb_expect {
+ -re "Type commands for definition of \"nextwhere\".\r\nEnd with a line saying just \"end\".\r\n>$"\
+ {send_gdb "next\nbt\nend\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "define user command: nextwhere"}
+ timeout {fail "(timeout) define user command: nextwhere"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "define user command: nextwhere"}
+ timeout {fail "(timeout) define user command: nextwhere"}
+}
+
+# Verify that those commands work as gdb_expected.
+#
+send_gdb "nextwhere\n"
+gdb_expect {
+ -re ".*79\[ \t\]*printf.*#0\[ \t\]*main.*:79.*$gdb_prompt $"\
+ {pass "use user command: nextwhere"}
+ -re "$gdb_prompt $"\
+ {fail "use user command: nextwhere"}
+ timeout {fail "(timeout) use user command: nextwhere"}
+}
+
+# Verify that a user can define a command whose spelling is a
+# proper substring of another user-defined command.
+#
+send_gdb "define nextwh\n"
+gdb_expect {
+ -re "Type commands for definition of \"nextwh\".\r\nEnd with a line saying just \"end\".\r\n>$"\
+ {send_gdb "next 2\nbt\nend\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "define user command: nextwh"}
+ timeout {fail "(timeout) define user command: nextwh"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "define user command: nextwh"}
+ timeout {fail "(timeout) define user command: nextwh"}
+}
+
+# Verify that a user can redefine their commands. (Test both the
+# confirmed and unconfirmed cases.)
+#
+send_gdb "define nextwhere\n"
+gdb_expect {
+ -re "Redefine command \"nextwhere\".*y or n. $"\
+ {send_gdb "n\n"
+ gdb_expect {
+ -re "Command \"nextwhere\" not redefined.*$gdb_prompt $"\
+ {pass "redefine user command aborted: nextwhere"}
+ -re "$gdb_prompt $"\
+ {fail "redefine user command aborted: nextwhere"}
+ timeout {fail "(timeout) redefine user command aborted: nextwhere"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "redefine user command aborted: nextwhere"}
+ timeout {fail "(timeout) redefine user command aborted: nextwhere"}
+}
+
+send_gdb "define nextwhere\n"
+gdb_expect {
+ -re "Redefine command \"nextwhere\".*y or n. $"\
+ {send_gdb "y\n"
+ gdb_expect {
+ -re "Type commands for definition of \"nextwhere\".\r\nEnd with a line saying just \"end\".\r\n>$"\
+ {send_gdb "bt\nnext\nend\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "redefine user command: nextwhere"}
+ timeout {fail "(timeout) redefine user command: nextwhere"}
+ }
+ }
+ timeout {fail "(timeout) redefine user command: nextwhere"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "redefine user command: nextwhere"}
+ timeout {fail "(timeout) redefine user command: nextwhere"}
+}
+
+# Verify that GDB gracefully handles an attempt to redefine the
+# help text for a builtin command.
+#
+send_gdb "document step\n"
+gdb_expect {
+ -re "Command \"step\" is built-in..*$gdb_prompt $"\
+ {pass "redocumenting builtin command disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "redocumenting builtin command disallowed"}
+ timeout {fail "(timeout) redocumenting builtin command disallowed"}
+}
+
+# Verify that a user can document their own commands. (And redocument
+# them.)
+#
+send_gdb "document nextwhere\n"
+gdb_expect {
+ -re "Type documentation for \"nextwhere\".\r\nEnd with a line saying just \"end\".\r\n>$"\
+ {send_gdb "A next command that frist shows you where you're stepping from.\nend\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "document user command: nextwhere"}
+ timeout {fail "(timeout) document user command: nextwhere"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "document user command: nextwhere"}
+ timeout {fail "(timeout) document user command: nextwhere"}
+}
+
+send_gdb "document nextwhere\n"
+gdb_expect {
+ -re "Type documentation for \"nextwhere\".\r\nEnd with a line saying just \"end\".\r\n>$"\
+ {send_gdb "A next command that first shows you where you're stepping from.\nend\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "re-document user command: nextwhere"}
+ timeout {fail "(timeout) re-document user command: nextwhere"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "re-document user command: nextwhere"}
+ timeout {fail "(timeout) re-document user command: nextwhere"}
+}
+
+send_gdb "help nextwhere\n"
+gdb_expect {
+ -re "A next command that first shows you where you're stepping from.\r\n$gdb_prompt $"\
+ {pass "help user command: nextwhere"}
+ -re "$gdb_prompt $"\
+ {fail "help user command: nextwhere"}
+ timeout {fail "(timeout) help user command: nextwhere"}
+}
+
+# Verify that the user can "hook" a builtin command. We choose to
+# hook the "stop" pseudo command, and we'll define it to use a user-
+# define command.
+#
+send_gdb "define user-bt\n"
+gdb_expect {
+ -re "Type commands for definition of \"user-bt\".\r\nEnd with a line saying just \"end\".\r\n>$"\
+ {send_gdb "bt\nend\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "define user command: user-bt"}
+ timeout {fail "(timeout) define user command: user-bt"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "define user command: user-bt"}
+ timeout {fail "(timeout) define user command: user-bt"}
+}
+
+send_gdb "define hook-stop\n"
+gdb_expect {
+ -re "Type commands for definition of \"hook-stop\".\r\nEnd with a line saying just \"end\".\r\n>$"\
+ {send_gdb "user-b\nend\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "define hook-stop command"}
+ timeout {fail "(timeout) define hook-stop command"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "define hook-stop command"}
+ timeout {fail "(timeout) define hook-stop command"}
+}
+
+send_gdb "next\n"
+gdb_expect {
+ -re "#0\[ \t\]*main.*:81.*$gdb_prompt $"\
+ {pass "use hook-stop command"}
+ -re "$gdb_prompt $"\
+ {fail "use hook-stop command"}
+ timeout {fail "(timeout) use hook-stop command"}
+}
+
+# Verify that GDB responds gracefully to an attempt to define a "hook
+# command" which doesn't exist. (Test both the confirmed and unconfirmed
+# cases.)
+#
+send_gdb "define hook-bar\n"
+gdb_expect {
+ -re "warning: Your new `hook-bar' command does not hook any existing command.\r\nProceed.*y or n. $"\
+ {send_gdb "n\n"
+ gdb_expect {
+ -re "Not confirmed.*$gdb_prompt $"\
+ {pass "define hook undefined command aborted: bar"}
+ -re "$gdb_prompt $"\
+ {fail "define hook undefined command aborted: bar"}
+ timeout {fail "(timeout) define hook undefined command aborted: bar"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "define hook undefined command aborted: bar"}
+ timeout {fail "(timeout) define hook undefined command aborted: bar"}
+}
+
+send_gdb "define hook-bar\n"
+gdb_expect {
+ -re "warning: Your new `hook-bar' command does not hook any existing command.\r\nProceed.*y or n. $"\
+ {send_gdb "y\n"
+ gdb_expect {
+ -re "Type commands for definition of \"hook-bar\".\r\nEnd with a line saying just \"end\".\r\n>$"\
+ {send_gdb "nextwhere\nend\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "define hook undefined command: bar"}
+ timeout {fail "(timeout) define hook undefined command: bar"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "define hook undefined command: bar"}
+ timeout {fail "(timeout) define hook undefined command: bar"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "define hook undefined command: bar"}
+ timeout {fail "(timeout) define hook undefined command: bar"}
+}
+
+# This is a quasi-define command: Verify that the user can redefine
+# GDB's gdb_prompt.
+#
+send_gdb "set prompt \\(blah\\) \n"
+gdb_expect {
+ -re "\\(blah\\) $"\
+ {pass "set gdb_prompt"}
+ -re "$gdb_prompt $"\
+ {fail "set gdb_prompt"}
+ timeout {fail "(timeout) set gdb_prompt"}
+}
+
+send_gdb "set prompt \\(gdb\\) \n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "reset gdb_prompt"}
+ timeout {fail "(timeout) reset gdb_prompt"}
+}
+
+gdb_exit
+return 0
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.base/display.c b/gdb/testsuite/gdb.base/display.c
new file mode 100644
index 00000000000..365240922d1
--- /dev/null
+++ b/gdb/testsuite/gdb.base/display.c
@@ -0,0 +1,52 @@
+/* Loop and vars for tests of display commands
+*/
+#include <stdio.h>
+#define LOOP 10
+
+int sum = 0;
+
+int do_loops()
+{
+ int i=0;
+ int k=0;
+ int j=0;
+ float f=3.1415;
+ for( i = 0; i < LOOP; i++ ) {
+ for( j = 0; j < LOOP; j++ ) {
+ for( k = 0; k < LOOP; k++ ) {
+ sum++; f++;
+ }
+ }
+ }
+ return i;
+}
+
+int do_vars()
+{
+ int j;
+ int i = 9;
+ float f = 1.234;
+ char c = 'Q';
+ int *p_i = &i;
+ float *p_f = &f;
+ char *p_c = "rubarb and fries";
+
+ /* Need some code here to set breaks on.
+ */
+ for( j = 0; j < LOOP; j++ ) {
+ if( p_c[j] == c ) {
+ j++;
+ }
+ else {
+ i++;
+ }
+ }
+
+ return *p_i;
+}
+
+main()
+{
+ do_loops();
+ do_vars();
+}
diff --git a/gdb/testsuite/gdb.base/display.exp b/gdb/testsuite/gdb.base/display.exp
new file mode 100644
index 00000000000..e285729adab
--- /dev/null
+++ b/gdb/testsuite/gdb.base/display.exp
@@ -0,0 +1,215 @@
+# Copyright 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# display.exp Test display commands
+# Also do some printing stuff for coverage's sake.
+#
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile display
+set srcfile ${srcdir}/${subdir}/${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+
+
+if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+# Preserve the old timeout, and set a new one that should be
+# sufficient to avoid timing out during this test.
+set oldtimeout $timeout
+set timeout [expr "$timeout + 60"]
+verbose "Timeout is now $timeout seconds" 2
+
+# use this to debug:
+#log_user 1
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Some coverage stuff
+#
+if ![target_info exists use_gdb_stub] {
+ gdb_test "kill" ".*The program is not being run.*"
+ gdb_test "detach" ".*"
+ gdb_test "run" ".*"
+
+ gdb_load ${binfile}
+ gdb_test "kill" ".*" "kill again"
+ gdb_test "detach" ".*" "detach again"
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+}
+
+# Ok, on to real life
+#
+if ![runto_main] then {
+ fail "Could not run to main - other tests will fail."
+ continue
+}
+
+# Disable hardware watchpoints if necessary.
+if [target_info exists gdb,no_hardware_watchpoints] {
+ gdb_test "set can-use-hw-watchpoints 0" "" ""
+}
+
+gdb_test "break 14" ".*Breakpoint 2.*" "break do_loops"
+gdb_test "cont" ".*Breakpoint 2, do_loops.*" "get to do_loops"
+
+# Create stopping points.
+#
+gdb_test "watch sum" ".*\[Ww\]atchpoint 3: sum.*" "set watch"
+gdb_test "break 19" ".*Breakpoint 4.*" "break 19"
+
+# Create displays for those points
+#
+gdb_test "info disp" ".*There are no auto-display expressions now..*" "inf disp"
+gdb_test "disp i" ".*1: i = 0.*" "display i"
+gdb_test "disp/x j" ".*2: /x j = 0x0.*" "display j"
+gdb_test "disp/i &k" ".*3: x/i &k $hex:.*" "display &k"
+gdb_test "disp/f f" ".*4: /f f = 3.1415*" "display/f f"
+gdb_test "disp/s &sum" ".*5: x/s &sum $hex.*sum.:.*" "display/s &sum"
+
+# Hit the displays
+#
+gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 3.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0\r\n\[1-9\]*: i = 0.*" "first disp"
+gdb_test "cont" ".*\[Ww\]atchpoint 3: sum.*\[1-9\]*: x/s &sum.*\[1-9\]*: /f f = 4.1415\r\n\[1-9\]*: x/i &k.*\r\n\[1-9\]*: /x j = 0x0.*\[1-9\]*: i = 0.*" "second disp"
+
+gdb_test "enab disp 6" ".*No display number 6..*" "catch err"
+gdb_test "disab disp 1" ".*" "disab disp 1"
+gdb_test "disab disp 2" ".*" "disab disp 2"
+gdb_test "enab disp 1" ".*" "re-enab"
+gdb_test "enab disp 1" ".*" "re-enab of enab"
+gdb_test "undisp 5" ".*" "undisp"
+gdb_test "info disp" ".*Auto-display expressions now in effect.*y /f f.*y /1bi &k.*n /x j.*y i.*" "info disp"
+
+gdb_test "cont" ".*\[Ww\]atch.*5.1415.*.*i = 0.*" "next hit"
+
+send_gdb "undisp\n"
+gdb_expect {
+ -re ".*Delete all auto-display expressions.*y or n. $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "y\r\n$gdb_prompt $" {
+ pass "undisp all"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "some un-helpful response"
+ }
+ -re ".*Delete all.*$" {
+ fail "re-ask question"
+ }
+ timeout { fail "timeout" }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "undisp all"
+ }
+ timeout { fail "timeout" }
+}
+
+gdb_test "disab 3" ".*.*" "disab 3"
+gdb_test "cont" ".*Breakpoint 4.*" "watch off"
+
+# Now the printf tests
+#
+# The "finish" command may leave us mid-line in the caller on some
+# targets, including but not limited to the m68k, i386 & PA. So we
+# have to arrange to step until we hit the line with the call to
+# "do_vars".
+send_gdb "finish\n"
+gdb_expect {
+ -re ".*do_loops\\(\\);.*$gdb_prompt $" {
+ send_gdb "step\n"
+ exp_continue
+ }
+ -re ".*do_vars.*$gdb_prompt $" {
+ pass "finish"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "finish"
+ gdb_suppress_tests
+ }
+ timeout {
+ fail "(timeout) finish"
+ gdb_suppress_tests
+ }
+}
+
+gdb_test "step" ".*do_vars.*.*27.*"
+gdb_test "tbreak 37" ".*Breakpoint 5 a.*"
+gdb_test "cont" ".*do_vars.*37.*37.*"
+
+# Beat on printf a bit
+#
+gdb_test "printf" ".*Argument required.*"
+gdb_test "printf %d" ".*Bad format string, missing.*"
+gdb_test "printf \"%d" ".*Bad format string, non-terminated.*"
+gdb_test "printf \"%d%d\",i" ".*Wrong number of arguments.*"
+gdb_test "printf \"\\\\!\\a\\f\\r\\t\\v\\b\\n\"" ".*!.*"
+gdb_test "printf \"\"" ".*" "re-set term"
+gdb_test "printf \"\\w\"" ".*Unrecognized escape character.*"
+gdb_test "printf \"%d\" j" ".*Invalid argument syntax.*"
+
+# play with "print", too
+#
+gdb_test "print/r j" ".*Undefined output format.*"
+gdb_test "print j" ".*" "debug test output"
+
+# x/0 j doesn't produce any output and terminates PA64 process when testing
+if [istarget "hppa2.0w-hp-hpux11*"] {
+ xfail "'x/0 j' terminates PA64 process - skipped test point"
+} else {
+ gdb_test "x/0 j" ".*"
+}
+if [istarget "hppa*-hp-hpux*"] {
+ # on HP-UX you could access the first page without getting an error
+ gdb_test "x/rx j" ".*(Cannot access|Error accessing) memory.*|.*0xa:\[ \t\]*\[0-9\]+.*"
+}
+gdb_test "print/0 j" ".*Item count other than 1 is meaningless.*" "print/0 j"
+gdb_test "print/s sum" ".*Format letter.*is meaningless.*" " no s"
+gdb_test "print/i sum" ".*Format letter.*is meaningless.*.*" "no i"
+gdb_test "print/a &sum" ".*= $hex.*<sum>.*"
+# If the constant below is larger than the length of main, then
+# this test will (incorrectly) fail. So use a small number.
+gdb_test "print/a main+4" ".*= $hex.*<.*>.*"
+gdb_test "print/a \$pc" ".*= $hex.*<do_vars+.*>.*"
+gdb_test "print/a &&j" ".*A .* error in expression.*"
+
+# Done!
+#
+gdb_exit
+
+# Restore the preserved old timeout value.
+set timeout $oldtimeout
+verbose "Timeout is now $timeout seconds" 2
+
+return 0
diff --git a/gdb/testsuite/gdb.base/dump.c b/gdb/testsuite/gdb.base/dump.c
new file mode 100644
index 00000000000..784edf6ac8b
--- /dev/null
+++ b/gdb/testsuite/gdb.base/dump.c
@@ -0,0 +1,44 @@
+#define ARRSIZE 32
+int intarray[ARRSIZE], intarray2[ARRSIZE];
+
+struct teststruct {
+ int a;
+ int b;
+ int c;
+ int d;
+ int e;
+ int f;
+ int g;
+} intstruct, intstruct2;
+
+void checkpoint1 ()
+{
+ /* intarray and teststruct have been initialized. */
+}
+
+void
+zero_all ()
+{
+ memset ((char *) &intarray, 0, sizeof (intarray));
+ memset ((char *) &intarray2, 0, sizeof (intarray2));
+ memset ((char *) &intstruct, 0, sizeof (intstruct));
+ memset ((char *) &intstruct2, 0, sizeof (intstruct2));
+}
+
+main()
+{
+ int i;
+
+ for (i = 0; i < ARRSIZE; i++)
+ intarray[i] = i+1;
+
+ intstruct.a = 12 * 1;
+ intstruct.b = 12 * 2;
+ intstruct.c = 12 * 3;
+ intstruct.d = 12 * 4;
+ intstruct.e = 12 * 5;
+ intstruct.f = 12 * 6;
+ intstruct.g = 12 * 7;
+
+ checkpoint1 ();
+}
diff --git a/gdb/testsuite/gdb.base/dump.exp b/gdb/testsuite/gdb.base/dump.exp
new file mode 100644
index 00000000000..826fdfb0bfd
--- /dev/null
+++ b/gdb/testsuite/gdb.base/dump.exp
@@ -0,0 +1,442 @@
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@redhat.com)
+# This is a test for the gdb command "dump".
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "dump"
+
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Clean up any stale output files from previous test runs
+
+remote_exec build "rm -f intarr1.bin intarr1b.bin intarr1.ihex intarr1.srec intarr1.tekhex intarr2.bin intarr2b.bin intarr2.ihex intarr2.srec intarr2.tekhex intstr1.bin intstr1b.bin intstr1.ihex intstr1.srec intstr1.tekhex intstr2.bin intstr2b.bin intstr2.ihex intstr2.srec intstr2.tekhex intarr3.srec"
+
+# Test help (FIXME:)
+
+# Run target program until data structs are initialized.
+
+if { ! [ runto checkpoint1 ] } then {
+ gdb_suppress_entire_file "Program failed to run, so all tests in this file will automatically fail."
+}
+
+# Now generate some dump files.
+
+proc make_dump_file { command msg } {
+ global gdb_prompt
+
+ send_gdb "${command}\n"
+ gdb_expect {
+ -re ".*\[Ee\]rror.*$gdb_prompt $" { fail $msg }
+ -re ".*\[Ww\]arning.*$gdb_prompt $" { fail $msg }
+ -re ".*\[Uu\]ndefined .*$gdb_prompt $" { fail $msg }
+ -re ".*$gdb_prompt $" { pass $msg }
+ timeout { fail "$msg (timeout)" }
+ }
+}
+
+make_dump_file "dump val intarr1.bin intarray" \
+ "dump array as value, default"
+
+make_dump_file "dump val intstr1.bin intstruct" \
+ "dump struct as value, default"
+
+make_dump_file "dump bin val intarr1b.bin intarray" \
+ "dump array as value, binary"
+
+make_dump_file "dump bin val intstr1b.bin intstruct" \
+ "dump struct as value, binary"
+
+make_dump_file "dump srec val intarr1.srec intarray" \
+ "dump array as value, srec"
+
+make_dump_file "dump srec val intstr1.srec intstruct" \
+ "dump struct as value, srec"
+
+make_dump_file "dump ihex val intarr1.ihex intarray" \
+ "dump array as value, intel hex"
+
+make_dump_file "dump ihex val intstr1.ihex intstruct" \
+ "dump struct as value, intel hex"
+
+make_dump_file "dump tekhex val intarr1.tekhex intarray" \
+ "dump array as value, tekhex"
+
+make_dump_file "dump tekhex val intstr1.tekhex intstruct" \
+ "dump struct as value, tekhex"
+
+proc capture_value { expression } {
+ global gdb_prompt
+ global expect_out
+
+ set output_string ""
+ send_gdb "print ${expression}\n"
+ gdb_expect {
+ -re ".*\[\r\n\]+.\[0123456789\]+ = (\[^\r\n\]+).*$gdb_prompt $" {
+ set output_string $expect_out(1,string)
+ }
+ default {
+ fail "capture_value failed on $expression."
+ }
+ }
+ return $output_string
+}
+
+set array_start [capture_value "/x &intarray\[0\]"]
+set array_end [capture_value "/x &intarray\[32\]"]
+set struct_start [capture_value "/x &intstruct"]
+set struct_end [capture_value "/x &intstruct + 1"]
+
+set array_val [capture_value "intarray"]
+set struct_val [capture_value "intstruct"]
+
+make_dump_file "dump mem intarr2.bin $array_start $array_end" \
+ "dump array as memory, default"
+
+make_dump_file "dump mem intstr2.bin $struct_start $struct_end" \
+ "dump struct as memory, default"
+
+make_dump_file "dump bin mem intarr2b.bin $array_start $array_end" \
+ "dump array as memory, binary"
+
+make_dump_file "dump bin mem intstr2b.bin $struct_start $struct_end" \
+ "dump struct as memory, binary"
+
+make_dump_file "dump srec mem intarr2.srec $array_start $array_end" \
+ "dump array as memory, srec"
+
+make_dump_file "dump srec mem intstr2.srec $struct_start $struct_end" \
+ "dump struct as memory, srec"
+
+make_dump_file "dump ihex mem intarr2.ihex $array_start $array_end" \
+ "dump array as memory, ihex"
+
+make_dump_file "dump ihex mem intstr2.ihex $struct_start $struct_end" \
+ "dump struct as memory, ihex"
+
+make_dump_file "dump tekhex mem intarr2.tekhex $array_start $array_end" \
+ "dump array as memory, tekhex"
+
+make_dump_file "dump tekhex mem intstr2.tekhex $struct_start $struct_end" \
+ "dump struct as memory, tekhex"
+
+# test complex expressions
+make_dump_file \
+ "dump srec mem intarr3.srec &intarray \(char *\) &intarray + sizeof intarray" \
+ "dump array as mem, srec, expressions"
+
+
+# Now start a fresh gdb session, and reload the saved value files.
+
+gdb_exit
+gdb_start
+gdb_file_cmd ${binfile}
+
+# Reload saved values one by one, and compare.
+
+if { ![string compare $array_val [capture_value "intarray"]] } then {
+ fail "start with intarray un-initialized"
+} else {
+ pass "start with intarray un-initialized"
+}
+
+if { ![string compare $struct_val [capture_value "intstruct"]] } then {
+ fail "start with intstruct un-initialized"
+} else {
+ pass "start with intstruct un-initialized"
+}
+
+proc test_reload_saved_value { filename msg oldval newval } {
+ global gdb_prompt
+
+ gdb_file_cmd $filename
+ if { ![string compare $oldval [capture_value $newval]] } then {
+ pass $msg
+ } else {
+ fail $msg
+ }
+}
+
+proc test_restore_saved_value { restore_args msg oldval newval } {
+ global gdb_prompt
+
+ gdb_test "restore $restore_args" \
+ "Restoring .*" \
+ "Restore command, $msg"
+
+ if { ![string compare $oldval [capture_value $newval]] } then {
+ pass "Restored value, $msg"
+ } else {
+ fail "Restored value, $msg"
+ }
+}
+
+test_reload_saved_value "intarr1.srec" "reload array as value, srec" \
+ $array_val "intarray"
+test_reload_saved_value "intstr1.srec" "reload struct as value, srec" \
+ $struct_val "intstruct"
+test_reload_saved_value "intarr2.srec" "reload array as memory, srec" \
+ $array_val "intarray"
+test_reload_saved_value "intstr2.srec" "reload struct as memory, srec" \
+ $struct_val "intstruct"
+
+test_reload_saved_value "intarr1.ihex" "reload array as value, intel hex" \
+ $array_val "intarray"
+test_reload_saved_value "intstr1.ihex" "reload struct as value, intel hex" \
+ $struct_val "intstruct"
+test_reload_saved_value "intarr2.ihex" "reload array as memory, intel hex" \
+ $array_val "intarray"
+test_reload_saved_value "intstr2.ihex" "reload struct as memory, intel hex" \
+ $struct_val "intstruct"
+
+test_reload_saved_value "intarr1.tekhex" "reload array as value, tekhex" \
+ $array_val "intarray"
+test_reload_saved_value "intstr1.tekhex" "reload struct as value, tekhex" \
+ $struct_val "intstruct"
+test_reload_saved_value "intarr2.tekhex" "reload array as memory, tekhex" \
+ $array_val "intarray"
+test_reload_saved_value "intstr2.tekhex" "reload struct as memory, tekhex" \
+ $struct_val "intstruct"
+
+# Start a fresh gdb session
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Run to main.
+if { ! [ runto main ] } then {
+ gdb_suppress_entire_file "Program failed to run, so remaining tests in this file will automatically fail."
+}
+
+if { ![string compare $array_val [capture_value "intarray"]] } then {
+ fail "start with intarray un-initialized, runto main"
+} else {
+ pass "start with intarray un-initialized, runto main"
+}
+
+if { ![string compare $struct_val [capture_value "intstruct"]] } then {
+ fail "start with intstruct un-initialized, runto main"
+} else {
+ pass "start with intstruct un-initialized, runto main"
+}
+
+test_restore_saved_value "intarr1.srec" "array as value, srec" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr1.srec" "struct as value, srec" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" "void" "zero all"
+
+test_restore_saved_value "intarr2.srec" "array as memory, srec" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr2.srec" "struct as memory, srec" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.ihex" "array as value, ihex" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr1.ihex" "struct as value, ihex" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr2.ihex" "array as memory, ihex" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr2.ihex" "struct as memory, ihex" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.tekhex" "array as value, tekhex" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr1.tekhex" "struct as value, tekhex" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr2.tekhex" "array as memory, tekhex" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr2.tekhex" "struct as memory, tekhex" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.bin binary $array_start" \
+ "array as value, binary" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr1.bin binary $struct_start" \
+ "struct as value, binary" \
+ $struct_val "intstruct"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr2.bin binary $array_start" \
+ "array as memory, binary" \
+ $array_val "intarray"
+
+test_restore_saved_value "intstr2.bin binary $struct_start" \
+ "struct as memory, binary" \
+ $struct_val "intstruct"
+
+# test restore with offset.
+
+set array2_start [capture_value "/x &intarray2\[0\]"]
+set struct2_start [capture_value "/x &intstruct2"]
+set array2_offset \
+ [capture_value "/x (char *) &intarray2 - (char *) &intarray"]
+set struct2_offset \
+ [capture_value "/x (char *) &intstruct2 - (char *) &intstruct"]
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.srec $array2_offset" \
+ "array copy, srec" \
+ $array_val "intarray2"
+
+test_restore_saved_value "intstr1.srec $struct2_offset" \
+ "struct copy, srec" \
+ $struct_val "intstruct2"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.ihex $array2_offset" \
+ "array copy, ihex" \
+ $array_val "intarray2"
+
+test_restore_saved_value "intstr1.ihex $struct2_offset" \
+ "struct copy, ihex" \
+ $struct_val "intstruct2"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.tekhex $array2_offset" \
+ "array copy, tekhex" \
+ $array_val "intarray2"
+
+test_restore_saved_value "intstr1.tekhex $struct2_offset" \
+ "struct copy, tekhex" \
+ $struct_val "intstruct2"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.bin binary $array2_start" \
+ "array copy, binary" \
+ $array_val "intarray2"
+
+test_restore_saved_value "intstr1.bin binary $struct2_start" \
+ "struct copy, binary" \
+ $struct_val "intstruct2"
+
+#
+# test restore with start/stop addresses.
+#
+# For this purpose, we will restore just the third element of the array,
+# and check to see that adjacent elements are not modified.
+#
+# We will need the address and offset of the third and fourth elements.
+#
+
+set element3_start [capture_value "/x &intarray\[3\]"]
+set element4_start [capture_value "/x &intarray\[4\]"]
+set element3_offset \
+ [capture_value "/x (char *) &intarray\[3\] - (char *) &intarray\[0\]"]
+set element4_offset \
+ [capture_value "/x (char *) &intarray\[4\] - (char *) &intarray\[0\]"]
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.srec 0 $element3_start $element4_start" \
+ "array partial, srec" \
+ [capture_value "4"] "intarray\[3\]"
+
+gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 1"
+gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 1"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.ihex 0 $element3_start $element4_start" \
+ "array partial, ihex" \
+ [capture_value "4"] "intarray\[3\]"
+
+gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 2"
+gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 2"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value "intarr1.tekhex 0 $element3_start $element4_start" \
+ "array partial, tekhex" \
+ [capture_value "4"] "intarray\[3\]"
+
+gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 3"
+gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 3"
+
+gdb_test "print zero_all ()" ""
+
+test_restore_saved_value \
+ "intarr1.bin binary $array_start $element3_offset $element4_offset" \
+ "array partial, binary" \
+ [capture_value "4"] "intarray\[3\]"
+
+gdb_test "print intarray\[2\] == 0" " = 1" "element 2 not changed - 4"
+gdb_test "print intarray\[4\] == 0" " = 1" "element 4 not changed - 4"
+
+gdb_test "print zero_all ()" "" ""
+
+# restore with expressions
+test_restore_saved_value \
+ "intarr3.srec ${array2_start}-${array_start} &intarray\[3\] &intarray\[4\]" \
+ "array partial with expressions" \
+ [capture_value "4"] "intarray2\[3\]"
+
+gdb_test "print intarray2\[2\] == 0" " = 1" "element 2 not changed, == 4"
+gdb_test "print intarray2\[4\] == 0" " = 1" "element 4 not changed, == 4"
+
+
+# clean up files
+
+remote_exec build "rm -f intarr1.bin intarr1b.bin intarr1.ihex intarr1.srec intarr1.tekhex intarr2.bin intarr2b.bin intarr2.ihex intarr2.srec intarr2.tekhex intstr1.bin intstr1b.bin intstr1.ihex intstr1.srec intstr1.tekhex intstr2.bin intstr2b.bin intstr2.ihex intstr2.srec intstr2.tekhex intarr3.srec"
+
diff --git a/gdb/testsuite/gdb.base/echo.exp b/gdb/testsuite/gdb.base/echo.exp
new file mode 100644
index 00000000000..c8220ff2d65
--- /dev/null
+++ b/gdb/testsuite/gdb.base/echo.exp
@@ -0,0 +1,44 @@
+# Copyright (C) 1988, 1990, 1991, 1992, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+# Crank up gdb.
+gdb_start
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# test the echo command
+#
+
+# this sets the prms id number. This is the number that will appear
+# on all the output logs.
+# ex: set prms_id 643
+set prms_id 0
+
+# this sets the bug id id. This is the number that will appear
+# on all the output logs. This is optional and if it is not set
+# it will appear on all output logs as a 0.
+# ex: set bug_id 12
+set bug_id 0
+
+gdb_test "echo Hello world!\\n" "Hello world!" "Echo test"
diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp
new file mode 100644
index 00000000000..40b0bda3fd4
--- /dev/null
+++ b/gdb/testsuite/gdb.base/ena-dis-br.exp
@@ -0,0 +1,493 @@
+# Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+global usestubs
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "break"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc rerun_to_main {} {
+ global gdb_prompt
+
+ if [target_info exists use_gdb_stub] {
+ gdb_run_cmd
+ gdb_expect {
+ -re ".*Breakpoint .*main .*$gdb_prompt $"\
+ {pass "rerun to main" ; return 0}
+ -re "$gdb_prompt $"\
+ {fail "rerun to main" ; return 0}
+ timeout {fail "(timeout) rerun to main" ; return 0}
+ }
+ } else {
+ send_gdb "run\n"
+ gdb_expect {
+ -re "Starting program.*$gdb_prompt $"\
+ {pass "rerun to main" ; return 0}
+ -re "$gdb_prompt $"\
+ {fail "rerun to main" ; return 0}
+ timeout {fail "(timeout) rerun to main" ; return 0}
+ }
+ }
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then { fail "enable/disable break tests suppressed" }
+
+# Verify that we can set a breakpoint (the location is irrelevant),
+# then enable it (yes, it's already enabled by default), then hit it.
+#
+send_gdb "break marker1\n"
+gdb_expect {
+ -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
+ {pass "break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "break marker1"}
+ timeout {fail "(timeout) break marker1"}
+}
+
+send_gdb "enable $expect_out(1,string)\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "enable break marker1"}
+ timeout {fail "(timeout) enable break marker1"}
+}
+
+send_gdb "info break $expect_out(1,string)\n"
+gdb_expect {
+ -re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y.*$gdb_prompt $"\
+ {pass "info break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "info break marker1"}
+ timeout {fail "(timeout) info break marker1"}
+}
+
+# See the comments in condbreak.exp for "run until breakpoint at marker1"
+# for an explanation of the xfail below.
+send_gdb "continue\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
+ {pass "continue to break marker1"}
+ -re "Breakpoint \[0-9\]*, $hex in marker1.*$gdb_prompt $"\
+ {xfail "continue to break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "continue to break marker1"}
+ timeout {fail "(timeout) continue to break marker1"}
+}
+
+send_gdb "delete $expect_out(1,string)\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "delete break marker1"}
+ timeout {fail "(timeout) delete break marker1"}
+}
+
+# Verify that we can set a breakpoint to be self-disabling after
+# the first time it triggers.
+#
+send_gdb "break marker2\n"
+gdb_expect {
+ -re "Breakpoint (\[0-9\]*) at .*, line 4\[49\].*$gdb_prompt $"\
+ {pass "break marker2"}
+ -re "$gdb_prompt $"\
+ {fail "break marker2"}
+ timeout {fail "(timeout) break marker2"}
+}
+
+send_gdb "enable once $expect_out(1,string)\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "enable once break marker2"}
+ timeout {fail "(timeout) enable once break marker2"}
+}
+
+send_gdb "info break $expect_out(1,string)\n"
+gdb_expect {
+ -re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+dis\[ \t\]+y.*$gdb_prompt $"\
+ {pass "info auto-disabled break marker2"}
+ -re "$gdb_prompt $"\
+ {fail "info auto-disabled break marker2"}
+ timeout {fail "(timeout) info auto-disabled break marker2"}
+}
+
+# See the comments in condbreak.exp for "run until breakpoint at marker1"
+# for an explanation of the xfail below.
+send_gdb "continue\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*, marker2.*$gdb_prompt $"\
+ {pass "continue to auto-disabled break marker2"}
+ -re "Breakpoint \[0-9\]*, $hex in marker2.*$gdb_prompt $"\
+ {xfail "continue to auto-disabled break marker2"}
+ -re "$gdb_prompt $"\
+ {fail "continue to auto-disabled break marker2"}
+ timeout {fail "(timeout) continue to auto-disabled break marker2"}
+}
+
+send_gdb "info break $expect_out(1,string)\n"
+gdb_expect {
+ -re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+dis\[ \t\]+n.*$gdb_prompt $"\
+ {pass "info auto-disabled break marker2"}
+ -re "$gdb_prompt $"\
+ {fail "info auto-disabled break marker2"}
+ timeout {fail "(timeout) info auto-disabled break marker2"}
+}
+
+# Verify that we don't stop at a disabled breakpoint.
+#
+gdb_continue_to_end "no stop"
+rerun_to_main
+gdb_continue_to_end "no stop at auto-disabled break marker2"
+
+# Verify that we can set a breakpoint to be self-deleting after
+# the first time it triggers.
+#
+if ![runto_main] then { fail "enable/disable break tests suppressed" }
+
+send_gdb "break marker3\n"
+gdb_expect {
+ -re "Breakpoint (\[0-9\]*) at .*, line (45|50).*$gdb_prompt $"\
+ {pass "break marker3"}
+ -re "$gdb_prompt $"\
+ {fail "break marker3"}
+ timeout {fail "(timeout) break marker3"}
+}
+
+send_gdb "enable del $expect_out(1,string)\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "enable del break marker3"}
+ timeout {fail "(timeout) enable del break marker3"}
+}
+
+send_gdb "info break $expect_out(1,string)\n"
+gdb_expect {
+ -re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+del\[ \t\]+y.*$gdb_prompt $"\
+ {pass "info auto-deleted break marker2"}
+ -re "$gdb_prompt $"\
+ {fail "info auto-deleted break marker2"}
+ timeout {fail "(timeout) info auto-deleted break marker2"}
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re ".*marker3 .*:(45|50).*$gdb_prompt $"\
+ {pass "continue to auto-deleted break marker3"}
+ -re "Breakpoint \[0-9\]*, marker3.*$gdb_prompt $"\
+ {fail "continue to auto-deleted break marker3"}
+ -re "$gdb_prompt $"\
+ {fail "continue to auto-deleted break marker3"}
+ timeout {fail "(timeout) continue to break marker3"}
+}
+
+send_gdb "info break $expect_out(1,string)\n"
+gdb_expect {
+ -re ".*No breakpoint or watchpoint number.*$gdb_prompt $"\
+ {pass "info auto-deleted break marker3"}
+ -re "\[0-9\]*\[ \t\]+breakpoint\[ \t\].*$gdb_prompt $"\
+ {fail "info auto-deleted break marker3"}
+ -re "$gdb_prompt $"\
+ {fail "info auto-deleted break marker3"}
+ timeout {fail "(timeout) info auto-deleted break marker3"}
+}
+
+# Verify that we can set a breakpoint and manually disable it (we've
+# already proven that disabled bp's don't trigger).
+#
+send_gdb "break marker4\n"
+gdb_expect {
+ -re "Breakpoint (\[0-9\]*) at .*, line (46|51).*$gdb_prompt $"\
+ {pass "break marker4"}
+ -re "$gdb_prompt $"\
+ {fail "break marker4"}
+ timeout {fail "(timeout) break marker4"}
+}
+
+send_gdb "disable $expect_out(1,string)\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "disable break marker4"}
+ timeout {fail "(timeout) disable break marker4"}
+}
+
+send_gdb "info break $expect_out(1,string)\n"
+gdb_expect {
+ -re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+n.*$gdb_prompt $"\
+ {pass "info break marker4"}
+ -re "$gdb_prompt $"\
+ {fail "info break marker4"}
+ timeout {fail "(timeout) info break marker4"}
+}
+
+# Verify that we can set a breakpoint with an ignore count N, which
+# should cause the next N triggers of the bp to be ignored. (This is
+# a flavor of enablement/disablement, after all.)
+#
+if ![runto_main] then { fail "enable/disable break tests suppressed" }
+
+send_gdb "break marker1\n"
+gdb_expect {
+ -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
+ {pass "break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "break marker1"}
+ timeout {fail "(timeout) break marker1"}
+}
+
+# Verify that an ignore of a non-existent breakpoint is gracefully
+# handled.
+#
+send_gdb "ignore 999 2\n"
+gdb_expect {
+ -re "No breakpoint number 999..*$gdb_prompt $"\
+ {pass "ignore non-existent break"}
+ -re "$gdb_prompt $"\
+ {fail "ignore non-existent break"}
+ timeout {fail "(timeout) ignore non-existent break"}
+}
+
+# Verify that a missing ignore count is gracefully handled.
+#
+send_gdb "ignore $expect_out(1,string) \n"
+gdb_expect {
+ -re "Second argument .specified ignore-count. is missing..*$gdb_prompt $"\
+ {pass "ignore break with missing ignore count"}
+ -re "$gdb_prompt $"\
+ {fail "ignore break with missing ignore count"}
+ timeout {fail "(timeout) ignore break with missing ignore count"}
+}
+
+# Verify that a negative or zero ignore count is handled gracefully
+# (they both are treated the same).
+#
+send_gdb "ignore $expect_out(1,string) -1\n"
+gdb_expect {
+ -re "Will stop next time breakpoint \[0-9\]* is reached..*$gdb_prompt $"\
+ {pass "ignore break marker1 -1"}
+ -re "$gdb_prompt $"\
+ {fail "ignore break marker1 -1"}
+ timeout {fail "(timeout) ignore break marker1 -1"}
+}
+
+send_gdb "ignore $expect_out(1,string) 0\n"
+gdb_expect {
+ -re "Will stop next time breakpoint \[0-9\]* is reached..*$gdb_prompt $"\
+ {pass "ignore break marker1 0"}
+ -re "$gdb_prompt $"\
+ {fail "ignore break marker1 0"}
+ timeout {fail "(timeout) ignore break marker1 0"}
+}
+
+send_gdb "ignore $expect_out(1,string) 1\n"
+gdb_expect {
+ -re "Will ignore next crossing of breakpoint \[0-9\]*.*$gdb_prompt $"\
+ {pass "ignore break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "ignore break marker1"}
+ timeout {fail "(timeout) ignore break marker1"}
+}
+
+send_gdb "info break $expect_out(1,string)\n"
+gdb_expect {
+ -re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y.*ignore next 1 hits.*$gdb_prompt $"\
+ {pass "info ignored break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "info ignored break marker1"}
+ timeout {fail "(timeout) info ignored break marker1"}
+}
+
+gdb_continue_to_end "no stop at ignored break marker1"
+rerun_to_main
+
+# See the comments in condbreak.exp for "run until breakpoint at marker1"
+# for an explanation of the xfail below.
+send_gdb "continue\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
+ {pass "continue to break marker1, 2nd time"}
+ -re "Breakpoint \[0-9\]*, $hex in marker1.*$gdb_prompt $"\
+ {xfail "continue to break marker1, 2nd time"}
+ -re "$gdb_prompt $"\
+ {fail "continue to break marker1, 2nd time"}
+ timeout {fail "(timeout) continue to break marker1, 2nd time"}
+}
+
+# Verify that we can specify both an ignore count and an auto-delete.
+#
+if ![runto_main] then { fail "enable/disable break tests suppressed" }
+
+send_gdb "break marker1\n"
+gdb_expect {
+ -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
+ {pass "break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "break marker1"}
+ timeout {fail "(timeout) break marker1"}
+}
+
+send_gdb "ignore $expect_out(1,string) 1\n"
+gdb_expect {
+ -re "Will ignore next crossing of breakpoint \[0-9\]*.*$gdb_prompt $"\
+ {pass "ignore break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "ignore break marker1"}
+ timeout {fail "(timeout) ignore break marker1"}
+}
+
+send_gdb "enable del $expect_out(1,string)\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "enable del break marker1"}
+ timeout {fail "(timeout) enable del break marker1"}
+}
+
+send_gdb "info break $expect_out(1,string)\n"
+gdb_expect {
+ -re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+del\[ \t\]+y.*ignore next 1 hits.*$gdb_prompt $"\
+ {pass "info break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "info break marker1"}
+ timeout {fail "(timeout) info break marker2"}
+}
+
+gdb_continue_to_end "no stop at ignored & auto-deleted break marker1"
+rerun_to_main
+
+send_gdb "continue\n"
+gdb_expect {
+ -re ".*marker1 .*:4\[38\].*$gdb_prompt $"\
+ {pass "continue to ignored & auto-deleted break marker1"}
+ -re "Breakpoint \[0-9\]*, marker1.*$gdb_prompt $"\
+ {fail "continue to ignored & auto-deleted break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "continue to ignored & auto-deleted break marker1"}
+ timeout {fail "(timeout) continue to ignored & auto-deleted break marker1"}
+}
+
+# Verify that a disabled breakpoint's ignore count isn't updated when
+# the bp is encountered.
+#
+if ![runto_main] then { fail "enable/disable break tests suppressed" }
+
+send_gdb "break marker1\n"
+gdb_expect {
+ -re "Breakpoint (\[0-9\]*) at .*, line 4\[38\].*$gdb_prompt $"\
+ {pass "break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "break marker1"}
+ timeout {fail "(timeout) break marker1"}
+}
+
+send_gdb "ignore $expect_out(1,string) 10\n"
+gdb_expect {
+ -re "Will ignore next 10 crossings of breakpoint \[0-9\]*.*$gdb_prompt $"\
+ {pass "ignore break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "ignore break marker1"}
+ timeout {fail "(timeout) ignore break marker1"}
+}
+
+send_gdb "disable $expect_out(1,string)\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "disable break marker1"}
+ timeout {fail "(timeout) disable break marker1"}
+}
+
+gdb_continue_to_end "no stop at ignored & disabled break marker1"
+rerun_to_main
+
+send_gdb "info break $expect_out(1,string)\n"
+gdb_expect {
+ -re "\[0-9\]*\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+n.*ignore next 10 hits.*$gdb_prompt $"\
+ {pass "info ignored & disabled break marker1"}
+ -re "$gdb_prompt $"\
+ {fail "info ignored & disabled break marker1"}
+ timeout {fail "(timeout) info ignored & disabled break marker1"}
+}
+
+# Verify that GDB correctly handles the "continue" command with an argument,
+# which is an ignore count to set on the currently stopped-at breakpoint.
+# (Also verify that GDB gracefully handles the case where the inferior
+# isn't stopped at a breakpoint.)
+#
+if ![runto_main] then { fail "enable/disable break tests suppressed" }
+
+send_gdb "break 79\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*.*, line 79.*$gdb_prompt $"\
+ {pass "prepare to continue with ignore count"}
+ -re "$gdb_prompt $"\
+ {fail "prepare to continue with ignore count"}
+ timeout {fail "(timeout) prepare to continue with ignore count"}
+}
+send_gdb "continue 2\n"
+gdb_expect {
+ -re "Will ignore next crossing of breakpoint \[0-9\]*. Continuing..*$gdb_prompt $"\
+ {pass "continue with ignore count"}
+ -re "$gdb_prompt $"\
+ {fail "continue with ignore count"}
+ timeout {fail "(timeout) continue with ignore count"}
+}
+
+send_gdb "next\n"
+gdb_expect {
+ -re ".*81\[ \t\]*marker1.*$gdb_prompt $"\
+ {pass "step after continue with ignore count"}
+ -re "$gdb_prompt $"\
+ {fail "step after continue with ignore count"}
+ timeout {fail "(timeout) step after continue with ignore count"}
+}
+
+# ??rehrauer: Huh. This appears to be an actual bug. (No big
+# surprise, since this feature hasn't been tested...) Looks like
+# GDB is currently trying to set the ignore count of bp # -1!
+#
+setup_xfail hppa_*_*
+send_gdb "continue 2\n"
+gdb_expect {
+ -re "Not stopped at any breakpoint; argument ignored..*$gdb_prompt $"\
+ {pass "continue with ignore count, not stopped at bpt"}
+ -re "No breakpoint number -1.*$gdb_prompt $"\
+ {xfail "(DTS'd) continue with ignore count, not stopped at bpt"}
+ -re "$gdb_prompt $"\
+ {fail "continue with ignore count, not stopped at bpt"}
+ timeout {fail "(timeout) step after continue with ignore count, not stopped at bpt"}
+}
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.base/ending-run.c b/gdb/testsuite/gdb.base/ending-run.c
new file mode 100644
index 00000000000..8c67706fbe9
--- /dev/null
+++ b/gdb/testsuite/gdb.base/ending-run.c
@@ -0,0 +1,33 @@
+/* Test program for <next-at-end> and
+ * <leaves-core-file-on-quit> bugs.
+ */
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef PROTOTYPES
+int callee (int x)
+#else
+int callee( x )
+int x;
+#endif
+{
+ int y = x * x;
+ return (y - 2);
+}
+
+int main()
+{
+
+ int *p;
+ int i;
+
+ p = (int *) malloc( 4 );
+
+ for (i = 1; i < 10; i++)
+ {
+ printf( "%d ", callee( i ));
+ fflush (stdout);
+ }
+ printf( " Goodbye!\n" ); fflush (stdout);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/ending-run.exp b/gdb/testsuite/gdb.base/ending-run.exp
new file mode 100644
index 00000000000..656601efc98
--- /dev/null
+++ b/gdb/testsuite/gdb.base/ending-run.exp
@@ -0,0 +1,289 @@
+# Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# use this to debug:
+#
+#log_user 1
+
+# ending-run.exp -- Expect script to test ending a test run in gdb
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile ending-run
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+remote_exec build "rm -f ${binfile}"
+remote_exec build "rm -f core"
+
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# CHFts23469: Test that you can "clear" a bp set at
+# a line _before_ the routine (which will default to the
+# first line in the routine, which turns out to correspond
+# to the prolog--that's another bug...)
+#
+
+gdb_test "b ending-run.c:1" ".*Breakpoint.*ending-run.c, line 1.*" \
+ "bpt at line before routine"
+
+gdb_test "b ending-run.c:13" \
+ ".*Note.*also.*Breakpoint 2.*ending-run.c, line 13.*" \
+ "b ending-run.c:13, one"
+
+# Set up to go to the next-to-last line of the program
+#
+gdb_test "b ending-run.c:31" ".*Breakpoint 3.*ending-run.c, line 31.*"
+
+# Expect to hit the bp at line "1", but symbolize this
+# as line "13". Then try to clear it--this should work.
+#
+if [target_info exists use_gdb_stub] {
+ gdb_test "continue" ".*Breakpoint.*1.*callee.*13.*"
+} else {
+ gdb_test "r" ".*Breakpoint.*1.*callee.*13.*"
+}
+gdb_test "cle" ".*Deleted breakpoints 2 1.*" "clear worked"
+send_gdb "i b\n"
+gdb_expect {
+ -re ".*breakpoint.*breakpoint.*$gdb_prompt $" {
+ fail "cleared bp at line before routine"
+ }
+ -re ".*3.*main.*31.*$gdb_prompt $" {
+ pass "cleared bp at line before routine"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "cleared bp at line before routine (info b)"
+ }
+}
+
+# Test some other "clear" combinations
+#
+gdb_test "b ending-run.c:1" ".*Breakpoint.*4.*"
+gdb_test "b ending-run.c:13" ".*Note.*also.*Breakpoint.*5.*" "b ending-run.c:13, two"
+gdb_test "cle ending-run.c:13" \
+ ".*Deleted breakpoint 5.*" "Only cleared 1 by line"
+
+send_gdb "inf line ending-run.c:13\n"
+gdb_expect {
+ -re ".*address (0x\[0-9a-fA-F]*).*$gdb_prompt $" {
+ set line_eight $expect_out(1,string)
+ gdb_test "b 13" ".*Breakpoint.*6.*"
+ gdb_test "cle *$line_eight" ".*Deleted breakpoints 6 4.*" "Clear 2 by address"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "need to fix test for new compile outcome"
+ }
+}
+
+send_gdb "inf line ending-run.c:14\n"
+gdb_expect {
+ -re ".*address (0x\[0-9a-fA-F]*).*$gdb_prompt $" {
+ set line_nine $expect_out(1,string)
+ gdb_test "b ending-run.c:14" ".*Breakpoint 7.*ending-run.c, line 14.*"
+ gdb_test "b *$line_nine" ".*Note.*also.*Breakpoint 8.*"
+ gdb_test "c" ".*Breakpoint.*7.*callee.*14.*"
+ gdb_test "cle" ".*Deleted breakpoints 8 7.*" "Clear 2 by default"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "need to fix test for new compile outcome"
+ }
+}
+
+send_gdb "i b\n"
+gdb_expect {
+ -re ".*breakpoint.*breakpoint.*$gdb_prompt $" {
+ fail "all set to continue (didn't clear bps)"
+ }
+ -re ".*3.*main.*31.*$gdb_prompt $" {
+ pass "all set to continue"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "all set to continue (missing bp at end)"
+ }
+}
+
+
+# See if we can step out with control. The "1 2 3" stuff
+# is output from the program.
+#
+if ![gdb_skip_stdio_test "cont"] {
+ gdb_test "cont" ".*1 2 7 14 23 34 47 62 79.*Breakpoint.*31.*"
+} else {
+ gdb_test "cont" ".*Breakpoint.*31.*"
+}
+
+if ![gdb_skip_stdio_test "Step to return"] {
+ gdb_test "next" ".*Goodbye!.*32.*" \
+ "Step to return"
+} else {
+ gdb_test "next" "" ""
+}
+
+set old_timeout $timeout
+set timeout 50
+set program_exited 0
+send_gdb "next\n"
+gdb_expect {
+ -re "33.*$gdb_prompt $" {
+ # sometimes we stop at the closing brace, if so, do another next
+ send_gdb "next\n"
+ gdb_expect {
+ -re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
+ fail "step out of main (Old bug came back!)"
+ gdb_test "n" ".*" ""
+ }
+ -re ".*in.*start.*$gdb_prompt $" {
+ pass "step out of main"
+ }
+ -re ".*in.*bsp_trap.*$gdb_prompt $" {
+ pass "step out of main"
+ }
+ -re ".*in.*init.*$gdb_prompt $" {
+ # This is what happens on sparc64-elf ultra.
+ pass "step out of main"
+ }
+ -re ".*Program exited normally.*$gdb_prompt $" {
+ # This is what happens on Linux i86 (and I would expect others)
+ set program_exited 1
+ pass "step out of main"
+ }
+ -re ".*in .nope ().*$gdb_prompt $" {
+ # This is what happens on Solaris currently -sts 1999-08-25
+ pass "step out of main (on Solaris)"
+ }
+ -re ".*in _int_reset ().*$gdb_prompt $" {
+ # This is what happens on Sanyo XStormy16
+ pass "step out of main"
+ }
+ -re ".*init ().*$gdb_prompt $" {
+ # This is what happens on many Mips targets
+ pass "step out of main"
+ }
+ -re ".*in ..change.mode ().*$gdb_prompt $" {
+ # This is what happens on ARM in thumb mode -fn 2000-02-01
+ pass "step out of main (on ARM thumb)"
+ }
+ -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" {
+ pass "step out of main"
+ }
+ -re ".*in __wrap_main ().*$gdb_prompt $" {
+ pass "step out of main (status wrapper)"
+ }
+ -re ".*$gdb_prompt $" { fail "step out of main (at end 2)" }
+ timeout {
+ fail "step out of main (hang or timeout on step at end 2)"
+ }
+ }
+ }
+ -re ".*Unable to find return pc for this frame.*$gdb_prompt $" {
+ fail "Old bug came back!"
+ gdb_test "n" ".*" ""
+ }
+ -re ".*in.*start.*$gdb_prompt $" {
+ pass "step out of main"
+ }
+ -re ".*in.*\\\$START\\\$.*from.*dld.sl.*$gdb_prompt $" {
+ pass "step out of main (2)"
+ }
+ -re ".*Program exited normally.*$gdb_prompt $" {
+ # This is what happens on Linux i86 (and I would expect others)
+ set program_exited 1
+ pass "step out of main"
+ }
+ -re ".*in.*currently asm.*$gdb_prompt $" {
+ pass "step out of main (into assembler)"
+ }
+ -re ".*Program received signal SIGTRAP.*$gdb_prompt $" {
+ pass "Cygmon stopped in ending trap."
+ }
+ -re ".*$gdb_prompt $" { fail "step out of main (at end 1)" }
+ timeout { fail "step out of main (hang or timeout on step at end 1)" }
+}
+
+if {![target_info exists use_cygmon] || ![target_info use_cygmon]} {
+ global program_exited;
+ if {[eval expr $program_exited == 0]} {
+ send_gdb "n\n"
+ gdb_expect {
+ -re "Program exited normally.*$gdb_prompt $" {
+ # If we actually have debug info for the start function,
+ # then we won't get the "Single-stepping until function
+ # exit" message.
+ pass "step to end of run"
+ }
+ -re "Single.*EXIT code 0.*Program exited normally.*$gdb_prompt $" {
+ pass "step to end of run (status wrapper)"
+ }
+ -re ".*Single.*Program exited.*$gdb_prompt $" {
+ pass "step to end of run"
+ }
+ -re ".*Single.*in exit.*from.*dld.sl.*$gdb_prompt $" {
+ pass "step to end of run"
+ gdb_test "c" ".*" "continue after exit"
+ }
+ -re ".*Single.*_int_reset.*$gdb_prompt $" {
+ pass "step to end of run"
+ setup_xfail "xstormy16-*-*"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "step to end of run"
+ }
+ timeout {
+ fail "(timeout) step to end of run"
+ }
+ }
+ }
+
+ set timeout $old_timeout
+
+ gdb_test "n" ".*The program is not being run.*" "don't step after run"
+
+ set exec_output [remote_exec host "ls core"]
+
+ if [ regexp "core not found" $exec_output] {
+ pass "No core dumped on quit"
+ } else {
+ if [ regexp "No such file or directory" $exec_output] {
+ pass "ls: core (No core dumped on quit)"
+ } else {
+ remote_exec build "rm -f core"
+ fail "ls: core (Core dumped on quit)"
+ }
+ }
+}
+
+#remote_exec build "rm -f ${binfile}"
+return 0
+
+
+
+
diff --git a/gdb/testsuite/gdb.base/environ.exp b/gdb/testsuite/gdb.base/environ.exp
new file mode 100644
index 00000000000..55ff0a0b779
--- /dev/null
+++ b/gdb/testsuite/gdb.base/environ.exp
@@ -0,0 +1,329 @@
+# Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+global usestubs
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+# This test exists solely to exercise the "environment" commands for
+# code-coverage on HP-UX.
+#
+if ![istarget "hppa*-*-hpux*"] then {
+ return
+}
+
+set testfile "break"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then { fail "environment command tests suppressed" }
+
+# (No, this is not really related to the environment commands. But it's
+# a convenient place to verify that this command works.)
+#
+send_gdb "info program\n"
+gdb_expect {
+ -re ".*Using the running image of child process \[0-9\]*.\r\nProgram stopped at 0x\[0-9a-fA-F\]*.\r\nIt stopped at breakpoint 1..*$gdb_prompt $"\
+ {pass "info program"}
+ -re "$gdb_prompt $"\
+ {fail "info program"}
+ timeout {fail "(timeout) info program"}
+}
+
+# We don't really care where this step lands, so long as it gets
+# the inferior pushed off the breakpoint it's currently on...
+#
+send_gdb "next\n"
+gdb_expect {
+ -re ".*$gdb_prompt $"\
+ {pass "step before info program"}
+ timeout {fail "(timeout) step before info program"}
+}
+send_gdb "info program\n"
+gdb_expect {
+ -re ".*Using the running image of child process \[0-9\]*.\r\nProgram stopped at 0x\[0-9a-fA-F\]*.\r\nIt stopped after being stepped..*$gdb_prompt $"\
+ {pass "info program after step"}
+ -re "$gdb_prompt $"\
+ {fail "info program after step"}
+ timeout {fail "(timeout) info program after step"}
+}
+
+if ![runto_main] then { fail "environment command tests suppressed" }
+
+send_gdb "delete\n"
+gdb_expect {
+ -re ".*y or n. $"\
+ {send_gdb "y\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $"\
+ {pass "delete breakpoint before info program"}
+ timeout {fail "(timeout) delete breakpoint before info program"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "delete breakpoint before info program"}
+ timeout {fail "(timeout) delete breakpoint before info program"}
+}
+send_gdb "info program\n"
+gdb_expect {
+ -re ".*Using the running image of child process \[0-9\]*.\r\nProgram stopped at 0x\[0-9a-fA-F\]*.\r\nIt stopped at a breakpoint that has since been deleted..*$gdb_prompt $"\
+ {pass "info program after deleted breakpoint"}
+ -re "$gdb_prompt $"\
+ {fail "info program after deleted breakpoint"}
+ timeout {fail "(timeout) info program after deleted breakpoint"}
+}
+
+# Verify that we can show all currently-set environment variables.
+# (It's a bit hacky, but nonetheless probably safe to check for at
+# least the SHELL variable.)
+#
+# need to increase timeout because of very long output
+set oldtimeout $timeout
+set timeout [expr "$timeout + 300"]
+
+send_gdb "show environment\n"
+gdb_expect {
+ -re ".*SHELL=(\[a-zA-Z0-9\]*).*$gdb_prompt $"\
+ {pass "show environment"}
+ -re "$gdb_prompt $"\
+ {fail "show environment"}
+ timeout {fail "(timeout) show environment"}
+}
+set timeout $oldtimeout
+
+# Verify that we can unset a specific environment variable.
+#
+send_gdb "unset environment EDITOR\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "issue unset environment"}
+ timeout {fail "(timeout) issue unset environment"}
+}
+send_gdb "show environment EDITOR\n"
+gdb_expect {
+ -re "Environment variable \"EDITOR\" not defined.\r\n$gdb_prompt $"\
+ {pass "unset environment"}
+ -re "$gdb_prompt $"\
+ {fail "unset environment"}
+ timeout {fail "(timeout) unset environment"}
+}
+
+# Verify that we can unset all environment variables.
+#
+send_gdb "unset environment\n"
+gdb_expect {
+ -re "Delete all environment variables.*y or n. $"\
+ {send_gdb "y\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "unset entire environment"}
+ timeout {fail "(timeout) unset entire environment"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "unset entire environment"}
+ timeout {fail "(timeout) unset entire environment"}
+}
+
+# Verify that we can set a specific environment variable.
+#
+send_gdb "set environment EDITOR emacs\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "issue set environment"}
+ timeout {fail "(timeout) issue set environment"}
+}
+send_gdb "show environment EDITOR\n"
+gdb_expect {
+ -re "EDITOR = emacs\r\n$gdb_prompt $"\
+ {pass "set environment"}
+ -re "$gdb_prompt $"\
+ {fail "set environment"}
+ timeout {fail "(timeout) set environment"}
+}
+
+# Verify that GDB responds gracefully to a request to set environment,
+# with no variable name.
+#
+send_gdb "set environment\n"
+gdb_expect {
+ -re "Argument required .environment variable and value..*$gdb_prompt $"\
+ {pass "set environment without variable disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "set environment without variable disallowed"}
+ timeout {fail "(timeout) set environment without variable disallowed"}
+}
+
+# I'm not sure just what GDB has in mind in explicitly checking
+# for this variant, but since GDB handles it, test it.
+#
+send_gdb "set environment =\n"
+gdb_expect {
+ -re "Argument required .environment variable to set..*$gdb_prompt $"\
+ {pass "set environment equals without variable disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "set environment equals without variable disallowed"}
+ timeout {fail "(timeout) set environment equals without variable disallowed"}
+}
+
+# Setting an environment variable without a value sets it to a NULL
+# value.
+#
+send_gdb "set environment EDITOR\n"
+gdb_expect {
+ -re "Setting environment variable \"EDITOR\" to null value..*$gdb_prompt $"\
+ {pass "issue set environment without variable value"}
+ -re "$gdb_prompt $"\
+ {fail "issue set environment without variable value"}
+ timeout {fail "(timeout) issue set environment without variable value"}
+}
+send_gdb "show environment EDITOR\n"
+gdb_expect {
+ -re "EDITOR = \r\n$gdb_prompt $"\
+ {pass "set environment without variable value"}
+ -re "$gdb_prompt $"\
+ {fail "set environment without variable value"}
+ timeout {fail "(timeout) set environment without variable value"}
+}
+
+# Verify that GDB responds gracefully to an attempt to show a
+# non-existent environment variable. (We hope this variable is
+# undefined!)
+#
+send_gdb "show environment FOOBARBAZGRUNGESPAZBALL\n"
+gdb_expect {
+ -re "Environment variable \"FOOBARBAZGRUNGESPAZBALL\" not defined..*$gdb_prompt $"\
+ {pass "show non-existent environment variable disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "show non-existent environment variable disallowed"}
+ timeout {fail "(timeout) show non-existent environment variable disallowed"}
+}
+
+# Verify that GDB can set an environment variable hitherto undefined.
+#
+send_gdb "set environment FOOBARBAZGRUNGESPAZBALL t\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "issue set environment for previously undefined variable"}
+ timeout {fail "(timeout) issue set environment for previously undefined variable"}
+}
+send_gdb "show environment FOOBARBAZGRUNGESPAZBALL\n"
+gdb_expect {
+ -re "FOOBARBAZGRUNGESPAZBALL = t\r\n$gdb_prompt $"\
+ {pass "set environment for previously undefined variable"}
+ -re "$gdb_prompt $"\
+ {fail "set environment for previously undefined variable"}
+ timeout {fail "(timeout) set environment for previously undefined variable"}
+}
+
+# Verify that GDB can also set an environment variable using the "="
+# syntax.
+#
+send_gdb "set environment FOOBARBAZGRUNGESPAZBALL = t\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "issue set environment with equals"}
+ timeout {fail "(timeout) issue set environment with equals"}
+}
+send_gdb "show environment FOOBARBAZGRUNGESPAZBALL\n"
+gdb_expect {
+ -re "FOOBARBAZGRUNGESPAZBALL = t\r\n$gdb_prompt $"\
+ {pass "set environment with equals"}
+ -re "$gdb_prompt $"\
+ {fail "set environment with equals"}
+ timeout {fail "(timeout) set environment with equals"}
+}
+
+# Verify that GDB can set an environment variable to a value that has
+# an embedded (trailing, in this case) equals.
+#
+send_gdb "set environment FOOBARBAZGRUNGESPAZBALL t=\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "issue set environment with trailing equals"}
+ timeout {fail "(timeout) issue set environment with trailing equals"}
+}
+send_gdb "show environment FOOBARBAZGRUNGESPAZBALL\n"
+gdb_expect {
+ -re "FOOBARBAZGRUNGESPAZBALL = t=\r\n$gdb_prompt $"\
+ {pass "set environment with trailing equals"}
+ -re "$gdb_prompt $"\
+ {fail "set environment with trailing equals"}
+ timeout {fail "(timeout) set environment with trailing equals"}
+}
+
+# Verify that GDB can set an environment variable to a value preceded
+# by whitespace, and that such whitespace is ignored (not included
+# in the set value).
+#
+send_gdb "set environment FOOBARBAZGRUNGESPAZBALL = foo\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "issue set environment with preceding whitespace"}
+ timeout {fail "(timeout) issue set environment with preceding whitespace"}
+}
+send_gdb "show environment FOOBARBAZGRUNGESPAZBALL\n"
+gdb_expect {
+ -re "FOOBARBAZGRUNGESPAZBALL = foo\r\n$gdb_prompt $"\
+ {pass "set environment with preceding whitespace"}
+ -re "$gdb_prompt $"\
+ {fail "set environment with preceding whitespace"}
+ timeout {fail "(timeout) set environment with preceding whitespace"}
+}
+
+# Verify that GDB can manipulate the distinguished PATH variable.
+#
+send_gdb "path /tmp/FOOBARBAZGRUNGESPAZBALL\n"
+gdb_expect {
+ -re ".*Executable and object file path: /tmp/FOOBARBAZGRUNGESPAZBALL.*$gdb_prompt $"\
+ {pass "issue path"}
+ -re "$gdb_prompt $"\
+ {fail "issue path"}
+ timeout {fail "(timeout) issue path"}
+}
+send_gdb "show paths\n"
+gdb_expect {
+ -re "Executable and object file path: /tmp/FOOBARBAZGRUNGESPAZBALL.*$gdb_prompt $"\
+ {pass "show paths"}
+ -re "$gdb_prompt $"\
+ {fail "show paths"}
+ timeout {fail "(timeout) show paths"}
+}
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.base/eval-skip.exp b/gdb/testsuite/gdb.base/eval-skip.exp
new file mode 100644
index 00000000000..a2ab25cdaf7
--- /dev/null
+++ b/gdb/testsuite/gdb.base/eval-skip.exp
@@ -0,0 +1,352 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This file is part of the gdb testsuite
+
+#
+# tests to cover evaluate_subexp_standard with the EVAL_SKIP flag set.
+# this happens for instance when there is short circuit evaluation in the && and ||
+# operators, or in the non returned part of a (x ? y: z) expression.
+# the part that is not evaluated is parsed and evaluated anyway, but with
+# the EVAL_SKIP flag set
+#
+# source file "int-type.c"
+#
+
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Check to see if we have an executable to test. If not, then either we
+# haven't tried to compile one, or the compilation failed for some reason.
+# In either case, just notify the user and skip the tests in this file.
+
+set testfile "int-type"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+
+if [get_compiler_info $binfile] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+gdb_test "set variable x=14" "" "set variable x=14"
+gdb_test "set variable y=2" "" "set variable y=2"
+gdb_test "set variable z=2" "" "set variable z=2"
+gdb_test "set variable w=3" "" "set variable w=3"
+
+send_gdb "print (0 && (x+y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x+y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x+y))" }
+ timeout { fail "(timeout) print value of (0 && (x+y))" }
+ }
+
+
+send_gdb "print (0 && (x-y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x-y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x-y))" }
+ timeout { fail "(timeout) print value of (0 && (x-y))" }
+ }
+
+
+send_gdb "print (0 && (x*y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x*y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x*y))" }
+ timeout { fail "(timeout) print value of (0 && (x*y))" }
+ }
+
+
+
+send_gdb "print (0 && (x/y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x/y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x/y))" }
+ timeout { fail "(timeout) print value of (0 && (x/y))" }
+ }
+
+
+send_gdb "print (0 && (x%y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x%y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x%y))" }
+ timeout { fail "(timeout) print value of (0 && (x%y))" }
+ }
+
+
+send_gdb "print (0 && (x&&y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x&&y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x&&y))" }
+ timeout { fail "(timeout) print value of (0 && (x&&y))" }
+ }
+
+
+
+send_gdb "print (0 && (x||y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x||y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x||y))" }
+ timeout { fail "(timeout) print value of (0 && (x||y))" }
+ }
+
+
+
+send_gdb "print (0 && (x&y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x&y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x&y))" }
+ timeout { fail "(timeout) print value of (0 && (x&y))" }
+ }
+
+
+send_gdb "print (0 && (x|y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x|y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x|y))" }
+ timeout { fail "(timeout) print value of (0 && (x|y))" }
+ }
+
+
+send_gdb "print (0 && (x^y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x^y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x^y))" }
+ timeout { fail "(timeout) print value of (0 && (x^y))" }
+ }
+
+
+
+send_gdb "print (0 && (x < y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x < y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x < y))" }
+ timeout { fail "(timeout) print value of (0 && (x < y))" }
+ }
+
+
+send_gdb "print (0 && (x <= y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x <= y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x <= y))" }
+ timeout { fail "(timeout) print value of (0 && (x <= y))" }
+ }
+
+
+
+send_gdb "print (0 && (x>y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x>y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x>y))" }
+ timeout { fail "(timeout) print value of (0 && (x>y))" }
+ }
+
+
+send_gdb "print (0 && (x>=y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x>=y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x>=y))" }
+ timeout { fail "(timeout) print value of (0 && (x>=y))" }
+ }
+
+
+
+send_gdb "print (0 && (x==y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x==y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x==y))" }
+ timeout { fail "(timeout) print value of (0 && (x==y))" }
+ }
+
+
+send_gdb "print (0 && (x!=y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x!=y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x!=y))" }
+ timeout { fail "(timeout) print value of (0 && (x!=y))" }
+ }
+
+
+send_gdb "print (0 && (x<<31))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x<<31))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x<<31))" }
+ timeout { fail "(timeout) print value of (0 && (x<<31))" }
+ }
+
+
+send_gdb "print (0 && (x>>31))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x>>31))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x>>31))" }
+ timeout { fail "(timeout) print value of (0 && (x>>31))" }
+ }
+
+
+
+send_gdb "print (0 && (!x))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (!x))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (!x))" }
+ timeout { fail "(timeout) print value of (0 && (!x))" }
+ }
+
+
+send_gdb "print (0 && (~x))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (~x))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (~x))" }
+ timeout { fail "(timeout) print value of (0 && (~x))" }
+ }
+
+send_gdb "print (0 && (-x))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (-x))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (-x))" }
+ timeout { fail "(timeout) print value of (0 && (-x))" }
+ }
+
+
+send_gdb "print (0 && (x++))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x++))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x++))" }
+ timeout { fail "(timeout) print value of (0 && (x++))" }
+ }
+
+
+send_gdb "print (0 && (++x))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (++x))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (++x))" }
+ timeout { fail "(timeout) print value of (0 && (++x))" }
+ }
+
+
+send_gdb "print (0 && (x--))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x--))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x--))" }
+ timeout { fail "(timeout) print value of (0 && (x--))" }
+ }
+
+
+send_gdb "print (0 && (--x))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (--x))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (--x))" }
+ timeout { fail "(timeout) print value of (0 && (--x))" }
+ }
+
+send_gdb "print (0 && (x+=7))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x+=7))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x+=7))" }
+ timeout { fail "(timeout) print value of (0 && (x+=7))" }
+ }
+
+send_gdb "print (0 && (x=y))\n"
+gdb_expect {
+ -re ".$decimal = $false\r\n$gdb_prompt $" {
+ pass "print value of (0 && (x=y))"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (0 && (x=y))" }
+ timeout { fail "(timeout) print value of (0 && (x=y))" }
+ }
+
+gdb_exit
+return 0
+
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.base/execd-prog.c b/gdb/testsuite/gdb.base/execd-prog.c
new file mode 100644
index 00000000000..5469f656c0c
--- /dev/null
+++ b/gdb/testsuite/gdb.base/execd-prog.c
@@ -0,0 +1,34 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+/* There is a global_i in foll-exec, which exec's us. We
+ should not be able to see that other definition of global_i
+ after we are exec'd.
+ */
+int global_i = 0;
+
+#ifdef PROTOTYPES
+int main (int argc, char **argv)
+#else
+main (argc, argv)
+ int argc;
+ char * argv[];
+#endif
+{
+ /* There is a local_j in foll-exec, which exec's us. We
+ should not be able to see that other definition of local_j
+ after we are exec'd.
+ */
+ int local_j = argc;
+ char * s;
+
+ printf ("Hello from execd-prog...\n");
+ if (argc != 2)
+ {
+ printf ("expected one string argument\n");
+ exit (-1);
+ }
+ s = argv[1];
+ printf ("argument received: %s\n", s);
+}
diff --git a/gdb/testsuite/gdb.base/exprs.c b/gdb/testsuite/gdb.base/exprs.c
new file mode 100644
index 00000000000..b35c3a58d25
--- /dev/null
+++ b/gdb/testsuite/gdb.base/exprs.c
@@ -0,0 +1,254 @@
+#ifdef PROTOTYPES
+int main (int argc, char **argv, char **envp)
+#else
+main (argc, argv, envp)
+ int argc;
+ char **argv;
+ char **envp;
+#endif
+{
+ extern void dummy();
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ dummy();
+ return 0;
+
+}
+
+/* We put main() right up front so its line number doesn't keep changing. */
+
+/*
+ * Test file with lots of different types, for testing the
+ * "whatis" command.
+ */
+
+/*
+ * First the basic C types.
+ */
+
+#if !defined (__STDC__) && !defined (_AIX)
+#define signed /**/
+#endif
+
+char v_char;
+signed char v_signed_char;
+unsigned char v_unsigned_char;
+
+short v_short;
+signed short v_signed_short;
+unsigned short v_unsigned_short;
+
+int v_int;
+signed int v_signed_int;
+unsigned int v_unsigned_int;
+
+long v_long;
+signed long v_signed_long;
+unsigned long v_unsigned_long;
+
+float v_float;
+double v_double;
+/*
+ * Now some derived types, which are arrays, functions-returning,
+ * pointers, structures, unions, and enumerations.
+ */
+
+/**** arrays *******/
+
+char v_char_array[2];
+signed char v_signed_char_array[2];
+unsigned char v_unsigned_char_array[2];
+
+short v_short_array[2];
+signed short v_signed_short_array[2];
+unsigned short v_unsigned_short_array[2];
+
+int v_int_array[2];
+signed int v_signed_int_array[2];
+unsigned int v_unsigned_int_array[2];
+
+long v_long_array[2];
+signed long v_signed_long_array[2];
+unsigned long v_unsigned_long_array[2];
+
+float v_float_array[2];
+double v_double_array[2];
+/**** pointers *******/
+
+char *v_char_pointer;
+signed char *v_signed_char_pointer;
+unsigned char *v_unsigned_char_pointer;
+
+short *v_short_pointer;
+signed short *v_signed_short_pointer;
+unsigned short *v_unsigned_short_pointer;
+
+int *v_int_pointer;
+signed int *v_signed_int_pointer;
+unsigned int *v_unsigned_int_pointer;
+
+long *v_long_pointer;
+signed long *v_signed_long_pointer;
+unsigned long *v_unsigned_long_pointer;
+
+float *v_float_pointer;
+double *v_double_pointer;
+
+/**** structs *******/
+
+struct t_struct {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_struct1;
+
+struct {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_struct2;
+
+/**** unions *******/
+
+union t_union {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_union;
+
+union {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_union2;
+
+/*** Functions returning type ********/
+
+char v_char_func () { return(0); }
+signed char v_signed_char_func () { return (0); }
+unsigned char v_unsigned_char_func () { return (0); }
+
+short v_short_func () { return (0); }
+signed short v_signed_short_func () { return (0); }
+unsigned short v_unsigned_short_func () { return (0); }
+
+int v_int_func () { return (0); }
+signed int v_signed_int_func () { return (0); }
+unsigned int v_unsigned_int_func () { return (0); }
+
+long v_long_func () { return (0); }
+signed long v_signed_long_func () { return (0); }
+unsigned long v_unsigned_long_func () { return (0); }
+
+float v_float_func () { return (0.0); }
+double v_double_func () { return (0.0); }
+
+/**** Some misc more complicated things *******/
+
+struct link {
+ struct link *next;
+#ifdef __STDC__
+ struct link *(*linkfunc) (struct link *this, int flags);
+#else
+ struct link *(*linkfunc) ();
+#endif
+ struct t_struct stuff[1][2][3];
+} *s_link;
+
+union tu_link {
+ struct link *next;
+#ifdef __STDC__
+ struct link *(*linkfunc) (struct link *this, int flags);
+#else
+ struct link *(*linkfunc) ();
+#endif
+ struct t_struct stuff[1][2][3];
+} u_link;
+
+/**** Enumerations *******/
+
+enum colors {red, green, blue} color;
+enum cars {chevy, ford, porsche} clunker;
+
+
+void dummy()
+{
+ /* Some linkers (e.g. on AIX) remove unreferenced variables,
+ so make sure to reference them. */
+ v_char = 0;
+ v_signed_char = 1;
+ v_unsigned_char = 2;
+
+ v_short = 3;
+ v_signed_short = 4;
+ v_unsigned_short = 5;
+
+ v_int = 6;
+ v_signed_int = 7;
+ v_unsigned_int = 8;
+
+ v_long = 9;
+ v_signed_long = 10;
+ v_unsigned_long = 11;
+
+ v_float = 100.0;
+ v_double = 200.0;
+ v_char_array[0] = v_char;
+ v_signed_char_array[0] = v_signed_char;
+ v_unsigned_char_array[0] = v_unsigned_char;
+
+ v_short_array[0] = v_short;
+ v_signed_short_array[0] = v_signed_short;
+ v_unsigned_short_array[0] = v_unsigned_short;
+
+ v_int_array[0] = v_int;
+ v_signed_int_array[0] = v_signed_int;
+ v_unsigned_int_array[0] = v_unsigned_int;
+
+ v_long_array[0] = v_long;
+ v_signed_long_array[0] = v_signed_long;
+ v_unsigned_long_array[0] = v_unsigned_long;
+
+ v_float_array[0] = v_float;
+ v_double_array[0] = v_double;
+ v_char_pointer = &v_char;
+ v_signed_char_pointer = &v_signed_char;
+ v_unsigned_char_pointer = &v_unsigned_char;
+
+ v_short_pointer = &v_short;
+ v_signed_short_pointer = &v_signed_short;
+ v_unsigned_short_pointer = &v_unsigned_short;
+
+ v_int_pointer = &v_int;
+ v_signed_int_pointer = &v_signed_int;
+ v_unsigned_int_pointer = &v_unsigned_int;
+
+ v_long_pointer = &v_long;
+ v_signed_long_pointer = &v_signed_long;
+ v_unsigned_long_pointer = &v_unsigned_long;
+
+ v_float_pointer = &v_float;
+ v_double_pointer = &v_double;
+
+ color = red;
+ clunker = porsche;
+
+ u_link.next = s_link;
+
+ v_struct2.v_int_member = v_struct1.v_int_member;
+ v_union2.v_short_member = v_union.v_short_member;
+}
diff --git a/gdb/testsuite/gdb.base/exprs.exp b/gdb/testsuite/gdb.base/exprs.exp
new file mode 100644
index 00000000000..49df15a2f60
--- /dev/null
+++ b/gdb/testsuite/gdb.base/exprs.exp
@@ -0,0 +1,259 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2001
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "exprs"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+proc test_expr { args } {
+ if { [llength $args] % 2 } {
+ warning "an even # of arguments should be passed to test_expr"
+ }
+ set last_ent [expr [llength $args] - 1];
+ set testname [lindex $args $last_ent];
+ if [gdb_test [lindex $args 0] "" "$testname (setup)"] {
+ gdb_suppress_tests;
+ }
+ for {set x 1} {$x < $last_ent} {set x [expr $x + 2]} {
+ if [gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname ([lindex $args $x])"] {
+ gdb_suppress_tests;
+ }
+ }
+ gdb_stop_suppressing_tests;
+}
+#
+# test expressions with "char" types
+#
+test_expr "set variable v_char=127" "print v_char == 0" "\\$\[0-9\]* = $false" "print v_char == 127" "\\$\[0-9\]* = $true" "print char =="
+test_expr "set variable v_char=127" "print v_char != 0" "\\$\[0-9\]* = $true" "print v_char != 127" "\\$\[0-9\]* = $false" "print char !="
+test_expr "set variable v_char=127" "print v_char < 0" "\\$\[0-9\]* = $false" "print v_char < 127" "\\$\[0-9\]* = $false" "print char <"
+test_expr "set variable v_char=127" "print v_char > 0" "\\$\[0-9\]* = $true" "print v_char > 127" "\\$\[0-9\]* = $false" "print char >"
+#
+# test expressions with "signed char" types
+#
+test_expr "set variable v_signed_char=127" "print v_signed_char == 0" "\\$\[0-9\]* = $false" "print v_signed_char == 127" "\\$\[0-9\]* = $true" "print signed char =="
+test_expr "set variable v_signed_char=127" "print v_signed_char != 0" "\\$\[0-9\]* = $true" "print v_signed_char != 127" "\\$\[0-9\]* = $false" "print signed char !="
+test_expr "set variable v_signed_char=127" "print v_signed_char < 0" "\\$\[0-9\]* = $false" "print v_signed_char < 127" "\\$\[0-9\]* = $false" "print signed char <"
+test_expr "set variable v_signed_char=127" "print v_signed_char > 0" "\\$\[0-9\]* = $true" "print v_signed_char > 127" "\\$\[0-9\]* = $false" "print signed char >"
+# make char a minus
+test_expr "set variable v_signed_char=-1" "print v_signed_char == 0" "\\$\[0-9\]* = $false" "print v_signed_char == -1" "\\$\[0-9\]* = $true" "print signed char == (minus)"
+test_expr "set variable v_signed_char=-1" "print v_signed_char != 0" "\\$\[0-9\]* = $true" "print v_signed_char != -1" "\\$\[0-9\]* = $false" "print signed char != (minus)"
+test_expr "set variable v_signed_char=-1" "print v_signed_char < 0" "\\$\[0-9\]* = $true" "print v_signed_char < 127" "\\$\[0-9\]* = $true" "print signed char < (minus)"
+test_expr "set variable v_signed_char=-1" "print v_signed_char > 0" "\\$\[0-9\]* = $false" "print v_signed_char > 127" "\\$\[0-9\]* = $false" "print signed char > (minus)"
+#
+# test expressions with "unsigned char" types
+#
+test_expr "set variable v_unsigned_char=127" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == 127" "\\$\[0-9\]* = $true" "print unsigned char =="
+test_expr "set variable v_unsigned_char=127" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != 127" "\\$\[0-9\]* = $false" "print unsigned char !="
+test_expr "set variable v_unsigned_char=127" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char <"
+test_expr "set variable v_unsigned_char=127" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $false" "print unsigned char >"
+# make char a minus
+# FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've
+# set up an expected failure for this case.
+setup_xfail "i960-*-*" 1821
+test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char == 0" "\\$\[0-9\]* = $false" "print v_unsigned_char == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_char == (unsigned char)~0" "\\$\[0-9\]* = $true" "print unsigned char == (~0)"
+# FIXME: gdb mishandles the cast (unsigned char) on the i960, so I've
+# set up an expected failure for this case.
+setup_xfail "i960-*-*" 1821
+test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char != 0" "\\$\[0-9\]* = $true" "print v_unsigned_char != (unsigned char)~0" "\\$\[0-9\]* = $false" "print v_unsigned_char != ~0" "\\$\[0-9\]* = $true" "print unsigned char != (~0)"
+test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char < 0" "\\$\[0-9\]* = $false" "print v_unsigned_char < 127" "\\$\[0-9\]* = $false" "print unsigned char < (~0)"
+test_expr "set variable v_unsigned_char=~0" "print v_unsigned_char > 0" "\\$\[0-9\]* = $true" "print v_unsigned_char > 127" "\\$\[0-9\]* = $true" "print unsigned char > (~0)"
+#
+# test expressions with "short" types
+#
+test_expr "set variable v_short=0x7FFF" "print v_short == 0" "\\$\[0-9\]* = $false" "print v_short == 0x7FFF" "\\$\[0-9\]* = $true" "print signed short =="
+test_expr "set variable v_short=0x7FFF" "print v_short != 0" "\\$\[0-9\]* = $true" "print v_short != 0x7FFF" "\\$\[0-9\]* = $false" "print signed short !="
+test_expr "set variable v_short=0x7FFF" "print v_short < 0" "\\$\[0-9\]* = $false" "print v_short < 0x7FFF" "\\$\[0-9\]* = $false" "print signed short <"
+test_expr "set variable v_short=0x7FFF" "print v_short > 0" "\\$\[0-9\]* = $true" "print v_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed short >"
+# make short a minus
+test_expr "set variable v_short=-1" "print v_short == 0" "\\$\[0-9\]* = $false" "print v_short == -1" "\\$\[0-9\]* = $true" "print signed short == (minus)"
+test_expr "set variable v_short=-1" "print v_short != 0" "\\$\[0-9\]* = $true" "print v_short != -1" "\\$\[0-9\]* = $false" "print signed short != (minus)"
+test_expr "set variable v_short=-1" "print v_short < 0" "\\$\[0-9\]* = $true" "print v_short < 0x7FFF" "\\$\[0-9\]* = $true" "print signed short < (minus)"
+test_expr "set variable v_short=-1" "print v_short > 0" "\\$\[0-9\]* = $false" "print v_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed short > (minus)"
+#
+# test expressions with "signed short" types
+#
+test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short == 0" "\\$\[0-9\]* = $false" "print v_signed_short == 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed short =="
+test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short != 0" "\\$\[0-9\]* = $true" "print v_signed_short != 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short !="
+test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short < 0" "\\$\[0-9\]* = $false" "print v_signed_short < 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short <"
+test_expr "set variable v_signed_short=0x7FFF" "print v_signed_short > 0" "\\$\[0-9\]* = $true" "print v_signed_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short >"
+# make short a minus
+test_expr "set variable v_signed_short=-1" "print v_signed_short == 0" "\\$\[0-9\]* = $false" "print v_signed_short == -1" "\\$\[0-9\]* = $true" "print signed signed short == (minus)"
+test_expr "set variable v_signed_short=-1" "print v_signed_short != 0" "\\$\[0-9\]* = $true" "print v_signed_short != -1" "\\$\[0-9\]* = $false" "print signed signed short != (minus)"
+test_expr "set variable v_signed_short=-1" "print v_signed_short < 0" "\\$\[0-9\]* = $true" "print v_signed_short < 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed short < (minus)"
+test_expr "set variable v_signed_short=-1" "print v_signed_short > 0" "\\$\[0-9\]* = $false" "print v_signed_short > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed short > (minus)"
+#
+# test expressions with "unsigned short" types
+#
+test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short == 0" "\\$\[0-9\]* = $false" "print v_unsigned_short == 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned short =="
+test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short != 0" "\\$\[0-9\]* = $true" "print v_unsigned_short != 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short !="
+test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short < 0" "\\$\[0-9\]* = $false" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short <"
+test_expr "set variable v_unsigned_short=0x7FFF" "print v_unsigned_short > 0" "\\$\[0-9\]* = $true" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short >"
+# make short a minus
+test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short == 0" "\\$\[0-9\]* = $false" "print sizeof (v_unsigned_short) < sizeof (~0) && v_unsigned_short == ~0" "\\$\[0-9\]* = $false" "print v_unsigned_short == (unsigned short)~0" "\\$\[0-9\]* = $true" "print unsigned short == (~0)"
+test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short != 0" "\\$\[0-9\]* = $true" "print v_unsigned_short != (unsigned short)~0" "\\$\[0-9\]* = $false" "print unsigned short != (~0)"
+test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short < 0" "\\$\[0-9\]* = $false" "print v_unsigned_short < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned short < (~0)"
+test_expr "set variable v_unsigned_short=~0" "print v_unsigned_short > 0" "\\$\[0-9\]* = $true" "print v_unsigned_short > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned short > (~0)"
+#
+# test expressions with "int" types
+#
+test_expr "set variable v_int=0x7FFF" "print v_int == 0" "\\$\[0-9\]* = $false" "print v_int == 0x7FFF" "\\$\[0-9\]* = $true" "print signed int =="
+test_expr "set variable v_int=0x7FFF" "print v_int != 0" "\\$\[0-9\]* = $true" "print v_int != 0x7FFF" "\\$\[0-9\]* = $false" "print signed int !="
+test_expr "set variable v_int=0x7FFF" "print v_int < 0" "\\$\[0-9\]* = $false" "print v_int < 0x7FFF" "\\$\[0-9\]* = $false" "print signed int <"
+test_expr "set variable v_int=0x7FFF" "print v_int > 0" "\\$\[0-9\]* = $true" "print v_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed int >"
+# make int a minus
+test_expr "set variable v_int=-1" "print v_int == 0" "\\$\[0-9\]* = $false" "print v_int == -1" "\\$\[0-9\]* = $true" "print signed int == (minus)"
+test_expr "set variable v_int=-1" "print v_int != 0" "\\$\[0-9\]* = $true" "print v_int != -1" "\\$\[0-9\]* = $false" "print signed int != (minus)"
+test_expr "set variable v_int=-1" "print v_int < 0" "\\$\[0-9\]* = $true" "print v_int < 0x7FFF" "\\$\[0-9\]* = $true" "print signed int < (minus)"
+test_expr "set variable v_int=-1" "print v_int > 0" "\\$\[0-9\]* = $false" "print v_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed int > (minus)"
+#
+# test expressions with "signed int" types
+#
+test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int == 0" "\\$\[0-9\]* = $false" "print v_signed_int == 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed int =="
+test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int != 0" "\\$\[0-9\]* = $true" "print v_signed_int != 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int !="
+test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int < 0" "\\$\[0-9\]* = $false" "print v_signed_int < 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int <"
+test_expr "set variable v_signed_int=0x7FFF" "print v_signed_int > 0" "\\$\[0-9\]* = $true" "print v_signed_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int >"
+# make int a minus
+test_expr "set variable v_signed_int=-1" "print v_signed_int == 0" "\\$\[0-9\]* = $false" "print v_signed_int == -1" "\\$\[0-9\]* = $true" "print signed signed int == (minus)"
+test_expr "set variable v_signed_int=-1" "print v_signed_int != 0" "\\$\[0-9\]* = $true" "print v_signed_int != -1" "\\$\[0-9\]* = $false" "print signed signed int != (minus)"
+test_expr "set variable v_signed_int=-1" "print v_signed_int < 0" "\\$\[0-9\]* = $true" "print v_signed_int < 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed int < (minus)"
+test_expr "set variable v_signed_int=-1" "print v_signed_int > 0" "\\$\[0-9\]* = $false" "print v_signed_int > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed int > (minus)"
+#
+# test expressions with "unsigned int" types
+#
+test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int == 0" "\\$\[0-9\]* = $false" "print v_unsigned_int == 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned int =="
+test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int != 0" "\\$\[0-9\]* = $true" "print v_unsigned_int != 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int !="
+test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int < 0" "\\$\[0-9\]* = $false" "print v_unsigned_int < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int <"
+test_expr "set variable v_unsigned_int=0x7FFF" "print v_unsigned_int > 0" "\\$\[0-9\]* = $true" "print v_unsigned_int > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int >"
+# make int a minus
+test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int == 0" "\\$\[0-9\]* = $false" "print v_unsigned_int == ~0" "\\$\[0-9\]* = $true" "print v_unsigned_int == (unsigned int)~0" "\\$\[0-9\]* = $true" "print unsigned int == (~0)"
+test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int != 0" "\\$\[0-9\]* = $true" "print v_unsigned_int != (unsigned int)~0" "\\$\[0-9\]* = $false" "print unsigned int != (~0)"
+test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int < 0" "\\$\[0-9\]* = $false" "print v_unsigned_int < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned int < (~0)"
+test_expr "set variable v_unsigned_int=~0" "print v_unsigned_int > 0" "\\$\[0-9\]* = $true" "print v_unsigned_int > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned int > (~0)"
+#
+# test expressions with "long" types
+#
+test_expr "set variable v_long=0x7FFF" "print v_long == 0" "\\$\[0-9\]* = $false" "print v_long == 0x7FFF" "\\$\[0-9\]* = $true" "print signed long =="
+test_expr "set variable v_long=0x7FFF" "print v_long != 0" "\\$\[0-9\]* = $true" "print v_long != 0x7FFF" "\\$\[0-9\]* = $false" "print signed long !="
+test_expr "set variable v_long=0x7FFF" "print v_long < 0" "\\$\[0-9\]* = $false" "print v_long < 0x7FFF" "\\$\[0-9\]* = $false" "print signed long <"
+test_expr "set variable v_long=0x7FFF" "print v_long > 0" "\\$\[0-9\]* = $true" "print v_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed long >"
+# make long a minus
+test_expr "set variable v_long=-1" "print v_long == 0" "\\$\[0-9\]* = $false" "print v_long == -1" "\\$\[0-9\]* = $true" "print signed long == (minus)"
+test_expr "set variable v_long=-1" "print v_long != 0" "\\$\[0-9\]* = $true" "print v_long != -1" "\\$\[0-9\]* = $false" "print signed long != (minus)"
+test_expr "set variable v_long=-1" "print v_long < 0" "\\$\[0-9\]* = $true" "print v_long < 0x7FFF" "\\$\[0-9\]* = $true" "print signed long < (minus)"
+test_expr "set variable v_long=-1" "print v_long > 0" "\\$\[0-9\]* = $false" "print v_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed long > (minus)"
+#
+# test expressions with "signed long" types
+#
+test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long == 0" "\\$\[0-9\]* = $false" "print v_signed_long == 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed long =="
+test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long != 0" "\\$\[0-9\]* = $true" "print v_signed_long != 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long !="
+test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long < 0" "\\$\[0-9\]* = $false" "print v_signed_long < 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long <"
+test_expr "set variable v_signed_long=0x7FFF" "print v_signed_long > 0" "\\$\[0-9\]* = $true" "print v_signed_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long >"
+# make long a minus
+test_expr "set variable v_signed_long=-1" "print v_signed_long == 0" "\\$\[0-9\]* = $false" "print v_signed_long == -1" "\\$\[0-9\]* = $true" "print signed signed long == (minus)"
+test_expr "set variable v_signed_long=-1" "print v_signed_long != 0" "\\$\[0-9\]* = $true" "print v_signed_long != -1" "\\$\[0-9\]* = $false" "print signed signed long != (minus)"
+test_expr "set variable v_signed_long=-1" "print v_signed_long < 0" "\\$\[0-9\]* = $true" "print v_signed_long < 0x7FFF" "\\$\[0-9\]* = $true" "print signed signed long < (minus)"
+test_expr "set variable v_signed_long=-1" "print v_signed_long > 0" "\\$\[0-9\]* = $false" "print v_signed_long > 0x7FFF" "\\$\[0-9\]* = $false" "print signed signed long > (minus)"
+#
+# test expressions with "unsigned long" types
+#
+test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long == 0" "\\$\[0-9\]* = $false" "print v_unsigned_long == 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned long =="
+test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long != 0" "\\$\[0-9\]* = $true" "print v_unsigned_long != 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long !="
+test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long < 0" "\\$\[0-9\]* = $false" "print v_unsigned_long < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long <"
+test_expr "set variable v_unsigned_long=0x7FFF" "print v_unsigned_long > 0" "\\$\[0-9\]* = $true" "print v_unsigned_long > 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long >"
+# make long a minus
+test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long == 0" "\\$\[0-9\]* = $false" "print v_unsigned_long == ~0" "\\$\[0-9\]* = $true" "print v_unsigned_long == (unsigned long)~0" "\\$\[0-9\]* = $true" "print unsigned long == (~0)"
+test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long != 0" "\\$\[0-9\]* = $true" "print v_unsigned_long != (unsigned long)~0" "\\$\[0-9\]* = $false" "print unsigned long != (~0)"
+test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long < 0" "\\$\[0-9\]* = $false" "print v_unsigned_long < 0x7FFF" "\\$\[0-9\]* = $false" "print unsigned long < (~0)"
+test_expr "set variable v_unsigned_long=~0" "print v_unsigned_long > 0" "\\$\[0-9\]* = $true" "print v_unsigned_long > 0x7FFF" "\\$\[0-9\]* = $true" "print unsigned long > (~0)"
+#
+# Test expressions with casts to a pointer.
+# NB: Some architectures convert a ``NULL'' pointer into
+# something else. Don't simply test for 0.
+#
+test_expr "set variable v_signed_char = 0" "print (void*)v_signed_char" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_char"
+test_expr "set variable v_signed_short = 0" "print (void*)v_signed_short" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_short"
+test_expr "set variable v_signed_int = 0" "print (void*)v_signed_int" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_int"
+test_expr "set variable v_signed_long = 0" "print (void*)v_signed_long" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_signed_long"
+test_expr "set variable v_unsigned_char = 0" "print (void*)v_unsigned_char" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_unsigned_char"
+test_expr "set variable v_unsigned_short = 0" "print (void*)v_unsigned_short" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_unsigned_short"
+test_expr "set variable v_unsigned_int = 0" "print (void*)v_unsigned_int" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_unsigned_int"
+test_expr "set variable v_unsigned_long = 0" "print (void*)v_unsigned_long" "\\$\[0-9\]* = .void \\*. $hex" "print (void*)v_unsigned_long"
+#
+# Test expressions with pointers out of range
+#
+# NB: For some architectures, all of sizeof(long),
+# sizeof(long long) and sizeof(void*) are
+# the same size so this test can not work.
+#
+send_gdb "print sizeof (long long) > sizeof (long)\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = $true.*$gdb_prompt" {
+ set ok 1
+ pass "sizeof (long long) > sizeof (long) (true)"
+ }
+ -re "\\$\[0-9\]* = $false.*$gdb_prompt" {
+ set ok 0
+ pass "sizeof (long long) > sizeof (long) (false)"
+ }
+ timeout {
+ set ok 0
+ fail "sizeof (long long) > sizeof (long) (timeout)"
+ }
+}
+if [expr ! $ok] { setup_xfail "*-*-*" }
+gdb_test "print (void*) ((long long) (unsigned long) -1 + 1)" \
+ "warning: value truncated.*" "truncate (void*) 0x00000000ffffffff + 1"
+if [expr ! $ok] { setup_xfail "*-*-*" }
+gdb_test "print (void*) (~((long long)(unsigned long) -1) - 1)" \
+ "warning: value truncated.*" "truncate (void*) 0xffffffff00000000 - 1"
diff --git a/gdb/testsuite/gdb.base/finish.exp b/gdb/testsuite/gdb.base/finish.exp
new file mode 100644
index 00000000000..064f26e39dc
--- /dev/null
+++ b/gdb/testsuite/gdb.base/finish.exp
@@ -0,0 +1,125 @@
+# Copyright 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@redhat.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# re-use the program from the "return2" test.
+set testfile "return2"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc finish_1 { type } {
+ global gdb_prompt
+
+ gdb_test "break ${type}_func" "Breakpoint \[0123456789\].*" \
+ "set break on ${type}_func"
+ gdb_test "continue" "Breakpoint.* ${type}_func.*" \
+ "continue to ${type}_func"
+ send_gdb "finish\n"
+ gdb_expect {
+ -re ".*Value returned is .* = 49 '1'\r\n$gdb_prompt $" {
+ if { $type == "char" } {
+ pass "finish from char_func"
+ } else {
+ fail "finish from ${type}_func"
+ }
+ }
+ -re ".*Value returned is .* = \[0123456789\]* '1'\r\n$gdb_prompt $" {
+ if { $type == "char" } {
+ pass "finish from char_func (non-ASCII char set?)"
+ } else {
+ fail "finish from ${type}_func"
+ }
+ }
+ -re ".*Value returned is .* = 1\r\n$gdb_prompt $" {
+ pass "finish from ${type}_func"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "finish from ${type}_func"
+ }
+ timeout {
+ fail "finish from ${type}_func (timeout)"
+ }
+ }
+}
+
+proc finish_void { } {
+ global gdb_prompt
+
+ gdb_test "break void_func" "Breakpoint \[0123456789\].*" \
+ "set break on void_func"
+ gdb_test "continue" "Breakpoint.* void_func.*" \
+ "continue to void_func"
+ send_gdb "finish\n"
+ # Some architectures will have one or more instructions after the
+ # call instruction which still is part of the call sequence, so we
+ # must be prepared for a "finish" to show us the void_func call
+ # again as well as the statement after.
+ gdb_expect {
+ -re ".*void_checkpoint.*$gdb_prompt $" {
+ pass "finish from void_func"
+ }
+ -re "0x\[0-9a-fA-F\]+ in main.*call to void_func.*$gdb_prompt $" {
+ pass "finish from void_func"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "finish from void_func"
+ }
+ timeout {
+ fail "finish from void_func (timeout)"
+ }
+ }
+}
+
+proc finish_tests { } {
+ global gdb_prompt
+
+ if { ! [ runto main ] } then {
+ gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
+ }
+
+ finish_void
+ finish_1 "char"
+ finish_1 "short"
+ finish_1 "int"
+ finish_1 "long"
+ finish_1 "long_long"
+ finish_1 "float"
+ finish_1 "double"
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set timeout 30
+finish_tests
diff --git a/gdb/testsuite/gdb.base/foll-exec.c b/gdb/testsuite/gdb.base/foll-exec.c
new file mode 100644
index 00000000000..1b760903dd7
--- /dev/null
+++ b/gdb/testsuite/gdb.base/foll-exec.c
@@ -0,0 +1,43 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+
+int global_i = 100;
+
+#ifdef PROTOTYPES
+int main (void)
+#else
+main ()
+#endif
+{
+ int local_j = global_i+1;
+ int local_k = local_j+1;
+
+ printf ("foll-exec is about to execlp(execd-prog)...\n");
+
+ execlp ("gdb.base/execd-prog",
+ "gdb.base/execd-prog",
+ "execlp arg1 from foll-exec",
+ (char *)0);
+
+ printf ("foll-exec is about to execl(execd-prog)...\n");
+
+ execl ("gdb.base/execd-prog",
+ "gdb.base/execd-prog",
+ "execl arg1 from foll-exec",
+ "execl arg2 from foll-exec",
+ (char *)0);
+
+ {
+ static char * argv[] = {
+ (char *)"gdb.base/execd-prog",
+ (char *)"execv arg1 from foll-exec",
+ (char *)0};
+
+ printf ("foll-exec is about to execv(execd-prog)...\n");
+
+ execv ("gdb.base/execd-prog", argv);
+ }
+}
diff --git a/gdb/testsuite/gdb.base/foll-exec.exp b/gdb/testsuite/gdb.base/foll-exec.exp
new file mode 100644
index 00000000000..482a0df3c3d
--- /dev/null
+++ b/gdb/testsuite/gdb.base/foll-exec.exp
@@ -0,0 +1,400 @@
+# Copyright 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { ![isnative] } then {
+ continue
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "foll-exec"
+set testfile2 "execd-prog"
+set srcfile ${testfile}.c
+set srcfile2 ${testfile2}.c
+set binfile ${objdir}/${subdir}/${testfile}
+set binfile2 ${objdir}/${subdir}/${testfile2}
+
+# build the first test case
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+# Until "catch exec" is implemented on other targets...
+#
+if ![istarget "hppa*-hp-hpux*"] then {
+ continue
+}
+
+proc zap_session {} {
+ global gdb_prompt
+ global binfile
+
+ send_gdb "kill\n"
+ gdb_expect {
+ -re ".*Kill the program being debugged.*y or n. $" {
+ send_gdb "y\n"
+ send_gdb "file $binfile\n"
+ gdb_expect {
+ -re ".*Load new symbol table from.*y or n. $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "Reading symbols from.*$gdb_prompt $" {}
+ timeout { fail "loading symbols (timeout)"; return }
+ }
+ }
+ -re ".*gdb_prompt $" {}
+ timeout { fail "loading symbols (timeout)"; return }
+ }
+ }
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "killing inferior (timeout)" ; return }
+ }
+}
+
+proc do_exec_tests {} {
+ global gdb_prompt
+ global binfile
+ global srcfile
+ global srcfile2
+ global testfile
+ global testfile2
+
+ # Start the program running, and stop at main.
+ #
+ if ![runto_main] then {
+ perror "Couldn't run ${testfile}"
+ return
+ }
+
+ # Verify that we can see various global and local variables
+ # in this program, and that they have expected values. Some
+ # of these variables are also declared in the program we'll
+ # exec in a moment.
+ #
+ send_gdb "next 3\n"
+ gdb_expect {
+ -re "20.*execlp.*$gdb_prompt $"\
+ {pass "step to exec call"}
+ -re "$gdb_prompt $" {fail "step to exec call"}
+ timeout {fail "(timeout) step to exec call"}
+ }
+ send_gdb "print global_i\n"
+ gdb_expect {
+ -re ".* = 100.*$gdb_prompt $"\
+ {pass "print follow-exec/global_i"}
+ -re "$gdb_prompt $" {fail "print follow-exec/global_i"}
+ timeout {fail "(timeout) print follow-exec/global_i"}
+ }
+ send_gdb "print local_j\n"
+ gdb_expect {
+ -re ".* = 101.*$gdb_prompt $"\
+ {pass "print follow-exec/local_j"}
+ -re "$gdb_prompt $" {fail "print follow-exec/local_j"}
+ timeout {fail "(timeout) print follow-exec/local_j"}
+ }
+ send_gdb "print local_k\n"
+ gdb_expect {
+ -re ".* = 102.*$gdb_prompt $"\
+ {pass "print follow-exec/local_k"}
+ -re "$gdb_prompt $" {fail "print follow-exec/local_k"}
+ timeout {fail "(timeout) print follow-exec/local_k"}
+ }
+
+ # Try stepping through an execlp call, without catching it.
+ # We should stop in execd-program, at its first statement.
+ #
+ send_gdb "next\n"
+ gdb_expect {
+ -re "Executing new program: .*${testfile2}.*${srcfile2}:23.*int local_j = argc;.*$gdb_prompt $"\
+ {pass "step through execlp call"}
+ -re "$gdb_prompt $" {fail "step through execlp call"}
+ timeout {fail "(timeout) step through execlp call"}
+ }
+
+ # Verify that we can see the variables defined in the newly-exec'd
+ # program, and CANNOT see those defined in the exec'ing program.
+ #
+ send_gdb "next\n"
+ gdb_expect {
+ -re "26.*printf.*$gdb_prompt $"\
+ {pass "step after execlp call"}
+ -re "$gdb_prompt $" {fail "step after execlp call"}
+ timeout {fail "(timeout) step after execlp call"}
+ }
+ send_gdb "print global_i\n"
+ gdb_expect {
+ -re ".* = 0.*$gdb_prompt $"\
+ {pass "print execd-program/global_i (after execlp)"}
+ -re "$gdb_prompt $" {fail "print execd-program/global_i (after execlp)"}
+ timeout {fail "(timeout) print execd-program/global_i (after execlp)"}
+ }
+ send_gdb "print local_j\n"
+ gdb_expect {
+ -re ".* = 2.*$gdb_prompt $"\
+ {pass "print execd-program/local_j (after execlp)"}
+ -re "$gdb_prompt $" {fail "print execd-program/local_j (after execlp)"}
+ timeout {fail "(timeout) print execd-program/local_j (after execlp)"}
+ }
+ send_gdb "print local_k\n"
+ gdb_expect {
+ -re "No symbol \"local_k\" in current context.*$gdb_prompt $"\
+ {pass "print follow-exec/local_k (after execlp)"}
+ -re "$gdb_prompt $" {fail "print follow-exec/local_k (after execlp)"}
+ timeout {fail "(timeout) print follow-exec/local_k (after execlp)"}
+ }
+
+ # Explicitly kill this program, or a subsequent rerun actually runs
+ # the exec'd program, not the original program...
+ zap_session
+
+ # Start the program running, and stop at main.
+ #
+ if ![runto_main] then {
+ perror "Couldn't run ${testfile} (2nd try)"
+ return
+ }
+
+ # Verify that we can catch an exec event, and then continue
+ # to follow through the exec. (Since there's a breakpoint on
+ # "main", it'll also be transferred to the exec'd program,
+ # and we expect to stop there.)
+ #
+ send_gdb "catch exec\n"
+ gdb_expect {
+ -re "Catchpoint .*(exec).*$gdb_prompt $"\
+ {pass "set catch exec"}
+ -re "$gdb_prompt $" {fail "set catch exec"}
+ timeout {fail "(timeout) set catch exec"}
+ }
+
+ # Verify that the catchpoint is mentioned in an "info breakpoints",
+ # and further that the catchpoint mentions no program name.
+ #
+ send_gdb "info breakpoints\n"
+ gdb_expect {
+ -re ".*catch exec.*keep y.*$gdb_prompt $"\
+ {pass "info shows catchpoint without exec pathname"}
+ -re ".*catch exec.*program \"\".*$gdb_prompt $"\
+ {fail "info shows catchpoint without exec pathname"}
+ -re "$gdb_prompt $" {fail "info shows catchpoint without exec pathname"}
+ timeout {fail "(timeout) info shows catchpoint without exec pathname"}
+ }
+
+ # DTS CLLbs16760
+ # PA64 doesn't know about $START$ in dld.sl at this point. It should.
+ # - Michael Coulter
+ setup_xfail hppa2.0w-hp-hpux* CLLbs16760
+ send_gdb "continue\n"
+ gdb_expect {
+ -re ".*Executing new program:.*${testfile2}.*Catchpoint .*(exec\'d .*${testfile2}).*in .START..*$gdb_prompt $"\
+ {pass "hit catch exec"}
+ -re "$gdb_prompt $" {fail "hit catch exec"}
+ timeout {fail "(timeout) hit catch exec"}
+ }
+
+ # DTS CLLbs16760
+ # test gets out of sync if previous test fails.
+ gdb_test "bt" ".*" "sync up after possible failure 1"
+ gdb_test "bt" "#0.*" "sync up after possible failure 2"
+
+ # Verify that the catchpoint is mentioned in an "info breakpoints",
+ # and further that the catchpoint managed to capture the exec'd
+ # program's name.
+ #
+ send_gdb "info breakpoints\n"
+ gdb_expect {
+ -re ".*catch exec .*program \".*${testfile2}\".*$gdb_prompt $"\
+ {pass "info shows catchpoint exec pathname"}
+ -re "$gdb_prompt $" {fail "info shows catchpoint exec pathname"}
+ timeout {fail "(timeout) info shows catchpoint exec pathname"}
+ }
+
+ # Verify that we can continue from the catchpoint, and land in the
+ # main of the newly-exec'd program.
+ #
+ send_gdb "continue\n"
+ gdb_expect {
+ -re ".*${srcfile2}:23.*$gdb_prompt $"\
+ {pass "continue after hit catch exec"}
+ -re "$gdb_prompt $" {fail "continue after hit catch exec"}
+ timeout {fail "(timeout) continue after hit catch exec"}
+ }
+
+ # Explicitly kill this program, or a subsequent rerun actually runs
+ # the exec'd program, not the original program...
+ zap_session
+
+ # Start the program running, and stop at main.
+ #
+ if ![runto_main] then {
+ perror "Couldn't run ${testfile} (3rd try)"
+ return
+ }
+
+ # Verify that we can follow through follow an execl()
+ # call. (We must jump around earlier exec* calls.)
+ #
+ send_gdb "tbreak 27\n"
+ gdb_expect {
+ -re "Breakpoint .*file .*${srcfile}, line 27.*$gdb_prompt $"\
+ {pass "prepare to jump to execl call"}
+ -re "$gdb_prompt $" {fail "prepare to jump to execl call"}
+ timeout {fail "(timeout) prepare to jump to execl call"}
+ }
+ send_gdb "jump 27\n"
+ gdb_expect {
+ -re "main.* at .*${srcfile}:27.*$gdb_prompt $"\
+ {pass "jump to execl call"}
+ -re "$gdb_prompt $" {fail "jump to execl call"}
+ timeout {fail "(timeout) jump to execl call"}
+ }
+ # Note that stepping through an exec call causes the step-count
+ # to be reset to zero. I.e.: you may specify "next 2" at the
+ # call, but you'll actually stop at the first breakpoint set in
+ # the newly-exec'd program, not after the remaining step-count
+ # reaches zero.
+ #
+ send_gdb "next 2\n"
+ gdb_expect {
+ -re "Executing new program: .*${testfile2}.*${srcfile2}:23.*int local_j = argc;.*$gdb_prompt $"\
+ {pass "step through execl call"}
+ -re "$gdb_prompt $" {fail "step through execl call"}
+ timeout {fail "(timeout) step through execl call"}
+ }
+ send_gdb "next\n"
+ gdb_expect {
+ -re "26.*printf.*$gdb_prompt $"\
+ {pass "step after execl call"}
+ -re "$gdb_prompt $" {fail "step after execl call"}
+ timeout {fail "(timeout) step after execl call"}
+ }
+
+ # Verify that we can print a local variable (which happens to be
+ # assigned the value of main's argc).
+ #
+ send_gdb "print local_j\n"
+ gdb_expect {
+ -re ".* = 3.*$gdb_prompt $"\
+ {pass "print execd-program/local_j (after execl)"}
+ -re "$gdb_prompt $" {fail "print execd-program/local_j (after execl)"}
+ timeout {fail "(timeout) print execd-program/local_j (after execl)"}
+ }
+
+ # Explicitly kill this program, or a subsequent rerun actually runs
+ # the exec'd program, not the original program...
+ zap_session
+
+ # Start the program running, and stop at main.
+ #
+ if ![runto_main] then {
+ perror "Couldn't run ${testfile} (4th try)"
+ return
+ }
+
+ # Verify that we can follow through follow an execv()
+ # call. (We must jump around earlier exec* calls.)
+ #
+ send_gdb "tbreak 41\n"
+ gdb_expect {
+ -re "Breakpoint .*file .*${srcfile}, line 41.*$gdb_prompt $"\
+ {pass "prepare to jump to execv call"}
+ -re "$gdb_prompt $" {fail "prepare to jump to execv call"}
+ timeout {fail "(timeout) prepare to jump to execv call"}
+ }
+ send_gdb "jump 41\n"
+ gdb_expect {
+ -re "main.* at .*${srcfile}:41.*$gdb_prompt $"\
+ {pass "jump to execv call"}
+ -re "$gdb_prompt $" {fail "jump to execv call"}
+ timeout {fail "(timeout) jump to execv call"}
+ }
+ send_gdb "next\n"
+ gdb_expect {
+ -re "Executing new program: .*${testfile2}.*${srcfile2}:23.*int local_j = argc;.*$gdb_prompt $"\
+ {pass "step through execv call"}
+ -re "$gdb_prompt $" {fail "step through execv call"}
+ timeout {fail "(timeout) step through execv call"}
+ }
+ send_gdb "next\n"
+ gdb_expect {
+ -re "26.*printf.*$gdb_prompt $"\
+ {pass "step after execv call"}
+ -re "$gdb_prompt $" {fail "step after execv call"}
+ timeout {fail "(timeout) step after execv call"}
+ }
+
+ # Verify that we can print a local variable (which happens to be
+ # assigned the value of main's argc).
+ #
+ send_gdb "print local_j\n"
+ gdb_expect {
+ -re ".* = 2.*$gdb_prompt $"\
+ {pass "print execd-program/local_j (after execv)"}
+ -re "$gdb_prompt $" {fail "print execd-program/local_j (after execv)"}
+ timeout {fail "(timeout) print execd-program/local_j (after execv)"}
+ }
+
+ # Explicitly kill this program, or a subsequent rerun actually runs
+ # the exec'd program, not the original program...
+ zap_session
+
+ # Start the program running, and stop at main.
+ #
+ if ![runto_main] then {
+ perror "Couldn't run ${testfile} (5th try)"
+ return
+ }
+
+ # Verify that we can just continue and thereby follow through an
+ # exec call. (Since the breakpoint on "main" is reset, we should
+ # just stop in main of the newly-exec'd program.)
+ #
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Executing new program: .*${testfile2}.*${srcfile2}:23.*int local_j = argc;.*$gdb_prompt $"\
+ {pass "continue through exec"}
+ -re "$gdb_prompt $" {fail "continue through exec"}
+ timeout {fail "(timeout) continue through exec"}
+ }
+}
+
+# Start with a fresh gdb
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+# This is a test of gdb's ability to follow a process through a
+# Unix exec() system call.
+#
+do_exec_tests
+
+return 0
diff --git a/gdb/testsuite/gdb.base/foll-fork.c b/gdb/testsuite/gdb.base/foll-fork.c
new file mode 100644
index 00000000000..841258f147c
--- /dev/null
+++ b/gdb/testsuite/gdb.base/foll-fork.c
@@ -0,0 +1,34 @@
+#include <stdio.h>
+#include <unistd.h>
+
+#ifdef PROTOTYPES
+void callee (int i)
+#else
+void callee (i)
+ int i;
+#endif
+{
+ printf("callee: %d\n", i);
+}
+
+#ifdef PROTOTYPES
+int main (void)
+#else
+main ()
+#endif
+{
+ int pid;
+ int v = 5;
+
+ pid = fork ();
+ if (pid == 0)
+ {
+ v++;
+ /* printf ("I'm the child!\n"); */
+ }
+ else
+ {
+ v--;
+ /* printf ("I'm the proud parent of child #%d!\n", pid); */
+ }
+}
diff --git a/gdb/testsuite/gdb.base/foll-fork.exp b/gdb/testsuite/gdb.base/foll-fork.exp
new file mode 100644
index 00000000000..d3fb1676878
--- /dev/null
+++ b/gdb/testsuite/gdb.base/foll-fork.exp
@@ -0,0 +1,367 @@
+# Copyright 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { ![isnative] } then {
+ continue
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "foll-fork"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+
+# Until "set follow-fork-mode" and "catch fork" are implemented on
+# other targets...
+#
+if ![istarget "hppa*-hp-hpux*"] then {
+ continue
+}
+
+proc default_fork_parent_follow {} {
+ global gdb_prompt
+
+ send_gdb "show follow\n"
+ gdb_expect {
+ -re "Debugger response to a program call of fork or vfork is \"parent\"..*$gdb_prompt $"\
+ {pass "default show parent follow, no catchpoints"}
+ -re "$gdb_prompt $" {fail "default show parent follow, no catchpoints"}
+ timeout {fail "(timeout) default show parent follow, no catchpoints"}
+ }
+ send_gdb "next 2\n"
+ gdb_expect {
+ -re "Detaching after fork from.*$gdb_prompt $"\
+ {pass "default parent follow, no catchpoints"}
+ -re "$gdb_prompt $" {fail "default parent follow, no catchpoints"}
+ timeout {fail "(timeout) default parent follow, no catchpoints" }
+ }
+ # The child has been detached; allow time for any output it might
+ # generate to arrive, so that output doesn't get confused with
+ # any expected debugger output from a subsequent testpoint.
+ #
+ exec sleep 1
+}
+
+proc explicit_fork_parent_follow {} {
+ global gdb_prompt
+
+ send_gdb "set follow parent\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "set follow parent"}
+ timeout {fail "(timeout) set follow parent"}
+ }
+ send_gdb "show follow\n"
+ gdb_expect {
+ -re "Debugger response to a program call of fork or vfork is \"parent\"..*$gdb_prompt $"\
+ {pass "explicit show parent follow, no catchpoints"}
+ -re "$gdb_prompt $" {fail "explicit show parent follow, no catchpoints"}
+ timeout {fail "(timeout) explicit show parent follow, no catchpoints"}
+ }
+ send_gdb "next 2\n"
+ gdb_expect {
+ -re "Detaching after fork from.*$gdb_prompt $"\
+ {pass "explicit parent follow, no catchpoints"}
+ -re "$gdb_prompt $" {fail "explicit parent follow, no catchpoints"}
+ timeout {fail "(timeout) explicit parent follow, no catchpoints"}
+ }
+ # The child has been detached; allow time for any output it might
+ # generate to arrive, so that output doesn't get confused with
+ # any expected debugger output from a subsequent testpoint.
+ #
+ exec sleep 1
+}
+
+proc explicit_fork_child_follow {} {
+ global gdb_prompt
+
+ send_gdb "set follow child\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "set follow child"}
+ timeout {fail "(timeout) set follow child"}
+ }
+ send_gdb "show follow\n"
+ gdb_expect {
+ -re "Debugger response to a program call of fork or vfork is \"child\"..*$gdb_prompt $"\
+ {pass "explicit show child follow, no catchpoints"}
+ -re "$gdb_prompt $" {fail "explicit show child follow, no catchpoints"}
+ timeout {fail "(timeout) explicit show child follow, no catchpoints"}
+ }
+ send_gdb "next 2\n"
+ gdb_expect {
+ -re "Detaching from program:.*Attaching after fork to.*$gdb_prompt $"\
+ {pass "explicit child follow, no catchpoints"}
+ -re "$gdb_prompt $" {fail "explicit child follow, no catchpoints"}
+ timeout {fail "(timeout) explicit child follow, no catchpoints"}
+ }
+ # The child has been detached; allow time for any output it might
+ # generate to arrive, so that output doesn't get confused with
+ # any gdb_expected debugger output from a subsequent testpoint.
+ #
+ exec sleep 1
+}
+
+proc catch_fork_child_follow {} {
+ global gdb_prompt
+
+ send_gdb "catch fork\n"
+ gdb_expect {
+ -re "Catchpoint .*(fork).*$gdb_prompt $"\
+ {pass "explicit child follow, set catch fork"}
+ -re "$gdb_prompt $" {fail "explicit child follow, set catch fork"}
+ timeout {fail "(timeout) explicit child follow, set catch fork"}
+ }
+
+ # Verify that the catchpoint is mentioned in an "info breakpoints",
+ # and further that the catchpoint mentions no process id.
+ #
+ send_gdb "info breakpoints\n"
+ gdb_expect {
+ -re ".*catch fork.*keep y.*$gdb_prompt $"\
+ {pass "info shows catchpoint without pid"}
+ -re ".*catch fork.*process .*$gdb_prompt $"\
+ {fail "info shows catchpoint without pid"}
+ -re "$gdb_prompt $" {fail "info shows catchpoint without pid"}
+ timeout {fail "(timeout) info shows catchpoint without pid"}
+ }
+
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Catchpoint.*(forked process.*),.*in _fork_sys.*$gdb_prompt $"\
+ {pass "explicit child follow, catch fork"}
+ -re "$gdb_prompt $" {fail "explicit child follow, catch fork"}
+ timeout {fail "(timeout) explicit child follow, catch fork"}
+ }
+
+ # Verify that the catchpoint is mentioned in an "info breakpoints",
+ # and further that the catchpoint managed to capture a process id.
+ #
+ send_gdb "info breakpoints\n"
+ gdb_expect {
+ -re ".*catch fork .*process \[0-9\]+.*$gdb_prompt $"\
+ {pass "info shows catchpoint pid"}
+ -re "$gdb_prompt $" {fail "info shows catchpoint pid"}
+ timeout {fail "(timeout) info shows catchpoint pid"}
+ }
+
+ send_gdb "set follow child\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "set follow child"}
+ timeout {fail "(timeout) set follow child"}
+ }
+ send_gdb "tbreak 24\n"
+ gdb_expect {
+ -re "Breakpoint.*, line 24.*$gdb_prompt $"\
+ {pass "set follow child, tbreak"}
+ -re "$gdb_prompt $" {fail "set follow child, tbreak"}
+ timeout {fail "(timeout) set follow child, tbreak"}
+ }
+ send_gdb "continue\n"
+ gdb_expect {
+ -re ".*Detaching from program:.*Attaching after fork to.* at .*24.*$gdb_prompt $"\
+ {pass "set follow child, hit tbreak"}
+ -re "$gdb_prompt $" {fail "set follow child, hit tbreak"}
+ timeout {fail "(timeout) set follow child, hit tbreak"}
+ }
+ # The child has been detached; allow time for any output it might
+ # generate to arrive, so that output doesn't get confused with
+ # any expected debugger output from a subsequent testpoint.
+ #
+ exec sleep 1
+ send_gdb "delete breakpoints\n"
+ gdb_expect {
+ -re "Delete all breakpoints.*$" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "set follow child, cleanup"}
+ timeout {fail "(timeout) set follow child, cleanup"}
+ }
+ }
+ -re "$gdb_prompt $" {fail "set follow child, cleanup"}
+ timeout {fail "(timeout) set follow child, cleanup"}
+ }
+}
+
+proc tcatch_fork_parent_follow {} {
+ global gdb_prompt
+
+ send_gdb "catch fork\n"
+ gdb_expect {
+ -re "Catchpoint .*(fork).*$gdb_prompt $"\
+ {pass "explicit parent follow, set tcatch fork"}
+ -re "$gdb_prompt $" {fail "explicit parent follow, set tcatch fork"}
+ timeout {fail "(timeout) explicit parent follow, set tcatch fork"}
+ }
+# ??rehrauer: I don't yet know how to get the id of the tcatch
+# via this script, so that I can add a -do list to it. For now,
+# do the follow stuff after the catch happens.
+
+ send_gdb "continue\n"
+ gdb_expect {
+ -re ".*in _fork_sys.*$gdb_prompt $"\
+ {pass "explicit parent follow, tcatch fork"}
+ -re "$gdb_prompt $" {fail "explicit parent follow, tcatch fork"}
+ timeout {fail "(timeout) explicit parent follow, tcatch fork"}
+ }
+ send_gdb "set follow parent\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "set follow parent"}
+ timeout {fail "(timeout) set follow parent"}
+ }
+ send_gdb "tbreak 24\n"
+ gdb_expect {
+ -re "Breakpoint.*, line 24.*$gdb_prompt $"\
+ {pass "set follow parent, tbreak"}
+ -re "$gdb_prompt $" {fail "set follow parent, tbreak"}
+ timeout {fail "(timeout) set follow child, tbreak"}
+ }
+ send_gdb "continue\n"
+ gdb_expect {
+ -re ".*Detaching after fork from.* at .*24.*$gdb_prompt $"\
+ {pass "set follow parent, hit tbreak"}
+ -re "$gdb_prompt $" {fail "set follow parent, hit tbreak"}
+ timeout {fail "(timeout) set follow parent, hit tbreak"}
+ }
+ # The child has been detached; allow time for any output it might
+ # generate to arrive, so that output doesn't get confused with
+ # any expected debugger output from a subsequent testpoint.
+ #
+ exec sleep 1
+ send_gdb "delete breakpoints\n"
+ gdb_expect {
+ -re "Delete all breakpoints.*$" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "set follow parent, cleanup"}
+ timeout {fail "(timeout) set follow parent, cleanup"}
+ }
+ }
+ -re "$gdb_prompt $" {fail "set follow parent, cleanup"}
+ timeout {fail "(timeout) set follow parent, cleanup"}
+ }
+}
+
+proc do_fork_tests {} {
+ global gdb_prompt
+
+ # Verify that help is available for "set follow-fork-mode".
+ #
+ send_gdb "help set follow-fork-mode\n"
+ gdb_expect {
+ -re "Set debugger response to a program call of fork or vfork..*
+A fork or vfork creates a new process. follow-fork-mode can be:.*
+.*parent - the original process is debugged after a fork.*
+.*child - the new process is debugged after a fork.*
+.*ask - the debugger will ask for one of the above choices.*
+For \"parent\" or \"child\", the unfollowed process will run free..*
+By default, the debugger will follow the parent process..*$gdb_prompt $"\
+ { pass "help set follow" }
+ -re "$gdb_prompt $" { fail "help set follow" }
+ timeout { fail "(timeout) help set follow" }
+ }
+
+ # Verify that we can set follow-fork-mode, using an abbreviation
+ # for both the flag and its value.
+ #
+ send_gdb "set follow ch\n"
+ send_gdb "show fol\n"
+ gdb_expect {
+ -re "Debugger response to a program call of fork or vfork is \"child\".*$gdb_prompt $"\
+ {pass "set follow, using abbreviations"}
+ timeout {fail "(timeout) set follow, using abbreviations"}
+ }
+
+ # Verify that we cannot set follow-fork-mode to nonsense.
+ #
+ send_gdb "set follow chork\n"
+ gdb_expect {
+ -re "Undefined item: \"chork\".*$gdb_prompt $"\
+ {pass "set follow to nonsense is prohibited"}
+ -re "$gdb_prompt $" {fail "set follow to nonsense is prohibited"}
+ timeout {fail "(timeout) set follow to nonsense is prohibited"}
+ }
+ send_gdb "set follow parent\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "set follow to nonsense is prohibited (reset parent)"}
+ timeout {fail "set follow to nonsense is prohibited (reset parent)"}
+ }
+
+ # Test the default behaviour, which is to follow the parent of a
+ # fork, and detach from the child. Do this without catchpoints.
+ #
+ if [runto_main] then { default_fork_parent_follow }
+
+ # Test the ability to explicitly follow the parent of a fork, and
+ # detach from the child. Do this without catchpoints.
+ #
+ if [runto_main] then { explicit_fork_parent_follow }
+
+ # Test the ability to follow the child of a fork, and detach from
+ # the parent. Do this without catchpoints.
+ #
+ if [runto_main] then { explicit_fork_child_follow }
+
+ # Test the ability to follow both child and parent of a fork. Do
+ # this without catchpoints.
+ # ??rehrauer: NYI. Will add testpoints here when implemented.
+ #
+
+ # Test the ability to have the debugger ask the user at fork-time
+ # whether to follow the parent, child or both. Do this without
+ # catchpoints.
+ # ??rehrauer: NYI. Will add testpoints here when implemented.
+ #
+
+ # Test the ability to catch a fork, specify that the child be
+ # followed, and continue. Make the catchpoint permanent.
+ #
+ if [runto_main] then { catch_fork_child_follow }
+
+ # Test the ability to catch a fork, specify via a -do clause that
+ # the parent be followed, and continue. Make the catchpoint temporary.
+ #
+ if [runto_main] then { tcatch_fork_parent_follow }
+}
+
+# Start with a fresh gdb
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+# This is a test of gdb's ability to follow the parent, child or both
+# parent and child of a Unix fork() system call.
+#
+do_fork_tests
+
+return 0
diff --git a/gdb/testsuite/gdb.base/foll-vfork.c b/gdb/testsuite/gdb.base/foll-vfork.c
new file mode 100644
index 00000000000..3c7fab573fa
--- /dev/null
+++ b/gdb/testsuite/gdb.base/foll-vfork.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+#include <unistd.h>
+
+#ifdef PROTOTYPES
+int main (void)
+#else
+main ()
+#endif
+{
+ int pid;
+
+ pid = vfork ();
+ if (pid == 0) {
+ printf ("I'm the child!\n");
+ execlp ("gdb.base/vforked-prog", "gdb.base/vforked-prog", (char *)0);
+ }
+ else {
+ printf ("I'm the proud parent of child #%d!\n", pid);
+ }
+}
diff --git a/gdb/testsuite/gdb.base/foll-vfork.exp b/gdb/testsuite/gdb.base/foll-vfork.exp
new file mode 100644
index 00000000000..1fed06bb966
--- /dev/null
+++ b/gdb/testsuite/gdb.base/foll-vfork.exp
@@ -0,0 +1,369 @@
+# Copyright 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { ![isnative] } then {
+ continue
+}
+
+set prms_id 0
+set bug_id 0
+
+if [istarget "hppa2.0w-hp-hpux*"] {
+ warning "Don't run gdb.base/foll-vfork.exp until JAGaa43495 kernel problem is fixed."
+ return 0
+}
+
+set testfile "foll-vfork"
+set testfile2 "vforked-prog"
+set srcfile ${testfile}.c
+set srcfile2 ${testfile2}.c
+set binfile ${objdir}/${subdir}/${testfile}
+set binfile2 ${objdir}/${subdir}/${testfile2}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+# Until "set follow-fork-mode" and "catch vfork" are implemented on
+# other targets...
+#
+if ![istarget "hppa*-hp-hpux*"] then {
+ continue
+}
+
+# Test to see if we are on an HP-UX 10.20 and if so,
+# do not run these tests as catching vfork is disabled for
+# 10.20.
+
+if [istarget "hppa*-hp-hpux10.20"] then {
+ return 0
+}
+
+# A few of these tests require a little more time than the standard
+# timeout allows.
+set oldtimeout $timeout
+set timeout [expr "$timeout + 10"]
+
+proc vfork_parent_follow_through_step {} {
+ global gdb_prompt
+
+ send_gdb "set follow parent\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "set follow parent, vfork through step"}
+ timeout {fail "set follow parent, vfork through step"}
+ }
+ send_gdb "next\n"
+ gdb_expect {
+ -re "Detaching after fork from.*13.*$gdb_prompt "\
+ {pass "vfork parent follow, through step"}
+ -re "$gdb_prompt $" {fail "vfork parent follow, through step"}
+ timeout {fail "(timeout) vfork parent follow, through step" }
+ }
+ # The child has been detached; allow time for any output it might
+ # generate to arrive, so that output doesn't get confused with
+ # any gdb_expected debugger output from a subsequent testpoint.
+ #
+ exec sleep 1
+}
+
+proc vfork_parent_follow_to_bp {} {
+ global gdb_prompt
+
+ send_gdb "set follow parent\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "set follow parent, vfork to bp"}
+ timeout {fail "set follow parent, vfork to bp"}
+ }
+ send_gdb "break 18\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "break, vfork to bp"}
+ timeout {fail "break, vfork to bp"}
+ }
+ send_gdb "continue\n"
+ gdb_expect {
+ -re ".*Detaching after fork from process.*Breakpoint.*18.*$gdb_prompt "\
+ {pass "vfork parent follow, to bp"}
+ -re "$gdb_prompt $" {fail "vfork parent follow, to bp"}
+ timeout {fail "(timeout) vfork parent follow, to bp" }
+ }
+ # The child has been detached; allow time for any output it might
+ # generate to arrive, so that output doesn't get confused with
+ # any expected debugger output from a subsequent testpoint.
+ #
+ exec sleep 1
+}
+
+proc vfork_and_exec_child_follow_to_main_bp {} {
+ global gdb_prompt
+ global binfile
+
+ send_gdb "set follow child\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "set follow child, vfork and exec to main bp"}
+ timeout {fail "set follow child, vfork and exec to main bp"}
+ }
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Detaching from program.*Attaching after fork to.*Executing new program.*Breakpoint.*vforked-prog.c:9.*$gdb_prompt "\
+ {pass "vfork and exec child follow, to main bp"}
+ -re "$gdb_prompt $" {fail "vfork and exec child follow, to main bp"}
+ timeout {fail "(timeout) vfork and exec child follow, to main bp" }
+ }
+ # The parent has been detached; allow time for any output it might
+ # generate to arrive, so that output doesn't get confused with
+ # any gdb_expected debugger output from a subsequent testpoint.
+ #
+ exec sleep 1
+
+ # Explicitly kill this child, or a subsequent rerun actually runs
+ # the exec'd child, not the original program...
+ send_gdb "kill\n"
+ gdb_expect {
+ -re ".*Kill the program being debugged.*y or n. $" {
+ send_gdb "y\n"
+ send_gdb "file $binfile\n"
+ gdb_expect {
+ -re ".*Load new symbol table from.*y or n. $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "Reading symbols from.*$gdb_prompt $" {}
+ timeout { fail "loading symbols (timeout)"; return }
+ }
+ }
+ -re ".*gdb_prompt $" {}
+ timeout { fail "loading symbols (timeout)"; return }
+ }
+ }
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "killing inferior (timeout)" ; return }
+ }
+}
+
+proc vfork_and_exec_child_follow_through_step {} {
+ global gdb_prompt
+ global binfile
+
+# This test cannot be performed prior to HP-UX 10.30, because ptrace-based
+# debugging of a vforking program basically doesn't allow the child to do
+# things like hit a breakpoint between a vfork and exec. This means that
+# saying "set follow child; next" at a vfork() call won't work, because
+# the implementation of "next" sets a "step resume" breakpoint at the
+# return from the vfork(), which the child will hit on its way to exec'ing.
+#
+ if { ![istarget "hppa*-*-hpux11.*"] } {
+ verbose "vfork child-following next test ignored for non-hppa or pre-HP/UX-10.30 targets."
+ return 0
+ }
+
+ send_gdb "set follow child\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "set follow child, vfork and exec through step"}
+ timeout {fail "set follow child, vfork and exec through step"}
+ }
+ send_gdb "next\n"
+ gdb_expect {
+ -re "Detaching from program.*Attaching after fork to.*Executing new program.*Breakpoint.*vforked-prog.c:9.*$gdb_prompt "\
+ {pass "vfork and exec child follow, through step"}
+ -re "$gdb_prompt $" {fail "vfork and exec child follow, through step"}
+ timeout {fail "(timeout) vfork and exec child follow, through step" }
+ }
+ # The parent has been detached; allow time for any output it might
+ # generate to arrive, so that output doesn't get confused with
+ # any expected debugger output from a subsequent testpoint.
+ #
+ exec sleep 1
+
+ # Explicitly kill this child, or a subsequent rerun actually runs
+ # the exec'd child, not the original program...
+ send_gdb "kill\n"
+ gdb_expect {
+ -re ".*Kill the program being debugged.*y or n. $" {
+ send_gdb "y\n"
+ send_gdb "file $binfile\n"
+ gdb_expect {
+ -re ".*Load new symbol table from.*y or n. $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "Reading symbols from.*$gdb_prompt $" {}
+ timeout { fail "loading symbols (timeout)"; return }
+ }
+ }
+ -re ".*gdb_prompt $" {}
+ timeout { fail "loading symbols (timeout)"; return }
+ }
+ }
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "killing inferior (timeout)" ; return }
+ }
+}
+
+proc tcatch_vfork_then_parent_follow {} {
+ global gdb_prompt
+ global srcfile
+
+ send_gdb "set follow parent\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "set follow parent, tcatch vfork"}
+ timeout {fail "set follow parent, tcatch vfork"}
+ }
+ send_gdb "tcatch vfork\n"
+ gdb_expect {
+ -re "Catchpoint .*(vfork).*$gdb_prompt $"\
+ {pass "vfork parent follow, set tcatch vfork"}
+ -re "$gdb_prompt $" {fail "vfork parent follow, set tcatch vfork"}
+ timeout {fail "(timeout) vfork parent follow, set tcatch vfork"}
+ }
+ send_gdb "continue\n"
+# HP-UX 10.20 seems to stop you in "vfork", while more recent HP-UXs
+# stop you in "_vfork".
+ gdb_expect {
+ -re "0x\[0-9a-fA-F\]*.*vfork.*$gdb_prompt "\
+ {pass "vfork parent follow, tcatch vfork"}
+ -re "0x\[0-9a-fA-F\]*.*_vfork.*$gdb_prompt "\
+ {pass "vfork parent follow, tcatch vfork"}
+ -re "$gdb_prompt $" {fail "vfork parent follow, tcatch vfork"}
+ timeout {fail "(timeout) vfork parent follow, tcatch vfork"}
+ }
+ send_gdb "finish\n"
+ gdb_expect {
+ -re "Run till exit from.*vfork.*0x\[0-9a-fA-F\]* in main .* at .*${srcfile}:12.*$gdb_prompt "\
+ {pass "vfork parent follow, finish after tcatch vfork"}
+ -re "$gdb_prompt $" {fail "vfork parent follow, finish after tcatch vfork"}
+ timeout {fail "(timeout) vfork parent follow, finish after tcatch vfork" }
+ }
+ # The child has been detached; allow time for any output it might
+ # generate to arrive, so that output doesn't get confused with
+ # any expected debugger output from a subsequent testpoint.
+ #
+ exec sleep 1
+}
+
+proc tcatch_vfork_then_child_follow {} {
+ global gdb_prompt
+ global srcfile2
+
+ send_gdb "set follow child\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "set follow child, tcatch vfork"}
+ timeout {fail "set follow child, tcatch vfork"}
+ }
+ send_gdb "tcatch vfork\n"
+ gdb_expect {
+ -re "Catchpoint .*(vfork).*$gdb_prompt $"\
+ {pass "vfork child follow, set tcatch vfork"}
+ -re "$gdb_prompt $" {fail "vfork child follow, set tcatch vfork"}
+ timeout {fail "(timeout) vfork child follow, set tcatch vfork"}
+ }
+ send_gdb "continue\n"
+# HP-UX 10.20 seems to stop you in "vfork", while more recent HP-UXs
+# stop you in "_vfork".
+ gdb_expect {
+ -re "0x\[0-9a-fA-F\]*.*vfork.*$gdb_prompt "\
+ {pass "vfork child follow, tcatch vfork"}
+ -re "0x\[0-9a-fA-F\]*.*_vfork.*$gdb_prompt "\
+ {pass "vfork child follow, tcatch vfork"}
+ -re "$gdb_prompt $" {fail "vfork child follow, tcatch vfork"}
+ timeout {fail "(timeout) vfork child follow, tcatch vfork"}
+ }
+ send_gdb "finish\n"
+ gdb_expect {
+ -re "Run till exit from.*vfork.*${srcfile2}:9.*$gdb_prompt "\
+ {pass "vfork child follow, finish after tcatch vfork"}
+ -re "$gdb_prompt $" {fail "vfork child follow, finish after tcatch vfork"}
+ timeout {fail "(timeout) vfork child follow, finish after tcatch vfork" }
+ }
+ # The parent has been detached; allow time for any output it might
+ # generate to arrive, so that output doesn't get confused with
+ # any expected debugger output from a subsequent testpoint.
+ #
+ exec sleep 1
+}
+
+proc do_vfork_and_exec_tests {} {
+ global gdb_prompt
+
+ # Try following the parent process by stepping through a call to
+ # vfork. Do this without catchpoints.
+ if [runto_main] then { vfork_parent_follow_through_step }
+
+ # Try following the parent process by setting a breakpoint on the
+ # other side of a vfork, and running to that point. Do this
+ # without catchpoints.
+ if [runto_main] then { vfork_parent_follow_to_bp }
+
+ # Try following the child process by just continuing through the
+ # vfork, and letting the parent's breakpoint on "main" be auto-
+ # magically reset in the child.
+ #
+ if [runto_main] then { vfork_and_exec_child_follow_to_main_bp }
+
+ # Try following the child process by stepping through a call to
+ # vfork. The child also executes an exec. Since the child cannot
+ # be debugged until after it has exec'd, and since there's a bp on
+ # "main" in the parent, and since the bp's for the parent are
+ # recomputed in the exec'd child, the step through a vfork should
+ # land us in the "main" for the exec'd child, too.
+ #
+ if [runto_main] then { vfork_and_exec_child_follow_through_step }
+
+ # Try catching a vfork, and stepping out to the parent.
+ #
+ if [runto_main] then { tcatch_vfork_then_parent_follow }
+
+ # Try catching a vfork, and stepping out to the child.
+ #
+ if [runto_main] then { tcatch_vfork_then_child_follow }
+
+ # Test the ability to follow both child and parent of a vfork. Do
+ # this without catchpoints.
+ # ??rehrauer: NYI. Will add testpoints here when implemented.
+ #
+
+ # Test the ability to have the debugger ask the user at vfork-time
+ # whether to follow the parent, child or both. Do this without
+ # catchpoints.
+ # ??rehrauer: NYI. Will add testpoints here when implemented.
+ #
+}
+
+# Start with a fresh gdb
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+# This is a test of gdb's ability to follow the parent or child
+# of a Unix vfork() system call. (The child will subsequently
+# call a variant of a Unix exec() system call.)
+#
+do_vfork_and_exec_tests
+
+set timeout $oldtimeout
+return 0
diff --git a/gdb/testsuite/gdb.base/foo.c b/gdb/testsuite/gdb.base/foo.c
new file mode 100644
index 00000000000..2553607d5ec
--- /dev/null
+++ b/gdb/testsuite/gdb.base/foo.c
@@ -0,0 +1,9 @@
+static int foox = 'f' + 'o' + 'o';
+
+int foo (int x)
+{
+ if (x)
+ return foox;
+ else
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/funcargs.c b/gdb/testsuite/gdb.base/funcargs.c
new file mode 100644
index 00000000000..f7dfc649676
--- /dev/null
+++ b/gdb/testsuite/gdb.base/funcargs.c
@@ -0,0 +1,792 @@
+/* Test passing of arguments to functions. Use various sorts of arguments,
+ including basic types, pointers to those types, structures, lots of
+ args, etc, in various combinations. */
+
+/* AIX requires this to be the first thing in the file. */
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_STACK_ALLOCA 1
+#else /* not __GNUC__ */
+# ifdef _AIX
+ #pragma alloca
+# define HAVE_STACK_ALLOCA 1
+# else /* Not AIX */
+# ifdef sparc
+# include <alloca.h>
+# define HAVE_STACK_ALLOCA 1
+# ifdef __STDC__
+ void *alloca ();
+# else
+ char *alloca ();
+# endif /* __STDC__ */
+# endif /* sparc */
+# endif /* Not AIX */
+#endif /* not __GNUC__ */
+
+char c = 'a';
+char *cp = &c;
+
+unsigned char uc = 'b';
+unsigned char *ucp = &uc;
+
+short s = 1;
+short *sp = &s;
+
+unsigned short us = 6;
+unsigned short *usp = &us;
+
+int i = 2;
+int *ip = &i;
+
+unsigned int ui = 7;
+unsigned int *uip = &ui;
+
+long l = 3;
+long *lp = &l;
+
+unsigned long ul = 8;
+unsigned long *ulp = &ul;
+
+float f = 4.0;
+float *fp = &f;
+
+double d = 5.0;
+double *dp = &d;
+
+struct stag {
+ int s1;
+ int s2;
+} st = { 101, 102 };
+struct stag *stp = &st;
+
+union utag {
+ int u1;
+ long u2;
+} un;
+union utag *unp = &un;
+
+char carray[] = {'a', 'n', ' ', 'a', 'r', 'r', 'a', 'y', '\0'};
+
+
+/* Test various permutations and interleaving of integral arguments */
+
+
+#ifdef PROTOTYPES
+void call0a (char c, short s, int i, long l)
+#else
+call0a (c, s, i, l)
+char c; short s; int i; long l;
+#endif
+{
+ c = 'a';
+ s = 5;
+ i = 6;
+ l = 7;
+}
+
+#ifdef PROTOTYPES
+void call0b (short s, int i, long l, char c)
+#else
+call0b (s, i, l, c)
+short s; int i; long l; char c;
+#endif
+{
+ s = 6; i = 7; l = 8; c = 'j';
+}
+
+#ifdef PROTOTYPES
+void call0c (int i, long l, char c, short s)
+#else
+call0c (i, l, c, s)
+int i; long l; char c; short s;
+#endif
+{
+ i = 3; l = 4; c = 'k'; s = 5;
+}
+
+#ifdef PROTOTYPES
+void call0d (long l, char c, short s, int i)
+#else
+call0d (l, c, s, i)
+long l; char c; short s; int i;
+#endif
+{
+ l = 7; c = 'z'; s = 8; i = 9;
+}
+
+#ifdef PROTOTYPES
+void call0e (char c1, long l, char c2, int i, char c3, short s, char c4, char c5)
+#else
+call0e (c1, l, c2, i, c3, s, c4, c5)
+char c1; long l; char c2; int i; char c3; short s; char c4; char c5;
+#endif
+{
+ c1 = 'a'; l = 5; c2 = 'b'; i = 7; c3 = 'c'; s = 7; c4 = 'f'; c5 = 'g';
+}
+
+
+/* Test various permutations and interleaving of unsigned integral arguments */
+
+
+#ifdef PROTOTYPES
+void call1a (unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
+#else
+call1a (uc, us, ui, ul)
+unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
+#endif
+{
+ uc = 5; us = 6; ui = 7; ul = 8;
+}
+
+#ifdef PROTOTYPES
+void call1b (unsigned short us, unsigned int ui, unsigned long ul, unsigned char uc)
+#else
+call1b (us, ui, ul, uc)
+unsigned short us; unsigned int ui; unsigned long ul; unsigned char uc;
+#endif
+{
+ uc = 5; us = 6; ui = 7; ul = 8;
+}
+
+#ifdef PROTOTYPES
+void call1c (unsigned int ui, unsigned long ul, unsigned char uc, unsigned short us)
+#else
+call1c (ui, ul, uc, us)
+unsigned int ui; unsigned long ul; unsigned char uc; unsigned short us;
+#endif
+{
+ uc = 5; us = 6; ui = 7; ul = 8;
+}
+
+#ifdef PROTOTYPES
+void call1d (unsigned long ul, unsigned char uc, unsigned short us, unsigned int ui)
+#else
+call1d (ul, uc, us, ui)
+unsigned long ul; unsigned char uc; unsigned short us; unsigned int ui;
+#endif
+{
+ uc = 5; us = 6; ui = 7; ul = 8;
+}
+
+#ifdef PROTOTYPES
+void call1e (unsigned char uc1, unsigned long ul, unsigned char uc2, unsigned int ui, unsigned char uc3, unsigned short us, unsigned char uc4, unsigned char uc5)
+#else
+call1e (uc1, ul, uc2, ui, uc3, us, uc4, uc5)
+unsigned char uc1; unsigned long ul; unsigned char uc2; unsigned int ui;
+unsigned char uc3; unsigned short us; unsigned char uc4; unsigned char uc5;
+#endif
+{
+ uc1 = 5; ul = 7; uc2 = 8; ui = 9; uc3 = 10; us = 11; uc4 = 12; uc5 = 55;
+}
+
+/* Test various permutations and interleaving of integral arguments with
+ floating point arguments. */
+
+
+#ifdef PROTOTYPES
+void call2a (char c, float f1, short s, double d1, int i, float f2, long l, double d2)
+#else
+call2a (c, f1, s, d1, i, f2, l, d2)
+char c; float f1; short s; double d1; int i; float f2; long l; double d2;
+#endif
+{
+ c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
+}
+
+#ifdef PROTOTYPES
+void call2b (float f1, short s, double d1, int i, float f2, long l, double d2, char c)
+#else
+call2b (f1, s, d1, i, f2, l, d2, c)
+float f1; short s; double d1; int i; float f2; long l; double d2; char c;
+#endif
+{
+ c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
+}
+
+#ifdef PROTOTYPES
+void call2c (short s, double d1, int i, float f2, long l, double d2, char c, float f1)
+#else
+call2c (s, d1, i, f2, l, d2, c, f1)
+short s; double d1; int i; float f2; long l; double d2; char c; float f1;
+#endif
+{
+ c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
+}
+
+#ifdef PROTOTYPES
+void call2d (double d1, int i, float f2, long l, double d2, char c, float f1, short s)
+#else
+call2d (d1, i, f2, l, d2, c, f1, s)
+double d1; int i; float f2; long l; double d2; char c; float f1; short s;
+#endif
+{
+ c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
+}
+
+#ifdef PROTOTYPES
+void call2e (int i, float f2, long l, double d2, char c, float f1, short s, double d1)
+#else
+call2e (i, f2, l, d2, c, f1, s, d1)
+int i; float f2; long l; double d2; char c; float f1; short s; double d1;
+#endif
+{
+ c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
+}
+
+#ifdef PROTOTYPES
+void call2f (float f2, long l, double d2, char c, float f1, short s, double d1, int i)
+#else
+call2f (f2, l, d2, c, f1, s, d1, i)
+float f2; long l; double d2; char c; float f1; short s; double d1; int i;
+#endif
+{
+ c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
+}
+
+#ifdef PROTOTYPES
+void call2g (long l, double d2, char c, float f1, short s, double d1, int i, float f2)
+#else
+call2g (l, d2, c, f1, s, d1, i, f2)
+long l; double d2; char c; float f1; short s; double d1; int i; float f2;
+#endif
+{
+ c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
+}
+
+#ifdef PROTOTYPES
+void call2h (double d2, char c, float f1, short s, double d1, int i, float f2, long l)
+#else
+call2h (d2, c, f1, s, d1, i, f2, l)
+double d2; char c; float f1; short s; double d1; int i; float f2; long l;
+#endif
+{
+ c = 'a'; f1 = 0.0; s = 5; d1 = 0.0; i = 6; f2 = 0.1; l = 7; d2 = 0.2;
+}
+
+#ifdef PROTOTYPES
+void call2i (char c1, float f1, char c2, char c3, double d1, char c4, char c5, char c6, float f2, short s, char c7, double d2)
+#else
+call2i (c1, f1, c2, c3, d1, c4, c5, c6, f2, s, c7, d2)
+char c1; float f1; char c2; char c3; double d1; char c4; char c5; char c6;
+float f2; short s; char c7; double d2;
+#endif
+{
+ c1 = 'a'; f1 = 0.0; c2 = 5; d1 = 0.0; c3 = 6; f2 = 0.1; c4 = 7; d2 = 0.2;
+ c5 = 's'; c6 = 'f'; c7 = 'z'; s = 77;
+}
+
+
+/* Test pointers to various integral and floating types. */
+
+
+#ifdef PROTOTYPES
+void call3a (char *cp, short *sp, int *ip, long *lp)
+#else
+call3a (cp, sp, ip, lp)
+char *cp; short *sp; int *ip; long *lp;
+#endif
+{
+ cp = 0; sp = 0; ip = 0; lp = 0;
+}
+
+#ifdef PROTOTYPES
+void call3b (unsigned char *ucp, unsigned short *usp, unsigned int *uip, unsigned long *ulp)
+#else
+call3b (ucp, usp, uip, ulp)
+unsigned char *ucp; unsigned short *usp; unsigned int *uip;
+unsigned long *ulp;
+#endif
+{
+ ucp = 0; usp = 0; uip = 0; ulp = 0;
+}
+
+#ifdef PROTOTYPES
+void call3c (float *fp, double *dp)
+#else
+call3c (fp, dp)
+float *fp; double *dp;
+#endif
+{
+ fp = 0; dp = 0;
+}
+
+
+/* Test passing structures and unions by reference. */
+
+
+#ifdef PROTOTYPES
+void call4a (struct stag *stp)
+#else
+call4a (stp)
+struct stag *stp;
+#endif
+{stp = 0;}
+
+#ifdef PROTOTYPES
+void call4b (union utag *unp)
+#else
+call4b (unp)
+union utag *unp;
+#endif
+{
+ unp = 0;
+}
+
+
+/* Test passing structures and unions by value. */
+
+
+#ifdef PROTOTYPES
+void call5a (struct stag st)
+#else
+call5a (st)
+struct stag st;
+#endif
+{st.s1 = 5;}
+
+#ifdef PROTOTYPES
+void call5b (union utag un)
+#else
+call5b (un)
+union utag un;
+#endif
+{un.u1 = 7;}
+
+
+/* Test shuffling of args */
+
+
+void call6k ()
+{
+}
+
+#ifdef PROTOTYPES
+void call6j (unsigned long ul)
+#else
+call6j (ul)
+unsigned long ul;
+#endif
+{
+ ul = ul;
+ call6k ();
+}
+
+#ifdef PROTOTYPES
+void call6i (unsigned int ui, unsigned long ul)
+#else
+call6i (ui, ul)
+unsigned int ui; unsigned long ul;
+#endif
+{
+ ui = ui;
+ call6j (ul);
+}
+
+#ifdef PROTOTYPES
+void call6h (unsigned short us, unsigned int ui, unsigned long ul)
+#else
+call6h (us, ui, ul)
+unsigned short us; unsigned int ui; unsigned long ul;
+#endif
+{
+ us = us;
+ call6i (ui, ul);
+}
+
+#ifdef PROTOTYPES
+void call6g (unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
+#else
+call6g (uc, us, ui, ul)
+unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
+#endif
+{
+ uc = uc;
+ call6h (us, ui, ul);
+}
+
+#ifdef PROTOTYPES
+void call6f (double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
+#else
+call6f (d, uc, us, ui, ul)
+double d;
+unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
+#endif
+{
+ d = d;
+ call6g (uc, us, ui, ul);
+}
+
+#ifdef PROTOTYPES
+void call6e (float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
+#else
+call6e (f, d, uc, us, ui, ul)
+float f; double d;
+unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
+#endif
+{
+ f = f;
+ call6f (d, uc, us, ui, ul);
+}
+
+#ifdef PROTOTYPES
+void call6d (long l, float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
+#else
+call6d (l, f, d, uc, us, ui, ul)
+long l; float f; double d;
+unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
+#endif
+{
+ l = l;
+ call6e (f, d, uc, us, ui, ul);
+}
+
+#ifdef PROTOTYPES
+void call6c (int i, long l, float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
+#else
+call6c (i, l, f, d, uc, us, ui, ul)
+int i; long l; float f; double d;
+unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
+#endif
+{
+ i = i;
+ call6d (l, f, d, uc, us, ui, ul);
+}
+
+#ifdef PROTOTYPES
+void call6b (short s, int i, long l, float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
+#else
+call6b (s, i, l, f, d, uc, us, ui, ul)
+short s; int i; long l; float f; double d;
+unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
+#endif
+{
+ s = s;
+ call6c (i, l, f, d, uc, us, ui, ul);
+}
+
+#ifdef PROTOTYPES
+void call6a (char c, short s, int i, long l, float f, double d, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
+#else
+call6a (c, s, i, l, f, d, uc, us, ui, ul)
+char c; short s; int i; long l; float f; double d;
+unsigned char uc; unsigned short us; unsigned int ui; unsigned long ul;
+#endif
+{
+ c = c;
+ call6b (s, i, l, f, d, uc, us, ui, ul);
+}
+
+/* Test shuffling of args, round robin */
+
+
+#ifdef PROTOTYPES
+void call7k (char c, int i, short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui)
+#else
+call7k (c, i, s, l, f, uc, d, us, ul, ui)
+char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui;
+#endif
+{
+ c = 'a'; i = 7; s = 8; l = 7; f = 0.3; uc = 44; d = 0.44; us = 77;
+ ul = 43; ui = 33;
+}
+
+#ifdef PROTOTYPES
+void call7j (unsigned int ui, char c, int i, short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul)
+#else
+call7j (ui, c, i, s, l, f, uc, d, us, ul)
+unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul;
+#endif
+{
+ call7k (c, i, s, l, f, uc, d, us, ul, ui);
+}
+
+#ifdef PROTOTYPES
+void call7i (unsigned long ul, unsigned int ui, char c, int i, short s, long l, float f, unsigned char uc, double d, unsigned short us)
+#else
+call7i (ul, ui, c, i, s, l, f, uc, d, us)
+unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us;
+#endif
+{
+ call7j (ui, c, i, s, l, f, uc, d, us, ul);
+}
+
+#ifdef PROTOTYPES
+void call7h (unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s, long l, float f, unsigned char uc, double d)
+#else
+call7h (us, ul, ui, c, i, s, l, f, uc, d)
+unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc; double d;
+#endif
+{
+ call7i (ul, ui, c, i, s, l, f, uc, d, us);
+}
+
+#ifdef PROTOTYPES
+void call7g (double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s, long l, float f, unsigned char uc)
+#else
+call7g (d, us, ul, ui, c, i, s, l, f, uc)
+double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f; unsigned char uc;
+#endif
+{
+ call7h (us, ul, ui, c, i, s, l, f, uc, d);
+}
+
+#ifdef PROTOTYPES
+void call7f (unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s, long l, float f)
+#else
+call7f (uc, d, us, ul, ui, c, i, s, l, f)
+unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l; float f;
+#endif
+{
+ call7g (d, us, ul, ui, c, i, s, l, f, uc);
+}
+
+#ifdef PROTOTYPES
+void call7e (float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s, long l)
+#else
+call7e (f, uc, d, us, ul, ui, c, i, s, l)
+float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s; long l;
+#endif
+{
+ call7f (uc, d, us, ul, ui, c, i, s, l, f);
+}
+
+#ifdef PROTOTYPES
+void call7d (long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i, short s)
+#else
+call7d (l, f, uc, d, us, ul, ui, c, i, s)
+long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i; short s;
+#endif
+{
+ call7e (f, uc, d, us, ul, ui, c, i, s, l);
+}
+
+#ifdef PROTOTYPES
+void call7c (short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c, int i)
+#else
+call7c (s, l, f, uc, d, us, ul, ui, c, i)
+short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c; int i;
+#endif
+{
+ call7d (l, f, uc, d, us, ul, ui, c, i, s);
+}
+
+#ifdef PROTOTYPES
+void call7b (int i, short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui, char c)
+#else
+call7b (i, s, l, f, uc, d, us, ul, ui, c)
+int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui; char c;
+#endif
+{
+ call7c (s, l, f, uc, d, us, ul, ui, c, i);
+}
+
+#ifdef PROTOTYPES
+void call7a (char c, int i, short s, long l, float f, unsigned char uc, double d, unsigned short us, unsigned long ul, unsigned int ui)
+#else
+call7a (c, i, s, l, f, uc, d, us, ul, ui)
+char c; int i; short s; long l; float f; unsigned char uc; double d; unsigned short us; unsigned long ul; unsigned int ui;
+#endif
+{
+ call7b (i, s, l, f, uc, d, us, ul, ui, c);
+}
+
+
+/* Test printing of structures passed as arguments to recursive functions. */
+
+
+typedef struct s
+{
+ short s;
+ int i;
+ long l;
+} SVAL;
+
+void hitbottom ()
+{
+}
+
+#ifdef PROTOTYPES
+void recurse (SVAL a, int depth)
+#else
+void recurse (a, depth)
+SVAL a;
+int depth;
+#endif
+{
+ a.s = a.i = a.l = --depth;
+ if (depth == 0)
+ hitbottom ();
+ else
+ recurse (a, depth);
+}
+
+void test_struct_args ()
+{
+ SVAL s; s.s = 5; s.i = 5; s.l = 5;
+
+ recurse (s, 5);
+}
+
+/* On various machines (pa, 29k, and rs/6000, at least), a function which
+ calls alloca may do things differently with respect to frames. So give
+ it a try. */
+
+#ifdef PROTOTYPES
+void localvars_after_alloca (char c, short s, int i, long l)
+#else
+void
+localvars_after_alloca (c, s, i, l)
+ char c;
+ short s;
+ int i;
+ long l;
+#endif
+{
+#ifdef HAVE_STACK_ALLOCA
+ /* No need to use the alloca.c alloca-on-top-of-malloc; it doesn't
+ test what we are looking for, so if we don't have an alloca which
+ allocates on the stack, just don't bother to call alloca at all. */
+
+ char *z = alloca (s + 50);
+#endif
+ c = 'a';
+ s = 5;
+ i = 6;
+ l = 7;
+}
+
+#ifdef PROTOTYPES
+void call_after_alloca_subr (char c, short s, int i, long l, unsigned char uc, unsigned short us, unsigned int ui, unsigned long ul)
+#else
+void
+call_after_alloca_subr (c, s, i, l, uc, us, ui, ul)
+char c; int i; short s; long l; unsigned char uc; unsigned short us; unsigned long ul; unsigned int ui;
+#endif
+{
+ c = 'a';
+ i = 7; s = 8; l = 7; uc = 44; us = 77;
+ ul = 43; ui = 33;
+}
+
+#ifdef PROTOTYPES
+void call_after_alloca (char c, short s, int i, long l)
+#else
+void
+call_after_alloca (c, s, i, l)
+ char c;
+ short s;
+ int i;
+ long l;
+#endif
+{
+#ifdef HAVE_STACK_ALLOCA
+ /* No need to use the alloca.c alloca-on-top-of-malloc; it doesn't
+ test what we are looking for, so if we don't have an alloca which
+ allocates on the stack, just don't bother to call alloca at all. */
+
+ char *z = alloca (s + 50);
+#endif
+ call_after_alloca_subr (c, s, i, l, 'b', 11, 12, (unsigned long)13);
+}
+
+
+
+/* The point behind this test is the PA will call this indirectly
+ through dyncall. Unlike the indirect calls to call0a, this test
+ will require a trampoline between dyncall and this function on the
+ call path, then another trampoline on between this function and main
+ on the return path. */
+#ifdef PROTOTYPES
+double call_with_trampolines (double d1)
+#else
+double
+call_with_trampolines (d1)
+double d1;
+#endif
+{
+ return d1;
+} /* End of call_with_trampolines, this comment is needed by funcargs.exp */
+
+/* Dummy functions which the testsuite can use to run to, etc. */
+
+void
+marker_indirect_call () {}
+
+void
+marker_call_with_trampolines () {}
+
+int main ()
+{
+ void (*pointer_to_call0a) (char, short, int, long) = (void (*)(char, short, int, long))call0a;
+ double (*pointer_to_call_with_trampolines) (double) = call_with_trampolines;
+
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ /* Test calling with basic integer types */
+ call0a (c, s, i, l);
+ call0b (s, i, l, c);
+ call0c (i, l, c, s);
+ call0d (l, c, s, i);
+ call0e (c, l, c, i, c, s, c, c);
+
+ /* Test calling with unsigned integer types */
+ call1a (uc, us, ui, ul);
+ call1b (us, ui, ul, uc);
+ call1c (ui, ul, uc, us);
+ call1d (ul, uc, us, ui);
+ call1e (uc, ul, uc, ui, uc, us, uc, uc);
+
+ /* Test calling with integral types mixed with floating point types */
+ call2a (c, f, s, d, i, f, l, d);
+ call2b (f, s, d, i, f, l, d, c);
+ call2c (s, d, i, f, l, d, c, f);
+ call2d (d, i, f, l, d, c, f, s);
+ call2e (i, f, l, d, c, f, s, d);
+ call2f (f, l, d, c, f, s, d, i);
+ call2g (l, d, c, f, s, d, i, f);
+ call2h (d, c, f, s, d, i, f, l);
+ call2i (c, f, c, c, d, c, c, c, f, s, c, d);
+
+ /* Test dereferencing pointers to various integral and floating types */
+
+ call3a (cp, sp, ip, lp);
+ call3b (ucp, usp, uip, ulp);
+ call3c (fp, dp);
+
+ /* Test dereferencing pointers to structs and unions */
+
+ call4a (stp);
+ un.u1 = 1;
+ call4b (unp);
+
+ /* Test calling with structures and unions. */
+
+ call5a (st);
+ un.u1 = 2;
+ call5b (un);
+
+ /* Test shuffling of args */
+
+ call6a (c, s, i, l, f, d, uc, us, ui, ul);
+ call7a (c, i, s, l, f, uc, d, us, ul, ui);
+
+ /* Test passing structures recursively. */
+
+ test_struct_args ();
+
+ localvars_after_alloca (c, s, i, l);
+
+ call_after_alloca (c, s, i, l);
+
+ /* This is for localvars_in_indirect_call. */
+ marker_indirect_call ();
+ /* The comment on the following two lines is used by funcargs.exp,
+ don't change it. */
+ (*pointer_to_call0a) (c, s, i, l); /* First step into call0a. */
+ (*pointer_to_call0a) (c, s, i, l); /* Second step into call0a. */
+ marker_call_with_trampolines ();
+ (*pointer_to_call_with_trampolines) (d); /* Test multiple trampolines. */
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/funcargs.exp b/gdb/testsuite/gdb.base/funcargs.exp
new file mode 100644
index 00000000000..2ed154a007b
--- /dev/null
+++ b/gdb/testsuite/gdb.base/funcargs.exp
@@ -0,0 +1,1262 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "funcargs"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+#
+# Locate actual args; integral types.
+#
+
+proc integral_args {} {
+ global gdb_prompt
+ global det_file
+ global gcc_compiled
+
+ delete_breakpoints
+
+ gdb_breakpoint call0a
+ gdb_breakpoint call0b
+ gdb_breakpoint call0c
+ gdb_breakpoint call0d
+ gdb_breakpoint call0e
+
+ # Run; should stop at call0a and print actual arguments.
+ if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ gdb_run_cmd
+ gdb_expect {
+ -re ".* call0a \\(c=97 'a', s=1, i=2, l=3\\) .*$gdb_prompt $" {
+ pass "run to call0a"
+ }
+ -re "$gdb_prompt $" { fail "run to call0a" ; gdb_suppress_tests }
+ timeout { fail "(timeout) run to call0a" ; gdb_suppress_tests }
+ }
+
+ # 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'" "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"] {
+ gdb_suppress_tests;
+ }
+
+ # 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"] {
+ gdb_suppress_tests;
+ }
+
+ # 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";] {
+ gdb_suppress_tests;
+ }
+
+ # 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" ] {
+ gdb_suppress_tests;
+ }
+ gdb_stop_suppressing_tests;
+}
+
+#
+# Locate actual args; unsigned integral types.
+#
+
+proc unsigned_integral_args {} {
+ global gdb_prompt
+ global det_file
+ global gcc_compiled
+
+ delete_breakpoints
+
+ gdb_breakpoint call1a;
+ gdb_breakpoint call1b;
+ gdb_breakpoint call1c;
+ gdb_breakpoint call1d;
+ gdb_breakpoint call1e;
+
+ # Run; should stop at call1a and print actual arguments.
+ if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ gdb_run_cmd
+ gdb_expect {
+ -re ".* call1a \\(uc=98 'b', us=6, ui=7, ul=8\\) .*$gdb_prompt $" {
+ pass "run to call1a"
+ }
+ -re "$gdb_prompt $" { fail "run to call1a" ; gdb_suppress_tests; }
+ timeout { fail "(timeout) run to call1a" ; gdb_suppress_tests; }
+ }
+
+ # Print each arg as a double check to see if we can print
+ # them here as well as with backtrace.
+ gdb_test "print uc" ".* = 98 'b'"
+ gdb_test "print us" ".* = 6"
+ gdb_test "print ui" ".* = 7"
+ 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"] {
+ gdb_suppress_tests;
+ }
+
+ # 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"] {
+ gdb_suppress_tests;
+ }
+
+ # 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"] {
+ gdb_suppress_tests;
+ }
+
+ # 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"] {
+ gdb_suppress_tests;
+ }
+ gdb_stop_suppressing_tests;
+}
+
+#
+# Locate actual args; integrals mixed with floating point.
+#
+
+proc float_and_integral_args {} {
+ global gdb_prompt
+ global det_file
+ global gcc_compiled
+ global hp_cc_compiler
+
+ delete_breakpoints
+
+ gdb_breakpoint call2a
+ gdb_breakpoint call2b
+ gdb_breakpoint call2c
+ gdb_breakpoint call2d
+ gdb_breakpoint call2e
+ gdb_breakpoint call2f
+ gdb_breakpoint call2g
+ gdb_breakpoint call2h
+
+ # Run; should stop at call2a and print actual arguments.
+
+ setup_xfail "i960-*-*" 1813
+ if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
+ # The debug info. for "f" is not correct. It's a known bug.
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ gdb_run_cmd
+ gdb_expect {
+ -re ".* call2a \\(c=97 'a', f1=4, s=1, d1=5, i=2, f2=4, l=3, d2=5\\) .*$gdb_prompt $" { pass "run to call2a" }
+ -re ".* call2a \\(c=97 'a', f1=.*, s=1, d1=5, i=2, f2=4, l=3, d2=5\\) .*$gdb_prompt $" { xfail "run to call2a" }
+ -re "$gdb_prompt $" { fail "run to call2a" ; gdb_suppress_tests; }
+ timeout { fail "(timeout) run to call2a" ; gdb_suppress_tests; }
+ }
+
+ # Print each arg as a double check to see if we can print
+ gdb_test "print c" ".* = 97 'a'" "print c after run to call2a"
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ gdb_test "print f1" ".* = 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"
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ 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-*-*"
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
+ # 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"] {
+ gdb_suppress_tests;
+ }
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ # 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"] {
+ gdb_suppress_tests;
+ }
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ # 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"] {
+ gdb_suppress_tests;
+ }
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ # 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"] {
+ gdb_suppress_tests;
+ }
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ # 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"] {
+ gdb_suppress_tests;
+ }
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ # 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"] {
+ gdb_suppress_tests;
+ }
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ # 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"] {
+ gdb_suppress_tests;
+ }
+
+ # monitor only allows 8 breakpoints; w89k board allows 10, so
+ # break them up into two groups.
+ delete_breakpoints
+ gdb_breakpoint call2i
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ # 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"] {
+ gdb_suppress_tests;
+ }
+ gdb_stop_suppressing_tests;
+}
+
+#
+# Locate actual args; dereference pointers to ints and floats.
+#
+
+proc pointer_args {} {
+ global gdb_prompt
+ global hex
+ global det_file
+
+ delete_breakpoints
+
+ gdb_breakpoint call3a
+ gdb_breakpoint call3b
+ gdb_breakpoint call3c
+
+ # Run; should stop at call3a and print actual arguments.
+ # Try dereferencing the arguments.
+
+ gdb_run_cmd
+ gdb_expect {
+ -re ".* call3a \\(cp=$hex \"a.*\", sp=$hex, ip=$hex, lp=$hex\\) .*$gdb_prompt $" { pass "run to call3a" }
+ -re "$gdb_prompt $" { fail "run to call3a" ; gdb_suppress_tests; }
+ timeout { fail "(timeout) run to call3a" ; gdb_suppress_tests; }
+ }
+
+ gdb_test "print *cp" ".* = 97 'a'"
+ gdb_test "print *sp" ".* = 1"
+ gdb_test "print *ip" ".* = 2"
+ gdb_test "print *lp" ".* = 3"
+
+ # 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"] {
+ gdb_suppress_tests;
+ }
+
+ gdb_test "print *ucp" ".* = 98 'b'"
+ gdb_test "print *usp" ".* = 6"
+ gdb_test "print *uip" ".* = 7"
+ gdb_test "print *ulp" ".* = 8"
+
+ # 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"] {
+ gdb_suppress_tests;
+ }
+
+ gdb_test "print *fp" ".* = 4"
+ gdb_test "print *dp" ".* = 5"
+
+# pass "locate actual args, pointer types"
+ gdb_stop_suppressing_tests;
+}
+
+#
+# Locate actual args; structures and unions passed by reference.
+#
+
+proc structs_by_reference {} {
+ global gdb_prompt
+ global hex
+ global det_file
+ global target_sizeof_int
+ global target_sizeof_long
+ global target_bigendian_p
+
+ delete_breakpoints
+
+ gdb_breakpoint call4a
+ gdb_breakpoint call4b
+
+ # Run; should stop at call4a and print actual arguments.
+ # Try dereferencing the arguments.
+
+ gdb_run_cmd
+ gdb_expect {
+ -re ".* call4a \\(stp=$hex\\) .*$gdb_prompt $" {
+ pass "run to call4a"
+ }
+ -re "$gdb_prompt $" { fail "run to call4a" ; gdb_suppress_tests; }
+ timeout { fail "(timeout) run to call4a" ; gdb_suppress_tests; }
+ }
+
+ gdb_test "print *stp" ".* = \{s1 = 101, s2 = 102\}"
+
+ # Continue; should stop at call4b and print actual arguments.
+
+ gdb_test "cont" ".* call4b \\(unp=$hex\\) .*" "continue to call4b"
+
+ # Try dereferencing the arguments.
+ if { $target_sizeof_long == $target_sizeof_int } {
+ gdb_test "print *unp" ".* = \{u1 = 1, u2 = 1\}" \
+ "print *unp (sizeof long == sizeof int)"
+ } elseif { ! $target_bigendian_p } {
+ gdb_test "print *unp" ".* = \{u1 = 1, u2 = 1\}" \
+ "print *unp (little-endian, sizeof long != sizeof int)"
+ } elseif { $target_sizeof_long == 8 && $target_sizeof_int == 4 } {
+ gdb_test "print *unp" ".* = \{u1 = 1, u2 = 4294967296\}" \
+ "print *unp (big-endian, sizeof long == 8, sizeof int = 4)"
+ } elseif { $target_sizeof_long == 4 && $target_sizeof_int == 2 } {
+ gdb_test "print *unp" ".* = \{u1 = 1, u2 = 65536\}" \
+ "print *unp (big-endian, sizeof long == 4, sizeof int = 2)"
+ } else {
+ fail "print *unp (unknown case)"
+ }
+
+ pass "locate actual args, structs/unions passed by reference"
+ gdb_stop_suppressing_tests;
+}
+
+#
+# Locate actual args; structures and unions passed by value.
+#
+
+proc structs_by_value {} {
+ global gdb_prompt
+ global hex
+ global det_file
+ global target_sizeof_int
+ global target_sizeof_long
+ global target_bigendian_p
+
+ delete_breakpoints
+
+ gdb_breakpoint call5a
+ gdb_breakpoint call5b
+
+ # Run; should stop at call5a and print actual arguments.
+ # Try dereferencing the arguments.
+
+ gdb_run_cmd
+ gdb_expect {
+ -re ".* call5a \\(st=\{s1 = 101, s2 = 102\}\\) .*$gdb_prompt $" {
+ pass "run to call5a"
+ }
+ -re "$gdb_prompt $" { fail "run to call5a" ; gdb_suppress_tests; }
+ timeout { fail "(timeout) run to call5a" ; gdb_suppress_tests; }
+ }
+
+ gdb_test "print st" ".* = \{s1 = 101, s2 = 102\}"
+
+ # Continue; should stop at call5b and print actual arguments.
+ if { $target_sizeof_long == $target_sizeof_int } {
+ gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 2\}\\) .*" \
+ "continue to call5b (sizeof long == sizeof int)"
+ } elseif { ! $target_bigendian_p } {
+ gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 2\}\\) .*" \
+ "continue to call5b (little-endian, sizeof long != sizeof int)"
+ } elseif { $target_sizeof_long == 8 && $target_sizeof_int == 4 } {
+ gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 8589934592\}\\) .*" \
+ "continue to call5b (big-endian, sizeof long == 8, sizeof int = 4)"
+ } elseif { $target_sizeof_long == 4 && $target_sizeof_int == 2 } {
+ gdb_test "cont" ".* call5b \\(un=\{u1 = 2, u2 = 131072\}\\) .*" \
+ "continue to call5b (big-endian, sizeof long == 4, sizeof int = 2)"
+ } else {
+ fail "continue to call5b (unknown case)"
+ }
+
+ # Try dereferencing the arguments.
+ if { $target_sizeof_long == $target_sizeof_int } {
+ gdb_test "print un" ".* = \{u1 = 2, u2 = 2\}" \
+ "print un (sizeof long == sizeof int)"
+ } elseif { ! $target_bigendian_p } {
+ gdb_test "print un" ".* = \{u1 = 2, u2 = 2\}" \
+ "print un (little-endian, sizeof long != sizeof int)"
+ } elseif { $target_sizeof_long == 8 && $target_sizeof_int == 4 } {
+ gdb_test "print un" ".* = \{u1 = 2, u2 = 8589934592\}" \
+ "print un (big-endian, sizeof long == 8, sizeof int = 4)"
+ } elseif { $target_sizeof_long == 4 && $target_sizeof_int == 2 } {
+ gdb_test "print un" ".* = \{u1 = 2, u2 = 131072\}" \
+ "print un (big-endian, sizeof long == 4, sizeof int = 2)"
+ } else {
+ fail "print un (unknown case)"
+ }
+
+ gdb_stop_suppressing_tests;
+}
+
+#
+# Locate actual args; discard, shuffle, and call
+#
+
+proc discard_and_shuffle {} {
+ global gdb_prompt
+ global hex
+ global decimal
+ global det_file
+ global gcc_compiled
+ global hp_cc_compiler
+
+ delete_breakpoints
+
+ gdb_breakpoint call6a
+ gdb_breakpoint call6b
+ gdb_breakpoint call6c
+ gdb_breakpoint call6d
+ gdb_breakpoint call6e
+ gdb_breakpoint call6f
+ gdb_breakpoint call6g
+ gdb_breakpoint call6h
+
+ # Run; should stop at call6a and print actual arguments.
+ # Print backtrace.
+
+ gdb_run_cmd
+ gdb_expect {
+ -re ".*Breakpoint $decimal, call6a .*$gdb_prompt $" { pass "run to call6a" }
+ -re "$gdb_prompt $" { fail "run to call6a" ; gdb_suppress_tests; }
+ timeout { fail "(timeout) run to call6a" ; gdb_suppress_tests; }
+ }
+
+ setup_xfail "rs6000-*-*"
+
+ if {!$gcc_compiled} {
+ setup_xfail "mips-sgi-irix5*"
+ }
+
+ # The debug info. for "f" is not correct. It's a known bug.
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ send_gdb "backtrace 100\n"
+ gdb_expect {
+ -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
+$gdb_prompt $" {
+ pass "backtrace from call6a"
+ }
+ -re "backtrace 100\[\r\n\]+
+.* call6a \\(c=97 'a', s=1, i=2, l=3, f=.*, d=5, uc=98 'b', us=6, ui=7, ul=8\\) .*\r
+.* main \\(.*\\) .*\r
+$gdb_prompt $" {
+ xfail "backtrace from call6a"
+ }
+ -re "$gdb_prompt $" {
+ fail "backtrace from call6a"
+ gdb_suppress_tests
+ }
+ timeout {
+ fail "(timeout) backtrace from call6a"
+ gdb_suppress_tests
+ }
+ }
+
+ # Continue; should stop at call6b and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call6b
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ send_gdb "backtrace 100\n"
+ if [gdb_expect_list "backtrace from call6b" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#1 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#2 .* main \\(.*\\) "
+ } ] {
+ gdb_suppress_tests;
+ }
+
+ # Continue; should stop at call6c and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call6c
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ send_gdb "backtrace 100\n"
+ if [gdb_expect_list "backtrace from call6c" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#1 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#2 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#3 .* main \\(.*\\) "
+ } ] {
+ gdb_suppress_tests;
+ }
+ # Continue; should stop at call6d and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call6d
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ send_gdb "backtrace 100\n"
+ if [gdb_expect_list "backtrace from call6d" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#1 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#2 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#3 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#4 .* main \\(.*\\) "
+ } ] {
+ gdb_suppress_tests;
+ }
+
+ # Continue; should stop at call6e and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call6e
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ send_gdb "backtrace 100\n"
+ if [gdb_expect_list "backtrace from call6e" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#1 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#2 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#3 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#4 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#5 .* main \\(.*\\) "
+ } ] {
+ gdb_suppress_tests;
+ }
+
+ # Continue; should stop at call6f and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call6f
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ send_gdb "backtrace 100\n"
+ if [gdb_expect_list "backtrace from call6f" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#1 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#2 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#3 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#4 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#5 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#6 .* main \\(.*\\) "
+ } ] {
+ gdb_suppress_tests;
+ }
+
+ # Continue; should stop at call6g and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call6g
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ send_gdb "backtrace 100\n"
+ if [gdb_expect_list "backtrace from call6g" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#1 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#2 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#3 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#4 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#5 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#6 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#7 .* main \\(.*\\) "
+ } ] {
+ gdb_suppress_tests;
+ }
+
+ # Continue; should stop at call6h and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call6h
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ send_gdb "backtrace 100\n"
+ if [gdb_expect_list "backtrace from call6h" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call6h \\(us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#1 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#2 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#3 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#4 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#5 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#6 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#7 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#8 .* main \\(.*\\) "
+ } ] {
+ gdb_suppress_tests;
+ }
+
+ # monitor only allows 8 breakpoints; w89k board allows 10, so
+ # break them up into two groups.
+ delete_breakpoints
+ gdb_breakpoint call6i
+ gdb_breakpoint call6j
+ gdb_breakpoint call6k
+
+ # Continue; should stop at call6i and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call6i
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ send_gdb "backtrace 100\n"
+ if [gdb_expect_list "backtrace from call6i" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call6i \\(ui=7, ul=8\\) "
+ ".*\[\r\n\]#1 .* call6h \\(us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#2 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#3 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#4 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#5 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#6 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#7 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#8 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#9 .* main \\(.*\\) "
+ } ] {
+ gdb_suppress_tests;
+ }
+
+ # Continue; should stop at call6j and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call6j
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ send_gdb "backtrace 100\n"
+ if [gdb_expect_list "backtrace from call6j" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call6j \\(ul=8\\) "
+ ".*\[\r\n\]#1 .* call6i \\(ui=7, ul=8\\) "
+ ".*\[\r\n\]#2 .* call6h \\(us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#3 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#4 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#5 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#6 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#7 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#8 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#9 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#10 .* main \\(.*\\) "
+ } ] {
+ gdb_suppress_tests;
+ }
+
+ # Continue; should stop at call6k and print actual arguments.
+ # Print backtrace.
+ # This fails on i960-*-vxworks because gdb gets confused by
+ # breakpoints on adjacent instructions.
+ setup_xfail "i960-*-vxworks" 1786
+ gdb_continue call6k
+
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ send_gdb "backtrace 100\n"
+ if [gdb_expect_list "backtrace from call6k" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call6k \\(\\) "
+ ".*\[\r\n\]#1 .* call6j \\(ul=8\\) "
+ ".*\[\r\n\]#2 .* call6i \\(ui=7, ul=8\\) "
+ ".*\[\r\n\]#3 .* call6h \\(us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#4 .* call6g \\(uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#5 .* call6f \\(d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#6 .* call6e \\(f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#7 .* call6d \\(l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#8 .* call6c \\(i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#9 .* call6b \\(s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#10 .* call6a \\(c=97 'a', s=1, i=2, l=3, f=4, d=5, uc=98 'b', us=6, ui=7, ul=8\\) "
+ ".*\[\r\n\]#11 .* main \\(.*\\) "
+ } ] {
+ gdb_suppress_tests;
+ }
+ gdb_stop_suppressing_tests;
+}
+
+
+#
+# Locate actual args; shuffle round robin and call
+#
+
+proc shuffle_round_robin {} {
+ global gdb_prompt
+ global hex
+ global decimal
+ global det_file
+ global gcc_compiled
+ global hp_cc_compiler
+
+ delete_breakpoints
+
+ gdb_breakpoint call7a
+ gdb_breakpoint call7b
+ gdb_breakpoint call7c
+ gdb_breakpoint call7d
+ gdb_breakpoint call7e
+ gdb_breakpoint call7f
+ gdb_breakpoint call7g
+ gdb_breakpoint call7h
+
+ # Run; should stop at call7a and print actual arguments.
+ # Print backtrace.
+
+ gdb_run_cmd
+ gdb_expect {
+ -re ".*Breakpoint $decimal, call7a .*$gdb_prompt $" {
+ pass "run to call7a"
+ }
+ -re "$gdb_prompt $" { fail "run to call7a" ; gdb_suppress_tests; }
+ timeout { fail "(timeout) run to call7a" ; gdb_suppress_tests; }
+ }
+
+ setup_xfail "i960-*-*" 1813
+ if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "mips-sgi-irix5*" }
+ # The debug info. for "f" is not correct. It's a known bug.
+ if {$hp_cc_compiler} {setup_xfail hppa2.0w-*-*}
+ send_gdb "backtrace 100\n"
+ gdb_expect {
+ -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
+$gdb_prompt $" {
+ pass "backtrace from call7a"
+ }
+ -re "backtrace 100\[\r\n\]+
+.* call7a \\(c=97 'a', i=2, s=1, l=3, f=.*, uc=98 'b', d=5, us=6, ul=8, ui=7\\) .*\r
+.* main \\(.*\\) .*\r
+$gdb_prompt $" {
+ xfail "backtrace from call7a"
+ }
+ -re "$gdb_prompt $" { fail "backtrace from call7a" ; return }
+ timeout { fail "(timeout) backtrace from call7a" ; return }
+ }
+
+ # Continue; should stop at call7b and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call7b
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+
+ send_gdb "backtrace 100\n"
+ gdb_expect_list "backtrace from call7b" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+ ".*\[\r\n\]#1 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+ ".*\[\r\n\]#2 .* main \\(.*\\) "
+ }
+
+ # Continue; should stop at call7c and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call7c
+
+ send_gdb "backtrace 100\n"
+ gdb_expect_list "backtrace from call7c" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+ ".*\[\r\n\]#1 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+ ".*\[\r\n\]#2 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+ ".*\[\r\n\]#3 .* main \\(.*\\) "
+ }
+
+ # Continue; should stop at call7d and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call7d
+
+ send_gdb "backtrace 100\n"
+ gdb_expect_list "backtrace from call7d" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+ ".*\[\r\n\]#1 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+ ".*\[\r\n\]#2 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+ ".*\[\r\n\]#3 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+ ".*\[\r\n\]#4 .* main \\(.*\\) "
+ }
+
+ gdb_continue call7e
+
+ send_gdb "backtrace 100\n"
+ gdb_expect_list "backtrace from call7e" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+ ".*\[\r\n\]#1 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+ ".*\[\r\n\]#2 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+ ".*\[\r\n\]#3 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+ ".*\[\r\n\]#4 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+ ".*\[\r\n\]#5 .* main \\(.*\\) "
+ }
+
+ # Continue; should stop at call7f and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call7f
+
+ send_gdb "backtrace 100\n"
+ gdb_expect_list "backtrace from call7f" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
+ ".*\[\r\n\]#1 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+ ".*\[\r\n\]#2 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+ ".*\[\r\n\]#3 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+ ".*\[\r\n\]#4 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+ ".*\[\r\n\]#5 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+ ".*\[\r\n\]#6 .* main \\(.*\\) "
+ }
+
+ # Continue; should stop at call7g and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call7g
+
+ send_gdb "backtrace 100\n"
+ gdb_expect_list "backtrace from call7g" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
+ ".*\[\r\n\]#1 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
+ ".*\[\r\n\]#2 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+ ".*\[\r\n\]#3 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+ ".*\[\r\n\]#4 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+ ".*\[\r\n\]#5 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+ ".*\[\r\n\]#6 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+ ".*\[\r\n\]#7 .* main \\(.*\\) "
+ }
+
+ gdb_continue call7h
+
+ send_gdb "backtrace 100\n"
+ gdb_expect_list "backtrace from call7h" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) "
+ ".*\[\r\n\]#1 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
+ ".*\[\r\n\]#2 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
+ ".*\[\r\n\]#3 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+ ".*\[\r\n\]#4 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+ ".*\[\r\n\]#5 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+ ".*\[\r\n\]#6 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+ ".*\[\r\n\]#7 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+ ".*\[\r\n\]#8 .* main \\(.*\\) "
+ }
+
+ # monitor only allows 8 breakpoints; w89k board allows 10, so
+ # break them up into two groups.
+ delete_breakpoints
+ gdb_breakpoint call7i
+ gdb_breakpoint call7j
+ gdb_breakpoint call7k
+
+ # Continue; should stop at call7i and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call7i
+
+ send_gdb "backtrace 100\n"
+ gdb_expect_list "backtrace from call7i" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) "
+ ".*\[\r\n\]#1 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) "
+ ".*\[\r\n\]#2 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
+ ".*\[\r\n\]#3 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
+ ".*\[\r\n\]#4 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+ ".*\[\r\n\]#5 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+ ".*\[\r\n\]#6 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+ ".*\[\r\n\]#7 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+ ".*\[\r\n\]#8 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+ ".*\[\r\n\]#9 .* main \\(.*\\) "
+ }
+
+ # Continue; should stop at call7j and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call7j
+
+ send_gdb "backtrace 100\n"
+ gdb_expect_list "backtrace from call7j" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\) "
+ ".*\[\r\n\]#1 .* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) "
+ ".*\[\r\n\]#2 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) "
+ ".*\[\r\n\]#3 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
+ ".*\[\r\n\]#4 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
+ ".*\[\r\n\]#5 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+ ".*\[\r\n\]#6 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+ ".*\[\r\n\]#7 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+ ".*\[\r\n\]#8 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+ ".*\[\r\n\]#9 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+ ".*\[\r\n\]#10 .* main \\(.*\\) "
+ }
+
+ # Continue; should stop at call7k and print actual arguments.
+ # Print backtrace.
+
+ gdb_continue call7k
+
+ if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
+ send_gdb "backtrace 100\n"
+ gdb_expect_list "backtrace from call7k" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* call7k \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+ ".*\[\r\n\]#1 .* call7j \\(ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8\\) "
+ ".*\[\r\n\]#2 .* call7i \\(ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6\\) "
+ ".*\[\r\n\]#3 .* call7h \\(us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5\\) "
+ ".*\[\r\n\]#4 .* call7g \\(d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b'\\) "
+ ".*\[\r\n\]#5 .* call7f \\(uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3, f=4\\) "
+ ".*\[\r\n\]#6 .* call7e \\(f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1, l=3\\) "
+ ".*\[\r\n\]#7 .* call7d \\(l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2, s=1\\) "
+ ".*\[\r\n\]#8 .* call7c \\(s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a', i=2\\) "
+ ".*\[\r\n\]#9 .* call7b \\(i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7, c=97 'a'\\) "
+ ".*\[\r\n\]#10 .* call7a \\(c=97 'a', i=2, s=1, l=3, f=4, uc=98 'b', d=5, us=6, ul=8, ui=7\\) "
+ ".*\[\r\n\]#11 .* main \\(.*\\) "
+ }
+ gdb_stop_suppressing_tests;
+}
+
+#
+# Locate actual args; recursive passing of structs by value
+#
+
+proc recursive_structs_by_value {} {
+ global gdb_prompt
+ global hex
+ global decimal
+ global det_file
+
+ delete_breakpoints
+
+ gdb_breakpoint hitbottom
+
+ # Run; should stop at hitbottom and print actual arguments.
+ # Print backtrace.
+ gdb_run_cmd
+ gdb_expect {
+ -re ".*Breakpoint $decimal, hitbottom .*$gdb_prompt $" { pass "run to hitbottom" }
+ -re "$gdb_prompt $" { fail "run to hitbottom" ; gdb_suppress_tests; }
+ timeout { fail "(timeout) run to hitbottom" ; gdb_suppress_tests; }
+ }
+
+ if ![istarget sparclet-*-*] {
+ send_gdb "backtrace 100\n"
+ gdb_expect_list "recursive passing of structs by value" ".*$gdb_prompt $" {
+ ".*\[\r\n\]#0 .* hitbottom \\(\\) "
+ ".*\[\r\n\]#1 .* recurse \\(a=\{s = 0, i = 0, l = 0\}, depth=0\\) "
+ ".*\[\r\n\]#2 .* recurse \\(a=\{s = 1, i = 1, l = 1\}, depth=1\\) "
+ ".*\[\r\n\]#3 .* recurse \\(a=\{s = 2, i = 2, l = 2\}, depth=2\\) "
+ ".*\[\r\n\]#4 .* recurse \\(a=\{s = 3, i = 3, l = 3\}, depth=3\\) "
+ ".*\[\r\n\]#5 .* recurse \\(a=\{s = 4, i = 4, l = 4\}, depth=4\\) "
+ ".*\[\r\n\]#6 .* test_struct_args \\(\\) "
+ ".*\[\r\n\]#7 .* main \\(.*\\) "
+ }
+ } else {
+ fail "recursive passing of structs by value (sparclet)"
+ }
+ gdb_stop_suppressing_tests;
+}
+
+proc funcargs_reload { } {
+ global objdir
+ global subdir
+ global binfile
+ global srcdir
+
+ if [istarget "mips-idt-*"] {
+ # Restart because IDT/SIM runs out of file descriptors.
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+ }
+}
+
+#
+# Test for accessing local stack variables in functions which call alloca
+#
+proc localvars_after_alloca { } {
+ global gdb_prompt
+ global hex
+ global decimal
+ global gcc_compiled
+
+ if { ! [ runto localvars_after_alloca ] } then { gdb_suppress_tests; }
+
+ # 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 after runto localvars_after_alloca"
+ if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ gdb_test "print s" " = 1" "print s after runto localvars_after_alloca"
+ gdb_test "print i" " = 2" "print i after runto localvars_after_alloca"
+ gdb_test "print l" " = 3" "print l after runto localvars_after_alloca"
+
+ # Lame regexp.
+ gdb_test "next" ".*" "next in 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'" "print c in localvars_after_alloca"
+ gdb_test "print s" " = 1" "print s in 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_stop_suppressing_tests;
+}
+
+proc call_after_alloca { } {
+ global gdb_prompt
+ global hex
+ global decimal
+ global gcc_compiled
+
+ if { ! [ runto call_after_alloca_subr ] } then { gdb_suppress_tests; }
+
+ # 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"
+
+ 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"
+ gdb_stop_suppressing_tests;
+}
+
+#
+# Test for accessing local stack variables, backtraces, finish,
+# and finally stepping into indirect calls. The point is that on the PA
+# these use a funky `dyncall' mechanism which GDB needs to know about.
+#
+proc localvars_in_indirect_call { } {
+ global gdb_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
+ # take control from there.
+ if { ! [ runto marker_indirect_call ] } then { gdb_suppress_tests; }
+
+ # break on the next call to call0a, then delete all the breakpoints
+ # and start testing.
+ gdb_breakpoint call0a
+ gdb_continue call0a
+ delete_breakpoints
+
+ # 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.*" \
+ "backtrace in indirectly called function"
+
+ #
+ # "finish" brings us back to main. We then will try to step through
+ # the second indirect call.
+ # On some targets (e.g. m68k) gdb will stop from the finish in midline
+ # of the first indirect call. This is due to stack adjustment instructions
+ # after the indirect call. In these cases we will step till we hit the
+ # second indirect call.
+ #
+
+ send_gdb "finish\n"
+ gdb_expect {
+ -re "\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*First.*$gdb_prompt $" {
+#On hppa2.0w-hp-hpux11.00, gdb finishes at one line earlier than
+#hppa1.1-hp-hpux11.00. Therefore, an extra "step" is necessary to continue the test.
+ send_gdb "step\n"
+ exp_continue
+ }
+ -re ".*\\(\\*pointer_to_call0a\\) \\(c, s, i, l\\);.*Second.*$gdb_prompt $" {
+ pass "finish from indirectly called function"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "finish from indirectly called function"
+ gdb_suppress_tests;
+ }
+ default { fail "finish from indirectly called function" ; gdb_suppress_tests; }
+ }
+
+ 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"
+ gdb_stop_suppressing_tests;
+}
+
+#
+# Test for stepping into indirect calls which may have trampolines (possibly
+# cascaded) on both the call path and the gdb_suppress_tests; path.
+# to handle trampolines.
+#
+proc test_stepping_over_trampolines { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ # Stop in a marker function and take control from there.
+ if { ! [ runto marker_call_with_trampolines ] } then { gdb_suppress_tests; }
+
+ # Cater for gdb stopping in midline, see comment for finish above.
+ send_gdb "finish\n"
+ gdb_expect {
+ -re "marker_call_with_trampolines ..;.*$gdb_prompt $" {
+ send_gdb "step\n"
+ exp_continue
+ }
+ -re "pointer_to_call_with_trampolines.*$gdb_prompt $" {
+ pass "finish from marker_call_with_trampolines"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "finish from marker_call_with_trampolines"
+ }
+ default { fail "finish from marker_call_with_trampolines" ; gdb_suppress_tests; }
+ }
+
+ # Try to step into the target function.
+ 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.*" \
+ "backtrace through call with trampolines"
+
+ # Make sure we can get back to main.
+ # Stepping back to main might stop again after the gdb_suppress_tests; statement
+ # or immediately transfer control back to main if optimizations
+ # are performed.
+ send_gdb "step\n"
+ gdb_expect {
+ -re "main .* at.*$gdb_prompt $" {
+ pass "stepping back to main from function called with trampolines" ;
+ gdb_suppress_tests
+ }
+ -re "\}.*End of call_with_trampolines.*$gdb_prompt $" {
+ send_gdb "step\n"
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {
+ fail "stepping back to main from function called with trampolines"
+ }
+ default { fail "stepping back to main from function called with trampolines" ; gdb_suppress_tests; }
+ }
+ gdb_stop_suppressing_tests;
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if [istarget "mips*tx39-*"] {
+ set timeout 300
+} elseif [istarget "hppa*-hp-hpux*"] then {
+ set timeout 240
+} else {
+ set timeout 60
+}
+
+# Determine expected output for unsigned long variables,
+# the output varies with sizeof (unsigned long).
+
+set target_sizeof_long 4
+send_gdb "print sizeof (long)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 4.*$gdb_prompt $" { }
+ -re ".\[0-9\]* = 8.*$gdb_prompt $" { set target_sizeof_long 8 }
+ -re ".*$gdb_prompt $" {
+ fail "getting sizeof long"
+ }
+ default { fail "(timeout) getting sizeof long" }
+}
+
+set target_sizeof_int 4
+send_gdb "print sizeof (int)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 2.*$gdb_prompt $" { set target_sizeof_int 2 }
+ -re ".\[0-9\]* = 4.*$gdb_prompt $" { }
+ -re ".\[0-9\]* = 8.*$gdb_prompt $" { set target_sizeof_int 8 }
+ -re ".*$gdb_prompt $" {
+ fail "getting sizeof unsigned long"
+ }
+ default { fail "(timeout) getting sizeof int" }
+}
+
+set target_bigendian_p 1
+send_gdb "show endian\n"
+gdb_expect {
+ -re ".*little endian.*$gdb_prompt $" { set target_bigendian_p 0 }
+ -re ".*big endian.*$gdb_prompt $" { }
+ -re ".*$gdb_prompt $" {
+ fail "getting target endian"
+ }
+ default { fail "(timeout) getting target endian" }
+}
+
+# Perform tests
+
+integral_args
+funcargs_reload
+unsigned_integral_args
+funcargs_reload
+if {![target_info exists gdb,skip_float_tests]} {
+ float_and_integral_args
+}
+funcargs_reload
+pointer_args
+funcargs_reload
+structs_by_reference
+funcargs_reload
+structs_by_value
+funcargs_reload
+discard_and_shuffle
+funcargs_reload
+shuffle_round_robin
+funcargs_reload
+recursive_structs_by_value
+funcargs_reload
+localvars_after_alloca
+funcargs_reload
+call_after_alloca
+funcargs_reload
+localvars_in_indirect_call
+funcargs_reload
+test_stepping_over_trampolines
diff --git a/gdb/testsuite/gdb.base/gcore.c b/gdb/testsuite/gdb.base/gcore.c
new file mode 100644
index 00000000000..af09dced7e1
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore.c
@@ -0,0 +1,52 @@
+/*
+ * Test GDB's ability to save and reload a corefile.
+ */
+
+#include <stdlib.h>
+
+int extern_array[4] = {1, 2, 3, 4};
+static int static_array[4] = {5, 6, 7, 8};
+static int un_initialized_array[4];
+static char *heap_string;
+
+void
+terminal_func ()
+{
+ return;
+}
+
+void
+array_func ()
+{
+ int local_array[4];
+ int i;
+
+ heap_string = (char *) malloc (80);
+ strcpy (heap_string, "I'm a little teapot, short and stout...");
+ for (i = 0; i < 4; i++)
+ {
+ un_initialized_array[i] = extern_array[i] + 8;
+ local_array[i] = extern_array[i] + 12;
+ }
+ terminal_func ();
+}
+
+#ifdef PROTOTYPES
+int factorial_func (int value)
+#else
+int factorial_func (value)
+ int value;
+#endif
+{
+ if (value > 1) {
+ value *= factorial_func (value - 1);
+ }
+ array_func ();
+ return (value);
+}
+
+main()
+{
+ factorial_func (6);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/gcore.exp b/gdb/testsuite/gdb.base/gcore.exp
new file mode 100644
index 00000000000..f8d5baac614
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore.exp
@@ -0,0 +1,220 @@
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@redhat.com)
+# This is a test for the gdb command "generate-core-file".
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "gcore"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Does this gdb support gcore?
+send_gdb "help gcore\n"
+gdb_expect {
+ -re "Undefined command: .gcore.*$gdb_prompt $" {
+ # gcore command not supported -- nothing to test here.
+ unsupported "gdb does not support gcore on this target"
+ return -1;
+ }
+ -re "Save a core file .*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "help gcore"
+ }
+ timeout {
+ fail "help gcore (timeout)"
+ }
+}
+
+if { ! [ runto main ] } then {
+ gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
+}
+
+proc capture_command_output { command prefix } {
+ global gdb_prompt
+ global expect_out
+
+ set output_string ""
+ send_gdb "$command\n"
+ gdb_expect {
+ -re "${command}\[\r\n\]+${prefix}(.*)\[\r\n\]+$gdb_prompt $" {
+ set output_string $expect_out(1,string)
+ }
+ default {
+ fail "capture_command_output failed on $command."
+ }
+ }
+ return $output_string
+}
+
+gdb_test "break terminal_func" "Breakpoint .* at .*${srcfile}, line .*" \
+ "set breakpoint at terminal_func"
+
+gdb_test "continue" "Breakpoint .* terminal_func.*" \
+ "continue to terminal_func"
+
+set print_prefix ".\[0123456789\]* = "
+
+set pre_corefile_backtrace [capture_command_output "backtrace" ""]
+set pre_corefile_regs [capture_command_output "info registers" ""]
+set pre_corefile_allregs [capture_command_output "info all-reg" ""]
+set pre_corefile_static_array \
+ [capture_command_output "print static_array" "$print_prefix"]
+set pre_corefile_uninit_array \
+ [capture_command_output "print un_initialized_array" "$print_prefix"]
+set pre_corefile_heap_string \
+ [capture_command_output "print heap_string" "$print_prefix"]
+set pre_corefile_local_array \
+ [capture_command_output "print array_func::local_array" "$print_prefix"]
+set pre_corefile_extern_array \
+ [capture_command_output "print extern_array" "$print_prefix"]
+
+gdb_test "gcore ${objdir}/${subdir}/gcore.test" \
+ "Saved corefile ${objdir}/${subdir}/gcore.test" \
+ "save a corefile"
+
+# Now restart gdb and load the corefile.
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+send_gdb "core ${objdir}/${subdir}/gcore.test\n"
+gdb_expect {
+ -re ".* is not a core dump:.*$gdb_prompt $" {
+ fail "re-load generated corefile (bad file format)"
+ # No use proceeding from here.
+ return;
+ }
+ -re ".*: No such file or directory.*$gdb_prompt $" {
+ fail "re-load generated corefile (file not found)"
+ # No use proceeding from here.
+ return;
+ }
+ -re ".*Couldn't find .* registers in core file.*$gdb_prompt $" {
+ fail "re-load generated corefile (incomplete note section)"
+ }
+ -re "Core was generated by .*$gdb_prompt $" {
+ pass "re-load generated corefile"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "re-load generated corefile"
+ }
+ timeout {
+ fail "re-load generated corefile (timeout)"
+ }
+}
+
+send_gdb "where\n"
+gdb_expect_list "where in corefile" ".*$gdb_prompt $" {
+ ".*\[\r\n\]+#0 .* terminal_func \\(\\) at "
+ ".*\[\r\n\]+#1 .* array_func \\(\\) at "
+ ".*\[\r\n\]+#2 .* factorial_func \\(value=1\\) at "
+ ".*\[\r\n\]+#3 .* factorial_func \\(value=2\\) at "
+ ".*\[\r\n\]+#4 .* factorial_func \\(value=3\\) at "
+ ".*\[\r\n\]+#5 .* factorial_func \\(value=4\\) at "
+ ".*\[\r\n\]+#6 .* factorial_func \\(value=5\\) at "
+ ".*\[\r\n\]+#7 .* factorial_func \\(value=6\\) at "
+ ".*\[\r\n\]+#8 .* main \\(.*\\) at "
+}
+
+set post_corefile_regs [capture_command_output "info registers" ""]
+if ![string compare $pre_corefile_regs $post_corefile_regs] then {
+ pass "corefile restored general registers"
+} else {
+ fail "corefile restored general registers"
+}
+
+set post_corefile_allregs [capture_command_output "info all-reg" ""]
+if ![string compare $pre_corefile_allregs $post_corefile_allregs] then {
+ pass "corefile restored all registers"
+} else {
+ fail "corefile restored all registers"
+}
+
+set post_corefile_extern_array \
+ [capture_command_output "print extern_array" "$print_prefix"]
+pass "extern_array = $post_corefile_extern_array"
+if ![string compare $pre_corefile_extern_array $post_corefile_extern_array] {
+ pass "corefile restored extern array"
+} else {
+ fail "corefile restored extern array"
+}
+
+set post_corefile_static_array \
+ [capture_command_output "print static_array" "$print_prefix"]
+pass "static_array = $post_corefile_static_array"
+if ![string compare $pre_corefile_static_array $post_corefile_static_array] {
+ pass "corefile restored static array"
+} else {
+ fail "corefile restored static array"
+}
+
+set post_corefile_uninit_array \
+ [capture_command_output "print un_initialized_array" "$print_prefix"]
+pass "uninit_array = $post_corefile_uninit_array"
+if ![string compare $pre_corefile_uninit_array $post_corefile_uninit_array] {
+ pass "corefile restored un-initialized array"
+} else {
+ fail "corefile restored un-initialized array"
+}
+
+set post_corefile_heap_string \
+ [capture_command_output "print heap_string" "$print_prefix"]
+pass "heap_string = $post_corefile_heap_string"
+if ![string compare $pre_corefile_heap_string $post_corefile_heap_string] {
+ pass "corefile restored heap array"
+} else {
+ fail "corefile restored heap array"
+}
+
+set post_corefile_local_array \
+ [capture_command_output "print array_func::local_array" "$print_prefix"]
+pass "local_array = $post_corefile_local_array"
+if ![string compare $pre_corefile_local_array $post_corefile_local_array] {
+ pass "corefile restored stack array"
+} else {
+ fail "corefile restored stack array"
+}
+
+set post_corefile_backtrace [capture_command_output "backtrace" ""]
+if ![string compare $pre_corefile_backtrace $post_corefile_backtrace] {
+ pass "corefile restored backtrace"
+} else {
+ fail "corefile restored backtrace"
+}
diff --git a/gdb/testsuite/gdb.base/gdbvars.exp b/gdb/testsuite/gdb.base/gdbvars.exp
new file mode 100644
index 00000000000..9678df6bb6e
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gdbvars.exp
@@ -0,0 +1,117 @@
+# Copyright (C) 1992, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+proc test_convenience_variables {} {
+ global gdb_prompt
+
+ gdb_test "set \$foo = 101" "" \
+ "Set a new convenience variable"
+
+ gdb_test "print \$foo" " = 101" \
+ "Print contents of new convenience variable"
+
+ gdb_test "set \$foo = 301" "" \
+ "Set convenience variable to a new value"
+
+ gdb_test "print \$foo" " = 301" \
+ "Print new contents of convenience variable"
+
+ gdb_test "set \$_ = 11" "" \
+ "Set convenience variable \$_"
+
+ gdb_test "print \$_" " = 11" \
+ "Print contents of convenience variable \$_"
+
+ gdb_test "print \$foo + 10" " = 311" \
+ "Use convenience variable in arithmetic expression"
+
+ gdb_test "print (\$foo = 32) + 4" " = 36" \
+ "Use convenience variable assignment in arithmetic expression"
+
+ gdb_test "print \$bar" " = void" \
+ "Print contents of uninitialized convenience variable"
+}
+
+proc test_value_history {} {
+ global gdb_prompt
+
+ gdb_test "print 101" "\\\$1 = 101" \
+ "Set value-history\[1\] using \$1"
+
+ gdb_test "print 102" "\\\$2 = 102" \
+ "Set value-history\[2\] using \$2"
+
+ gdb_test "print 103" "\\\$3 = 103" \
+ "Set value-history\[3\] using \$3"
+
+ gdb_test "print \$\$" "\\\$4 = 102" \
+ "Print value-history\[MAX-1\] using inplicit index \$\$"
+
+ gdb_test "print \$\$" "\\\$5 = 103" \
+ "Print value-history\[MAX-1\] again using implicit index \$\$"
+
+ gdb_test "print \$" "\\\$6 = 103" \
+ "Print value-history\[MAX\] using implicit index \$"
+
+ gdb_test "print \$\$2" "\\\$7 = 102" \
+ "Print value-history\[MAX-2\] using explicit index \$\$2"
+
+ gdb_test "print \$0" "\\\$8 = 102" \
+ "Print value-history\[MAX\] using explicit index \$0"
+
+ gdb_test "print 108" "\\\$9 = 108"
+
+ gdb_test "print \$\$0" "\\\$10 = 108" \
+ "Print value-history\[MAX\] using explicit index \$\$0"
+
+ gdb_test "print \$1" "\\\$11 = 101" \
+ "Print value-history\[1\] using explicit index \$1"
+
+ gdb_test "print \$2" "\\\$12 = 102" \
+ "Print value-history\[2\] using explicit index \$2"
+
+ gdb_test "print \$3" "\\\$13 = 103" \
+ "Print value-history\[3\] using explicit index \$3"
+
+ gdb_test "print \$-3" "\\\$14 = 100" \
+ "Print (value-history\[MAX\] - 3) using implicit index \$"
+
+ gdb_test "print \$1 + 3" "\\\$15 = 104" \
+ "Use value-history element in arithmetic expression"
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+send_gdb "set print sevenbit-strings\n" ; gdb_expect -re ".*$gdb_prompt $"
+
+test_value_history
+test_convenience_variables
diff --git a/gdb/testsuite/gdb.base/grbx.c b/gdb/testsuite/gdb.base/grbx.c
new file mode 100644
index 00000000000..58034bbbaae
--- /dev/null
+++ b/gdb/testsuite/gdb.base/grbx.c
@@ -0,0 +1,10 @@
+static int grbxx = 'g' + 'r' + 'b' + 'x';
+
+int grbx (int x)
+{
+ if (x)
+ return grbxx;
+ else
+ return 0;
+}
+
diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp
new file mode 100644
index 00000000000..4b3d2eebd81
--- /dev/null
+++ b/gdb/testsuite/gdb.base/help.exp
@@ -0,0 +1,597 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+#
+# test gdb help commands
+#
+
+set prms_id 0
+set bug_id 0
+
+gdb_start
+
+# force the height of the debugger to be pretty large so no pagers getused
+gdb_test "set height 400" "" "test set height"
+
+# use a larger expect input buffer for long help outputs.
+# test help add-symbol-file
+gdb_test "help add-symbol-file" "Usage: add-symbol-file FILE ADDR \\\[-s <SECT> <SECT_ADDR> -s <SECT> <SECT_ADDR> \.\.\.\\\]\[\r\n\]+Load the symbols from FILE, assuming FILE has been dynamically loaded\.\[\r\n\]+ADDR is the starting address of the file's text\.\[\r\n\]+The optional arguments are section-name section-address pairs and\[\r\n\]+should be specified if the data and bss segments are not contiguous\[\r\n\]+with the text\. SECT is a section name to be loaded at SECT_ADDR\." "help add-symbol-file"
+# test help aliases
+gdb_test "help aliases" "Aliases of other commands\.\[\r\n\]+List of commands\:.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help aliases"
+# test help append
+gdb_test "help append" "Append target code/data to a local file\.\[\r\n\]+List of append subcommands:.*"
+gdb_test "help append binary" "Append target code/data to a raw binary file\.\[\r\n\]+List of append binary subcommands:.*"
+gdb_test "help append memory" "Append contents of memory to a raw binary file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory within the\[\r\n\]+range \\\[START \.\. STOP\\) to the specifed FILE in raw target ordered bytes\."
+gdb_test "help append value" "Append the value of an expression to a raw binary file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION to\[\r\n\]+the specified FILE in raw target ordered bytes\."
+gdb_test "help append binary memory" "Append contents of memory to a raw binary file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory within the\[\r\n\]+range \\\[START \.\. STOP\\) to the specifed FILE in raw target ordered bytes\."
+gdb_test "help append binary value" "Append the value of an expression to a raw binary file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION\[\r\n\]+to the specified FILE in raw target ordered bytes\."
+# test help attach
+gdb_test "help attach" "Attach to a process or file outside of GDB\.\[\r\n\]+This command attaches to another target, of the same type as your last\[\r\n\]+\"target\" command \\(\"info files\" will show your target stack\\)\.\[\r\n\]+The command may take as argument a process id or a device file\.\[\r\n\]+For a process id, you must have permission to send the process a signal,\[\r\n\]+and it must have the same effective uid as the debugger\.\[\r\n\]+When using \"attach\" with a process id, the debugger finds the\[\r\n\]+program running in the process, looking first in the current working\[\r\n\]+directory, or \\(if not found there\\) using the source file search path\[\r\n\]+\\(see the \"directory\" command\\)\. You can also use the \"file\" command\[\r\n\]+to specify the program, and to load its symbol table\." "help attach"
+# test help breakpoint "b" abbreviation
+gdb_test "help b" "Set breakpoint at specified line or function\.\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address\.\[\r\n\]+If line number is specified, break at start of code for that line\.\[\r\n\]+If function is specified, break at start of code for that function\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n\]+With no arg, uses current execution address of selected stack frame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints\." "help breakpoint \"b\" abbreviation"
+# test help breakpoint "br" abbreviation
+gdb_test "help br" "Set breakpoint at specified line or function\.\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address\.\[\r\n\]+If line number is specified, break at start of code for that line\.\[\r\n\]+If function is specified, break at start of code for that function\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n\]+With no arg, uses current execution address of selected stack frame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints\." "help breakpoint \"br\" abbreviation"
+# test help breakpoint "bre" abbreviation
+gdb_test "help bre" "Set breakpoint at specified line or function\.\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address\.\[\r\n\]+If line number is specified, break at start of code for that line\.\[\r\n\]+If function is specified, break at start of code for that function\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n\]+With no arg, uses current execution address of selected stack frame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints\." "help breakpoint \"bre\" abbreviation"
+# test help breakpoint "brea" abbreviation
+gdb_test "help brea" "Set breakpoint at specified line or function\.\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address\.\[\r\n\]+If line number is specified, break at start of code for that line\.\[\r\n\]+If function is specified, break at start of code for that function\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n\]+With no arg, uses current execution address of selected stack frame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints\." "help breakpoint \"brea\" abbreviation"
+# test help breakpoint "break" abbreviation
+gdb_test "help break" "Set breakpoint at specified line or function\.\[\r\n\]+Argument may be line number, function name, or \"\[*\]\" and an address\.\[\r\n\]+If line number is specified, break at start of code for that line\.\[\r\n\]+If function is specified, break at start of code for that function\.\[\r\n\]+If an address is specified, break at that exact address\.\[\r\n\]+With no arg, uses current execution address of selected stack frame\.\[\r\n\]+This is useful for breaking on return to a stack frame\.\[\r\n\]+Multiple breakpoints at one place are permitted, and useful if conditional\.\[\r\n\]+Do \"help breakpoints\" for info on other commands dealing with breakpoints\." "help breakpoint \"break\" abbreviation"
+# test help breakpoints
+gdb_test "help breakpoints" "Making program stop at certain points\.\[\r\n\]+List of commands:\[\r\n\]+awatch -- Set a watchpoint for an expression\[\r\n\]+break -- Set breakpoint at specified line or function\[\r\n\]+catch -- Set catchpoints to catch events\[\r\n\]+clear -- Clear breakpoint at specified line or function\[\r\n\]+commands -- Set commands to be executed when a breakpoint is hit\[\r\n\]+condition -- Specify breakpoint number N to break only if COND is true\[\r\n\]+delete -- Delete some breakpoints or auto-display expressions\[\r\n\]+disable -- Disable some breakpoints\[\r\n\]+enable -- Enable some breakpoints\[\r\n\]+hbreak -- Set a hardware assisted breakpoint\[\r\n\]+ignore -- Set ignore-count of breakpoint number N to COUNT\[\r\n\]+rbreak -- Set a breakpoint for all functions matching REGEXP\[\r\n\]+rwatch -- Set a read watchpoint for an expression\[\r\n\]+tbreak -- Set a temporary breakpoint\[\r\n\]+tcatch -- Set temporary catchpoints to catch events\[\r\n\]+thbreak -- Set a temporary hardware assisted breakpoint\[\r\n\]+watch -- Set a watchpoint for an expression\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help breakpoints"
+# test help backtrace "bt" abbreviation
+gdb_test "help bt" "Print backtrace of all stack frames, or innermost COUNT frames\.\[\r\n\]+With a negative argument, print outermost -COUNT frames\.\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables\." "help backtrace \"bt\" abbreviation"
+# test help backtrace
+gdb_test "help backtrace" "Print backtrace of all stack frames, or innermost COUNT frames\.\[\r\n\]+With a negative argument, print outermost -COUNT frames\.\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables\." "help backtrace"
+# test help continue "c" abbreviation
+gdb_test "help c" "Continue program being debugged.*" "help continue \"c\" abbreviation"
+# test help continue
+gdb_test "help continue" "Continue program being debugged.*" "help continue"
+# test help call
+gdb_test "help call" "Call a function.*" "help call"
+# test help catch
+gdb_test "help catch" "Set catchpoints to catch events.*Raised signals may be caught:.*catch signal.*all signals.*catch signal.*signame.*a particular signal.*Raised exceptions may be caught:.*catch throw.*all exceptions, when thrown.*catch throw.*exceptname.*a particular exception, when thrown.*catch catch.*all exceptions, when caught.*catch catch.*exceptname.*a particular exception, when caught.*Thread or process events may be caught:.*catch thread_start.*any threads, just after creation.*catch thread_exit.*any threads, just before expiration.*catch thread_join.*any threads, just after joins.*catch start.*any processes, just after creation.*catch exit.*any processes, just before expiration.*catch fork.*calls to fork.*catch vfork.*calls to vfork.*catch exec.*calls to exec.*Dynamically.linked library events may be caught:.*catch load.*loads of any library.*catch load.*libname.*loads of a particular library.*catch unload.*unloads of any library.*catch unload.*libname.*unloads of a particular library.*The act of your program's execution stopping may also be caught:.*catch stop.*Do.*help set follow-fork-mode.*for info on debugging your program.*after a fork or vfork is caught.*Do.*help breakpoints.*for info on other commands dealing with breakpoints." "help catch"
+# test help cd
+gdb_test "help cd" "Set working directory to DIR for debugger and program being debugged\.\[\r\n\]+The change does not take effect for the program being debugged\[\r\n\]+until the next time it is started\." "help cd"
+# test help clear
+gdb_test "help clear" "Clear breakpoint at specified line or function\.\[\r\n\]+Argument may be line number, function name, or \"\\*\" and an address\.\[\r\n\]+If line number is specified, all breakpoints in that line are cleared\.\[\r\n\]+If function is specified, breakpoints at beginning of function are cleared\.\[\r\n\]+If an address is specified, breakpoints at that address are cleared\.\[\r\n\]+With no argument, clears all breakpoints in the line that the selected frame\[\r\n\]+is executing in\.\[\r\n\]+See also the \"delete\" command which clears breakpoints by number\." "help clear"
+# test help commands
+gdb_test "help commands" "Set commands to be executed when a breakpoint is hit\.\[\r\n\]+Give breakpoint number as argument after \"commands\"\.\[\r\n\]+With no argument, the targeted breakpoint is the last one set\.\[\r\n\]+The commands themselves follow starting on the next line\.\[\r\n\]+Type a line containing \"end\" to indicate the end of them\.\[\r\n\]+Give \"silent\" as the first line to make the breakpoint silent;\[\r\n\]+then no output is printed when it is hit, except what the commands print\." "help commands"
+# test help condition
+gdb_test "help condition" "Specify breakpoint number N to break only if COND is true\.\[\r\n\]+Usage is `condition N COND', where N is an integer and COND is an\[\r\n\]+expression to be evaluated whenever breakpoint N is reached." "help condition"
+# test help core-file
+gdb_test "help core-file" "Use FILE as core dump for examining memory and registers\.\[\r\n\]+No arg means have no core file\. This command has been superseded by the\[\r\n\]+`target core' and `detach' commands\." "help core-file"
+# test help delete "d" abbreviation
+gdb_test "help d" "Delete some breakpoints or auto-display expressions\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To delete all breakpoints, give no argument\.\[\r\n\]+Also a prefix command for deletion of other GDB objects\.\[\r\n\]+The \"unset\" command is also an alias for \"delete\"\.\[\r\n\]+List of delete subcommands:\[\r\n\]+delete breakpoints -- Delete some breakpoints or auto-display expressions\[\r\n\]+delete display -- Cancel some expressions to be displayed when program stops\[\r\n\]+delete mem -- Delete memory region\[\r\n\]+delete tracepoints -- Delete specified tracepoints\[\r\n\]+Type \"help delete\" followed by delete subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help delete \"d\" abbreviation"
+# test help delete
+gdb_test "help delete" "Delete some breakpoints or auto-display expressions\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To delete all breakpoints, give no argument\.\[\r\n\]+Also a prefix command for deletion of other GDB objects\.\[\r\n\]+The \"unset\" command is also an alias for \"delete\"\.\[\r\n\]+List of delete subcommands:\[\r\n\]+delete breakpoints -- Delete some breakpoints or auto-display expressions\[\r\n\]+delete display -- Cancel some expressions to be displayed when program stops\[\r\n\]+delete mem -- Delete memory region\[\r\n\]+delete tracepoints -- Delete specified tracepoints\[\r\n\]+Type \"help delete\" followed by delete subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help delete"
+# test help data
+gdb_test "help data" "Examining data\.\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help data"
+# test help define
+gdb_test "help define" "Define a new command.*" "help define"
+# test help delete breakpoints
+gdb_test "help delete breakpoints" "Delete some breakpoints or auto-display expressions\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To delete all breakpoints, give no argument\.\[\r\n\]+This command may be abbreviated \"delete\"\." "help delete breakpoints"
+# test help delete display
+gdb_test "help delete display" "Cancel some expressions to be displayed when program stops\.\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying\.\[\r\n\]+No argument means cancel all automatic-display expressions\.\[\r\n\]+Do \"info display\" to see current list of code numbers\." "help delete display"
+# test help detach
+gdb_test "help detach" "Detach a process or file previously attached\.\[\r\n\]+If a process, it is no longer traced, and it continues its execution\.\[ \r\n\]+If\[ \r\n\]+you were debugging a file, the file is closed and gdb no longer accesses it\." "help detach"
+# test help directory
+gdb_test "help directory" "Add directory DIR to beginning of search path for source files\.\[\r\n\]+Forget cached info on source file locations and line positions\.\[\r\n\]+DIR can also be \\\$cwd for the current working directory, or \\\$cdir for the\[\r\n\]+directory in which the source file was compiled into object code\.\[\r\n\]+With no argument, reset the search path to \\\$cdir:\\\$cwd, the default\." "help directory"
+# test help disable "dis" abbreviation
+gdb_test "help dis" "Disable some breakpoints\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To disable all breakpoints, give no argument\.\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled\.\[\r\n\]+List of disable subcommands:\[\r\n\]+disable breakpoints -- Disable some breakpoints\[\r\n\]+disable display -- Disable some expressions to be displayed when program stops\[\r\n\]+disable mem -- Disable memory region\[\r\n\]+disable tracepoints -- Disable specified tracepoints\[\r\n\]+Type \"help disable\" followed by disable subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help disable \"dis\" abbreviation"
+# test help disable "disa" abbreviation
+gdb_test "help disa" "Disable some breakpoints\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To disable all breakpoints, give no argument\.\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled\.\[\r\n\]+List of disable subcommands:\[\r\n\]+disable breakpoints -- Disable some breakpoints\[\r\n\]+disable display -- Disable some expressions to be displayed when program stops\[\r\n\]+disable mem -- Disable memory region\[\r\n\]+disable tracepoints -- Disable specified tracepoints\[\r\n\]+Type \"help disable\" followed by disable subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help disable \"disa\" abbreviation"
+# test help disable
+gdb_test "help disable" "Disable some breakpoints\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To disable all breakpoints, give no argument\.\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled\.\[\r\n\]+List of disable subcommands:\[\r\n\]+disable breakpoints -- Disable some breakpoints\[\r\n\]+disable display -- Disable some expressions to be displayed when program stops\[\r\n\]+disable mem -- Disable memory region\[\r\n\]+disable tracepoints -- Disable specified tracepoints\[\r\n\]+Type \"help disable\" followed by disable subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help disable"
+# test help disable breakpoints
+gdb_test "help disable breakpoints" "Disable some breakpoints\.\[\r\n\]+Arguments are breakpoint numbers with spaces in between\.\[\r\n\]+To disable all breakpoints, give no argument\.\[\r\n\]+A disabled breakpoint is not forgotten, but has no effect until reenabled\.\[\r\n\]+This command may be abbreviated \"disable\"." "help disable breakpoints"
+# test help disable display
+gdb_test "help disable display" "Disable some expressions to be displayed when program stops\.\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying\.\[\r\n\]+No argument means disable all automatic-display expressions\.\[\r\n\]+Do \"info display\" to see current list of code numbers\." "help disable display"
+# test help disassemble
+gdb_test "help disassemble" "Disassemble a specified section of memory\.\[\r\n\]+Default is the function surrounding the pc of the selected frame\.\[\r\n\]+With a single argument, the function surrounding that address is dumped\.\[\r\n\]+Two arguments are taken as a range of memory to dump\." "help disassemble"
+# test help display
+gdb_test "help display" "Print value of expression EXP each time the program stops\.\[\r\n\]+/FMT may be used before EXP as in the \"print\" command\.\[\r\n\]+/FMT \"i\" or \"s\" or including a size-letter is allowed,\[\r\n\]+as in the \"x\" command, and then EXP is used to get the address to examine\[\r\n\]+and examining is done as in the \"x\" command\.\[\r\n\]+With no argument, display all currently requested auto-display expressions\.\[\r\n\]+Use \"undisplay\" to cancel display requests previously made\." "help display"
+# test help do
+gdb_test "help do" "Select and print stack frame called by this one\.\[\r\n\]+An argument says how many frames down to go\." "help do"
+# test help document
+gdb_test "help document" "Document a user-defined command\.\[\r\n\]+Give command name as argument\. Give documentation on following lines\.\[\r\n\]+End with a line of just \"end\"\." "help document"
+# test help down
+gdb_test "help down" "Select and print stack frame called by this one\.\[\r\n\]+An argument says how many frames down to go\." "help down"
+# test help down-silently
+gdb_test "help down-silently" "Same as the `down' command, but does not print anything\.\[\r\n\]+This is useful in command scripts\." "help down-silently"
+# test help dump
+gdb_test "help dump" "Dump target code/data to a local file\.\[\r\n\]+List of dump subcommands:.*"
+gdb_test "help dump binary" "Write target code/data to a raw binary file\.\[\r\n\]+List of dump binary subcommands:.*"
+gdb_test "help dump ihex" "Write target code/data to an intel hex file\.\[\r\n\]+List of dump ihex subcommands:.*"
+gdb_test "help dump memory" "Write contents of memory to a raw binary file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory within the\[\r\n\]+range \\\[START \.\. STOP\\) to the specifed FILE in raw target ordered bytes\."
+gdb_test "help dump srec" "Write target code/data to an srec file\.\[\r\n\]+List of dump srec subcommands:.*"
+gdb_test "help dump tekhex" "Write target code/data to a tekhex file\.\[\r\n\]+List of dump tekhex subcommands:.*"
+gdb_test "help dump value" "Write the value of an expression to a raw binary file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION to\[\r\n\]+the specified FILE in raw target ordered bytes\."
+gdb_test "help dump binary memory" "Write contents of memory to a raw binary file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory\[\r\n\]+within the range \\\[START \.\. STOP\\) to the specifed FILE in binary format\."
+gdb_test "help dump binary value" "Write the value of an expression to a raw binary file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION\[\r\n\]+to the specified FILE in raw target ordered bytes\." "help dump binary value"
+gdb_test "help dump ihex memory" "Write contents of memory to an ihex file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory within\[\r\n\]+the range \\\[START \.\. STOP\\) to the specifed FILE in intel hex format\."
+gdb_test "help dump ihex value" "Write the value of an expression to an ihex file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION\[\r\n\]+to the specified FILE in intel hex format\."
+gdb_test "help dump srec memory" "Write contents of memory to an srec file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory\[\r\n\]+within the range \\\[START \.\. STOP\\) to the specifed FILE in srec format\."
+gdb_test "help dump srec value" "Write the value of an expression to an srec file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION\[\r\n\]+to the specified FILE in srec format\."
+gdb_test "help dump tekhex memory" "Write contents of memory to a tekhex file\.\[\r\n\]+Arguments are FILE START STOP\. Writes the contents of memory\[\r\n\]+within the range \\\[START \.\. STOP\\) to the specifed FILE in tekhex format\."
+gdb_test "help dump tekhex value" "Write the value of an expression to a tekhex file\.\[\r\n\]+Arguments are FILE EXPRESSION\. Writes the value of EXPRESSION\[\r\n\]+to the specified FILE in tekhex format\."
+# this command was removed from GDB 4.5.8
+# test help dump-me
+#send_gdb "help dump-me"
+# -re "Get fatal error; make debugger dump its core\."
+#
+# }
+# test help echo
+gdb_test "help echo" "Print a constant string\. Give string as argument\.\[\r\n\]+C escape sequences may be used in the argument\.\[\r\n\]+No newline is added at the end of the argument;\[\r\n\]+use \"\\\\n\" if you want a newline to be printed\.\[\r\n\]+Since leading and trailing whitespace are ignored in command arguments,\[\r\n\]+if you want to print some you must use \"\\\\\" before leading whitespace\[\r\n\]+to be printed or after trailing whitespace\." "help echo"
+# test help enable breakpoints delete
+gdb_test "help enable breakpoints delete" "Enable breakpoints and delete when hit\. Give breakpoint numbers\.\[\r\n\]+If a breakpoint is hit while enabled in this fashion, it is deleted\." "help enable breakpoints delete"
+# test help enable breakpoints once
+gdb_test "help enable breakpoints once" "Enable breakpoints for one hit.*" "help enable breakpoints once"
+# test help enable breakpoints
+gdb_test "help enable breakpoints" "Enable some breakpoints\.\[\r\n\]+Give breakpoint numbers \\(separated by spaces\\) as arguments\.\[\r\n\]+This is used to cancel the effect of the \"disable\" command\.\[\r\n\]+May be abbreviated to simply \"enable\"\.\[\r\n\]+List of enable breakpoints subcommands:\[\r\n\]+enable breakpoints delete -- Enable breakpoints and delete when hit\[\r\n\]+enable breakpoints once -- Enable breakpoints for one hit\[\r\n\]+Type \"help enable breakpoints\" followed by enable breakpoints subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help enable breakpoints"
+# test help enable delete
+gdb_test "help enable delete" "Enable breakpoints and delete when hit\. Give breakpoint numbers\.\[\r\n\]+If a breakpoint is hit while enabled in this fashion, it is deleted\." "help enable delete"
+# test help enable display
+gdb_test "help enable display" "Enable some expressions to be displayed when program stops\.\[\r\n\]+Arguments are the code numbers of the expressions to resume displaying\.\[\r\n\]+No argument means enable all automatic-display expressions\.\[\r\n\]+Do \"info display\" to see current list of code numbers\." "help enable display"
+# test help enable once
+gdb_test "help enable once" "Enable breakpoints for one hit.*" "help enable once"
+# test help enable
+gdb_test "help enable" "Enable some breakpoints\.\[\r\n\]+Give breakpoint numbers \\(separated by spaces\\) as arguments\.\[\r\n\]+With no subcommand, breakpoints are enabled until you command otherwise\.\[\r\n\]+This is used to cancel the effect of the \"disable\" command\.\[\r\n\]+With a subcommand you can enable temporarily\.\[\r\n\]+List of enable subcommands:\[\r\n\]+enable delete -- Enable breakpoints and delete when hit\[\r\n\]+enable display -- Enable some expressions to be displayed when program stops\[\r\n\]+enable mem -- Enable memory region\[\r\n\]+enable once -- Enable breakpoints for one hit\[\r\n\]+enable tracepoints -- Enable specified tracepoints\[\r\n\]+Type \"help enable\" followed by enable subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help enable"
+# test help exec-file
+gdb_test "help exec-file" "Use FILE as program for getting contents of pure memory\.\[\r\n\]+If FILE cannot be found as specified, your execution directory path\[\r\n\]+is searched for a command of that name\.\[\r\n\]+No arg means have no executable file\." "help exec-file"
+# test help frame "f" abbreviation
+gdb_test "help f" "Select and print a stack frame\.\[\r\n\]+With no argument, print the selected stack frame\. \\(See also \"info frame\"\\)\.\[\r\n\]+An argument specifies the frame to select\.\[\r\n\]+It can be a stack frame number or the address of the frame\.\[\r\n\]+With argument, nothing is printed if input is coming from\[\r\n\]+a command file or a user-defined command\." "help frame \"f\" abbreviation"
+# test help frame
+gdb_test "help frame" "Select and print a stack frame\.\[\r\n\]+With no argument, print the selected stack frame\. \\(See also \"info frame\"\\)\.\[\r\n\]+An argument specifies the frame to select\.\[\r\n\]+It can be a stack frame number or the address of the frame\.\[\r\n\]+With argument, nothing is printed if input is coming from\[\r\n\]+a command file or a user-defined command\." "help frame"
+# test help fg
+gdb_test "help fg" "Continue program being debugged.*" "help fg"
+# test help file
+gdb_test "help file" "Use FILE as program to be debugged\.\[\r\n\]+It is read for its symbols, for getting the contents of pure memory,\[\r\n\]+and it is the program executed when you use the `run' command\.\[\r\n\]+If FILE cannot be found as specified, your execution directory path\[\r\n\]+\\(\\\$PATH\\) is searched for a command of that name\.\[\r\n\]+No arg means to have no executable file and no symbols\." "help file"
+# test help files
+gdb_test "help files" "Specifying.*" "help files"
+# test help finish
+gdb_test "help finish" "Execute until selected stack frame returns\.\[\r\n\]+Upon return, the value returned is printed and put in the value history\." "help finish"
+# test help forward-search
+gdb_test "help forward-search" "Search for regular expression \\(see regex\\(3\\)\\) from last line listed.*" "help forward-search"
+# test help gcore
+send_gdb "help gcore\n"
+gdb_expect {
+ -re "Undefined command: \"gcore\"\. Try \"help\".*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ -re "Save a core file with the current state of the debugged process\.\[\r\n\]+Argument is optional filename\. Default filename is 'core\.<process_id>'.*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ default { fail "help gcore" }
+}
+send_gdb "help generate-core-file\n"
+gdb_expect {
+ -re "Undefined command: \"generate-core-file\"\. Try \"help\".*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ -re "Save a core file with the current state of the debugged process\.\[\r\n\]+Argument is optional filename\. Default filename is 'core\.<process_id>'.*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ default { fail "help gcore" }
+}
+# test help help "h" abbreviation
+gdb_test "help h" "Print list of commands\." "help help \"h\" abbreviation"
+# test help help
+gdb_test "help help" "Print list of commands\." "help help"
+# test help handle
+gdb_test "help handle" "Specify how to handle a signal\..*" "help handle"
+# test help info "i" abbreviation
+gdb_test "help i" "Generic command for showing things about the program being debugged\.\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info\" followed by info subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help info \"i\" abbreviation"
+# test help info
+gdb_test "help info" "Generic command for showing things about the program being debugged\.\[\r\n\]+List of info subcommands:.*\[\r\n\]+Type \"help info\" followed by info subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help info"
+# test help ignore
+gdb_test "help ignore" "Set ignore-count of breakpoint number N to COUNT\.\[\r\n\]+Usage is `ignore N COUNT'\." "help ignore"
+# test help info address
+gdb_test "help info address" "Describe where symbol SYM is stored\." "help info address"
+# test help info all-registers
+gdb_test "help info all-registers" "List of all registers and their contents, for selected stack frame\.\[\r\n\]+Register name as argument means describe only that register\." "help info all-registers"
+# test help info args
+gdb_test "help info args" "Argument variables of current stack frame\." "help info args"
+# test help info breakpoints
+gdb_test "help info breakpoints" "Status of user-settable breakpoints, or breakpoint number NUMBER\..*\[\r\n\]+breakpoint set\." "help info breakpoints"
+# test help info catch
+gdb_test "help info catch" "Exceptions that can be caught in the current stack frame\." "help info catch"
+# test help info copying
+gdb_test "help info copying" "Conditions for redistributing copies of GDB\." "help info copying"
+# test help info display
+gdb_test "help info display" "Expressions to display when program stops, with code numbers\." "help info display"
+# test help info frame "f" abbreviation
+gdb_test "help info f" "All about selected stack frame, or frame at ADDR\." "help info frame \"f\" abbreviation"
+# test help info frame
+gdb_test "help info frame" "All about selected stack frame, or frame at ADDR\." "help info frame"
+# test help info files
+gdb_test "help info files" "Names of targets and files being debugged\.\[\r\n\]+Shows the entire stack of targets currently in use \\(including the exec-file,\[\r\n\]+core-file, and process, if any\\), as well as the symbol file name\." "help info files"
+# test help info float
+gdb_test "help info float" "Print the status of the floating point unit" "help info float"
+# test help info functions
+gdb_test "help info functions" "All function names, or those matching REGEXP\." "help info functions"
+# test help info line
+gdb_test "help info line" "Core addresses of the code for a source line\.\[\r\n\]+Line can be specified as\[\r\n\]+ LINENUM, to list around that line in current file,\[\r\n\]+ FILE:LINENUM, to list around that line in that file,\[\r\n\]+ FUNCTION, to list around beginning of that function,\[\r\n\]+ FILE:FUNCTION, to distinguish among like-named static functions\.\[\r\n\]+Default is to describe the last source line that was listed\.\[\r\n\]+This sets the default address for \"x\" to the line's first instruction\[\r\n\]+so that \"x/i\" suffices to start examining the machine code\.\[\r\n\]+The address is also stored as the value of \"\\\$_\"\." "help info line"
+# test help info locals
+gdb_test "help info locals" "Local variables of current stack frame\." "help info locals"
+# test help info program
+gdb_test "help info program" "Execution status of the program\." "help info program"
+# test help info registers
+gdb_test "help info registers" "List of integer registers and their contents, for selected stack frame\.\[\r\n\]+Register name as argument means describe only that register\." "help info registers"
+# test help info stack "s" abbreviation
+gdb_test "help info s" "Backtrace of the stack, or innermost COUNT frames\." "help info stack \"s\" abbreviation"
+# test help info stack
+gdb_test "help info stack" "Backtrace of the stack, or innermost COUNT frames\." "help info stack"
+# test help info set
+gdb_test "help info set" "Show all GDB settings\." "help info set"
+# test help info signals
+gdb_test "help info signals" "What debugger does when program gets various signals.*" "help info signals"
+# test help info source
+gdb_test "help info source" "Information about the current source file\." "help info source"
+# test help info sources
+gdb_test "help info sources" "Source files in the program\." "help info sources"
+# test help info symbol
+gdb_test "help info symbol" "Describe what symbol is at location ADDR.*"
+# test help info target
+gdb_test "help info target" "Names of targets and files being debugged\.\[\r\n\]+Shows the entire stack of targets currently in use \\(including the exec-file,\[\r\n\]+core-file, and process, if any\\), as well as the symbol file name\." "help info target"
+# test help info terminal
+gdb_test "help info terminal" "Print inferior's saved terminal status\." "help info terminal"
+# test help info types
+gdb_test "help info types" "All type names, or those matching REGEXP\." "help info types"
+# test help info variables
+gdb_test "help info variables" "All global and static variable names, or those matching REGEXP\." "help info variables"
+# test help info warranty
+gdb_test "help info warranty" "Various kinds of warranty you do not have\." "help info warranty"
+# test help info watchpoints
+gdb_test "help info watchpoints" "Synonym for ``info breakpoints''\." "help info watchpoints"
+# test help inspect
+gdb_test "help inspect" "Same as \"print\" command, except that if you are running in the epoch\[\r\n\]+environment, the value is printed in its own window\." "help inspect"
+# test help jump
+gdb_test "help jump" "Continue program being debugged at specified line or address\.\[\r\n\]+Give as argument either LINENUM or \[*\]+ADDR, where ADDR is an expression\[\r\n\]+for an address to start at\." "help jump"
+# test help kill
+gdb_test "help kill" "Kill execution of program being debugged\." "help kill"
+# test help list "l" abbreviation
+gdb_test "help l" "List specified function or line\.\[\r\n\]+With no argument, lists ten more lines after or around previous listing\.\[\r\n\]+\"list -\" lists the ten lines before a previous ten-line listing\.\[\r\n\]+One argument specifies a line, and ten lines are listed around that line\.\[\r\n\]+Two arguments with comma between specify starting and ending lines to list\.\[\r\n\]+Lines can be specified in these ways:\[\r\n\]+ LINENUM, to list around that line in current file,\[\r\n\]+ FILE:LINENUM, to list around that line in that file,\[\r\n\]+ FUNCTION, to list around beginning of that function,\[\r\n\]+ FILE:FUNCTION, to distinguish among like-named static functions\.\[\r\n\]+ \[*\]ADDRESS, to list around the line containing that address\.\[\r\n\]+With two args if one is empty it stands for ten lines away from the other arg\." "help list \"l\" abbreviation"
+# test help list
+gdb_test "help list" "List specified function or line\.\[\r\n\]+With no argument, lists ten more lines after or around previous listing\.\[\r\n\]+\"list -\" lists the ten lines before a previous ten-line listing\.\[\r\n\]+One argument specifies a line, and ten lines are listed around that line\.\[\r\n\]+Two arguments with comma between specify starting and ending lines to list\.\[\r\n\]+Lines can be specified in these ways:\[\r\n\]+ LINENUM, to list around that line in current file,\[\r\n\]+ FILE:LINENUM, to list around that line in that file,\[\r\n\]+ FUNCTION, to list around beginning of that function,\[\r\n\]+ FILE:FUNCTION, to distinguish among like-named static functions\.\[\r\n\]+ \[*\]ADDRESS, to list around the line containing that address\.\[\r\n\]+With two args if one is empty it stands for ten lines away from the other arg\." "help list"
+# test help load
+gdb_test "help load" "Dynamically load FILE into the running program, and record its symbols\[\r\n\]+for access from GDB\." "help load"
+# test help make
+gdb_test "help make" "Run the ``make'' program using the rest of the line as arguments\." "help make"
+# test help next "n" abbreviation
+gdb_test "help n" "Step program, proceeding through subroutine calls\.\[\r\n\]+Like the \"step\" command as long as subroutine calls do not happen;\[\r\n\]+when they do, the call is treated as one instruction\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help next \"n\" abbreviation"
+# test help next
+gdb_test "help next" "Step program, proceeding through subroutine calls\.\[\r\n\]+Like the \"step\" command as long as subroutine calls do not happen;\[\r\n\]+when they do, the call is treated as one instruction\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help next"
+# test help nexti
+gdb_test "help ni" "Step one instruction, but proceed through subroutine calls\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help nexti"
+# all the commands that used to be here are now in "maintainance" instead
+# test help obscure
+gdb_test "help obscure" "Obscure features\.\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help obscure"
+# test help output
+gdb_test "help output" "Like \"print\" but don't put in value history and don't print newline\.\[\r\n\]+This is useful in user-defined commands\." "help output"
+# test help overlay
+gdb_test "help overlay" "Commands for debugging overlays.*"
+gdb_test "help overlay off" "Disable overlay debugging\."
+gdb_test "help overlay manual" "Enable overlay debugging\."
+gdb_test "help overlay auto" "Enable automatic overlay debugging\."
+gdb_test "help overlay list" "List mappings of overlay sections\."
+gdb_test "help overlay map" "Assert that an overlay section is mapped\."
+gdb_test "help overlay unmap" "Assert that an overlay section is unmapped\."
+gdb_test "help overlay load" "Read the overlay mapping state from the target\."
+# test help print "p" abbreviation
+gdb_test "help p" "Print value of expression EXP\.\[\r\n\]+Variables accessible are those of the lexical environment of the selected.*\[\r\n\]+EXP may be preceded with /FMT, where FMT is a format letter\[\r\n\]+but no count or size letter \\(see \"x\" command\\)\." "help print \"p\" abbreviation"
+# test help print
+gdb_test "help print" "Print value of expression EXP\.\[\r\n\]+Variables accessible are those of the lexical environment of the selected.*\[\r\n\]+EXP may be preceded with /FMT, where FMT is a format letter\[\r\n\]+but no count or size letter \\(see \"x\" command\\)\." "help print"
+# test help path
+gdb_test "help path" "Add directory DIR\\(s\\) to beginning of search path for object files\.\[\r\n\]+\\\$cwd in the path means the current working directory\.\[\r\n\]+This path is equivalent to the \\\$PATH shell variable\. It is a list of\[\r\n\]+directories, separated by colons\. These directories are searched to find\[\r\n\]+fully linked executable files and separately compiled object files as needed\." "help path"
+# test help printcmds
+gdb_test "help printcmds" "Undefined command: \"printcmds\"\. Try \"help\"\." "help printcmds"
+# test help printf
+gdb_test "help printf" "printf \"printf format string\", arg1, arg2, arg3, \.\.\., argn\[\r\n\]+This is useful for formatted output in user-defined commands\." "help printf"
+# test help ptype
+gdb_test "help ptype" "Print definition of type.*" "help ptype"
+# test help pwd
+gdb_test "help pwd" "Print working directory\. This is used for your program as well\." "help pwd"
+# test help quit "q" abbreviation
+gdb_test "help q" "Exit gdb\." "help quit \"q\" abbreviation"
+# test help quit
+gdb_test "help quit" "Exit gdb\." "help quit"
+# test help run "r" abbreviation
+gdb_test "help r" "Start debugged program\. You may specify arguments to give it\.\[\r\n\]+Args may include \"\\*\", or \"\\\[\.\.\.\\\]\"; they are expanded using \"sh\"\.\[\r\n\]+Input and output redirection with \">\", \"<\", or \">>\" are also allowed\.\[\r\n\]+With no arguments, uses arguments last specified \\(with \"run\" or \"set args\"\\)\.\[\r\n\]+To cancel previous arguments and run with no arguments,\[\r\n\]+use \"set args\" without arguments\." "help run \"r\" abbreviation"
+# test help run
+gdb_test "help run" "Start debugged program\. You may specify arguments to give it\.\[\r\n\]+Args may include \"\\*\", or \"\\\[\.\.\.\\\]\"; they are expanded using \"sh\"\.\[\r\n\]+Input and output redirection with \">\", \"<\", or \">>\" are also allowed\.\[\r\n\]+With no arguments, uses arguments last specified \\(with \"run\" or \"set args\"\\)\.\[\r\n\]+To cancel previous arguments and run with no arguments,\[\r\n\]+use \"set args\" without arguments\." "help run"
+# test help rbreak
+gdb_test "help rbreak" "Set a breakpoint for all functions matching REGEXP\." "help rbreak"
+# test help restore
+gdb_test "help restore" "Restore the contents of FILE to target memory\.\[\r\n\]+Arguments are FILE OFFSET START END where all except FILE are optional\.\[\r\n\]+OFFSET will be added to the base address of the file \\(default zero\\)\.\[\r\n\]+If START and END are given, only the file contents within that range\[\r\n\]+\\(file relative\\) will be restored to target memory\."
+# test help return
+gdb_test "help return" "Make selected stack frame return to its caller\.\[\r\n\]+Control remains in the debugger, but when you continue\[\r\n\]+execution will resume in the frame above the one now selected\.\[\r\n\]+If an argument is given, it is an expression for the value to return\." "help return"
+# test help reverse-search
+gdb_test "help reverse-search" "Search backward for regular expression \\(see regex\\(3\\)\\) from last line listed\..*" "help reverse-search"
+# test help running
+gdb_test "help running" "Running the program\.\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help running"
+# test help step "s" abbreviation
+gdb_test "help s" "Step program until it reaches a different source line\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help step \"s\" abbreviation"
+# test help step
+gdb_test "help step" "Step program until it reaches a different source line\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help step #1"
+# test help search
+gdb_test "help search" "Search for regular expression \\(see regex\\(3\\)\\) from last line listed\..*" "help search"
+# test help section
+gdb_test "help section" "Change the base address of section SECTION of the exec file to ADDR\.\[\r\n\]+This can be used if the exec file does not contain section addresses,\[\r\n\]+\\(such as in the a\.out format\\), or when the addresses specified in the\[\r\n\]+file itself are wrong\. Each section must be changed separately\. The\[\r\n\]+``info files'' command lists all the sections and their addresses\." "help section"
+#test help set annotate
+gdb_test "help set annotate" "Set annotation_level\.\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\)\[\r\n\]+2 == output annotated suitably for use by programs that control GDB\." "help set annotate"
+# test help set args
+gdb_test "help set args" "Set argument list to give program being debugged when it is started\.\[\r\n\]+Follow this command with any number of args, to be passed to the program\."
+# test help set check "c" abbreviation
+gdb_test "help set c" "Set the status of the type/range checker\.\[\r\n\]+List of set check subcommands:\[\r\n\]+set check range -- Set range checking\[\r\n\]+set check type -- Set type checking\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set check \"c\" abbreviation"
+# test help set check "ch" abbreviation
+gdb_test "help set ch" "Set the status of the type/range checker\.\[\r\n\]+List of set check subcommands:\[\r\n\]+set check range -- Set range checking\[\r\n\]+set check type -- Set type checking\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set check \"ch\" abbreviation"
+# test help set check
+gdb_test "help set check" "Set the status of the type/range checker\.\[\r\n\]+List of set check subcommands:\[\r\n\]+set check range -- Set range checking\[\r\n\]+set check type -- Set type checking\[\r\n\]+Type \"help set check\" followed by set check subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set check"
+# test help set check range
+gdb_test "help set check range" "Set range checking\. \\(on/warn/off/auto\\)" "help set check range"
+# test help set check type
+gdb_test "help set check type" "Set type checking\. \\(on/warn/off/auto\\)." "help set check type"
+# test help set complaints
+gdb_test "help set complaints" "Set max number of complaints about incorrect symbols\." "help set complaints"
+# test help set confirm
+gdb_test "help set confirm" "Set whether to confirm potentially dangerous operations\." "help set confirm"
+# test help set editing
+gdb_test "help set editing" "Set editing of command lines as they are typed\.\[\r\n\]+Use \"on\" to enable the editing, and \"off\" to disable it\.\[\r\n\]+Without an argument, command line editing is enabled\. To edit, use\[\r\n\]+EMACS-like or VI-like commands like control-P or ESC\." "help set editing"
+# test help set environment
+gdb_test "help set environment" "Set environment variable value to give the program\.\[\r\n\]+Arguments are VAR VALUE where VAR is variable name and VALUE is value\.\[\r\n\]+VALUES of environment variables are uninterpreted strings\.\[\r\n\]+This does not affect the program until the next \"run\" command\." "help set environment"
+# test help set height
+gdb_test "help set height" "Set number of lines gdb thinks are in a page\." "help set height"
+# test help set history expansion
+gdb_test "help set history expansion" "Set history expansion on command input\.\[\r\n\]+Without an argument, history expansion is enabled\." "help set history expansion"
+# test help set history filename
+gdb_test "help set history filename" "Set the filename in which to record the command history\[\r\n\]+\\(the list of previous commands of which a record is kept\\)\." "help set history filename"
+# test help set history save
+gdb_test "help set history save" "Set saving of the history record on exit\.\[\r\n\]+Use \"on\" to enable the saving, and \"off\" to disable it\.\[\r\n\]+Without an argument, saving is enabled\." "help set history save"
+# test help set history size
+gdb_test "help set history size" "Set the size of the command history,\[\r\n\]+ie\. the number of previous commands to keep a record of\." "help set history size"
+# test help set history
+gdb_test "help set history" "Generic command for setting command history parameters\.\[\r\n\]+List of set history subcommands:\[\r\n\]+set history expansion -- Set history expansion on command input\[\r\n\]+set history filename -- Set the filename in which to record the command history\[\r\n\]+set history save -- Set saving of the history record on exit\[\r\n\]+set history size -- Set the size of the command history\[\r\n\]+Type \"help set history\" followed by set history subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set history"
+# test help set language
+gdb_test "help set language" "Set the current source language\." "help set language"
+# test help set listsize
+gdb_test "help set listsize" "Set number of source lines gdb will list by default\." "help set listsize"
+# test help set print "p" abbreviation
+# FIXME -- Ultrix hangs randomly on this very long output from gdb and
+# continues with its output only if something is sent to gdb.
+# Also, if the system is slow, it may time out because the output is large.
+gdb_test "help set p" "Generic command for setting how things print\.\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set print \"p\" abbreviation"
+# test help set print "pr" abbreviation
+gdb_test "help set pr" "Generic command for setting how things print\.\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set print \"pr\" abbreviation"
+# test help set print
+gdb_test "help set print" "Generic command for setting how things print\.\[\r\n\]+List of set print subcommands:.*\[\r\n\]+Type \"help set print\" followed by set print subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help set print"
+# test help set print address
+gdb_test "help set print address" "Set printing of addresses\." "help set print address"
+# test help set print array
+gdb_test "help set print array" "Set prettyprinting of arrays\." "help set print array"
+# test help set print asm-demangle
+gdb_test "help set print asm-demangle" "Set demangling of C\[+\]+ names in disassembly listings\." "help set print asm-demangle"
+# test help set print demangle
+gdb_test "help set print demangle" "Set demangling of encoded C\[+\]+ names when displaying symbols\." "help set print demangle"
+# test help set print elements
+gdb_test "help set print elements" "Set limit on string chars or array elements to print\.\[\r\n\]+\"set print elements 0\" causes there to be no limit\." "help set print elements"
+# test help set print object
+gdb_test "help set print object" "Set printing of object's derived type based on vtable info\." "help set print object"
+# test help set print pretty
+gdb_test "help set print pretty" "Set prettyprinting of structures\." "help set print pretty"
+# test help set print sevenbit-strings
+gdb_test "help set print sevenbit-strings" "Set printing of 8-bit characters in strings as \\\\nnn\." "help set print sevenbit-strings"
+# test help set print union
+gdb_test "help set print union" "Set printing of unions interior to structures\." "help set print union"
+# test help set print vtbl
+gdb_test "help set print vtbl" "Set printing of C\[+\]+ virtual function tables\." "help set print vtbl"
+# test help set prompt
+gdb_test "help set prompt" "Set gdb's prompt" "help set prompt"
+# test help set radix
+gdb_test "help set radix" "Set default input and output number radices\.\[\r\n\]+Use \'set input-radix\' or \'set output-radix\' to independently set each\.\[\r\n\]+Without an argument, sets both radices back to the default value of 10\." "help set radix"
+# test help set symbol-reloading
+gdb_test "help set symbol-reloading" "Set dynamic symbol table reloading multiple times in one run\." "help set symbol-reloading"
+# test help set variable
+gdb_test "help set variable" "Evaluate expression EXP and assign result to variable VAR, using assignment\[\r\n\]+syntax appropriate for the current language \\(VAR = EXP or VAR := EXP for\[\r\n\]+example\\)\. VAR may be a debugger \"convenience\" variable \\(names starting\[\r\n\]+with \\\$\\), a register \\(a few standard names starting with \\\$\\), or an actual\[\r\n\]+variable in the program being debugged\. EXP is any valid expression\.\[\r\n\]+This may usually be abbreviated to simply \"set\"\." "help set variable"
+# test help set verbose
+gdb_test "help set verbose" "Set verbosity\." "help set verbose"
+#test help set width
+gdb_test "help set width" "Set number of characters gdb thinks are in a line\." "help set width"
+# test help set write
+# This is only supported on targets which use exec.o.
+gdb_test "help set write" "Set writing into executable and core files\." "help set write"
+# test help set
+# FIXME -- Ultrix hangs randomly on this very long output from gdb and
+# continues with its output only if something is sent to gdb.
+# Also, if the system is slow, it may time out because the output is large.
+gdb_test "help set" "Evaluate expression EXP and assign result to variable VAR, using assignment\[\r\n\]+syntax appropriate for the current language \\(VAR = EXP or VAR := EXP for\[\r\n\]+example\\)\. VAR may be a debugger \"convenience\" variable \\(names starting\[\r\n\]+with \\\$\\), a register \\(a few standard names starting with \\\$\\), or an actual\[\r\n\]+variable in the program being debugged\. EXP is any valid expression.*\[\r\n\]+set listsize -- Set number of source lines gdb will list by default.*\[\r\n\]+Type \"help set\" followed by set subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous..*\[\r\n\]+" "help set"
+# test help shell
+gdb_test "help shell" "Execute the rest of the line as a shell command\.\[\r\n\]+With no arguments, run an inferior shell\." "help shell"
+#test help show annotate
+gdb_test "help show annotate" "Show annotation_level\.\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\)\[\r\n\]+2 == output annotated suitably for use by programs that control GDB\." "help show annotate"
+# test help show args
+gdb_test "help show args" "Show argument list to give program being debugged when it is started\.\[\r\n\]+Follow this command with any number of args, to be passed to the program\."
+# test help show check "c" abbreviation
+gdb_test "help show c" "Show the status of the type/range checker\.\[\r\n\]+List of show check subcommands:\[\r\n\]+show check range -- Show range checking\[\r\n\]+show check type -- Show type checking\[\r\n\]+Type \"help show check\" followed by show check subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show check \"c\" abbreviation"
+# test help show check
+gdb_test "help show check" "Show the status of the type/range checker\.\[\r\n\]+List of show check subcommands:\[\r\n\]+show check range -- Show range checking\[\r\n\]+show check type -- Show type checking\[\r\n\]+Type \"help show check\" followed by show check subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show check"
+# test help show check range
+gdb_test "help show check range" "Show range checking\. \\(on/warn/off/auto\\)" "help show check range"
+# test help show check type
+gdb_test "help show check type" "Show type checking\. \\(on/warn/off/auto\\)" "help show check type"
+# test help show commands
+gdb_test "help show commands" "Show the history of commands you typed\.\[\r\n\]+You can supply a command number to start with, or a `\[+\]' to start after\[\r\n\]+the previous command number shown\." "help show commands"
+# test help show complaints
+gdb_test "help show complaints" "Show max number of complaints about incorrect symbols\." "help show complaints"
+# test help show confirm
+gdb_test "help show confirm" "Show whether to confirm potentially dangerous operations\." "help show confirm"
+# test help show convenience
+gdb_test "help show convenience" "Debugger convenience \\(\"\\\$foo\"\\) variables\.\[\r\n\]+These variables are created when you assign them values;\[\r\n\]+thus, \"print \\\$foo=1\" gives \"\\\$foo\" the value 1\. Values may be any type\.\[\r\n\]+A few convenience variables are given values automatically:\[\r\n\]+\"\\\$_\"holds the last address examined with \"x\" or \"info lines\",\[\r\n\]+\"\\\$__\" holds the contents of the last address examined with \"x\"\." "help show convenience"
+# test help show directories
+gdb_test "help show directories" "Current search path for finding source files\.\[\r\n\]+\\\$cwd in the path means the current working directory\.\[\r\n\]+\\\$cdir in the path means the compilation directory of the source file\." "help show directories"
+# test help show editing
+gdb_test "help show editing" "Show editing of command lines as they are typed\.\[\r\n\]+Use \"on\" to enable the editing, and \"off\" to disable it\.\[\r\n\]+Without an argument, command line editing is enabled\. To edit, use\[\r\n\]+EMACS-like or VI-like commands like control-P or ESC\." "help show editing"
+# test help show environment
+gdb_test "help show environment" "The environment to give the program, or one variable's value\.\[\r\n\]+With an argument VAR, prints the value of environment variable VAR to\[\r\n\]+give the program being debugged\. With no arguments, prints the entire\[\r\n\]+environment to be given to the program\." "help show environment"
+# test help show height
+gdb_test "help show height" "Show number of lines gdb thinks are in a page\." "help show height"
+# test help show history expansion
+gdb_test "help show history expansion" "Show history expansion on command input\.\[\r\n\]+Without an argument, history expansion is enabled\." "help show history expansion"
+# test help show history filename
+gdb_test "help show history filename" "Show the filename in which to record the command history\[\r\n\]+\\(the list of previous commands of which a record is kept\\)\." "help show history filename"
+# test help show history save
+gdb_test "help show history save" "Show saving of the history record on exit\.\[\r\n\]+Use \"on\" to enable the saving, and \"off\" to disable it\.\[\r\n\]+Without an argument, saving is enabled\." "help show history save"
+# test help show history size
+gdb_test "help show history size" "Show the size of the command history,\[\r\n\]+ie\. the number of previous commands to keep a record of\." "help show history size"
+# test help show history
+gdb_test "help show history" "Generic command for showing command history parameters\.\[\r\n\]+List of show history subcommands:\[\r\n\]+show history expansion -- Show history expansion on command input\[\r\n\]+show history filename -- Show the filename in which to record the command history\[\r\n\]+show history save -- Show saving of the history record on exit\[\r\n\]+show history size -- Show the size of the command history\[\r\n\]+Type \"help show history\" followed by show history subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show history"
+# test help show language
+gdb_test "help show language" "Show the current source language\." "help show language"
+# test help show listsize
+gdb_test "help show listsize" "Show number of source lines gdb will list by default\." "help show listsize"
+# test help show print "p" abbreviation
+gdb_test "help show p" "Generic command for showing print settings\.\[\r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" followed by show print subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show print \"p\" abbreviation"
+# test help show print "pr" abbreviation
+gdb_test "help show pr" "Generic command for showing print settings\.\[\r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" followed by show print subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show print \"pr\" abbreviation"
+# test help show print
+gdb_test "help show print" "Generic command for showing print settings\.\[\r\n\]+List of show print subcommands:.*\[\r\n\]+Type \"help show print\" followed by show print subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show print"
+# test help show paths
+gdb_test "help show paths" "Current search path for finding object files\.\[\r\n\]+\\\$cwd in the path means the current working directory\.\[\r\n\]+This path is equivalent to the \\\$PATH shell variable\. It is a list of\[\r\n\]+directories, separated by colons\. These directories are searched to find\[\r\n\]+fully linked executable files and separately compiled object files as needed\." "help show paths"
+# test help show print address
+gdb_test "help show print address" "Show printing of addresses\." "help show print address"
+# test help show print array
+gdb_test "help show print array" "Show prettyprinting of arrays\." "help show print array"
+# test help show print asm-demangle
+gdb_test "help show print asm-demangle" "Show demangling of C\[+\]+ names in disassembly listings\." "help show print asm-demangle"
+# test help show print demangle
+gdb_test "help show print demangle" "Show demangling of encoded C\[+\]+ names when displaying symbols\." "help show print demangle"
+# test help show print elements
+gdb_test "help show print elements" "Show limit on string chars or array elements to print\.\[\r\n\]+\"set print elements 0\" causes there to be no limit\." "help show print elements"
+# test help show print object
+gdb_test "help show print object" "Show printing of object's derived type based on vtable info\." "help show print object"
+# test help show print pretty
+gdb_test "help show print pretty" "Show prettyprinting of structures\." "help show print pretty"
+# test help show print sevenbit-strings
+gdb_test "help show print sevenbit-strings" "Show printing of 8-bit characters in strings as \\\\nnn\." "help show print sevenbit-strings"
+# test help show print union
+gdb_test "help show print union" "Show printing of unions interior to structures\." "help show print union"
+# test help show print vtbl
+gdb_test "help show print vtbl" "Show printing of C\[+\]+ virtual function tables\." "help show print vtbl"
+# test help show prompt
+gdb_test "help show prompt" "Show gdb's prompt" "help show prompt"
+# test help show radix
+gdb_test "help show radix" "Show the default input and output number radices\.\[\r\n\]+Use \'show input-radix\' or \'show output-radix\' to independently show each\." "help show radix"
+# test help show symbol-reloading
+gdb_test "help show symbol-reloading" "Show dynamic symbol table reloading multiple times in one run\." "help show symbol-reloading"
+# test help show user
+gdb_test "help show user" "Show definitions of user defined commands\.\[\r\n\]+Argument is the name of the user defined command\.\[\r\n\]+With no argument, show definitions of all user defined commands\." "help show user"
+# test help show values
+gdb_test "help show values" "Elements of value history around item number IDX \\(or last ten\\)\." "help show values"
+# test help show verbose
+gdb_test "help show verbose" "Show verbosity\." "help show verbose"
+# test help show version
+gdb_test "help show version" "Show what version of GDB this is\." "help show version"
+# test help show width
+gdb_test "help show width" "Show number of characters gdb thinks are in a line\." "help show width"
+# test help show write
+# This is only supported on targets which use exec.o.
+gdb_test "help show write" "Show writing into executable and core files\." "help show write"
+# test help show
+# FIXME -- Ultrix hangs randomly on this very long output from gdb and
+# continues with its output only if something is sent to gdb.
+# Also, if the system is slow, it may time out because the output is large.
+gdb_test "help show" "Generic command for showing things about the debugger\.\[\r\n\]+List of show subcommands:.*\[\r\n\]+show directories -- Current search path for finding source files.*\[\r\n\]+show listsize -- Show number of source lines gdb will list by default.*\[\r\n\]+Type \"help show\" followed by show subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help show"
+# test help step
+gdb_test "help step" "Step program until it reaches a different source line\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help step #2"
+# test help stepi "si" abbreviation
+gdb_test "help si" "Step one instruction exactly\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help stepi \"si\" abbreviation"
+# test help stepi
+gdb_test "help stepi" "Step one instruction exactly\.\[\r\n\]+Argument N means do this N times \\(or till program stops for another reason\\)\." "help stepi"
+# test help signal
+gdb_test "help signal" "Continue program giving it signal.*" "help signal"
+# test help source
+# vxgdb reads .vxgdbinit
+gdb_test "help source" "Read commands from a file named FILE\.\[\r\n\]+Note that the file \"\[^\"\]*\" is read automatically in this way\[\r\n\]+when gdb is started\." "help source"
+# test help stack
+gdb_test "help stack" "Examining the stack\..*\[\r\n\]+When the program being debugged stops, gdb selects the innermost frame\.\[\r\n\]+The commands below can be used to select other frames by number or address\.\[\r\n\]+List of commands:\[\r\n\]+backtrace -- Print backtrace of all stack frames\[\r\n\]+bt -- Print backtrace of all stack frames\[\r\n\]+down -- Select and print stack frame called by this one\[\r\n\]+frame -- Select and print a stack frame\[\r\n\]+return -- Make selected stack frame return to its caller\[\r\n\]+select-frame -- Select a stack frame without printing anything\[\r\n\]+up -- Select and print stack frame that called this one\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help stack"
+# test help status
+gdb_test "help status" "Status inquiries\.\[\r\n\]+List of commands:\[\r\n\]+info -- Generic command for showing things about the program being debugged.*\[\r\n\]+show -- Generic command for showing things about the debugger\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help status"
+
+# test help support
+# FIXME -- Ultrix hangs randomly on this very long output from gdb and
+# continues with its output only if something is sent to gdb.
+# Also, if the system is slow, it may time out because the output is large.
+gdb_test "help support" "Support facilities\.\[\r\n\]+List of commands:.*\[\r\n\]+show confirm -- Show whether to confirm potentially dangerous operations.*\[\r\n\]+show history -- Generic command for showing command history parameters.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help support"
+# test help symbol-file
+gdb_test "help symbol-file" "Load symbol table from executable file FILE\.\[\r\n\]+The `file' command can also load symbol tables, as well as setting the file\[\r\n\]+to execute\." "help symbol-file"
+# test help target child
+gdb_test "help target child" "Unix child process \\(started by the \"run\" command\\)\.|Undefined target command: \"child\"\. Try \"help target\"\." "help target child"
+# test help target procfs
+gdb_test "help target procfs" "Unix /proc child process \\(started by the \"run\" command\\)\.|Undefined target command: \"procfs\"\. Try \"help target\"\." "help target procfs (procfs version)"
+# test help target core
+gdb_test "help target core" "Use a core file as a target\. Specify the filename of the core file\.|(Undefined target command: \"core\"\. Try \"help target\"\.)" "help target core"
+# test help target exec
+gdb_test "help target exec" "Use an executable file as a target\.\[\r\n\]+Specify the filename of the executable file\." "help target exec"
+# test help target remote
+gdb_test "help target remote" "Use a remote computer via a serial line, using a gdb-specific protocol\.\[\r\n\]+Specify the serial device it is connected to\[\r\n\]+\\(e.g. .*" "help target remote"
+# test help target
+# the child process target may be "target child" or "target procfs"
+gdb_test "help target" "Connect to a target machine or process\.\[\r\n\]+The first argument is the type or protocol of the target machine\.\[\r\n\]+Remaining arguments are interpreted by the target protocol\. For more\[\r\n\]+information on the arguments for a particular protocol, type\[\r\n\]+`help target ' followed by the protocol name\.\[\r\n\]+List of target subcommands:.*\[\r\n\]+target exec -- Use an executable file as a target.*\[\r\n\]+Type \"help target\" followed by target subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help target"
+# test help tbreak
+gdb_test "help tbreak" "Set a temporary breakpoint.*" "help tbreak"
+# test help tty
+gdb_test "help tty" "Set terminal for future runs of program being debugged\." "help tty"
+# test help until "u" abbreviation
+gdb_test "help u" "Execute until the program reaches a source line greater than the current\[\r\n\]+or a specified line or address or function \\(same args as break command\\)\.\[\r\n\]+Execution will also stop upon exit from the current stack frame\." "help until \"u\" abbreviation"
+# test help until
+gdb_test "help until" "Execute until the program reaches a source line greater than the current\[\r\n\]+or a specified line or address or function \\(same args as break command\\)\.\[\r\n\]+Execution will also stop upon exit from the current stack frame\." "help until"
+# test help undisplay
+gdb_test "help undisplay" "Cancel some expressions to be displayed when program stops\.\[\r\n\]+Arguments are the code numbers of the expressions to stop displaying\.\[\r\n\]+No argument means cancel all automatic-display expressions\.\[\r\n\]+\"delete display\" has the same effect as this command\.\[\r\n\]+Do \"info display\" to see current list of code numbers\." "help undisplay"
+# test help unset environment
+gdb_test "help unset environment" "Cancel environment variable VAR for the program\.\[\r\n\]+This does not affect the program until the next \"run\" command\." "help unset environment"
+# test help unset
+gdb_test "help unset" "Complement to certain \"set\" commands\.\[\r\n\]+List of unset subcommands:\[\r\n\]+unset environment -- Cancel environment variable VAR for the program\[\r\n\]+Type \"help unset\" followed by unset subcommand name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help unset"
+# test help up
+gdb_test "help up" "Select and print stack frame that called this one\.\[\r\n\]+An argument says how many frames up to go\." "help up"
+# test help up-silently
+gdb_test "help up-silently" "Same as the `up' command, but does not print anything\.\[\r\n\]+This is useful in command scripts\." "help up-silently"
+# test help user-defined
+gdb_test "help user-defined" "User-defined commands\.\[\r\n\]+The commands in this class are those defined by the user\.\[\r\n\]+Use the \"define\" command to define a command\.\[\r\n\]+List of commands:.*\[\r\n\]+Type \"help\" followed by command name for full documentation\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\." "help user-defined"
+# test help watch
+gdb_test "help watch" "Set a watchpoint for an expression\.\[\r\n\]+A watchpoint stops execution of your program whenever the value of\[\r\n\]+an expression changes\." "help watch"
+# test help whatis
+gdb_test "help whatis" "Print data type of expression EXP\." "help whatis"
+# test help where
+gdb_test "help where" "Print backtrace of all stack frames, or innermost COUNT frames\.\[\r\n\]+With a negative argument, print outermost -COUNT frames\.\[\r\n\]+Use of the 'full' qualifier also prints the values of the local variables\." "help where"
+# test help x
+gdb_test "help x" "Examine memory: x/FMT ADDRESS\.\[\r\n\]+ADDRESS is an expression for the memory address to examine\.\[\r\n\]+FMT is a repeat count followed by a format letter and a size letter\..*\[\r\n\]+Defaults for format and size letters are those previously used\.\[\r\n\]+Default count is 1\. Default address is following last thing printed\[\r\n\]+with this command or \"print\"\." "help x"
+# test help info bogus-gdb-command
+gdb_test "help info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\"\. Try \"help info\"\." "help info bogus-gdb-command"
+# test help gotcha
+gdb_test "help gotcha" "Undefined command: \"gotcha\"\. Try \"help\"\." "help gotcha"
+# test apropos regex
+gdb_test "apropos \\\(print\[\^ bsiedf\\\".-\]\\\)" "handle -- Specify how to handle a signal"
+# test apropos >1 word string
+gdb_test "apropos handle a signal" "handle -- Specify how to handle a signal"
+# test apropos apropos
+gdb_test "apropos apropos" "apropos -- Search for commands matching a REGEXP"
diff --git a/gdb/testsuite/gdb.base/huge.c b/gdb/testsuite/gdb.base/huge.c
new file mode 100644
index 00000000000..419b92cc5b7
--- /dev/null
+++ b/gdb/testsuite/gdb.base/huge.c
@@ -0,0 +1,17 @@
+/*
+ * Test GDB's ability to read a very large data object from target memory.
+ */
+
+/* A value that will produce a target data object large enough to
+ crash GDB. 0x200000 is big enough on GNU/Linux, other systems may
+ need a larger number. */
+
+#define CRASH_GDB 0x200000
+
+static int a[CRASH_GDB], b[CRASH_GDB];
+
+main()
+{
+ memcpy (a, b, sizeof (a));
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/huge.exp b/gdb/testsuite/gdb.base/huge.exp
new file mode 100644
index 00000000000..fa50d0115ac
--- /dev/null
+++ b/gdb/testsuite/gdb.base/huge.exp
@@ -0,0 +1,57 @@
+# Copyright 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@redhat.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# Define if you want to skip this test
+# (could be very time-consuming on remote targets with slow connection).
+#
+if [target_info exists gdb,skip_huge_test] {
+ return;
+}
+
+set testfile "huge"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set timeout 30
+
+if { ! [ runto main ] } then {
+ gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
+}
+
+gdb_test "print a" ".1 = .0 .repeats \[0123456789\]+ times.." "print a very large data object"
+
diff --git a/gdb/testsuite/gdb.base/info-proc.exp b/gdb/testsuite/gdb.base/info-proc.exp
new file mode 100644
index 00000000000..2a9a4b09a3d
--- /dev/null
+++ b/gdb/testsuite/gdb.base/info-proc.exp
@@ -0,0 +1,75 @@
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@redhat.com)
+# This is a test for the gdb command "info proc"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "break"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+set ws "\[ \t\]+"
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Does this gdb support info proc?
+send_gdb "help info proc\n"
+gdb_expect {
+ -re "Undefined info command: .proc.. Try .help info.*$gdb_prompt $" {
+ # info proc command not supported -- nothing to test here.
+ unsupported "gdb does not support info proc on this target"
+ return -1;
+ }
+ -re "Show /proc process information about .*$gdb_prompt $" {
+ pass "help info proc"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "help info proc"
+ }
+ timeout {
+ fail "help info proc (timeout)"
+ }
+}
+
+gdb_test "info proc" "No current process.*" "info proc without a process"
+
+if { ! [ runto main ] } then {
+ gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
+}
+
+gdb_test "info proc" "process ${decimal}.*" "info proc with process"
+
+gdb_test "info proc mapping" \
+ ".*Mapped address spaces:.*${hex}${ws}${hex}${ws}${hex}${ws}${hex}.*" \
+ "info proc mapping"
diff --git a/gdb/testsuite/gdb.base/int-type.c b/gdb/testsuite/gdb.base/int-type.c
new file mode 100644
index 00000000000..548ca9c36bb
--- /dev/null
+++ b/gdb/testsuite/gdb.base/int-type.c
@@ -0,0 +1,25 @@
+
+int x;
+int y;
+int z;
+int w;
+
+
+
+int main ()
+{
+
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+
+ x = 14;
+ y = 3;
+ z = 2;
+ w = 2;
+
+ return 0;
+
+}
+
diff --git a/gdb/testsuite/gdb.base/interrupt.c b/gdb/testsuite/gdb.base/interrupt.c
new file mode 100644
index 00000000000..a895d4b7d81
--- /dev/null
+++ b/gdb/testsuite/gdb.base/interrupt.c
@@ -0,0 +1,40 @@
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+int
+main ()
+{
+ char x;
+ int nbytes;
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ printf ("talk to me baby\n");
+ while (1)
+ {
+ nbytes = read (0, &x, 1);
+ if (nbytes < 0)
+ {
+#ifdef EINTR
+ if (errno != EINTR)
+#endif
+ perror ("");
+ }
+ else if (nbytes == 0)
+ {
+ printf ("end of file\n");
+ exit (0);
+ }
+ else
+ write (1, &x, 1);
+ }
+ return 0;
+}
+
+int
+func1 ()
+{
+ return 4;
+}
diff --git a/gdb/testsuite/gdb.base/interrupt.exp b/gdb/testsuite/gdb.base/interrupt.exp
new file mode 100644
index 00000000000..b370b53a52d
--- /dev/null
+++ b/gdb/testsuite/gdb.base/interrupt.exp
@@ -0,0 +1,185 @@
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if [host_info exists name] {
+ if [board_info host exists gdb,nointerrupts] {
+ verbose "Skipping interrupt.exp because of nointerrupts."
+ continue
+ }
+}
+
+if [target_info exists gdb,noinferiorio] {
+ verbose "Skipping interrupt.exp because of noinferiorio."
+ return
+}
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile interrupt
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_start
+
+
+if ![file exists $binfile] then {
+ perror "$binfile does not exist."
+ return 0
+} else {
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+ # Hope this is unix :-)
+ gdb_test "shell stty intr '^C'" "" \
+ "set interrupt character in interrupt.exp"
+ if [runto_main] then {
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "\r\ntalk to me baby\r\n$" {
+ pass "child process is alive"
+ }
+ timeout { fail "run (timeout)" }
+ eof { fail "run (eof)" }
+ }
+ # This should appear twice, once for the echo and once for the
+ # program's output. Under dejagnu (but not interactively) for
+ # SunOS4, it only appears once. Don't worry about it, I imagine
+ # dejagnu has just done something to the tty modes.
+ send_gdb "a\n"
+ gdb_expect {
+ -re "^a\r\n(|a\r\n)$" {
+ pass "child process ate our char"
+ }
+ timeout { fail "echo a (timeout)" }
+ eof { fail "echo a (eof)" }
+ }
+ # Wait until the program is in the read system call again.
+ sleep 2
+
+ # Cntrl-c may fail for simulator targets running on a BSD host.
+ # This is the result of a combination of the read syscall
+ # being restarted and gdb capturing the cntrl-c signal.
+
+ # Cntrl-c may fail for simulator targets on slow hosts.
+ # This is because there is a race condition between entering
+ # the read and delivering the cntrl-c.
+
+ send_gdb "\003"
+ gdb_expect {
+ -re "Program received signal SIGINT.*$gdb_prompt $" {
+ pass "send_gdb control C"
+ }
+ -re ".*$gdb_prompt $" { fail "send_gdb control C" }
+ timeout { fail "send_gdb control C (timeout)" }
+ eof { fail "send_gdb control C (eof)" }
+ }
+
+ send_gdb "p func1 ()\n"
+ gdb_expect {
+ -re " = 4.*$gdb_prompt $" { pass "call function when asleep" }
+ -re ".*Program received signal SIG(SEGV|ILL).*$gdb_prompt $" {
+ setup_xfail "i*86-pc-linux*-gnu*"
+ fail "child died when we called func1, skipped rest of tests"
+ return
+ }
+ -re "$gdb_prompt $" {
+ # On HPUX-11.0 'send "p func1 ()"' above
+ # terminates the program. A defect is pending on this
+ # issue [defect #DTS CHFts24203]. Hence calling setup_xfail
+ # below.
+ setup_xfail "hppa*-*-*11*" CHFts24203
+ fail "call function when asleep (wrong output)"
+ }
+ default {
+
+ # This fail probably happens whenever we use /proc (we
+ # don't use PRSABORT), but apparently also happens on
+ # other machines as well.
+
+ setup_xfail "sparc*-*-solaris2*"
+ setup_xfail "mips-*-ultrix*"
+ setup_xfail "i386*-*-bsd*"
+ setup_xfail "i*86-*-solaris2*"
+ setup_xfail "*-*-sysv4*"
+ setup_xfail "vax-*-*"
+ setup_xfail "alpha-*-*"
+ setup_xfail "*-*-irix*"
+ setup_xfail "*-*-hpux*"
+ setup_xfail "*-*-*lynx*"
+ fail "call function when asleep (stays asleep)"
+ # Send_Gdb a newline to wake it up
+ send_gdb "\n"
+ gdb_test "" " = 4" "call function after waking it"
+ }
+# eof { fail "call function when asleep (eof)" }
+ }
+
+ # Now try calling the function again.
+ gdb_test "p func1 ()" " = 4" "call function a second time"
+
+ # And the program should still be doing the same thing.
+ # The optional trailing \r\n is in case we sent a newline above
+ # to wake the program, in which case the program now sends it
+ # back. We check for it either here or in the next gdb_expect
+ # command, because which one it ends up in is timing dependent.
+ send_gdb "continue\n"
+ # For some reason, i386-*-sysv4 gdb fails to issue the Continuing
+ # message, but otherwise appears normal (FIXME).
+ gdb_expect {
+ -re "^continue\r\nContinuing.\r\n(\r\n|)$" { pass "continue" }
+ -re "^continue\r\n\r\n" { fail "continue (missing Continuing.)" }
+ -re "$gdb_prompt $" { fail "continue" }
+ timeout { fail "continue (timeout)" }
+ eof { fail "continue (eof)" }
+ }
+
+ send_gdb "data\n"
+ # The optional leading \r\n is in case we sent a newline above
+ # to wake the program, in which case the program now sends it
+ # back.
+ # FIXME: The pattern below leads to an expected success on HPUX-11.0
+ # but the success is spurious. Need to provide the right reg.expr.
+ # here.
+ gdb_expect {
+ -re "^(\r\n|)data\r\n(|data\r\n)$" { pass "echo data" }
+ timeout { fail "echo data (timeout)" }
+ eof { fail "echo data (eof)" }
+ }
+
+ setup_xfail "i*86-pc-linux*-gnu*"
+ send_gdb "\004"
+ gdb_expect {
+ -re "end of file.*Program exited normally.*$gdb_prompt $" {
+ pass "send end of file"
+ }
+ -re "$gdb_prompt $" { fail "send end of file" }
+ timeout { fail "send end of file (timeout)" }
+ eof { fail "send end of file (eof)" }
+ }
+ }
+}
+return 0
diff --git a/gdb/testsuite/gdb.base/jump.c b/gdb/testsuite/gdb.base/jump.c
new file mode 100644
index 00000000000..aae94f7e85a
--- /dev/null
+++ b/gdb/testsuite/gdb.base/jump.c
@@ -0,0 +1,24 @@
+/* This program is used to test the "jump" command. There's nothing
+ particularly deep about the functionality nor names in here.
+ */
+
+#ifdef PROTOTYPES
+static int square (int x)
+#else
+static int square (x)
+ int x;
+#endif
+{
+ return x*x;
+}
+
+
+int main ()
+{
+ int i = 99;
+
+ i++;
+ i = square (i);
+ i--;
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/jump.exp b/gdb/testsuite/gdb.base/jump.exp
new file mode 100644
index 00000000000..a2c53ee7788
--- /dev/null
+++ b/gdb/testsuite/gdb.base/jump.exp
@@ -0,0 +1,187 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+set prms_id 0
+set bug_id 0
+
+clear_xfail "*-*-*"
+
+set testfile "jump"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Build the test case
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+
+
+# Start with a fresh gdb
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ perror "Couldn't run to main"
+ return -1
+}
+
+# Set a breakpoint on the statement that we're about to jump to.
+# The statement doesn't contain a function call.
+#
+send_gdb "break 22\n"
+set bp_on_non_call 0
+gdb_expect {
+ -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line 22.*$gdb_prompt $"\
+ {set bp_on_non_call $expect_out(1,string)
+ pass "break before jump to non-call"}
+ -re "$gdb_prompt $"\
+ {fail "break before jump to non-call"}
+ timeout {fail "(timeout) break before jump to non-call"}
+}
+
+# Can we jump to the statement? Do we stop there?
+#
+send_gdb "jump 22\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*, .*${srcfile}:22.*$gdb_prompt $"\
+ {pass "jump to non-call"}
+ -re "$gdb_prompt $"\
+ {fail "jump to non-call"}
+ timeout {fail "(timeout) jump to non-call"}
+}
+
+# Set a breakpoint on the statement that we're about to jump to.
+# The statement does contain a function call.
+#
+send_gdb "break 21\n"
+set bp_on_call 0
+gdb_expect {
+ -re "\[Bb\]reakpoint (\[0-9\]*) at 0x\[0-9a-fA-F\]*: file .*${srcfile}, line 21.*$gdb_prompt $"\
+ {set bp_on_call $expect_out(1,string)
+ pass "break before jump to call"}
+ -re "$gdb_prompt $"\
+ {fail "break before jump to call"}
+ timeout {fail "(timeout) break before jump to call"}
+}
+
+# Can we jump to the statement? Do we stop there?
+#
+send_gdb "jump 21\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*, .*${srcfile}:21.*$gdb_prompt $"\
+ {pass "jump to call"}
+ -re "$gdb_prompt $"\
+ {fail "jump to call"}
+ timeout {fail "(timeout) jump to call"}
+}
+
+# If we disable the breakpoint at the function call, and then
+# if we jump to that statement, do we not stop there, but at
+# the following breakpoint?
+#
+send_gdb "disable $bp_on_call\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "disable breakpoint on call"}
+ timeout {fail "(timeout) disable breakpoint on call"}
+}
+
+send_gdb "jump 21\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*, .*${srcfile}:22.*$gdb_prompt $"\
+ {pass "jump to call with disabled breakpoint"}
+ -re "$gdb_prompt $"\
+ {fail "jump to call with disabled breakpoint"}
+ timeout {fail "(timeout) jump to call with disabled breakpoint"}
+}
+
+# Verify that GDB responds gracefully to the "jump" command without
+# an argument.
+#
+send_gdb "jump\n"
+gdb_expect {
+ -re "Argument required .starting address..*$gdb_prompt $"\
+ {pass "jump without argument disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "jump without argument disallowed"}
+ timeout {fail "(timeout) jump without argument disallowed"}
+}
+
+# Verify that GDB responds gracefully to the "jump" command with
+# trailing junk.
+#
+send_gdb "jump 21 100\n"
+gdb_expect {
+ -re "Junk at end of line specification: 100.*$gdb_prompt $"\
+ {pass "jump with trailing argument junk"}
+ -re "$gdb_prompt $"\
+ {fail "jump with trailing argument junk"}
+ timeout {fail "(timeout) jump with trailing argument junk"}
+}
+
+# Verify that GDB responds gracefully to a request to jump out of
+# the current function. (Note that this will very likely cause the
+# inferior to die. Be prepared to rerun the inferior, if further
+# testing is desired.)
+#
+# Try it both ways: confirming and not confirming the jump.
+#
+send_gdb "jump 12\n"
+gdb_expect {
+ -re "Line 12 is not in `main'. Jump anyway.*y or n. $"\
+ {send_gdb "n\n"
+ gdb_expect {
+ -re "Not confirmed.*$gdb_prompt $"\
+ {pass "aborted jump out of current function"}
+ -re "$gdb_prompt $"\
+ {fail "aborted jump out of current function"}
+ timeout {fail "(timeout) aborted jump out of current function"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "aborted jump out of current function"}
+ timeout {fail "(timeout) aborted jump out of current function"}
+}
+
+send_gdb "jump 12\n"
+gdb_expect {
+ -re "Line 12 is not in `main'. Jump anyway.*y or n. $"\
+ {send_gdb "y\n"
+ gdb_expect {
+ -re "Continuing at.*$gdb_prompt $"\
+ {pass "jump out of current function"}
+ -re "$gdb_prompt $"\
+ {fail "jump out of current function"}
+ timeout {fail "(timeout) jump out of current function"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "jump out of current function"}
+ timeout {fail "(timeout) jump out of current function"}
+}
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.base/langs.exp b/gdb/testsuite/gdb.base/langs.exp
new file mode 100644
index 00000000000..9ed1e91a289
--- /dev/null
+++ b/gdb/testsuite/gdb.base/langs.exp
@@ -0,0 +1,149 @@
+# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile langs
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [is_remote host] {
+ remote_download host ${srcdir}/${subdir}/langs1.f
+ remote_download host ${srcdir}/${subdir}/langs2.cxx
+}
+
+
+if { [gdb_compile "${srcdir}/${subdir}/langs0.c" "${binfile}0.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/langs1.c" "${binfile}1.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/langs2.c" "${binfile}2.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${binfile}0.o ${binfile}1.o ${binfile}2.o" ${binfile} executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+set oldtimeout $timeout
+set timeout 10
+
+
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+gdb_test "b langs0" "Function \"langs0\" not defined\.|Breakpoint .* (deferred).*" \
+ "break on nonexistent function in langs.exp"
+
+if {$hp_aCC_compiler} {
+ set isfixed 1
+ set lang c\\+\\+
+ set ext cxx
+ set foo_func foo__Fi__Fi
+ set do_func do::langs0
+} else {
+ if {$hp_cc_compiler} {
+ set isfixed 1
+ set lang c
+ set ext c
+ } else {
+ set isfixed 0
+ }
+ set foo_func foo__Fi
+ set do_func langs0__2do
+}
+
+if [runto csub] then {
+
+ if { !$isfixed } { set lang c }
+ gdb_test "show language" "currently $lang\".*" \
+ "show language at csub in langs.exp"
+ # On some machines, foo doesn't get demangled because the N_SOL for
+ # langs2.cxx is seen only after the function stab for foo. So
+ # the following regexps are kludged to accept foo__Fi as well as foo,
+ # even though only the latter is correct. I haven't tried to xfail it
+ # because it depends on details of the compiler.
+
+ # Take out xfail. This test has been passing for some time now.
+ #if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
+ gdb_test "bt" "#0.*csub.*#1.*(foo|$foo_func) \\(.*#2.*cppsub_ .*#3.*fsub.*#4.*$do_func \\(.*#5 \[0-9a-fx\]* in main.*" "backtrace in langs.exp"
+
+ if { !$isfixed } { set lang c\\+\\+; set ext cxx }
+ if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ gdb_test "up" ".* in (foo|$foo_func).* at langs2\\.$ext.*return csub \\(.*" \
+ "up to foo in langs.exp"
+ gdb_test "show language" "currently $lang.*" \
+ "show language at foo in langs.exp"
+
+ if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ gdb_test "up" ".* in cppsub_ .* at langs2\\.$ext.*return foo \\(.*" \
+ "up to cppsub_ in langs.exp"
+ gdb_test "show language" "currently $lang.*" \
+ "show language at cppsub_ in langs.exp"
+
+ if { !$isfixed } { set lang fortran }
+ if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ gdb_test "up" ".* in fsub.* at langs1\\.f.*" \
+ "up to fsub in langs.exp"
+ gdb_test "show language" "currently $lang.*" \
+ "show language at fsub in langs.exp"
+
+ # Take out xfail. This test has been passing for sometime now.
+ #if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
+ if { !$isfixed } { set lang c }
+ gdb_test "up" ".* in $do_func .* at .*langs0\\.c.*return fsub.*" \
+ "up to langs0__2do in langs.exp"
+ gdb_test "show language" "currently $lang\".*" \
+ "show language at langs0__2do in langs.exp"
+
+ gdb_test "up" ".* in main .* at .*langs0\\.c.*if \\(langs0__2do \\(.*" \
+ "up to main in langs.exp"
+ gdb_test "show language" "currently $lang\".*" \
+ "show language at main in langs.exp"
+
+ if [target_info exists gdb,noresults] { return }
+
+ if [target_info exists use_gdb_stub] {
+ gdb_breakpoint "exit"
+ gdb_test "cont" "Breakpoint .*exit.*" "continue to exit in langs.exp"
+ } else {
+ gdb_test "cont" "Program exited normally\\..*" \
+ "continue to exit in langs.exp"
+ }
+}
+
+set timeout $oldtimeout
+return 0
diff --git a/gdb/testsuite/gdb.base/langs0.c b/gdb/testsuite/gdb.base/langs0.c
new file mode 100644
index 00000000000..1477a324f91
--- /dev/null
+++ b/gdb/testsuite/gdb.base/langs0.c
@@ -0,0 +1,34 @@
+/* This file is actually in C, it is not supposed to simulate something
+ translated from another language or anything like that. */
+#ifdef PROTOTYPES
+extern int fsub_();
+
+int csub (int x)
+#else
+int
+csub (x)
+ int x;
+#endif
+{
+ return x + 1;
+}
+
+int
+langs0__2do ()
+{
+ return fsub_ () + 2;
+}
+
+int
+main ()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ if (langs0__2do () == 5003)
+ /* Success. */
+ return 0;
+ else
+ return 1;
+}
diff --git a/gdb/testsuite/gdb.base/langs1.c b/gdb/testsuite/gdb.base/langs1.c
new file mode 100644
index 00000000000..8ffd13f0840
--- /dev/null
+++ b/gdb/testsuite/gdb.base/langs1.c
@@ -0,0 +1,41 @@
+/* langs1.f -- translated by f2c (version of 5 May 1990 1:12:08). */
+
+/* f2c output hacked as follows for GDB testsuite:
+ 1. Change commented out "#" lines to #line directives.
+ I don't know why this behavior isn't the default for f2c -g.
+ 2. Remove include of f2c.h and put in just a typedef for "integer".
+ Additional notes:
+ 3. f2c was called as "f2c -g langs1.f".
+ 4. We don't need to use the fortran libraries. */
+
+typedef int integer;
+
+/* Table of constant values */
+
+static integer c__10000 = 10000;
+
+/* I am not sure whether there is a way to have a fortran program without */
+/* a MAIN, but it does not really harm us to have one. */
+#ifdef PROTOTYPES
+/* Main program */ void MAIN__()
+#else
+/* Main program */ MAIN__()
+#endif
+{
+} /* MAIN__ */
+
+#line 4 "langs1.f"
+/* Subroutine */ int fsub_()
+{
+#ifdef PROTOTYPES
+ extern integer cppsub_(int*);
+#else
+ extern integer cppsub_();
+#endif
+
+#line 5 "langs1.f"
+#line 6 "langs1.f"
+ return cppsub_(&c__10000);
+#line 7 "langs1.f"
+} /* fsub_ */
+
diff --git a/gdb/testsuite/gdb.base/langs1.f b/gdb/testsuite/gdb.base/langs1.f
new file mode 100644
index 00000000000..35ce6911472
--- /dev/null
+++ b/gdb/testsuite/gdb.base/langs1.f
@@ -0,0 +1,7 @@
+c I am not sure whether there is a way to have a fortran program without
+c a MAIN, but it does not really harm us to have one.
+ end
+ subroutine fsub
+ integer*4 cppsub
+ return (cppsub (10000))
+ end
diff --git a/gdb/testsuite/gdb.base/langs2.c b/gdb/testsuite/gdb.base/langs2.c
new file mode 100644
index 00000000000..502b80063f0
--- /dev/null
+++ b/gdb/testsuite/gdb.base/langs2.c
@@ -0,0 +1,32 @@
+/* This is intended to be a vague simulation of cfront output. */
+#ifdef PROTOTYPES
+#line 1 "langs2.cxx"
+extern int csub (int);
+int
+foo__Fi (int x)
+{
+ return csub (x / 2);
+}
+
+extern int cppsub_ (int *y);
+int
+cppsub_ (int * y)
+{
+ return foo__Fi (*y);
+}
+#else
+#line 1 "langs2.cxx"
+extern int csub ();
+int
+foo__Fi (x) int x;
+{
+ return csub (x / 2);
+}
+
+extern int cppsub_ ();
+int
+cppsub_ (y) int *y;
+{
+ return foo__Fi (*y);
+}
+#endif
diff --git a/gdb/testsuite/gdb.base/langs2.cxx b/gdb/testsuite/gdb.base/langs2.cxx
new file mode 100644
index 00000000000..5a2ca8a1568
--- /dev/null
+++ b/gdb/testsuite/gdb.base/langs2.cxx
@@ -0,0 +1,13 @@
+extern "C" int csub (int);
+int
+foo (int x)
+{
+ return csub (x / 2);
+}
+
+extern "C" int cppsub_ (int *);
+int
+cppsub_ (int *y)
+{
+ return foo (*y);
+}
diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp
new file mode 100644
index 00000000000..881e0e6bff9
--- /dev/null
+++ b/gdb/testsuite/gdb.base/list.exp
@@ -0,0 +1,559 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "list"
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Need to download the header to the host.
+remote_download host ${srcdir}/${subdir}/list0.h list0.h
+
+
+if { [gdb_compile "${srcdir}/${subdir}/list0.c" "${binfile}0.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/list1.c" "${binfile}1.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${binfile}0.o ${binfile}1.o" ${binfile} executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+#
+# Local utility proc just to set and verify listsize
+# Return 1 if success, 0 if fail.
+#
+
+set set_listsize_count 0;
+
+proc set_listsize { arg } {
+ global gdb_prompt
+ global set_listsize_count;
+
+ incr set_listsize_count;
+ if [gdb_test "set listsize $arg" "" "setting listsize to $arg #$set_listsize_count"] {
+ return 0;
+ }
+ if { $arg <= 0 } {
+ set arg "unlimited";
+ }
+
+ if [gdb_test "show listsize" "Number of source lines.* is ${arg}.*" "show listsize $arg #$set_listsize_count"] {
+ return 0;
+ }
+ return 1
+}
+
+#
+# Test display of listsize lines around a given line number.
+#
+
+proc test_listsize {} {
+ global gdb_prompt
+ global hp_cc_compiler
+ global hp_aCC_compiler
+
+ # Show default size
+
+ gdb_test "show listsize" "Number of source lines gdb will list by default is 10.*" "show default list size"
+
+ # Show the default lines
+ # Note that remote targets that have debugging info for _start available will
+ # list the lines there instead of main, so we skip this test for remote targets.
+ # The second case is for optimized code, it is still correct.
+
+ if [is_remote target] {
+ runto_main;
+ unsupported "list default lines around main";
+ } else {
+ gdb_test "list" "(1\[ \t\]+#include \"list0.h\".*10\[ \t\]+x = 0;|2.*11\[ \t\]+foo .x\[+)\]+;)" "list default lines around main"
+ }
+
+ # Ensure we can limit printouts to one line
+
+ if [set_listsize 1] {
+ gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"" "list line 1 with listsize 1"
+ gdb_test "list 2" "2\[ \t\]+" "list line 2 with listsize 1"
+ }
+
+ # Try just two lines
+
+ if [ set_listsize 2 ] {
+ gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 1 with listsize 2"
+ gdb_test "list 2" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 2 with listsize 2"
+ gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+int main \[)(\]+" "list line 3 with listsize 2"
+ }
+
+ # Try small listsize > 1 that is an odd number
+
+ if [ set_listsize 3 ] {
+ gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 1 with listsize 3"
+ gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 2 with listsize 3"
+ gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+int main \[(\]+\[)\]+\r\n4\[ \t\]+\{" "list line 3 with listsize 3"
+ }
+
+ # Try small listsize > 2 that is an even number.
+
+ if [ set_listsize 4 ] then {
+ gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 1 with listsize 4"
+ gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 2 with listsize 4"
+
+ gdb_test "list 3" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 3 with listsize 4"
+ gdb_test "list 4" "2\[ \t\]+\r\n.*5\[ \t\]+int x;.*" "list line 4 with listsize 4"
+ }
+
+ # Try a size larger than the entire file.
+
+ if [ set_listsize 100 ] then {
+ gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*\r\n4\[23\]\[ \t\]+\}" "list line 1 with listsize 100"
+
+ gdb_test "list 10" "1\[ \t\]+#include \"list0.h\".*\r\n4\[23\]\[ \t\]+\}" "list line 10 with listsize 100"
+ }
+
+ # Try listsize of 0 which suppresses printing.
+
+ set_listsize 0
+ gdb_test "list 1" "" "listsize of 0 suppresses output"
+
+ # Try listsize of -1 which is special, and means unlimited.
+
+ set_listsize -1
+ setup_xfail "*-*-*"
+ gdb_test "list 1" "1\[ \t\]+#include .*\r\n39\[ \t\]+\}" "list line 1 with unlimited listsize"
+}
+
+#
+# Test "list filename:number" for C include file
+#
+
+proc test_list_include_file {} {
+ global gdb_prompt
+
+ setup_xfail_format "DWARF 1"
+ setup_xfail_format "COFF"
+ gdb_test "list list0.h:1" "1\[ \t\]+/\[*\]+ An include file .*10\[ \t\]+bar \\(x\\+\\+\\);" "list line 1 in include file"
+
+ setup_xfail_format "DWARF 1"
+ setup_xfail_format "COFF"
+ gdb_test "list list0.h:100" "Line number 95 out of range; .*list0.h has 3\[67\] lines." "list message for lines past EOF"
+}
+
+#
+# Test "list filename:number" for C source file
+#
+
+proc test_list_filename_and_number {} {
+ global gdb_prompt
+
+ set testcnt 0
+
+ send_gdb "list list0.c:1\n"
+ gdb_expect {
+ -re "1\[ \t\]+#include \"list0.h\".*10\[ \t]+x = 0;\r\n$gdb_prompt $" {
+ incr testcnt
+ }
+ -re ".*$gdb_prompt $" { fail "list list0.c:1" ; gdb_suppress_tests }
+ timeout { fail "list list0.c:1 (timeout)" ; gdb_suppress_tests }
+ }
+ send_gdb "list list0.c:10\n"
+ gdb_expect {
+ -re "5\[ \t\]+int x;.*14\[ \t\]+foo .x\[+)\]+;\r\n$gdb_prompt $" {
+ incr testcnt
+ }
+ -re ".*$gdb_prompt $" { fail "list list.c:10" ; gdb_suppress_tests }
+ timeout { fail "list list.c:10 (timeout)" ; gdb_suppress_tests }
+ }
+ send_gdb "list list1.c:1\n"
+ gdb_expect {
+ -re "1\[ \t\]+\#include.*4\[ \t\]+.*int oof\[ \t\]*\(.*\);\r\n.*$gdb_prompt $" {
+ incr testcnt
+ }
+ -re ".*$gdb_prompt $" { fail "list list1.c:1" ; gdb_suppress_tests }
+ timeout { fail "list list1.c:1 (timeout)" ; gdb_suppress_tests }
+ }
+ send_gdb "list list1.c:12\n"
+ gdb_expect {
+ -re "12\[ \t\]+long_line \[(\]+.*\[)\]+;.*13\[ \t\]+\}\r\n.*$gdb_prompt $" {
+ incr testcnt
+ }
+ -re ".*$gdb_prompt $" { fail "list list1.c:12" ; gdb_suppress_tests }
+ timeout { fail "list list1.c:12 (timeout)" ; gdb_suppress_tests }
+ }
+ pass "list filename:number ($testcnt tests)"
+ gdb_stop_suppressing_tests;
+}
+
+#
+# Test "list function" for C source file
+#
+
+proc test_list_function {} {
+ global gdb_prompt
+ global gcc_compiled
+
+ # gcc appears to generate incorrect debugging information for code
+ # in include files, which breaks this test.
+ # SunPRO cc is the second case below, it's also correct.
+ gdb_test "list main" "(5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;|1\[ \t\]+#include .*10\[ \t\]+x = 0;)" "list function in source file 1"
+
+ # Ultrix gdb takes the second case below; it's also correct.
+ # SunPRO cc is the third case.
+ gdb_test "list bar" "(4\[ \t\]+void.*\[ \t\]*long_line.*;.*bar.*9\[ \t\]*.*|1\[ \t\]+void.*8\[ \t\]+\}|1\[ \t\]+void.*7\[ \t\]*long_line ..;|7\[ \t\]+void.*14\[ \t\]+\})" "list function in source file 2"
+
+ # Test "list function" for C include file
+ # Ultrix gdb is the second case, still correct.
+ # SunPRO cc is the third case.
+ setup_xfail "powerpc-*-*"
+ setup_xfail_format "DWARF 1"
+ gdb_test "list foo" "(3\[ \t\]+.*12\[ \t\]+bar \[(\]+.*\[)\]+;|2\[ \t\]+including file.*11\[ \t\]+bar \[(\]+.*\[)\]+;|1\[ \t\]+/. An include file.*10\[ \t\]+bar \[(\]+.*\[)\]+;)" "list function in include file"
+}
+
+proc test_list_forward {} {
+ global gdb_prompt
+
+ set testcnt 0
+
+ send_gdb "list list0.c:10\n"
+ gdb_expect {
+ -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list list0.c:10" ; gdb_suppress_tests }
+ timeout { fail "list list0.c:10 (timeout)" ; gdb_suppress_tests }
+ }
+
+ send_gdb "list\n"
+ gdb_expect {
+ -re "15\[ \t\]+foo \[(\]+.*\[)\]+;.*24\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list 15-24" ; gdb_suppress_tests }
+ timeout { fail "list 15-24 (timeout)" ; gdb_suppress_tests }
+ }
+
+ send_gdb "list\n"
+ gdb_expect {
+ -re "25\[ \t\]+foo \[(\]+.*\[)\]+;.*34\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list 25-34" ; gdb_suppress_tests }
+ timeout { fail "list 25-34 (timeout)" ; gdb_suppress_tests }
+ }
+
+ send_gdb "list\n"
+ gdb_expect {
+ -re "35\[ \t\]+foo \\(.*\\);.*42\[ \t\]+.*\}\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list 35-42" ; gdb_suppress_tests }
+ timeout { fail "list 35-42 (timeout)" ; gdb_suppress_tests }
+ }
+
+ pass "successive list commands to page forward ($testcnt tests)"
+ gdb_stop_suppressing_tests;
+}
+
+# Test that repeating the list linenum command doesn't print the same
+# lines over again. Note that this test makes sure that the argument
+# linenum is dropped, when we repeat the previous command. 'x/5i $pc'
+# works the same way.
+
+proc test_repeat_list_command {} {
+ global gdb_prompt
+
+ set testcnt 0
+
+ send_gdb "list list0.c:10\n"
+ gdb_expect {
+ -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list list0.c:10" ; gdb_suppress_tests }
+ timeout { fail "list list0.c:10 (timeout)" ; gdb_suppress_tests }
+ }
+
+ send_gdb "\n"
+ gdb_expect {
+ -re "15\[ \t\]+foo \[(\]+.*\[)\]+;.*24\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list 15-24" ; gdb_suppress_tests }
+ timeout { fail "list 15-24 (timeout)" ; gdb_suppress_tests }
+ }
+
+ send_gdb "\n"
+ gdb_expect {
+ -re "25\[ \t\]+foo \[(\]+.*\[)\]+;.*34\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list 25-34" ; gdb_suppress_tests }
+ timeout { fail "list 25-34 (timeout)" ; gdb_suppress_tests }
+ }
+
+ send_gdb "\n"
+ gdb_expect {
+ -re "35\[ \t\]+foo \\(.*\\);.*42\[ \t\]+.*\}\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list 35-42" ; gdb_suppress_tests }
+ timeout { fail "list 35-42 (timeout)" ; gdb_suppress_tests }
+ }
+
+ pass "repeat list commands to page forward using 'return' ($testcnt tests)"
+ gdb_stop_suppressing_tests;
+}
+
+proc test_list_backwards {} {
+ global gdb_prompt
+
+ set testcnt 0
+
+ send_gdb "list list0.c:33\n"
+ gdb_expect {
+ -re "28\[ \t\]+foo \\(.*\\);.*37\[ \t\]+\}\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list list0.c:33" ; gdb_suppress_tests }
+ timeout { fail "list list0.c:33 (timeout)" ; gdb_suppress_tests }
+ }
+
+ send_gdb "list -\n"
+ gdb_expect {
+ -re "18\[ \t\]+foo \[(\]+.*\[)\]+;.*27\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list 18-27" ; gdb_suppress_tests }
+ timeout { fail "list 18-27 (timeout)" ; gdb_suppress_tests }
+ }
+
+ send_gdb "list -\n"
+ gdb_expect {
+ -re "8\[ \t\]+breakpoint\[(\]\[)\];.*17\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list 8-17" ; gdb_suppress_tests }
+ timeout { fail "list 8-17 (timeout)" ; gdb_suppress_tests }
+ }
+
+ send_gdb "list -\n"
+ gdb_expect {
+ -re "1\[ \t\]+#include .*7\[ \t\]+set_debug_traps\[(\]\[)\]+;\r\n$gdb_prompt $" { incr testcnt }
+ -re ".*$gdb_prompt $" { fail "list 1-7" ; gdb_suppress_tests }
+ timeout { fail "list 1-7 (timeout)" ; gdb_suppress_tests }
+ }
+
+ pass "$testcnt successive \"list -\" commands to page backwards"
+ gdb_stop_suppressing_tests;
+}
+
+#
+# Test "list first,last"
+#
+
+proc test_list_range {} {
+ global gdb_prompt
+
+ gdb_test "list list0.c:2,list0.c:5" "2\[ \t\]+\r\n3\[ \t\]+int main \[)(\]+.*5\[ \t\]+int x;" "list range; filename:line1,filename:line2"
+
+ gdb_test "list 2,5" "2\[ \t\]+\r\n3\[ \t\]+int main \[)(\]+.*5\[ \t\]+int x;" "list range; line1,line2"
+
+# gdb_test "list -1,6" "Line number 0 out of range; .*list0.c has 39 lines." "list range; lower bound negative"
+
+# gdb_test "list -100,-40" "Line number -60 out of range; .*list0.c has 39 lines." "list range; both bounds negative"
+
+ gdb_test "list 30,45" "30\[ \t\]+foo \(.*\);.*43\[ \t\]+\}" "list range; upper bound past EOF"
+
+ gdb_test "list 45,100" "Line number 45 out of range; .*list0.c has 43 lines." "list range; both bounds past EOF"
+
+ gdb_test "list list0.c:2,list1.c:17" "Specified start and end are in different files." "list range, must be same files"
+}
+
+#
+# Test "list filename:function"
+#
+
+proc test_list_filename_and_function {} {
+ global gdb_prompt
+
+ set testcnt 0
+
+ # gcc appears to generate incorrect debugging information for code
+ # in include files, which breaks this test.
+ # SunPRO cc is the second case below, it's also correct.
+ send_gdb "list list0.c:main\n"
+ gdb_expect {
+ -re "1\[ \t\]+#include .*10\[ \t\]+x = 0;\r\n$gdb_prompt $" {
+ incr testcnt
+ }
+ -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
+ pass "list function in source file 1"
+ }
+ -re ".*$gdb_prompt $" { fail "list list0.c:main" }
+ timeout { fail "list list0.c:main (timeout)" }
+ }
+
+ # The i960 is a second case
+
+ # Not sure what the point of having this function be unused is.
+ # AIX is legitimately removing it.
+ setup_xfail "rs6000-*-aix*"
+ send_gdb "list list0.c:unused\n"
+ gdb_expect {
+ -re "40\[ \t\]+unused.*43\[ \t\]+\}\r\n$gdb_prompt $" {
+ incr testcnt
+ }
+ -re "37.*42\[ \t\]+\}\r\n$gdb_prompt $" {
+ incr testcnt
+ }
+ -re ".*$gdb_prompt $" { fail "list list0.c:unused" }
+ timeout { fail "list list0.c:unused (timeout)" }
+ }
+ clear_xfail "rs6000-*-aix*"
+
+ # gcc appears to generate incorrect debugging information for code
+ # in include files, which breaks this test.
+ # Ultrix gdb is the second case, one line different but still correct.
+ # SunPRO cc is the third case.
+ setup_xfail "rs6000-*-*" 1804
+ setup_xfail "powerpc-*-*" 1804
+ setup_xfail_format "DWARF 1"
+ setup_xfail_format "COFF"
+ send_gdb "list list0.h:foo\n"
+ gdb_expect {
+ -re "2\[ \t\]+including file. This.*11\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
+ incr testcnt
+ }
+ -re "1\[ \t\]+/. An include file.*10\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
+ incr testcnt
+ }
+ -re "3\[ \t\]+.*12\[ \t\]+bar \[(\]+.*\[)\]+;\r\n$gdb_prompt $" {
+ incr testcnt
+ }
+ -re "No source file named list0.h.\r\n$gdb_prompt $" {
+ fail "list list0.h:foo"
+ }
+ -re ".*$gdb_prompt $" { fail "list list0.h:foo" }
+ timeout { fail "list list0.h:foo (timeout)" }
+ }
+
+ # Ultrix gdb is the second case.
+ send_gdb "list list1.c:bar\n"
+ gdb_expect {
+ -re "4\[ \t\]+void.*13\[ \t\]+\}\r\n$gdb_prompt $" {
+ incr testcnt
+ }
+ -re "4\[ \t\]+void.*12\[ \t\]*long_line ..;\r\n$gdb_prompt $" {
+ incr testcnt
+ }
+ -re "4\[ \t\]+void.*11\[ \t\]*\r\n$gdb_prompt $" {
+ incr testcnt
+ }
+ -re ".*$gdb_prompt $" { fail "list list1.c:bar" }
+ timeout { fail "list list1.c:bar (timeout)" }
+ }
+
+ # The i960 is a second case
+
+ # Not sure what the point of having this function be unused is.
+ # AIX is legitimately removing it.
+ setup_xfail "rs6000-*-aix*"
+ send_gdb "list list1.c:unused\n"
+ gdb_expect {
+ -re "12\[ \t\]+long_line \[(\]\[)\];.*13\[ \t\]+\}\r\n.*$gdb_prompt $" {
+ incr testcnt
+ }
+ -re "14.*19\[ \t\]+\}\r\n.*$gdb_prompt $" {
+ incr testcnt
+ }
+ -re ".*$gdb_prompt $" { fail "list list1.c:unused" }
+ timeout { fail "list list1.c:unused (timeout)" }
+ }
+ clear_xfail "rs6000-*-aix*"
+
+ pass "list filename:function ($testcnt tests)"
+
+ # Test some invalid specs
+ # The following test takes the FIXME result on most systems using
+ # DWARF. It fails to notice that main() is not in the file requested.
+
+ setup_xfail "*-*-*"
+
+# Does this actually work ANYWHERE? I believe not, as this is an `aspect' of
+# lookup_symbol(), where, when it is given a specific symtab which does not
+# contain the requested symbol, it will subsequently search all of the symtabs
+# for the requested symbol.
+
+ gdb_test "list list0.c:foo" "Function \"foo\" not defined in .*list0.c" "list filename:function; wrong filename rejected"
+
+ gdb_test "list foobar.c:main" "No source file named foobar.c.|Location not found" "list filename:function; nonexistant file"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "list list0.h:foobar" "Function \"foobar\" not defined.|Location not found" "list filename:function; nonexistant function"
+
+}
+
+proc test_forward_search {} {
+ global timeout
+
+ gdb_test "set listsize 4" ""
+ # On SunOS4, this gives us lines 19-22. On AIX, it gives us
+ # lines 20-23. This depends on whether the line number of a function
+ # is considered to be the openbrace or the first statement--either one
+ # is acceptable.
+ gdb_test "list long_line" "24\[ \t\]+long_line .*"
+
+ gdb_test "search 4321" " not found"
+
+ gdb_test "search 6789" "28\[ \t\]+oof .6789.;"
+
+ # Test that GDB won't crash if the line being searched is extremely long.
+
+ set oldtimeout $timeout
+ set timeout [expr "$timeout + 300"]
+ verbose "Timeout is now $timeout seconds" 2
+ gdb_test "search 1234" ".*1234.*" "search extremely long line (> 5000 chars)"
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+gdb_test "set width 0" "" "set width 0"
+
+test_listsize
+get_debug_format
+if [ set_listsize 10 ] then {
+ test_list_include_file
+ test_list_filename_and_number
+ test_list_function
+ test_list_forward
+ test_list_backwards
+ test_repeat_list_command
+ test_list_range
+ test_list_filename_and_function
+ test_forward_search
+}
+
+remote_exec build "rm -f list0.h"
diff --git a/gdb/testsuite/gdb.base/list0.c b/gdb/testsuite/gdb.base/list0.c
new file mode 100644
index 00000000000..b50fdd4323d
--- /dev/null
+++ b/gdb/testsuite/gdb.base/list0.c
@@ -0,0 +1,43 @@
+#include "list0.h"
+
+int main ()
+{
+ int x;
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ x = 0;
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ return 0;
+}
+
+static void
+unused ()
+{
+ /* Not used for anything */
+}
diff --git a/gdb/testsuite/gdb.base/list0.h b/gdb/testsuite/gdb.base/list0.h
new file mode 100644
index 00000000000..d46833060e5
--- /dev/null
+++ b/gdb/testsuite/gdb.base/list0.h
@@ -0,0 +1,37 @@
+/* An include file that actually causes code to be generated in the including file. This is known to cause problems on some systems. */
+#ifdef PROTOTYPES
+extern void bar(int);
+static void foo (int x)
+#else
+static void foo (x) int x;
+#endif
+{
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+}
diff --git a/gdb/testsuite/gdb.base/list1.c b/gdb/testsuite/gdb.base/list1.c
new file mode 100644
index 00000000000..6094104b9cd
--- /dev/null
+++ b/gdb/testsuite/gdb.base/list1.c
@@ -0,0 +1,39 @@
+#include <stdio.h>
+
+#ifdef PROTOTYPES
+void long_line (); int oof (int);
+void bar (int x)
+#else
+void bar (x) int x;
+#endif
+{
+ printf ("%d\n", x);
+
+ long_line ();
+}
+
+static void
+unused ()
+{
+ /* Not used for anything */
+}
+/* This routine has a very long line that will break searching in older versions of GDB. */
+#ifdef PROTOTYPES
+void
+#endif
+long_line ()
+{
+ oof (67);
+
+ oof (6789);
+
+ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 5 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 10 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 15 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 20 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 25 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 30 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 35 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 40 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 45 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 50 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 55 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 60 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 65 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (1234); /* 70 */
+}
+#ifdef PROTOTYPES
+int oof (int n)
+#else
+oof (n) int n;
+#endif
+{
+ return n + 1;
+}
diff --git a/gdb/testsuite/gdb.base/logical.exp b/gdb/testsuite/gdb.base/logical.exp
new file mode 100644
index 00000000000..304f45c66ec
--- /dev/null
+++ b/gdb/testsuite/gdb.base/logical.exp
@@ -0,0 +1,577 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This file is part of the gdb testsuite
+
+#
+# tests for correctenss of logical operators, associativity and precedence
+# with integer type variables
+#
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "int-type"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+#
+# test expressions with "int" types
+#
+
+gdb_test "set variable x=0" "" "set variable x=0"
+gdb_test "set variable y=0" "" "set variable y=0"
+gdb_test "set variable z=0" "" "set variable z=0"
+
+send_gdb "print x\n"
+gdb_expect {
+ -re ".*0.*$gdb_prompt $" {
+ pass "print value of x"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x" }
+ timeout { fail "(timeout) print value of x" }
+ }
+
+
+send_gdb "print y\n"
+gdb_expect {
+ -re ".*0.*$gdb_prompt $" {
+ pass "print value of y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of y" }
+ timeout { fail "(timeout) print value of y" }
+ }
+
+send_gdb "print z\n"
+gdb_expect {
+ -re ".*0.*$gdb_prompt $" {
+ pass "print value of z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of z" }
+ timeout { fail "(timeout) print value of z" }
+ }
+
+
+# truth tables for && , || , !
+
+send_gdb "print x && y\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x<y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<y" }
+ timeout { fail "(timeout) print value of x<y" }
+ }
+
+
+
+send_gdb "print x || y\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x<=y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<=y" }
+ timeout { fail "(timeout) print value of x<=y" }
+ }
+
+send_gdb "print !x\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x>y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>y" }
+ timeout { fail "(timeout) print value of x>y" }
+ }
+
+gdb_test "set variable y=1" "" "set variable y=1"
+
+send_gdb "print x && y\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x<y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<y" }
+ timeout { fail "(timeout) print value of x<y" }
+ }
+
+
+
+send_gdb "print x || y\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x<=y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<=y" }
+ timeout { fail "(timeout) print value of x<=y" }
+ }
+
+gdb_test "set variable x=1" "" "set variable x=1"
+
+send_gdb "print x && y\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x<y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<y" }
+ timeout { fail "(timeout) print value of x<y" }
+ }
+
+
+
+send_gdb "print x || y\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x<=y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<=y" }
+ timeout { fail "(timeout) print value of x<=y" }
+ }
+
+send_gdb "print !x\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x>y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>y" }
+ timeout { fail "(timeout) print value of x>y" }
+ }
+
+gdb_test "set variable y=0" "" "set variable y=0"
+
+send_gdb "print x && y\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x<y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<y" }
+ timeout { fail "(timeout) print value of x<y" }
+ }
+
+
+
+send_gdb "print x || y\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x<=y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<=y" }
+ timeout { fail "(timeout) print value of x<=y" }
+ }
+
+
+# end truth tables for &&, ||, !
+
+
+# test associativity of && , || , !
+
+gdb_test "set variable x=0" "" "set variable x=0"
+gdb_test "set variable y=0" "" "set variable y=0"
+gdb_test "set variable z=0" "" "set variable z=0"
+
+send_gdb "print x && y && z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x && y && z (000)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x && y && z (000) " }
+ timeout { fail "(timeout) print value of x && y && z (000) " }
+ }
+
+send_gdb "print x || y || z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x || y || z (000)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x || y || z (000)" }
+ timeout { fail "(timeout) print value of x || y || z (000) " }
+ }
+
+send_gdb "print !!x\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of !!x (0)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !!x (0)" }
+ timeout { fail "(timeout) print value of !!x (0) " }
+ }
+
+
+gdb_test "set variable y=1" "" "set variable y=1"
+
+send_gdb "print x && y && z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x && y && z (010)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x && y && z (010) " }
+ timeout { fail "(timeout) print value of x && y && z (010) " }
+ }
+
+send_gdb "print x || y || z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x || y || z (010)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x || y || z (010)" }
+ timeout { fail "(timeout) print value of x || y || z (010) " }
+ }
+
+
+gdb_test "set variable z=1" "" "set variable z=1"
+
+send_gdb "print x && y && z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x && y && z (011)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x && y && z (011) " }
+ timeout { fail "(timeout) print value of x && y && z (011) " }
+ }
+
+send_gdb "print x || y || z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x || y || z (011)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x || y || z (011)" }
+ timeout { fail "(timeout) print value of x || y || z (011) " }
+ }
+
+
+gdb_test "set variable x=1" "" "set variable x=1"
+
+send_gdb "print x && y && z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x && y && z (111)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x && y && z (111) " }
+ timeout { fail "(timeout) print value of x && y && z (111) " }
+ }
+
+send_gdb "print x || y || z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x || y || z (111)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x || y || z (111)" }
+ timeout { fail "(timeout) print value of x || y || z (111) " }
+ }
+
+send_gdb "print !!x\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of !!x (1)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !!x (1)" }
+ timeout { fail "(timeout) print value of !!x (1) " }
+ }
+
+
+gdb_test "set variable z=0" "" "set variable z=0"
+
+send_gdb "print x && y && z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x && y && z (110)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x && y && z (110) " }
+ timeout { fail "(timeout) print value of x && y && z (110) " }
+ }
+
+send_gdb "print x || y || z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x || y || z (110)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x || y || z (110)" }
+ timeout { fail "(timeout) print value of x || y || z (110) " }
+ }
+
+
+
+
+gdb_test "set variable y=0" "" "set variable y=0"
+
+send_gdb "print x && y && z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x && y && z (100)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x && y && z (100) " }
+ timeout { fail "(timeout) print value of x && y && z (100) " }
+ }
+
+send_gdb "print x || y || z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x || y || z (100)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x || y || z (100)" }
+ timeout { fail "(timeout) print value of x || y || z (100) " }
+ }
+
+
+
+
+gdb_test "set variable z=1" "" "set variable z=1"
+
+send_gdb "print x && y && z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x && y && z (101)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x && y && z (101) " }
+ timeout { fail "(timeout) print value of x && y && z (101) " }
+ }
+
+send_gdb "print x || y || z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x || y || z (101)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x || y || z (101)" }
+ timeout { fail "(timeout) print value of x || y || z (101) " }
+ }
+
+
+gdb_test "set variable x=0" "" "set variable x=0"
+
+send_gdb "print x && y && z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x && y && z (001)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x && y && z (001) " }
+ timeout { fail "(timeout) print value of x && y && z (001) " }
+ }
+
+send_gdb "print x || y || z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x || y || z (001)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x || y || z (001)" }
+ timeout { fail "(timeout) print value of x || y || z (001) " }
+ }
+
+
+
+
+# test precedence of &&, || ,!
+
+
+send_gdb "print !x && y\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of !x && y (00)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !x && y (00)" }
+ timeout { fail "(timeout) print value of !x && y (00) " }
+ }
+
+
+gdb_test "set variable x=1" "" "set variable x=1"
+
+
+send_gdb "print !x && y\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of !x && y (10)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !x && y (10)" }
+ timeout { fail "(timeout) print value of !x && y (10) " }
+ }
+
+
+
+
+gdb_test "set variable y=1" "" "set variable y=1"
+
+send_gdb "print !x || y\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of !x || y (11)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !x || y (11)" }
+ timeout { fail "(timeout) print value of !x || y (11) " }
+ }
+
+
+gdb_test "set variable x=0" "" "set variable x=0"
+
+
+send_gdb "print !x || y\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of !x || y (01)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !x || y (01)" }
+ timeout { fail "(timeout) print value of !x || y (01) " }
+ }
+
+
+
+gdb_test "set variable x=1" "" "set variable x=1"
+gdb_test "set variable z=0" "" "set variable z=0"
+
+send_gdb "print x || y && z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x || y && z (110)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x || y && z (110)" }
+ timeout { fail "(timeout) print value of x || y && z (110) " }
+ }
+
+
+gdb_test "set variable y=0" "" "set variable y=0"
+
+
+send_gdb "print x || y && z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x || y && z (100)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x || y && z (100)" }
+ timeout { fail "(timeout) print value of x || y && z (100) " }
+ }
+
+
+
+gdb_test "set variable x=0" "" "set variable x=0"
+
+send_gdb "print x || !y && z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+
+ gdb_test "set variable x=1" "" "set variable x=1"
+ send_gdb "print x || !y && z\n"
+ gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x || !y && z "
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x || !y && z" }
+ timeout { fail "(timeout) print value of x || !y && z " }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x || y && z " }
+ timeout { fail "(timeout) print value of x || y && z " }
+ }
+
+
+
+
+
+gdb_test "set variable x=1" "" "set variable x=1"
+gdb_test "set variable y=2" "" "set variable y=2"
+gdb_test "set variable w=3" "" "set variable w=3"
+gdb_test "set variable z=3" "" "set variable z=3"
+
+
+send_gdb "print x > y || w == z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x > y || w == z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x > y || w == z" }
+ timeout { fail "(timeout) print value of x > y || w == z " }
+ }
+
+
+gdb_test "set variable x=1" "" "set variable x=1"
+gdb_test "set variable y=2" "" "set variable y=2"
+gdb_test "set variable w=1" "" "set variable w=1"
+gdb_test "set variable z=3" "" "set variable z=3"
+
+
+send_gdb "print x >= y && w != z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x >= y || w != z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x >= y || w != z" }
+ timeout { fail "(timeout) print value of x >= y || w != z " }
+ }
+
+
+
+gdb_test "set variable x=2" "" "set variable x=2"
+gdb_test "set variable y=2" "" "set variable y=2"
+gdb_test "set variable w=2" "" "set variable w=2"
+gdb_test "set variable z=3" "" "set variable z=3"
+
+
+send_gdb "print ! x > y || w + z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x > y || w != z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x > y || w != z" }
+ timeout { fail "(timeout) print value of x > y || w != z " }
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.base/long_long.c b/gdb/testsuite/gdb.base/long_long.c
new file mode 100644
index 00000000000..04fba92897e
--- /dev/null
+++ b/gdb/testsuite/gdb.base/long_long.c
@@ -0,0 +1,61 @@
+/* Test long long expression; test printing in general.
+ *
+ * /CLO/BUILD_ENV/Exports/cc -g +e -o long_long long_long.c
+ *
+ * or
+ *
+ * cc +e +DA2.0 -g -o long_long long_long.c
+ */
+
+#ifdef PROTOTYPES
+long long callee(long long i)
+#else
+long long callee( i )
+long long i;
+#endif
+{
+ register long long result;
+
+ result = 0x12345678;
+ result = result << i;
+ result += 0x9abcdef0;
+
+ return result;
+}
+
+int known_types()
+{
+ long long bin = 0, oct = 0, dec = 0, hex = 0;
+
+ /* Known values, filling the full 64 bits.
+ */
+ bin = 0x123456789abcdefLL; /* 64 bits = 16 hex digits */
+ oct = 01234567123456701234567LL; /* = 21+ octal digits */
+ dec = 12345678901234567890ULL; /* = 19+ decimal digits */
+
+ /* Stop here and look!
+ */
+ hex = bin - dec | oct;
+
+ return 0;
+}
+
+int main() {
+
+ register long long x, y;
+ register long long i;
+
+ x = (long long) 0xfedcba9876543210LL;
+ y = x++;
+ x +=y;
+ i = 11;
+ x = callee( i );
+ y += x;
+
+ known_types();
+
+ return 0;
+}
+
+
+
diff --git a/gdb/testsuite/gdb.base/long_long.exp b/gdb/testsuite/gdb.base/long_long.exp
new file mode 100644
index 00000000000..7084a8deee1
--- /dev/null
+++ b/gdb/testsuite/gdb.base/long_long.exp
@@ -0,0 +1,304 @@
+# Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+
+# long_long.exp Test printing of 64-bit things in 32-bit gdb.
+# Also test differnet kinds of formats.
+#
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [target_info exists no_long_long] {
+ return 0
+}
+
+set testfile long_long
+set srcfile ${srcdir}/${subdir}/${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# What compiler are we using?
+#
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+if {$hp_cc_compiler} {
+ set flag "+e"
+} else {
+ set flag ""
+}
+
+if { [gdb_compile "${srcfile}" "${binfile}" executable [concat debug "additional_flags=$flag -w"]] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# use this to debug:
+#log_user 1
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if { ![runto known_types] } then {
+ fail "run to known_types"
+ return
+}
+
+set target_bigendian_p 1
+send_gdb "show endian\n"
+gdb_expect {
+ -re ".*little endian.*$gdb_prompt $" { set target_bigendian_p 0 }
+ -re ".*big endian.*$gdb_prompt $" { }
+ -re ".*$gdb_prompt $" {
+ fail "getting target endian"
+ }
+ default { fail "(timeout) getting target endian" }
+}
+
+# Detect targets with 2-byte integers. Yes, it's not general to assume
+# that all others have 4-byte ints, but don't worry about it until one
+# actually exists.
+
+set sizeof_int 4
+send_gdb "print sizeof(int)\n"
+gdb_expect {
+ -re ".* = 2.*$gdb_prompt $" { set sizeof_int 2 }
+ -re ".*$gdb_prompt $" { }
+ default { }
+}
+
+# Detect targets with 2-byte pointers. Assume all others use 4-bytes.
+set sizeof_ptr 4
+send_gdb "print sizeof(void*)\n"
+gdb_expect {
+ -re ".* = 2.*$gdb_prompt $" { set sizeof_ptr 2 }
+ -re ".*$gdb_prompt $" { }
+ default { }
+}
+
+# Detect targets with 4-byte shorts. Assume all others use 2-bytes.
+
+set sizeof_short 2
+send_gdb "print sizeof(short)\n"
+gdb_expect {
+ -re ".* = 4.*$gdb_prompt $" { set sizeof_short 4 }
+ -re ".*$gdb_prompt $" { }
+ default { }
+}
+
+# Detect targets with 4-byte doubles.
+
+set sizeof_double 8
+send_gdb "print sizeof(double)\n"
+gdb_expect {
+ -re ".* = 4.*$gdb_prompt $" { set sizeof_double 4 }
+ -re ".*$gdb_prompt $" { }
+ default { }
+}
+
+gdb_test "n 4" ".*38.*" "get to known place"
+
+# Check the hack for long long prints.
+#
+gdb_test "p/x hex" ".*0x0*0.*" "hex print p/x"
+gdb_test "p/x dec" ".*0xab54a98ceb1f0ad2.*" "decimal print p/x"
+# see if 'p/<code>' is handled same as 'p /<code>'
+#
+gdb_test "p /x dec" ".*0xab54a98ceb1f0ad2.*" "default print dec"
+gdb_test "p /x bin" ".*0x0*123456789abcdef.*" "default print bin"
+gdb_test "p /x oct" ".*0xa72ee53977053977.*" "default print oct"
+gdb_test "p hex" ".*= 0*x*0*0.*" "default print hex"
+
+gdb_test "p/u dec" ".*12345678901234567890.*" "decimal print p/u"
+gdb_test "p/t bin" ".*0*100100011010001010110011110001001101010111100110111101111.*" "binary print"
+gdb_test "p/o oct" ".*01234567123456701234567.*" "octal print"
+gdb_test "p /d bin" ".*81985529216486895.*" "print +ve long long"
+gdb_test "p/d dec" ".*-6101065172474983726.*" "decimal print p/d"
+
+# Try all the combinations to bump up coverage.
+#
+gdb_test "p/d oct" ".*-6399925985474168457.*"
+gdb_test "p/u oct" ".*12046818088235383159.*"
+gdb_test "p/o oct" ".*.*"
+gdb_test "p/t oct" ".*1010011100101110111001010011100101110111000001010011100101110111.*"
+if { $sizeof_ptr == 2 } {
+ gdb_test "p/a oct" ".*0x.*3977.*"
+} else {
+ gdb_test "p/a oct" ".*0x.*77053977.*"
+}
+gdb_test "p/c oct" ".*'w'.*"
+
+if { $sizeof_double == 8 } {
+
+# ARM floating point numbers are not strictly little endian or big endian,
+# but a hybrid. They are in little endian format with the two words
+# swapped in big endian format.
+
+ if { [istarget "arm*-*-*"] || \
+ [istarget "xscale*-*-*"] || \
+ [istarget "strongarm*-*-*"] } then {
+ # assume the long long represents a floating point double in ARM format
+ gdb_test "p/f oct" ".*2.1386676354387559e\\+265.*"
+ } else {
+ # assume the long long represents a floating point double in little
+ # endian format
+ gdb_test "p/f oct" ".*-5.9822653797615723e-120.*"
+ }
+
+} else {
+
+ gdb_test "p/f oct" ".*-2.42716126e-15.*"
+
+}
+
+if { $target_bigendian_p } {
+
+ if { $sizeof_int == 4 } {
+
+ gdb_test "p/d *(int *)&oct" ".*-1490098887.*"
+ gdb_test "p/u *(int *)&oct" ".*2804868409.*"
+ gdb_test "p/o *(int *)&oct" ".*024713562471.*"
+ gdb_test "p/t *(int *)&oct" ".*10100111001011101110010100111001.*"
+
+ if { $sizeof_ptr == 2 } {
+ gdb_test "p/a *(int *)&oct" ".*0xe539.*"
+ } else {
+ gdb_test "p/a *(int *)&oct" ".*0xf*a72ee539.*"
+ }
+
+ gdb_test "p/c *(int *)&oct" ".*57 '9'.*"
+ gdb_test "p/f *(int *)&oct" ".*-2.42716126e-15.*"
+
+ } else {
+
+ gdb_test "p/d *(int *)&oct" ".*-22738.*"
+ gdb_test "p/u *(int *)&oct" ".*42798.*"
+ gdb_test "p/o *(int *)&oct" ".*0123456.*"
+ gdb_test "p/t *(int *)&oct" ".*1010011100101110.*"
+
+ if { $sizeof_ptr == 2 } {
+ gdb_test "p/a *(int *)&oct" ".*0xa72e.*"
+ } else {
+ gdb_test "p/a *(int *)&oct" ".*0xffffa72e.*"
+ }
+ gdb_test "p/c *(int *)&oct" ".*46 '.'.*"
+ gdb_test "p/f *(int *)&oct" ".*-22738.*"
+
+ }
+
+ if { $sizeof_short == 2 } {
+ gdb_test "p/d *(short *)&oct" ".*-22738.*"
+ gdb_test "p/u *(short *)&oct" ".*42798.*"
+ gdb_test "p/o *(short *)&oct" ".*0123456.*"
+ gdb_test "p/t *(short *)&oct" ".*1010011100101110.*"
+ if { $sizeof_ptr == 2 } {
+ gdb_test "p/a *(short *)&oct" ".*0xa72e.*"
+ } else {
+ gdb_test "p/a *(short *)&oct" ".*0xf*ffffa72e.*"
+ }
+ gdb_test "p/c *(short *)&oct" ".* 46 '.'.*"
+ gdb_test "p/f *(short *)&oct" ".*-22738.*"
+ } else {
+ gdb_test "p/d *(short *)&oct" ".*-1490098887.*"
+ gdb_test "p/u *(short *)&oct" ".*2804868409.*"
+ gdb_test "p/o *(short *)&oct" ".*024713562471.*"
+ gdb_test "p/t *(short *)&oct" ".*10100111001011101110010100111001.*"
+ gdb_test "p/a *(short *)&oct" ".*0xf*a72ee539.*"
+ gdb_test "p/c *(short *)&oct" ".* 57 '9'.*"
+ gdb_test "p/f *(short *)&oct" ".*-2.42716126e-15.*"
+ }
+
+ gdb_test "x/x &oct" ".*0xa72ee539.*"
+ gdb_test "x/d &oct" ".*.-1490098887*"
+ gdb_test "x/u &oct" ".*2804868409.*"
+ gdb_test "x/o &oct" ".*024713562471.*"
+ gdb_test "x/t &oct" ".*10100111001011101110010100111001.*"
+ if { $sizeof_ptr == 2 } {
+ gdb_test "x/a &oct" ".*0xa72e.*"
+ } else {
+ gdb_test "x/a &oct" ".*0xa72ee539.*"
+ }
+ gdb_test "x/c &oct" ".*-89 .*"
+ # FIXME GDB's output is correct, but this longer match fails.
+ # gdb_test "x/c &oct" ".*-89 '\\\\247'.*"
+ if { $sizeof_double == 8 } {
+ gdb_test "x/f &oct" ".*-5.9822653797615723e-120.*"
+ } else {
+ gdb_test "x/f &oct" ".*-2.42716126e-15.*"
+ }
+
+ # FIXME Fill in the results for all the following tests. (But be careful
+ # about looking at locations with unspecified contents!)
+
+ gdb_test "x/2x &oct" ".*0xa72ee53977053977.*"
+ gdb_test "x/2d &oct" ".*-6399925985474168457.*"
+ gdb_test "x/2u &oct" ".*.*"
+ gdb_test "x/2o &oct" ".*.*"
+ gdb_test "x/2t &oct" ".*.*"
+ gdb_test "x/2a &oct" ".*.*"
+ gdb_test "x/2c &oct" ".*.*"
+ gdb_test "x/2f &oct" ".*.*"
+
+ gdb_test "x/2bx &oct" ".*.*"
+ gdb_test "x/2bd &oct" ".*.*"
+ gdb_test "x/2bu &oct" ".*.*"
+ gdb_test "x/2bo &oct" ".*.*"
+ gdb_test "x/2bt &oct" ".*.*"
+ gdb_test "x/2ba &oct" ".*.*"
+ gdb_test "x/2bc &oct" ".*.*"
+ gdb_test "x/2bf &oct" ".*.*"
+
+ gdb_test "x/2hx &oct" ".*.*"
+ gdb_test "x/2hd &oct" ".*.*"
+ gdb_test "x/2hu &oct" ".*.*"
+ gdb_test "x/2ho &oct" ".*.*"
+ gdb_test "x/2ht &oct" ".*.*"
+ gdb_test "x/2ha &oct" ".*.*"
+ gdb_test "x/2hc &oct" ".*.*"
+ gdb_test "x/2hf &oct" ".*.*"
+
+ gdb_test "x/2wx &oct" ".*.*"
+ gdb_test "x/2wd &oct" ".*.*"
+ gdb_test "x/2wu &oct" ".*.*"
+ gdb_test "x/2wo &oct" ".*.*"
+ gdb_test "x/2wt &oct" ".*.*"
+ gdb_test "x/2wa &oct" ".*.*"
+ gdb_test "x/2wc &oct" ".*.*"
+ gdb_test "x/2wf &oct" ".*.*"
+
+ gdb_test "x/2gx &oct" ".*.*"
+ gdb_test "x/2gd &oct" ".*.*"
+ gdb_test "x/2gu &oct" ".*.*"
+ gdb_test "x/2go &oct" ".*.*"
+ gdb_test "x/2gt &oct" ".*.*"
+ gdb_test "x/2ga &oct" ".*.*"
+ gdb_test "x/2gc &oct" ".*.*"
+ gdb_test "x/2gf &oct" ".*.*"
+
+} else {
+
+ # FIXME Add little-endian versions of these tests, or define a
+ # gdb_test_bi with two strings to match on.
+
+}
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.base/m32r.ld b/gdb/testsuite/gdb.base/m32r.ld
new file mode 100644
index 00000000000..b96077adb6a
--- /dev/null
+++ b/gdb/testsuite/gdb.base/m32r.ld
@@ -0,0 +1,160 @@
+OUTPUT_FORMAT("elf32-m32r", "elf32-m32r",
+ "elf32-m32r")
+OUTPUT_ARCH(m32r)
+ENTRY(_start)
+ SEARCH_DIR(/usr/cygnus/m32r-961018/H-sparc-sun-sunos4.1//lib);
+/* Do we need any of these for elf?
+ __DYNAMIC = 0; */
+SECTIONS
+{
+ OVERLAY 0x300000 : AT (0x400000)
+ {
+ .ovly0 { foo.o(.text) }
+ .ovly1 { bar.o(.text) }
+ }
+ OVERLAY 0x380000 : AT (0x480000)
+ {
+ .ovly2 { baz.o(.text) }
+ .ovly3 { grbx.o(.text) }
+ }
+ OVERLAY 0x340000 : AT (0x440000)
+ {
+ .data00 { foo.o(.data) }
+ .data01 { bar.o(.data) }
+ }
+ OVERLAY 0x3C0000 : AT (0x4C0000)
+ {
+ .data02 { baz.o(.data) }
+ .data03 { grbx.o(.data) }
+ }
+
+ /* Read-only sections, merged into text segment: */
+ . = 0x208000;
+ .interp : { *(.interp) }
+ .hash : { *(.hash) }
+ .dynsym : { *(.dynsym) }
+ .dynstr : { *(.dynstr) }
+ .rel.text : { *(.rel.text) }
+ .rela.text : { *(.rela.text) }
+ .rel.data : { *(.rel.data) }
+ .rela.data : { *(.rela.data) }
+ .rel.rodata : { *(.rel.rodata) }
+ .rela.rodata : { *(.rela.rodata) }
+ .rel.got : { *(.rel.got) }
+ .rela.got : { *(.rela.got) }
+ .rel.ctors : { *(.rel.ctors) }
+ .rela.ctors : { *(.rela.ctors) }
+ .rel.dtors : { *(.rel.dtors) }
+ .rela.dtors : { *(.rela.dtors) }
+ .rel.init : { *(.rel.init) }
+ .rela.init : { *(.rela.init) }
+ .rel.fini : { *(.rel.fini) }
+ .rela.fini : { *(.rela.fini) }
+ .rel.bss : { *(.rel.bss) }
+ .rela.bss : { *(.rela.bss) }
+ .rel.plt : { *(.rel.plt) }
+ .rela.plt : { *(.rela.plt) }
+ .init : { *(.init) } =0
+ .plt : { *(.plt) }
+ .text :
+ {
+ *(.text)
+ /* .gnu.warning sections are handled specially by elf32.em. */
+ *(.gnu.warning)
+ *(.gnu.linkonce.t*)
+ } =0
+ _etext = .;
+ PROVIDE (etext = .);
+ .fini : { *(.fini) } =0
+ .rodata : { *(.rodata) *(.gnu.linkonce.r*) }
+ .rodata1 : { *(.rodata1) }
+ /* Adjust the address for the data segment. We want to adjust up to
+ the same address within the page on the next page up. */
+ . = ALIGN(32) + (ALIGN(8) & (32 - 1));
+ .data :
+ {
+ *(.data)
+ *(.gnu.linkonce.d*)
+ _ovly_table = .;
+ _ovly0_entry = .;
+ LONG(ABSOLUTE(ADDR(.ovly0)));
+ LONG(SIZEOF(.ovly0));
+ LONG(LOADADDR(.ovly0));
+ LONG(0);
+ _ovly1_entry = .;
+ LONG(ABSOLUTE(ADDR(.ovly1)));
+ LONG(SIZEOF(.ovly1));
+ LONG(LOADADDR(.ovly1));
+ LONG(0);
+ _ovly2_entry = .;
+ LONG(ABSOLUTE(ADDR(.ovly2)));
+ LONG(SIZEOF(.ovly2));
+ LONG(LOADADDR(.ovly2));
+ LONG(0);
+ _ovly3_entry = .;
+ LONG(ABSOLUTE(ADDR(.ovly3)));
+ LONG(SIZEOF(.ovly3));
+ LONG(LOADADDR(.ovly3));
+ LONG(0);
+ _data00_entry = .;
+ LONG(ABSOLUTE(ADDR(.data00)));
+ LONG(SIZEOF(.data00));
+ LONG(LOADADDR(.data00));
+ LONG(0);
+ _data01_entry = .;
+ LONG(ABSOLUTE(ADDR(.data01)));
+ LONG(SIZEOF(.data01));
+ LONG(LOADADDR(.data01));
+ LONG(0);
+ _data02_entry = .;
+ LONG(ABSOLUTE(ADDR(.data02)));
+ LONG(SIZEOF(.data02));
+ LONG(LOADADDR(.data02));
+ LONG(0);
+ _data03_entry = .;
+ LONG(ABSOLUTE(ADDR(.data03)));
+ LONG(SIZEOF(.data03));
+ LONG(LOADADDR(.data03));
+ LONG(0);
+ _novlys = .;
+ LONG((_novlys - _ovly_table) / 16);
+
+ CONSTRUCTORS
+ }
+ .data1 : { *(.data1) }
+ .ctors : { *(.ctors) }
+ .dtors : { *(.dtors) }
+ .got : { *(.got.plt) *(.got)}
+ .dynamic : { *(.dynamic) }
+ /* We want the small data sections together, so single-instruction offsets
+ can access them all, and initialized data all before uninitialized, so
+ we can shorten the on-disk segment size. */
+ .sdata : { *(.sdata) }
+ _edata = .;
+ PROVIDE (edata = .);
+ __bss_start = .;
+ .sbss : { *(.sbss) *(.scommon) }
+ .bss : { *(.dynbss) *(.bss) *(COMMON) }
+ _end = . ;
+ PROVIDE (end = .);
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ /* DWARF debug sections.
+ Symbols in the .debug DWARF section are relative to the beginning of the
+ section so we begin .debug at 0. It's not clear yet what needs to happen
+ for the others. */
+ .debug 0 : { *(.debug) }
+ .debug_srcinfo 0 : { *(.debug_srcinfo) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .debug_sfnames 0 : { *(.debug_sfnames) }
+ .line 0 : { *(.line) }
+ .stack 0x5ffffc : { _stack = .; *(.stack) }
+ /* These must appear regardless of . */
+}
diff --git a/gdb/testsuite/gdb.base/m32rovly.c b/gdb/testsuite/gdb.base/m32rovly.c
new file mode 100644
index 00000000000..bdb90feae6b
--- /dev/null
+++ b/gdb/testsuite/gdb.base/m32rovly.c
@@ -0,0 +1,225 @@
+
+/*
+ * Ovlymgr.c -- Runtime Overlay Manager for the GDB testsuite.
+ */
+
+#include "ovlymgr.h"
+
+/* Local functions and data: */
+
+extern unsigned long _ovly_table[][4];
+extern unsigned long _novlys __attribute__ ((section (".data")));
+enum ovly_index { VMA, SIZE, LMA, MAPPED};
+
+static void ovly_copy (unsigned long dst, unsigned long src, long size);
+
+/* Flush the data and instruction caches at address START for SIZE bytes.
+ Support for each new port must be added here. */
+/* FIXME: Might be better to have a standard libgloss function that
+ ports provide that we can then use. Use libgloss instead of newlib
+ since libgloss is the one intended to handle low level system issues.
+ I would suggest something like _flush_cache to avoid the user's namespace
+ but not be completely obscure as other things may need this facility. */
+
+static void
+FlushCache (void)
+{
+#ifdef __M32R__
+ volatile char *mspr = (char *) 0xfffffff7;
+ *mspr = 1;
+#endif
+}
+
+/* OverlayLoad:
+ * Copy the overlay into its runtime region,
+ * and mark the overlay as "mapped".
+ */
+
+bool
+OverlayLoad (unsigned long ovlyno)
+{
+ unsigned long i;
+
+ if (ovlyno < 0 || ovlyno >= _novlys)
+ exit (-1); /* fail, bad ovly number */
+
+ if (_ovly_table[ovlyno][MAPPED])
+ return TRUE; /* this overlay already mapped -- nothing to do! */
+
+ for (i = 0; i < _novlys; i++)
+ if (i == ovlyno)
+ _ovly_table[i][MAPPED] = 1; /* this one now mapped */
+ else if (_ovly_table[i][VMA] == _ovly_table[ovlyno][VMA])
+ _ovly_table[i][MAPPED] = 0; /* this one now un-mapped */
+
+ ovly_copy (_ovly_table[ovlyno][VMA],
+ _ovly_table[ovlyno][LMA],
+ _ovly_table[ovlyno][SIZE]);
+
+ FlushCache ();
+
+ return TRUE;
+}
+
+/* OverlayUnload:
+ * Copy the overlay back into its "load" region.
+ * Does NOT mark overlay as "unmapped", therefore may be called
+ * more than once for the same mapped overlay.
+ */
+
+bool
+OverlayUnload (unsigned long ovlyno)
+{
+ if (ovlyno < 0 || ovlyno >= _novlys)
+ exit (-1); /* fail, bad ovly number */
+
+ if (!_ovly_table[ovlyno][MAPPED])
+ exit (-1); /* error, can't copy out a segment that's not "in" */
+
+ ovly_copy (_ovly_table[ovlyno][LMA],
+ _ovly_table[ovlyno][VMA],
+ _ovly_table[ovlyno][SIZE]);
+
+ return TRUE;
+}
+
+#ifdef __D10V__
+#define IMAP0 (*(short *)(0xff00))
+#define IMAP1 (*(short *)(0xff02))
+#define DMAP (*(short *)(0xff04))
+
+static void
+D10VTranslate (unsigned long logical,
+ short *dmap,
+ unsigned long **addr)
+{
+ unsigned long physical;
+ unsigned long seg;
+ unsigned long off;
+
+ /* to access data, we use the following mapping
+ 0x00xxxxxx: Logical data address segment (DMAP translated memory)
+ 0x01xxxxxx: Logical instruction address segment (IMAP translated memory)
+ 0x10xxxxxx: Physical data memory segment (On-chip data memory)
+ 0x11xxxxxx: Physical instruction memory segment (On-chip insn memory)
+ 0x12xxxxxx: Phisical unified memory segment (Unified memory)
+ */
+
+ /* Addresses must be correctly aligned */
+ if (logical & (sizeof (**addr) - 1))
+ exit (-1);
+
+ /* If the address is in one of the two logical address spaces, it is
+ first translated into a physical address */
+ seg = (logical >> 24);
+ off = (logical & 0xffffffL);
+ switch (seg)
+ {
+ case 0x00: /* in logical data address segment */
+ if (off <= 0x7fffL)
+ physical = (0x10L << 24) + off;
+ else
+ /* Logical address out side of on-chip segment, not
+ supported */
+ exit (-1);
+ break;
+ case 0x01: /* in logical instruction address segment */
+ {
+ short map;
+ if (off <= 0x1ffffL)
+ map = IMAP0;
+ else if (off <= 0x3ffffL)
+ map = IMAP1;
+ else
+ /* Logical address outside of IMAP[01] segment, not
+ supported */
+ exit (-1);
+ if (map & 0x1000L)
+ {
+ /* Instruction memory */
+ physical = (0x11L << 24) | off;
+ }
+ else
+ {
+ /* Unified memory */
+ physical = ((map & 0x7fL) << 17) + (off & 0x1ffffL);
+ if (physical > 0xffffffL)
+ /* Address outside of unified address segment */
+ exit (-1);
+ physical |= (0x12L << 24);
+ }
+ break;
+ }
+ case 0x10:
+ case 0x11:
+ case 0x12:
+ physical = logical;
+ break;
+ default:
+ exit (-1); /* error */
+ }
+
+ seg = (physical >> 24);
+ off = (physical & 0xffffffL);
+ switch (seg)
+ {
+ case 0x10: /* dst is a 15 bit offset into the on-chip memory */
+ *dmap = 0;
+ *addr = (long *) (0x0000 + ((short)off & 0x7fff));
+ break;
+ case 0x11: /* dst is an 18-bit offset into the on-chip
+ instruction memory */
+ *dmap = 0x1000L | ((off & 0x3ffffL) >> 14);
+ *addr = (long *) (0x8000 + ((short)off & 0x3fff));
+ break;
+ case 0x12: /* dst is a 24-bit offset into unified memory */
+ *dmap = off >> 14;
+ *addr = (long *) (0x8000 + ((short)off & 0x3fff));
+ break;
+ default:
+ exit (-1); /* error */
+ }
+}
+#endif /* __D10V__ */
+
+static void
+ovly_copy (unsigned long dst, unsigned long src, long size)
+{
+#ifdef __M32R__
+ memcpy ((void *) dst, (void *) src, size);
+ return;
+#endif /* M32R */
+
+#ifdef __D10V__
+ unsigned long *s, *d, tmp;
+ short dmap_src, dmap_dst;
+ short dmap_save;
+
+ /* all section sizes should by multiples of 4 bytes */
+ dmap_save = DMAP;
+
+ D10VTranslate (src, &dmap_src, &s);
+ D10VTranslate (dst, &dmap_dst, &d);
+
+ while (size > 0)
+ {
+ /* NB: Transfer 4 byte (long) quantites, problems occure
+ when only two bytes are transfered */
+ DMAP = dmap_src;
+ tmp = *s;
+ DMAP = dmap_dst;
+ *d = tmp;
+ d++;
+ s++;
+ size -= sizeof (tmp);
+ src += sizeof (tmp);
+ dst += sizeof (tmp);
+ if ((src & 0x3fff) == 0)
+ D10VTranslate (src, &dmap_src, &s);
+ if ((dst & 0x3fff) == 0)
+ D10VTranslate (dst, &dmap_dst, &d);
+ }
+ DMAP = dmap_save;
+#endif /* D10V */
+}
+
diff --git a/gdb/testsuite/gdb.base/macscp.exp b/gdb/testsuite/gdb.base/macscp.exp
new file mode 100644
index 00000000000..283fe844573
--- /dev/null
+++ b/gdb/testsuite/gdb.base/macscp.exp
@@ -0,0 +1,403 @@
+# Test macro scoping.
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "macscp"
+set binfile ${objdir}/${subdir}/${testfile}
+
+if {[gdb_compile "${srcdir}/${subdir}/macscp1.c" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+# Ask GDB to show the current definition of MACRO, and return a list
+# describing the result.
+#
+# The return value has the form {FILE1 FILE2 ... DEF}, which means
+# that MACRO has the definition `DEF', and was defined in `FILE1',
+# which was included from `FILE2', included from ... .
+#
+# If GDB says that MACRO has no definition, return the string `undefined'.
+#
+# If GDB complains that it doesn't have any information about
+# preprocessor macro definitions, return the string `no-macro-info'.
+#
+# If expect times out waiting for GDB, we return the string `timeout'.
+#
+# If GDB's output doesn't otherwise match what we're expecting, we
+# return the empty string.
+
+proc info_macro {macro} {
+ global gdb_prompt
+ global decimal
+
+ set filepat {macscp[0-9]+\.[ch]}
+ set definition {}
+ set location {}
+
+ send_gdb "info macro ${macro}\n"
+
+ set debug_me 0
+
+ if {$debug_me} {exp_internal 1}
+ gdb_expect {
+ -re "Defined at \[^\r\n\]*(${filepat}):${decimal}\[\r\n\]" {
+ # `location' and `definition' should be empty when we see
+ # this message.
+ if {[llength $location] == 0 && [llength $definition] == 0} {
+ set location $expect_out(1,string)
+ exp_continue
+ } else {
+ # Exit this expect loop, with a result indicating failure.
+ set definition {}
+ }
+ }
+ -re "The symbol `${macro}' has no definition as a C/C\\+\\+ preprocessor macro\[^\r\n\]*\[\r\n\]" {
+ # `location' and `definition' should be empty when we see
+ # this message.
+ if {[llength $location] == 0 && [llength $definition] == 0} {
+ set definition undefined
+ exp_continue
+ } else {
+ # Exit this expect loop, with a result indicating failure.
+ set definition {}
+ }
+ }
+ -re "^\[\r\n\]* included at \[^\r\n\]*(${filepat}):${decimal}\[\r\n\]" {
+ # `location' should *not* be empty when we see this
+ # message. It should have recorded at least the initial
+ # `Defined at ' message (for definitions) or ` at' message
+ # (for undefined symbols).
+ if {[llength $location] != 0} {
+ lappend location $expect_out(1,string)
+ exp_continue
+ } else {
+ # Exit this expect loop, with a result indicating failure.
+ set definition {}
+ }
+ }
+ -re "^\[\r\n\]*at \[^\r\n\]*(${filepat}):${decimal}\[\r\n\]" {
+ # This appears after a `has no definition' message.
+ # `location' should be empty when we see it.
+ if {[string compare $definition undefined] == 0 \
+ && [llength $location] == 0} {
+ set location $expect_out(1,string)
+ exp_continue
+ } else {
+ # Exit this expect loop, with a result indicating failure.
+ set definition {}
+ }
+ }
+ -re "#define ${macro} (\[^\r\n\]*)\[\r\n\]" {
+ # `definition' should be empty when we see this message.
+ if {[string compare $definition ""] == 0} {
+ set definition $expect_out(1,string)
+ exp_continue
+ } else {
+ # Exit this expect loop, with a result indicating failure.
+ set definition {}
+ }
+ }
+ -re "has no preprocessor macro information.*$gdb_prompt $" {
+ set definition no-macro-info
+ }
+ -re "$gdb_prompt $" {
+ # Exit the expect loop; let the existing value of `definition'
+ # indicate failure or success.
+ }
+ timeout {
+ set definition timeout
+ }
+ }
+ if {$debug_me} {exp_internal 0}
+
+ switch -exact -- $definition {
+ no-macro-info { return no-macro-info }
+ timeout { return timeout }
+ undefined -
+ default {
+ if {[llength $location] >= 1} {
+ return [concat $location [list $definition]]
+ } else {
+ return {}
+ }
+ }
+ }
+}
+
+
+# Call info_macro to show the definition of MACRO. Expect a result of
+# EXPECTED. Use WHERE in pass/fail messages to identify the context.
+# Return non-zero if we should abort the entire test file, or zero if
+# we can continue.
+proc check_macro {macro expected where} {
+ set func_def [info_macro $macro]
+ if {[string compare $func_def $expected] == 0} {
+ pass "info macro $macro $where"
+ } else {
+ switch -exact -- $func_def {
+ no-macro-info {
+ xfail "executable includes no macro debugging information"
+ return 1
+ }
+ timeout {
+ fail "info macro $macro $where (timeout)"
+ }
+ default {
+ fail "info macro $macro $where"
+ }
+ }
+ }
+ return 0
+}
+
+
+# List the function FUNC, and then show the definition of MACRO,
+# expecting the result EXPECTED.
+proc list_and_check_macro {func macro expected} {
+ gdb_test "list $func" ".*${func}.*"
+ return [check_macro $macro $expected "after `list $func'"]
+}
+
+
+if {[list_and_check_macro main WHERE {macscp1.c {before macscp1_3}}]} {
+ return 0
+}
+list_and_check_macro macscp2_2 WHERE {macscp2.h macscp1.c {before macscp2_2}}
+list_and_check_macro macscp3_2 WHERE {macscp3.h macscp1.c {before macscp3_2}}
+
+
+# Although GDB's macro table structures distinguish between multiple
+# #inclusions of the same file, GDB's other structures don't. So the
+# `list' command here doesn't reliably select one #inclusion or the
+# other, even though it could. It would be nice to eventually change
+# GDB's structures to handle this correctly.
+gdb_test "list macscp4_2_from_macscp2" ".*macscp4_2_, MACSCP4_INCLUSION.*"
+switch -exact -- [info_macro WHERE] {
+ {macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}} {
+ pass "info macro WHERE after `list macscp_4_2_from_macscp2'"
+ }
+ {macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}} {
+ # setup_kfail "gdb/555"
+ fail "info macro WHERE after `list macscp_4_2_from_macscp2' (gdb/555)"
+ }
+ timeout {
+ fail "info macro WHERE after `list macscp_4_2_from_macscp2' (timeout)"
+ }
+ default { fail "info macro WHERE after `list macscp_4_2_from_macscp2'" }
+}
+
+gdb_test "list macscp4_2_from_macscp3" ".*macscp4_2_, MACSCP4_INCLUSION.*"
+switch -exact -- [info_macro WHERE] {
+ {macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}} {
+ pass "info macro WHERE after `list macscp_4_2_from_macscp3'"
+ }
+ {macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}} {
+ # setup_kfail "gdb/555"
+ fail "info macro WHERE after `list macscp_4_2_from_macscp3' (gdb/555)"
+ }
+ timeout {
+ fail "info macro WHERE after `list macscp_4_2_from_macscp3' (timeout)"
+ }
+ default { fail "info macro WHERE after `list macscp_4_2_from_macscp3'" }
+}
+
+
+#### Test the selection of the macro scope by the current frame.
+
+### A table of functions, in the order they will be reached, which is
+### also the order they appear in the preprocessed output. Each entry
+### has the form {FUNCNAME WHERE KFAILWHERE}, where:
+### - FUNCNAME is the name of the function,
+### - WHERE is the definition we expect to see for the macro `WHERE', as
+### returned by `info_macro', and
+### - KFAILWHERE is an alternate definition which should be reported
+### as a `known failure', due to GDB's inability to distinguish multiple
+### #inclusions of the same file.
+### KFAILWHERE may be omitted.
+
+set funcs {
+ {
+ macscp1_1
+ {macscp1.c {before macscp1_1}}
+ }
+ {
+ macscp2_1
+ {macscp2.h macscp1.c {before macscp2_1}}
+ }
+ {
+ macscp4_1_from_macscp2
+ {macscp4.h macscp2.h macscp1.c {before macscp4_1_..., from macscp2.h}}
+ {macscp4.h macscp3.h macscp1.c {before macscp4_1_..., from macscp3.h}}
+ }
+ {
+ macscp4_2_from_macscp2
+ {macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}}
+ {macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}}
+ }
+ {
+ macscp2_2
+ {macscp2.h macscp1.c {before macscp2_2}}
+ }
+ {
+ macscp1_2
+ {macscp1.c {before macscp1_2}}
+ }
+ {
+ macscp3_1
+ {macscp3.h macscp1.c {before macscp3_1}}
+ }
+ {
+ macscp4_1_from_macscp3
+ {macscp4.h macscp3.h macscp1.c {before macscp4_1_..., from macscp3.h}}
+ {macscp4.h macscp2.h macscp1.c {before macscp4_1_..., from macscp2.h}}
+ }
+ {
+ macscp4_2_from_macscp3
+ {macscp4.h macscp3.h macscp1.c {before macscp4_2_..., from macscp3.h}}
+ {macscp4.h macscp2.h macscp1.c {before macscp4_2_..., from macscp2.h}}
+ }
+ {
+ macscp3_2
+ {macscp3.h macscp1.c {before macscp3_2}}
+ }
+ {
+ macscp1_3
+ {macscp1.c {before macscp1_3}}
+ }
+}
+
+
+# Start the program running.
+if {! [runto_main]} {
+ fail "macro tests suppressed: couldn't run to main"
+ return 0
+}
+
+# Set a breakpoint on each of the functions.
+foreach func_entry $funcs {
+ set func [lindex $func_entry 0]
+ gdb_test "break $func" "Breakpoint.*"
+}
+
+# Run to each of the breakpoints and check the definition (or lack
+# thereof) of each macro.
+for {set i 0} {$i < [llength $funcs]} {incr i} {
+ set func_entry [lindex $funcs $i]
+ set func [lindex $func_entry 0]
+ set expected [lindex $func_entry 1]
+ set kfail_expected [lindex $func_entry 2]
+
+ # Run to the breakpoint for $func.
+ gdb_test "continue" "Breakpoint $decimal, $func .*" "continue to $func"
+
+ # Check the macro WHERE.
+ set result [info_macro WHERE]
+ if {[string compare $result $expected] == 0} {
+ pass "info macro WHERE stopped in $func"
+ } elseif {[string compare $result $kfail_expected] == 0} {
+ # setup_kfail "gdb/555"
+ fail "info macro WHERE stopped in $func (gdb/555)"
+ } elseif {[string compare $result timeout] == 0} {
+ fail "info macro WHERE stopped in $func (timeout)"
+ } else {
+ fail "info macro WHERE stopped in $func"
+ }
+
+ # Check that the BEFORE_<func> macros for all prior functions are
+ # #defined, and that those for all subsequent functions are not.
+ for {set j 0} {$j < [llength $funcs]} {incr j} {
+ if {$j != $i} {
+ set func_j_entry [lindex $funcs $j]
+ set func_j [lindex $func_j_entry 0]
+
+ set before_macro "BEFORE_[string toupper $func_j]"
+ set test_name \
+ "$before_macro defined/undefined when stopped at $func"
+ set result [info_macro $before_macro]
+
+ # We can't get the right scope info when we're stopped in
+ # the macro4_ functions.
+ if {[string match macscp4_* $func]} {
+ # setup_kfail "gdb/555"
+ set test_name "$test_name (gdb/555)"
+ }
+ if {$j < $i} {
+ if {[llength $result] >= 2 && \
+ [string compare [lindex $result end] {}] == 0} {
+ pass $test_name
+ } elseif {[string compare $result timeout] == 0} {
+ fail "$test_name (timeout)"
+ } else {
+ fail "$test_name"
+ }
+ } elseif {$j > $i} {
+ switch -- [lindex $result end] {
+ undefined { pass $test_name }
+ timeout { fail "$test_name (timeout)" }
+ default {
+ fail "$test_name"
+ }
+ }
+ }
+
+ set until_macro "UNTIL_[string toupper $func_j]"
+ set test_name \
+ "$until_macro defined/undefined when stopped at $func"
+ set result [info_macro $until_macro]
+
+ # We can't get the right scope info when we're stopped in
+ # the macro4_ functions.
+ if {[string match macscp4_* $func]} {
+ # setup_kfail "gdb/555"
+ set test_name "$test_name (gdb/555)"
+ }
+ if {$j <= $i} {
+ switch -- [lindex $result end] {
+ undefined { pass $test_name }
+ timeout { fail "$test_name (timeout)" }
+ default {
+ fail "$test_name"
+ }
+ }
+ } elseif {$j > $i} {
+ if {[llength $result] >= 2 && \
+ [string compare [lindex $result end] {}] == 0} {
+ pass $test_name
+ } elseif {[string compare $result timeout] == 0} {
+ fail "$test_name (timeout)"
+ } else {
+ fail "$test_name"
+ }
+ }
+ }
+ }
+}
diff --git a/gdb/testsuite/gdb.base/macscp1.c b/gdb/testsuite/gdb.base/macscp1.c
new file mode 100644
index 00000000000..89a1b07d1e6
--- /dev/null
+++ b/gdb/testsuite/gdb.base/macscp1.c
@@ -0,0 +1,80 @@
+#include <stdio.h>
+
+#define SPLICE(a, b) INNER_SPLICE(a, b)
+#define INNER_SPLICE(a, b) a ## b
+#define STRINGIFY(a) INNER_STRINGIFY(a)
+#define INNER_STRINGIFY(a) #a
+
+/* A macro named UNTIL_<func> is #defined until just before the
+ definition of the function <func>.
+
+ A macro named BEFORE_<func> is not #defined until just before the
+ definition of <func>.
+
+ The macro WHERE is redefined before each function <func> to the
+ token list ``before <func>''.
+
+ The macscp IN_MACSCP2_H and IN_MACSCP3_H are defined while
+ processing those header files; macscp4.h uses them to choose
+ appropriate function names, output strings, and macro definitions. */
+
+#define UNTIL_MACSCP1_1
+#define UNTIL_MACSCP2_1
+#define UNTIL_MACSCP4_1_FROM_MACSCP2
+#define UNTIL_MACSCP4_2_FROM_MACSCP2
+#define UNTIL_MACSCP2_2
+#define UNTIL_MACSCP1_2
+#define UNTIL_MACSCP3_1
+#define UNTIL_MACSCP4_1_FROM_MACSCP3
+#define UNTIL_MACSCP4_2_FROM_MACSCP3
+#define UNTIL_MACSCP3_2
+#define UNTIL_MACSCP1_3
+
+#define WHERE before macscp1_1
+#define BEFORE_MACSCP1_1
+#undef UNTIL_MACSCP1_1
+void
+macscp1_1 ()
+{
+ puts ("macscp1_1");
+}
+
+#include "macscp2.h"
+
+#undef WHERE
+#define WHERE before macscp1_2
+#define BEFORE_MACSCP1_2
+#undef UNTIL_MACSCP1_2
+void
+macscp1_2 ()
+{
+ puts ("macscp1_2");
+}
+
+#include "macscp3.h"
+
+#undef WHERE
+#define WHERE before macscp1_3
+#define BEFORE_MACSCP1_3
+#undef UNTIL_MACSCP1_3
+void
+macscp1_3 ()
+{
+ puts ("macscp1_3");
+}
+
+int
+main (int argc, char **argv)
+{
+ macscp1_1 ();
+ macscp2_1 ();
+ macscp4_1_from_macscp2 ();
+ macscp4_2_from_macscp2 ();
+ macscp2_2 ();
+ macscp1_2 ();
+ macscp3_1 ();
+ macscp4_1_from_macscp3 ();
+ macscp4_2_from_macscp3 ();
+ macscp3_2 ();
+ macscp1_3 ();
+}
diff --git a/gdb/testsuite/gdb.base/macscp2.h b/gdb/testsuite/gdb.base/macscp2.h
new file mode 100644
index 00000000000..ef0feaac5a5
--- /dev/null
+++ b/gdb/testsuite/gdb.base/macscp2.h
@@ -0,0 +1,25 @@
+#define IN_MACSCP2_H
+
+#undef WHERE
+#define WHERE before macscp2_1
+#define BEFORE_MACSCP2_1
+#undef UNTIL_MACSCP2_1
+void
+macscp2_1 ()
+{
+ puts ("macscp2_1");
+}
+
+#include "macscp4.h"
+
+#undef WHERE
+#define WHERE before macscp2_2
+#define BEFORE_MACSCP2_2
+#undef UNTIL_MACSCP2_2
+void
+macscp2_2 ()
+{
+ puts ("macscp2_2");
+}
+
+#undef IN_MACSCP2_H
diff --git a/gdb/testsuite/gdb.base/macscp3.h b/gdb/testsuite/gdb.base/macscp3.h
new file mode 100644
index 00000000000..ebfcc6e1930
--- /dev/null
+++ b/gdb/testsuite/gdb.base/macscp3.h
@@ -0,0 +1,25 @@
+#define IN_MACSCP3_H
+
+#undef WHERE
+#define WHERE before macscp3_1
+#define BEFORE_MACSCP3_1
+#undef UNTIL_MACSCP3_1
+void
+macscp3_1 ()
+{
+ puts ("macscp3_1");
+}
+
+#include "macscp4.h"
+
+#undef WHERE
+#define WHERE before macscp3_2
+#define BEFORE_MACSCP3_2
+#undef UNTIL_MACSCP3_2
+void
+macscp3_2 ()
+{
+ puts ("macscp3_2");
+}
+
+#undef IN_MACSCP3_H
diff --git a/gdb/testsuite/gdb.base/macscp4.h b/gdb/testsuite/gdb.base/macscp4.h
new file mode 100644
index 00000000000..5302d8d3c47
--- /dev/null
+++ b/gdb/testsuite/gdb.base/macscp4.h
@@ -0,0 +1,44 @@
+/* Put together a macro we can use as part of function names. */
+#undef MACSCP4_INCLUSION
+#ifdef IN_MACSCP2_H
+#define MACSCP4_INCLUSION from_macscp2
+#endif
+#ifdef IN_MACSCP3_H
+#define MACSCP4_INCLUSION from_macscp3
+#endif
+
+#undef WHERE
+#ifdef IN_MACSCP2_H
+#define WHERE before macscp4_1_..., from macscp2.h
+#define BEFORE_MACSCP4_1_FROM_MACSCP2
+#undef UNTIL_MACSCP4_1_FROM_MACSCP2
+#endif
+#ifdef IN_MACSCP3_H
+#define WHERE before macscp4_1_..., from macscp3.h
+#define BEFORE_MACSCP4_1_FROM_MACSCP3
+#undef UNTIL_MACSCP4_1_FROM_MACSCP3
+#endif
+void
+SPLICE (macscp4_1_, MACSCP4_INCLUSION) ()
+{
+ puts ("macscp4_1_" STRINGIFY(MACSCP4_INCLUSION));
+}
+
+#undef WHERE
+#ifdef IN_MACSCP2_H
+#define WHERE before macscp4_2_..., from macscp2.h
+#define BEFORE_MACSCP4_2_FROM_MACSCP2
+#undef UNTIL_MACSCP4_2_FROM_MACSCP2
+#endif
+#ifdef IN_MACSCP3_H
+#define WHERE before macscp4_2_..., from macscp3.h
+#define BEFORE_MACSCP4_2_FROM_MACSCP3
+#undef UNTIL_MACSCP4_2_FROM_MACSCP3
+#endif
+void
+SPLICE (macscp4_2_, MACSCP4_INCLUSION) ()
+{
+ puts ("macscp4_2_" STRINGIFY(MACSCP4_INCLUSION));
+}
+
+#define DEFINED_IN_MACSCP4 this was defined in macscp4.h.
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
new file mode 100644
index 00000000000..ac2e9f87526
--- /dev/null
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -0,0 +1,678 @@
+# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# this file tests maintenance commands and help on those.
+
+# source file used is break.c
+
+
+#maintenance check-symtabs -- Check consistency of psymtabs and symtabs
+#maintenance space -- Set the display of space usage
+#maintenance set -- Set GDB internal variables used by the GDB maintainer
+#maintenance show -- Show GDB internal variables used by the GDB maintainer
+#maintenance time -- Set the display of time usage
+#maintenance demangle -- Demangle a C++ mangled name
+#maintenance dump-me -- Get fatal error; make debugger dump its core
+#maintenance print -- Maintenance command for printing GDB internal state
+#maintenance info -- Commands for showing internal info about the program being debugged
+#maintenance internal-error -- Give GDB an internal error.
+#
+#maintenance print statistics -- Print statistics about internal gdb state
+#maintenance print objfiles -- Print dump of current object file definitions
+#maintenance print psymbols -- Print dump of current partial symbol definitions
+#maintenance print msymbols -- Print dump of current minimal symbol definitions
+#maintenance print symbols -- Print dump of current symbol definitions
+#maintenance print type -- Print a type chain for a given symbol
+#maintenance print unwind -- Print unwind table entry at given address
+#
+#
+#maintenance info sections -- List the BFD sections of the exec and core files
+#maintenance info breakpoints -- Status of all breakpoints
+#
+
+
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+global usestubs
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "break"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != ""
+ } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ perror "tests suppressed"
+}
+
+
+# The commands we test here produce many lines of output; disable "press
+# <return> to continue" prompts.
+send_gdb "set height 0\n"
+gdb_expect -re "$gdb_prompt $"
+
+# use a larger expect input buffer for long help outputs.
+match_max 6000
+
+#
+# this command does not produce any output
+# unless there is some problem with the symtabs and psymtabs
+# so that branch will really never be covered in this tests here!!
+#
+
+# guo: on linux this command output is huge. for some reason splitting up
+# the regexp checks works.
+#
+send_gdb "maint check-symtabs\n"
+gdb_expect {
+ -re "^maint check-symtabs" {
+ gdb_expect {
+ -re "$gdb_prompt $" \
+ { pass "maint check-symtabs" }
+ timeout { fail "(timeout) maint check-symtabs" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "maint check-symtabs" }
+ timeout { fail "(timeout) maint check-symtabs" }
+ }
+
+send_gdb "maint space\n"
+gdb_expect {
+ -re "\"maintenance space\" takes a numeric argument\\..*$gdb_prompt $"\
+ { pass "maint space" }
+ -re ".*$gdb_prompt $" { fail "maint space" }
+ timeout { fail "(timeout) maint space" }
+ }
+
+send_gdb "maint space 1\n"
+gdb_expect {
+ -re "Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\
+ { pass "maint space 1" }
+ -re ".*$gdb_prompt $" { fail "maint space 1" }
+ timeout { fail "(timeout) maint space 1" }
+ }
+
+
+send_gdb "maint time\n"
+gdb_expect {
+ -re "\"maintenance time\" takes a numeric argument\\..*Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\
+ { pass "maint time" }
+ -re ".*$gdb_prompt $" { fail "maint time" }
+ timeout { fail "(timeout) maint time" }
+ }
+
+send_gdb "maint time 1\n"
+gdb_expect {
+ -re "Command execution time: $decimal.*Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\
+ { pass "maint time 1" }
+ -re ".*$gdb_prompt $" { fail "maint time 1" }
+ timeout { fail "(timeout) maint time 1" }
+ }
+
+send_gdb "maint time 0\n"
+gdb_expect {
+ -re "Space used: $decimal \\(\\+$decimal for this command\\).*$gdb_prompt $"\
+ { pass "maint time 0" }
+ -re ".*$gdb_prompt $" { fail "maint time 0" }
+ timeout { fail "(timeout) maint time 0" }
+ }
+
+
+send_gdb "maint space 0\n"
+gdb_expect {
+ -re "maint space 0\r\n$gdb_prompt $"\
+ { pass "maint space 0" }
+ -re ".*$gdb_prompt $" { fail "maint space 0" }
+ timeout { fail "(timeout) maint space 0" }
+ }
+
+send_gdb "maint demangle\n"
+gdb_expect {
+ -re "\"maintenance demangle\" takes an argument to demangle\\..*$gdb_prompt $"\
+ { pass "maint demangle" }
+ -re ".*$gdb_prompt $" { fail "maint demangle" }
+ timeout { fail "(timeout) maint demangle" }
+ }
+
+send_gdb "maint demangle main\n"
+gdb_expect {
+ -re "Can't demangle \"main\".*$gdb_prompt $"\
+ { pass "maint demangle" }
+ -re ".*$gdb_prompt $" { fail "maint demangle" }
+ timeout { fail "(timeout) maint demangle" }
+ }
+
+
+send_gdb "maint print statistics\n"
+gdb_expect {
+ -re "Statistics for.*break.*Number of \"minimal\" symbols read.*Number of \"partial\" symbols read.*Number of \"types\" defined.*Total memory used for psymbol obstack.*Total memory used for psymbol cache.*Total memory used for symbol obstack.*Total memory used for type obstack.*$gdb_prompt $"\
+ { pass "maint print statistics" }
+ -re ".*$gdb_prompt $" { fail "maint print statistics" }
+ timeout { fail "(timeout) maint print statistics" }
+ }
+
+send_gdb "maint print objfiles\n"
+
+# To avoid timeouts, we avoid expects with many .* patterns that match
+# many lines. Instead, we keep track of which milestones we've seen
+# in the output, and stop when we've seen all of them.
+
+set header 0
+set psymtabs 0
+set symtabs 0
+set keep_looking 1
+
+while {$keep_looking} {
+ gdb_expect {
+
+ -re ".*Object file.*break($EXEEXT)?: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n" { set header 1 }
+ -re ".*Psymtabs:\[\r\t \]+\n" { set psymtabs 1 }
+ -re ".*Symtabs:\[\r\t \]+\n" { set symtabs 1 }
+
+ -re ".*$gdb_prompt $" {
+ set keep_looking 0
+ }
+ timeout {
+ fail "(timeout) maint print objfiles"
+ set keep_looking 0
+ }
+ }
+}
+
+proc maint_pass_if {val name} {
+ if $val { pass $name } else { fail $name }
+}
+
+maint_pass_if $header "maint print objfiles: header"
+maint_pass_if $psymtabs "maint print objfiles: psymtabs"
+maint_pass_if $symtabs "maint print objfiles: symtabs"
+
+send_gdb "maint print psymbols\n"
+gdb_expect {
+ -re "print-psymbols takes an output file name and optional symbol file name.*$gdb_prompt $"\
+ { pass "maint print psymbols w/o args" }
+ -re ".*$gdb_prompt $" { fail "maint print psymbols w/o args" }
+ timeout { fail "(timeout) maint print psymbols w/o args" }
+ }
+
+send_gdb "maint print psymbols psymbols_output\n"
+gdb_expect {
+ -re "^maint print psymbols psymbols_output\r\n$gdb_prompt $"\
+ {
+ send_gdb "shell ls psymbols_output\n"
+ gdb_expect {
+ -re "psymbols_output\r\n$gdb_prompt $"\
+ {
+ # We want this grep to be as specific as possible,
+ # so it's less likely to match symbol file names in
+ # psymbols_output. Yes, this actually happened;
+ # poor expect got tons of output, and timed out
+ # trying to match it. --- Jim Blandy <jimb@cygnus.com>
+ send_gdb "shell grep 'main.*function' psymbols_output\n"
+ gdb_expect {
+ -re ".main., function, $hex.*$gdb_prompt $"\
+ { pass "maint print psymbols 1" }
+ -re ".*main. .., function, $hex.*$gdb_prompt $"\
+ { pass "maint print psymbols 2" }
+ -re ".*$gdb_prompt $" { fail "maint print psymbols" }
+ timeout { fail "(timeout) maint print psymbols" }
+ }
+ gdb_test "shell rm -f psymbols_output" ""
+
+ }
+ -re ".*$gdb_prompt $" { fail "maint print psymbols" }
+ timeout { fail "(timeout) maint print psymbols" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "maint print psymbols" }
+ timeout { fail "(timeout) maint print psymbols" }
+ }
+
+
+send_gdb "maint print msymbols\n"
+gdb_expect {
+ -re "print-msymbols takes an output file name and optional symbol file name.*$gdb_prompt $"\
+ { pass "maint print msymbols w/o args" }
+ -re ".*$gdb_prompt $" { fail "maint print msymbols w/o args" }
+ timeout { fail "(timeout) maint print msymbols w/o args" }
+ }
+
+send_gdb "maint print msymbols msymbols_output\n"
+gdb_expect {
+ -re "^maint print msymbols msymbols_output\r\n$gdb_prompt $"\
+ {
+ send_gdb "shell ls msymbols_output\n"
+ gdb_expect {
+ -re "msymbols_output\r\n$gdb_prompt $"\
+ {
+ send_gdb "shell grep factorial msymbols_output\n"
+ gdb_expect {
+ -re "\\\[ *$decimal\\\] T\[ \t\]+$hex factorial.*$gdb_prompt $"\
+ { pass "maint print msymbols" }
+ -re ".*$gdb_prompt $" { fail "maint print msymbols" }
+ timeout { fail "(timeout) maint print msymbols" }
+ }
+ gdb_test "shell rm -f msymbols_output" ""
+
+ }
+ -re ".*$gdb_prompt $" { fail "maint print msymbols" }
+ timeout { fail "(timeout) maint print msymbols" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "maint print msymbols" }
+ timeout { fail "(timeout) maint print msymbols" }
+ }
+
+
+send_gdb "maint print symbols\n"
+gdb_expect {
+ -re "Arguments missing: an output file name and an optional symbol file name.*$gdb_prompt $"\
+ { pass "maint print symbols w/o args" }
+ -re ".*$gdb_prompt $" { fail "maint print symbols w/o args" }
+ timeout { fail "(timeout) maint print symbols w/o args" }
+ }
+
+# This command can legitimately take many minutes to execute. If the
+# executable is dynamically linked, then you get all the debugging
+# info for the entire library --- 89Mb on my system. -jimb
+
+set old_timeout $timeout
+set timeout 600
+
+send_gdb "maint print symbols symbols_output\n"
+gdb_expect {
+ -re "^maint print symbols symbols_output\r\n$gdb_prompt $"\
+ {
+ send_gdb "shell ls symbols_output\n"
+ gdb_expect {
+ -re "symbols_output\r\n$gdb_prompt $"\
+ {
+ # See comments for `maint print psymbols'.
+ send_gdb "shell grep 'main(.*block' symbols_output\n"
+ gdb_expect {
+ -re "int main\\(int, char \\*\\*, char \\*\\*\\); block.*$gdb_prompt $"\
+ { pass "maint print symbols" }
+ -re ".*$gdb_prompt $" { fail "maint print symbols" }
+ timeout { fail "(timeout) maint print symbols" }
+ }
+ gdb_test "shell rm -f symbols_output" ""
+
+ }
+ -re ".*$gdb_prompt $" { fail "maint print symbols" }
+ timeout { fail "(timeout) maint print symbols" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "maint print symbols" }
+ timeout { fail "(timeout) maint print symbols" }
+ }
+
+set timeout $old_timeout
+
+send_gdb "maint print type argc\n"
+gdb_expect {
+ -re "type node $hex\r\nname .int. \\($hex\\)\r\ntagname .<NULL>. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength \[24\]\r\nupper_bound_type $hex \\(BOUND_SIMPLE\\)\r\nlower_bound_type $hex \\(BOUND_SIMPLE\\)\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\ntype_chain $hex\r\ninstance_flags $hex\r\nflags $hex\r\nnfields 0 $hex\r\nvptr_basetype $hex\r\nvptr_fieldno -1\r\ntype_specific $hex\r\n$gdb_prompt $"\
+ { pass "maint print type" }
+ -re ".*$gdb_prompt $" { fail "maint print type" }
+ timeout { fail "(timeout) maint print type" }
+ }
+
+if [istarget "hppa*-*-11*"] {
+ setup_xfail hppa*-*-*11* CLLbs14860
+ send "maint print unwind &main\n"
+ expect {
+ -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+\[0-9\]*>\r\n\tflags = Args_stored Save_RP\r\n\tRegion_description = $hex\r\n\tEntry_FR = $hex\r\n\tEntry_GR = $hex\r\n\tTotal_frame_size = $hex\r\n$gdb_prompt $"\
+ { pass "maint print unwind" }
+ -re ".*unwind_table_entry \\($hex\\):\r\n\tregion_start = $hex <main>\r\n\tregion_end = $hex <main\\+\[0-9\]*>\r\n\tflags = Args_stored Save_RP\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n\tFLD = $hex\r\n$gdb_prompt $"\
+ { xfail "maint print unwind" }
+ -re ".*$gdb_prompt $" { xfail "maint info unwind" }
+ timeout { fail "(timeout) maint print unwind" }
+ }
+}
+
+set oldtimeout $timeout
+set timeout [expr $timeout + 300]
+
+# It'd be nice to check for every possible section. However, that's
+# problematic, since the relative ordering wanders from release to
+# release of the compilers. Instead, we'll just check for two
+# sections which appear to always come out in the same relative
+# order. (If that changes, then we should just check for one
+# section.)
+#
+# And by the way: This testpoint will break for PA64, where a.out's
+# are ELF files.
+#
+send_gdb "maint info sections\n"
+gdb_expect {
+ -re "Exec file:\r\n.*break($EXEEXT)?., file type.*$gdb_prompt $"\
+ { pass "maint info sections" }
+ -re ".*$gdb_prompt $" { fail "maint info sections" }
+ timeout { fail "(timeout) maint info sections" }
+ }
+
+# Test for new option: maint info sections <section name>
+# If you don't have a .text section, this will require tweaking.
+send_gdb "maint info sections .text\n"
+gdb_expect {
+ -re ".*bss.*$gdb_prompt $" { fail "maint info sections .text" }
+ -re ".*data.*$gdb_prompt $" { fail "maint info sections .text" }
+ -re ".* .text .*$gdb_prompt $" { pass "maint info sections .text" }
+ timeout { fail "(timeout) maint info sections .text" }
+}
+
+# Test for new option: CODE section flag
+# If your data section is tagged CODE, xfail this test.
+send_gdb "maint info sections CODE\n"
+gdb_expect {
+ -re ".* .data .*$gdb_prompt $" { fail "maint info sections CODE" }
+ -re ".* .text .*$gdb_prompt $" { pass "maint info sections CODE" }
+ timeout { fail "(timeout) maint info sections CODE" }
+}
+
+# Test for new option: DATA section flag
+# If your text section is tagged DATA, xfail this test.
+send_gdb "maint info sections DATA\n"
+gdb_expect {
+ -re ".* .text .*$gdb_prompt $" { fail "maint info sections DATA" }
+ -re ".* .data .*$gdb_prompt $" { pass "maint info sections DATA" }
+ timeout { fail "(timeout) maint info sections DATA" }
+}
+
+send_gdb "maint info breakpoints\n"
+gdb_expect {
+ -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex\[ \t\]+in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n.*$gdb_prompt $"\
+ { pass "maint info breakpoints" }
+ -re "Num\[ \t\]+Type\[ \t\]+Disp\[ \t\]+Enb\[ \t\]+Address\[ \t\]+What\r\n1\[ \t\]+breakpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex in main at.*break.c:75\r\n\[ \t\]+breakpoint already hit 1 time\r\n-1\[ \t\]+shlib events\[ \t\]+keep\[ \t\]+y\[ \t\]+$hex.*breakpoint already hit.*$gdb_prompt $"\
+ { pass "maint info breakpoints (with shlib events)" }
+ -re ".*$gdb_prompt $" { fail "maint info breakpoints" }
+ timeout { fail "(timeout) maint info breakpoints" }
+}
+
+send_gdb "maint print\n"
+gdb_expect {
+ -re "\"maintenance print\" must be followed by the name of a print command\\.\r\nList.*unambiguous\\..*$gdb_prompt $"\
+ { pass "maint print w/o args" }
+ -re ".*$gdb_prompt $" { fail "maint print w/o args" }
+ timeout { fail "(timeout) maint print w/o args" }
+ }
+
+send_gdb "maint info\n"
+gdb_expect {
+ -re "\"maintenance info\" must be followed by the name of an info command\\.\r\nList.*unambiguous\\..*$gdb_prompt $"\
+ { pass "maint info w/o args" }
+ -re ".*$gdb_prompt $" { fail "maint info w/o args" }
+ timeout { fail "(timeout) maint info w/o args" }
+ }
+
+send_gdb "maint\n"
+gdb_expect {
+ -re "\"maintenance\" must be followed by the name of a maintenance command\\.\r\nList.*unambiguous\\..*$gdb_prompt $"\
+ { pass "maint w/o args" }
+ -re ".*$gdb_prompt $" { fail "maint w/o args" }
+ timeout { fail "(timeout) maint w/o args" }
+ }
+
+
+set timeout $oldtimeout
+
+#============test help on maint commands
+
+send_gdb "help maint\n"
+gdb_expect {
+ -re "Commands for use by GDB maintainers\\..*Includes commands to dump specific internal GDB structures in.*a human readable form, to cause GDB to deliberately dump core,.*to test internal functions such as the C.. demangler, etc\\..*List of maintenance subcommands:.*maintenance check-symtabs.*maintenance demangle.*(maintenance dump-me.*)?maintenance info.*maintenance internal-error.*maintenance print.*maintenance set.*maintenance show.*maintenance space.*maintenance time.*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\..*Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
+ { pass "help maint" }
+ -re ".*$gdb_prompt $" { fail "help maint" }
+ timeout { fail "(timeout) help maint" }
+ }
+
+
+send_gdb "help maint check-symtabs\n"
+gdb_expect {
+ -re "Check consistency of psymtabs and symtabs\\..*$gdb_prompt $"\
+ { pass "help maint check-symtabs" }
+ -re ".*$gdb_prompt $" { fail "help maint check-symtabs" }
+ timeout { fail "(timeout) help maint check-symtabs" }
+ }
+
+send_gdb "help maint space\n"
+gdb_expect {
+ -re "Set the display of space usage\\.\r\nIf nonzero, will cause the execution space for each command to be\r\ndisplayed, following the command's output\\..*$gdb_prompt $"\
+ { pass "help maint space" }
+ -re ".*$gdb_prompt $" { fail "help maint space" }
+ timeout { fail "(timeout) help maint space" }
+ }
+
+send_gdb "help maint time\n"
+gdb_expect {
+ -re "Set the display of time usage\\.\r\nIf nonzero, will cause the execution time for each command to be\r\ndisplayed, following the command's output\\..*$gdb_prompt $"\
+ { pass "help maint time" }
+ -re ".*$gdb_prompt $" { fail "help maint time" }
+ timeout { fail "(timeout) help maint time" }
+ }
+
+send_gdb "help maint demangle\n"
+gdb_expect {
+ -re "Demangle a C\\+\\+ mangled name\\.\r\nCall internal GDB demangler routine to demangle a C\\+\\+ link name\r\nand prints the result\\..*$gdb_prompt $"\
+ { pass "help maint demangle" }
+ -re ".*$gdb_prompt $" { fail "help maint demangle" }
+ timeout { fail "(timeout) help maint demangle" }
+ }
+
+# dump-me is disabled ifdef _WIN32.
+if [ishost *cygwin*] {
+ setup_xfail "*-*-*"
+}
+send_gdb "help maint dump-me\n"
+gdb_expect {
+ -re "Get fatal error; make debugger dump its core\\.\r\nGDB sets it's handling of SIGQUIT back to SIG_DFL and then sends\r\nitself a SIGQUIT signal\\..*$gdb_prompt $"\
+ { pass "help maint dump-me" }
+ -re ".*$gdb_prompt $" { fail "help maint dump-me" }
+ timeout { fail "(timeout) help maint dump-me" }
+ }
+
+send_gdb "help maint internal-error\n"
+gdb_expect {
+ -re "Give GDB an internal error\\.\r\nCause GDB to behave as if an internal error was detected\\..*$gdb_prompt $"\
+ { pass "help maint internal-error" }
+ -re ".*$gdb_prompt $" { fail "help maint internal-error" }
+ timeout { fail "(timeout) help maint internal-error" }
+ }
+
+send_gdb "help maint print statistics\n"
+gdb_expect {
+ -re "Print statistics about internal gdb state\\..*$gdb_prompt $"\
+ { pass "help maint print statistics" }
+ -re ".*$gdb_prompt $" { fail "help maint print statistics" }
+ timeout { fail "(timeout) help maint print statistics" }
+ }
+
+send_gdb "help maint print objfiles\n"
+gdb_expect {
+ -re "Print dump of current object file definitions\\..*$gdb_prompt $"\
+ { pass "help maint print objfiles" }
+ -re ".*$gdb_prompt $" { fail "help maint print objfiles" }
+ timeout { fail "(timeout) help maint print objfiles" }
+ }
+
+send_gdb "help maint print psymbols\n"
+gdb_expect {
+ -re "Print dump of current partial symbol definitions\\.\r\nEntries in the partial symbol table are dumped to file OUTFILE\\.\r\nIf a SOURCE file is specified, dump only that file's partial symbols\\..*$gdb_prompt $"\
+ { pass "help maint print psymbols" }
+ -re ".*$gdb_prompt $" { fail "help maint print psymbols" }
+ timeout { fail "(timeout) help maint print psymbols" }
+ }
+
+send_gdb "help maint print msymbols\n"
+gdb_expect {
+ -re "Print dump of current minimal symbol definitions\\.\r\nEntries in the minimal symbol table are dumped to file OUTFILE\\.\r\nIf a SOURCE file is specified, dump only that file's minimal symbols\\..*$gdb_prompt $"\
+ { pass "help maint print msymbols" }
+ -re ".*$gdb_prompt $" { fail "help maint print msymbols" }
+ timeout { fail "(timeout) help maint print msymbols" }
+ }
+
+send_gdb "help maint print symbols\n"
+gdb_expect {
+ -re "Print dump of current symbol definitions\\.\r\nEntries in the full symbol table are dumped to file OUTFILE\\.\r\nIf a SOURCE file is specified, dump only that file's symbols\\..*$gdb_prompt $"\
+ { pass "help maint print symbols" }
+ -re ".*$gdb_prompt $" { fail "help maint print symbols" }
+ timeout { fail "(timeout) help maint print symbols" }
+ }
+
+
+send_gdb "help maint print type\n"
+gdb_expect {
+ -re "Print a type chain for a given symbol\\.\r\nFor each node in a type chain, print the raw data for each member of\r\nthe type structure, and the interpretation of the data\\..*$gdb_prompt $"\
+ { pass "help maint print type" }
+ -re ".*$gdb_prompt $" { fail "help maint print type" }
+ timeout { fail "(timeout) help maint print type" }
+ }
+
+if [istarget "hppa*-*-*"] {
+ send_gdb "help maint print unwind\n"
+ gdb_expect {
+ -re "Print unwind table entry at given address\\..*$gdb_prompt $"\
+ { pass "help maint print unwind" }
+ -re ".*$gdb_prompt $" { fail "help maint print unwind" }
+ timeout { fail "(timeout) help maint print unwind" }
+ }
+}
+
+send_gdb "help maint info sections\n"
+gdb_expect {
+ -re "List the BFD sections of the exec and core files\\..*$gdb_prompt $"\
+ { pass "help maint info sections" }
+ -re ".*$gdb_prompt $" { fail "help maint info sections" }
+ timeout { fail "(timeout) help maint info sections" }
+ }
+
+
+send_gdb "help maint info breakpoints\n"
+gdb_expect {
+-re "Status of all breakpoints, or breakpoint number NUMBER.*$gdb_prompt $" { pass "help maint info breakpoints" }
+ -re ".*$gdb_prompt $" { fail "help maint info breakpoints" }
+ timeout { fail "(timeout) help maint info breakpoints" }
+ }
+
+#send_gdb "help maint info breakpoints\n"
+#expect {
+# -re "Status of all breakpoints, or breakpoint number NUMBER\\.\[ \r\n\t\]+The \"Type\" column indicates one of:\[ \r\n\t\]+breakpoint\[ \t\]+- normal breakpoint\[ \r\n\t\]+watchpoint\[ \t\]+- watchpoint\[ \r\n\t\]+longjmp\[ \t\]+- internal breakpoint used to step through longjmp\\(\\)\[ \r\n\t\]+longjmp resume - internal breakpoint at the target of longjmp\\(\\)\[ \r\n\t\]+until\[ \t\]+- internal breakpoint used by the \"until\" command\[ \r\n\t\]+finish\[ \t\]+- internal breakpoint used by the \"finish\" command\[ \r\n\t\]+The \"Disp\" column contains one of \"keep\", \"del\", or \"dis\" to indicate\[ \r\n\t\]+the disposition of the breakpoint after it gets hit\\. \"dis\" means that the\[ \r\n\t\]+breakpoint will be disabled\\. The \"Address\" and \"What\" columns indicate the\[ \r\n\t\]+address and file.line number respectively\\.\[ \r\n\t\]+Convenience variable \".*\" and default examine address for \"x\"\[ \r\n\t\]+are set to the address of the last breakpoint listed\\.\[ \r\n\t\]+Convenience variable \".bpnum\" contains the number of the last\[ \r\n\t\]+breakpoint set\\..*$gdb_prompt $"\
+# { pass "help maint info breakpoints" }
+# -re ".*$gdb_prompt $" { fail "help maint info breakpoints" }
+# timeout { fail "(timeout) help maint info breakpoints" }
+# }
+
+send_gdb "help maint info\n"
+gdb_expect {
+ -re "Commands for showing internal info about the program being debugged.*unambiguous\\..*$gdb_prompt $"\
+ { pass "help maint info" }
+ -re ".*$gdb_prompt $" { fail "help maint info" }
+ timeout { fail "(timeout) help maint info" }
+ }
+
+send_gdb "help maint print\n"
+gdb_expect {
+ -re "Maintenance command for printing GDB internal state\\.\[\r\n\]+List of maintenance print subcommands:\[\r\n\]+maintenance print architecture -- Print the internal architecture configuration.*maintenance print msymbols -- Print dump of current minimal symbol definitions.*maintenance print objfiles -- Print dump of current object file definitions.*maintenance print psymbols -- Print dump of current partial symbol definitions.*maintenance print statistics -- Print statistics about internal gdb state.*maintenance print symbols -- Print dump of current symbol definitions.*maintenance print type -- Print a type chain for a given symbol.*Type .help maintenance print. followed by maintenance print subcommand name for full documentation\\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
+ { pass "help maint print" }
+ -re ".*$gdb_prompt $" { fail "help maint print" }
+ timeout { fail "(timeout) help maint print" }
+ }
+
+send_gdb "help maint\n"
+gdb_expect {
+ -re "Commands for use by GDB maintainers\\.\[\r\n\]+Includes commands to dump specific internal GDB structures in\[\r\n\]+a human readable form, to cause GDB to deliberately dump core,\[\r\n\]+to test internal functions such as the C\\+\\+ demangler, etc\\..*Type.*help maintenance.*followed by maintenance subcommand name for full documentation\\.\[\r\n\]+Command name abbreviations are allowed if unambiguous\\..*$gdb_prompt $"\
+ { pass "help maint" }
+ -re ".*$gdb_prompt $" { fail "help maint" }
+ timeout { fail "(timeout) help maint" }
+ }
+
+#set oldtimeout $timeout
+#set timeout [expr $timeout + 300]
+
+if [ishost *cygwin*] {
+ setup_xfail "*-*-*"
+}
+send_gdb "maint dump-me\n"
+gdb_expect {
+ -re "Should GDB dump core.*\\(y or n\\) $"\
+ { send_gdb "n\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" { pass "maint dump-me" }
+ timeout { fail "(timeout) maint dump-me" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "maint dump-me" }
+ timeout { fail "(timeout) maint dump-me" }
+ }
+
+send_gdb "maint internal-error\n"
+gdb_expect {
+ -re "Quit this debugging session.*\\(y or n\\) $" {
+ send_gdb "n\n"
+ gdb_expect {
+ -re "Create a core file.*\\(y or n\\) $" {
+ send_gdb "n\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ pass "maint internal-error"
+ }
+ timeout {
+ fail "(timeout) maint internal-error"
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "maint internal-error"
+ }
+ timeout {
+ fail "(timeout) maint internal-error"
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "maint internal-error"
+ }
+ timeout {
+ fail "(timeout) maint internal-error"
+ }
+}
+
+#set timeout $oldtimeout
+
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.base/mips_pro.c b/gdb/testsuite/gdb.base/mips_pro.c
new file mode 100644
index 00000000000..b659d82ded2
--- /dev/null
+++ b/gdb/testsuite/gdb.base/mips_pro.c
@@ -0,0 +1,57 @@
+/* Tests regarding examination of prologues. */
+
+#ifdef PROTOTYPES
+int
+inner (int z)
+#else
+int
+inner (z)
+ int z;
+#endif
+{
+ return 2 * z;
+}
+
+#ifdef PROTOTYPES
+int
+middle (int x)
+#else
+int
+middle (x)
+ int x;
+#endif
+{
+ if (x == 0)
+ return inner (5);
+ else
+ return inner (6);
+}
+
+#ifdef PROTOTYPES
+int
+top (int y)
+#else
+int
+top (y)
+ int y;
+#endif
+{
+ return middle (y + 1);
+}
+
+#ifdef PROTOTYPES
+int
+main (int argc, char **argv)
+#else
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+#endif
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ return top (-1) + top (1);
+}
diff --git a/gdb/testsuite/gdb.base/mips_pro.exp b/gdb/testsuite/gdb.base/mips_pro.exp
new file mode 100644
index 00000000000..1697eee136a
--- /dev/null
+++ b/gdb/testsuite/gdb.base/mips_pro.exp
@@ -0,0 +1,67 @@
+# Copyright 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile mips_pro
+set srcfile ${srcdir}/$subdir/${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+
+# This test must be compiled with -O2 if using gcc.
+
+if {$gcc_compiled} then {
+ if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-O2}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+} else {
+ if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if [runto middle] then {
+ # PR 3016
+ # warning: Hit heuristic-fence-post without finding
+ # warning: enclosing function for pc 0x1006ead0
+ if {$gcc_compiled} then {
+ setup_xfail "mips*-sgi-irix4*" "mips64*-*-elf"
+ }
+ # The call chain is main -> top -> middle. But gcc can optimize a tail
+ # call to a jump, so the stack may contain either main -> top -> middle
+ # or main -> middle.
+ gdb_test "backtrace" "#0.*middle.*#\[12\].*main.*"
+}
+return 0
diff --git a/gdb/testsuite/gdb.base/miscexprs.c b/gdb/testsuite/gdb.base/miscexprs.c
new file mode 100644
index 00000000000..580255d27cf
--- /dev/null
+++ b/gdb/testsuite/gdb.base/miscexprs.c
@@ -0,0 +1,49 @@
+void
+marker1 ()
+{
+
+}
+
+int
+main ()
+{
+ STORAGE struct {
+ char c[100];
+ } cbig;
+
+ STORAGE struct {
+ int i[800];
+ } ibig;
+
+ STORAGE struct {
+ long l[900];
+ } lbig;
+
+ STORAGE struct {
+ float f[200];
+ } fbig;
+
+ STORAGE struct {
+ double d[300];
+ } dbig;
+
+ STORAGE struct {
+ short s[400];
+ } sbig;
+
+ ibig.i[100] = 5;
+ cbig.c[0] = '\0';
+ cbig.c[100] = 'A';
+ fbig.f[100] = 11.99999;
+ dbig.d[202] = 9.99999999;
+ sbig.s[90] = 255;
+ lbig.l[333] = 999999999;
+
+#ifdef usestubs
+ set_debug_traps ();
+ breakpoint ();
+#endif
+
+ marker1 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/miscexprs.exp b/gdb/testsuite/gdb.base/miscexprs.exp
new file mode 100644
index 00000000000..ad8e11d837f
--- /dev/null
+++ b/gdb/testsuite/gdb.base/miscexprs.exp
@@ -0,0 +1,311 @@
+# Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+
+# This file is part of the gdb testsuite
+# file written by Elena Zannoni (ezannoni@cygnus.com)
+
+#
+# tests for expressions with struct/array elements and mixed operator types
+# with elementary types
+#
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+# By default, the datastructures are allocated on the stack. For targets
+# with very small stack, that will not work. In that case, just set
+# storage to `-DSTORAGE=static' which changes the datastructures to be
+# allocated in data segment.
+set storage "-DSTORAGE="
+if [target_info exists gdb,small_stack_section] {
+ set storage "-DSTORAGE=static"
+}
+
+set additional_flags "additional_flags=-w ${storage}"
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "miscexprs"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ${additional_flags}]] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
+
+ send_gdb "cont\n"
+ gdb_expect {
+ -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
+ send_gdb "up\n"
+ gdb_expect {
+ -re ".*main.*$gdb_prompt $" {
+ pass "up from marker1"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "up from marker1"
+ }
+ timeout { fail "up from marker1 (timeout)" }
+ }
+ }
+ -re "$gdb_prompt $" { fail "continue to marker1" }
+ timeout { fail "(timeout) continue to marker1" }
+ }
+
+global hex
+
+send_gdb "print &ibig.i\[0\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(int \\*\\) $hex.*$gdb_prompt $" {
+ pass "print value of &ibig.i\[0\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of &ibig.i\[0\]" }
+ timeout { fail "(timeout) print value of &ibig.i\[0\]" }
+ }
+
+send_gdb "print &cbig.c\[0\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = $hex \"\".*$gdb_prompt $" {
+ pass "print value of &cbig.c\[0\]"
+ }
+ -re ".\[0-9\]* = $hex \"*\".*$gdb_prompt $" {
+ pass "print value of &cbig.c\[0\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of &cbig.c\[0\]" }
+ timeout { fail "(timeout) print value of &cbig.c\[0\]" }
+ }
+
+send_gdb "print &fbig.f\[0\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(float \\*\\) $hex.*$gdb_prompt $" {
+ pass "print value of &fbig.f\[0\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of &fbig.f\[0\]" }
+ timeout { fail "(timeout) print value of &fbig.f\[0\]" }
+ }
+
+send_gdb "print &dbig.d\[0\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(double \\*\\) $hex.*$gdb_prompt $" {
+ pass "print value of &dbig.d\[0\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of &dbig.d\[0\]" }
+ timeout { fail "(timeout) print value of &dbig.d\[0\]" }
+ }
+
+send_gdb "print &sbig.s\[0\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(short \\*\\) $hex.*$gdb_prompt $" {
+ pass "print value of &sbig.s\[0\]"
+ }
+ -re ".\[0-9\]* = \\(short int \\*\\) $hex.*$gdb_prompt $" {
+ pass "print value of &sbig.s\[0\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of &sbig.s\[0\]" }
+ timeout { fail "(timeout) print value of &sbig.s\[0\]" }
+ }
+
+send_gdb "print &lbig.l\[0\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(long \\*\\) $hex.*$gdb_prompt $" {
+ pass "print value of &lbig.l\[0\]"
+ }
+ -re ".\[0-9\]* = \\(long int \\*\\) $hex.*$gdb_prompt $" {
+ pass "print value of &lbig.l\[0\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of &lbig.l\[0\]" }
+ timeout { fail "(timeout) print value of &lbig.l\[0\]" }
+ }
+
+
+send_gdb "print ibig.i\[100\] | 1\n"
+gdb_expect {
+ -re ".\[0-9\]* = 5.*$gdb_prompt $" {
+ pass "print value of ibig.i\[100\] | 1"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of ibig.i\[100\] | 1" }
+ timeout { fail "(timeout) print value of ibig.i\[100\] | 1" }
+ }
+
+
+send_gdb "print sbig.s\[90\] & 127\n"
+gdb_expect {
+ -re ".\[0-9\]* = 127.*$gdb_prompt $" {
+ pass "print value of sbig.s\[90\] & 127"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of sbig.s\[90\] & 127" }
+ timeout { fail "(timeout) print value of sbig.s\[90\] & 127" }
+ }
+
+send_gdb "print !ibig.i\[100\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = $false.*$gdb_prompt $" {
+ pass "print value of !ibig.i\[100\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !ibig.i\[100\]" }
+ timeout { fail "(timeout) print value of !ibig.i\[100\]" }
+ }
+
+send_gdb "print !sbig.s\[90\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = $false.*$gdb_prompt $" {
+ pass "print value of !sbig.s\[90\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !sbig.s\[90\]" }
+ timeout { fail "(timeout) print value of !sbig.s\[90\]" }
+ }
+
+
+send_gdb "print !fbig.f\[100\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = $false.*$gdb_prompt $" {
+ pass "print value of !ibig.i\[100\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !ibig.i\[100\]" }
+ timeout { fail "(timeout) print value of !ibig.i\[100\]" }
+ }
+
+send_gdb "print !dbig.d\[202\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = $false.*$gdb_prompt $" {
+ pass "print value of !ibig.i\[100\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !ibig.i\[100\]" }
+ timeout { fail "(timeout) print value of !ibig.i\[100\]" }
+ }
+
+
+
+send_gdb "print sbig.s\[90\] * 10\n"
+gdb_expect {
+ -re ".\[0-9\]* = 2550.*$gdb_prompt $" {
+ pass "print value of !sbig.s\[90\] * 10"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !sbig.s\[90\] * 10" }
+ timeout { fail "(timeout) print value of !sbig.s\[90\] * 10" }
+ }
+
+send_gdb "print ibig.i\[100\] * sbig.s\[90\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1275.*$gdb_prompt $" {
+ pass "print value of ibig.i\[100\] * sbig.s\[90\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of ibig.i\[100\] * sbig.s\[90\]" }
+ timeout { fail "(timeout) print value of ibig.i\[100\] * sbig.s\[90\]" }
+ }
+
+send_gdb "print fbig.f\[100\] * dbig.d\[202\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = 119.99\[0-9\]*.*$gdb_prompt $" {
+ pass "print value of fbig.f\[100\] * dbig.d\[202\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of fbig.f\[100\] * dbig.d\[202\]" }
+ timeout { fail "(timeout) print value of fbig.f\[100\] * dbig.d\[202\]" }
+ }
+
+send_gdb "print !(sbig.s\[90\] * 2)\n"
+gdb_expect {
+ -re ".\[0-9\]* = $false.*$gdb_prompt $" {
+ pass "print value of !(sbig.s\[90\] * 2)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of !(sbig.s\[90\] * 2)" }
+ timeout { fail "(timeout) print value of !(sbig.s\[90\] * 2)" }
+ }
+
+
+send_gdb "print sizeof(sbig)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 800.*$gdb_prompt $" {
+ pass "print value of sizeof(sbig)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of sizeof(sbig)" }
+ timeout { fail "(timeout) print value of sizeof(sbig)" }
+ }
+
+
+send_gdb "print sizeof(cbig)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 100.*$gdb_prompt $" {
+ pass "print value of sizeof(cbig)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of sizeof(cbig)" }
+ timeout { fail "(timeout) print value of sizeof(cbig)" }
+ }
+
+
+send_gdb "print sizeof(lbig)/sizeof(long)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 900.*$gdb_prompt $" {
+ pass "print value of sizeof(lbig)/sizeof(long)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of sizeof(lbig)/sizeof(long)" }
+ timeout { fail "(timeout) print value of sizeof(lbig)/sizeof(long)" }
+ }
+
+send_gdb "print ibig.i\[100\] << 2\n"
+gdb_expect {
+ -re ".\[0-9\]* = 20.*$gdb_prompt $" {
+ pass "print value of ibig.i\[100\] << 2"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of ibig.i\[100\] << 2" }
+ timeout { fail "(timeout) print value of ibig.i\[100\] << 2" }
+ }
+
+send_gdb "print sbig.s\[90\] >> 4\n"
+gdb_expect {
+ -re ".\[0-9\]* = 15.*$gdb_prompt $" {
+ pass "print value of sbig.s\[90\] >> 4"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of sbig.s\[90\] >> 4" }
+ timeout { fail "(timeout) print value of sbig.s\[90\] >> 4" }
+ }
+
+send_gdb "print lbig.l\[333\] >> 6\n"
+gdb_expect {
+ -re ".\[0-9\]* = 15624999.*$gdb_prompt $" {
+ pass "print value of lbig.l\[333\] >> 6"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of lbig.l\[333\] >> 6" }
+ timeout { fail "(timeout) print value of lbig.l\[333\] >> 6" }
+ }
diff --git a/gdb/testsuite/gdb.base/nodebug.c b/gdb/testsuite/gdb.base/nodebug.c
new file mode 100644
index 00000000000..3e0a4ce7862
--- /dev/null
+++ b/gdb/testsuite/gdb.base/nodebug.c
@@ -0,0 +1,81 @@
+#include <stdlib.h>
+/* Test that things still (sort of) work when compiled without -g. */
+
+int dataglobal = 3; /* Should go in global data */
+static int datalocal = 4; /* Should go in local data */
+int bssglobal; /* Should go in global bss */
+static int bsslocal; /* Should go in local bss */
+
+#ifdef PROTOTYPES
+int
+inner (int x)
+#else
+int
+inner (x)
+ int x;
+#endif
+{
+ return x + dataglobal + datalocal + bssglobal + bsslocal;
+}
+
+#ifdef PROTOTYPES
+static short
+middle (int x)
+#else
+static short
+middle (x)
+ int x;
+#endif
+{
+ return 2 * inner (x);
+}
+
+#ifdef PROTOTYPES
+short
+top (int x)
+#else
+short
+top (x)
+ int x;
+#endif
+{
+ return 2 * middle (x);
+}
+
+#ifdef PROTOTYPES
+int
+main (int argc, char **argv)
+#else
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+#endif
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ return top (argc);
+}
+
+int *x;
+
+#ifdef PROTOTYPES
+int array_index (char *arr, int i)
+#else
+int
+array_index (arr, i)
+ char *arr;
+ int i;
+#endif
+{
+ /* The basic concept is just "return arr[i];". But call malloc so that gdb
+ will be able to call functions. */
+ char retval;
+ x = (int *) malloc (sizeof (int));
+ *x = i;
+ retval = arr[*x];
+ free (x);
+ return retval;
+}
diff --git a/gdb/testsuite/gdb.base/nodebug.exp b/gdb/testsuite/gdb.base/nodebug.exp
new file mode 100644
index 00000000000..836ff8637e1
--- /dev/null
+++ b/gdb/testsuite/gdb.base/nodebug.exp
@@ -0,0 +1,181 @@
+# Copyright 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test that things still (sort of) work when compiled without -g.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile nodebug
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ""] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+source ${binfile}.ci
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+if [runto inner] then {
+
+ # Expect to find global/local symbols in each of text/data/bss.
+
+ # The exact format for some of this output is not necessarily
+ # ideal, particularly interpreting "p top" requires a fair bit of
+ # savvy about gdb's workings and the meaning of the "{}"
+ # construct. So the details maybe could be tweaked. But the
+ # basic purpose should be maintained, which is (a) users should be
+ # able to interact with these variables with some care (they have
+ # to know how to interpret them according to their real type,
+ # since gdb doesn't know the type), but (b) users should be able
+ # to detect that gdb does not know the type, rather than just
+ # being told they are ints or functions returning int like old
+ # versions of gdb used to do.
+
+ # On alpha (and other ecoff systems) the native compilers put
+ # out debugging info for non-aggregate return values of functions
+ # even without -g, which should be accepted.
+ # Irix5, even though it is ELF, counts as "ecoff" because it
+ # encapsulates ecoff debugging info in a .mdebug section.
+ # Irix6 gcc omits no debug info at all for static functions and
+ # variables, so all tests involving statics fail.
+
+ if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" "mips-sgi-irix6*" }
+ gdb_test "p top" \
+ "\{(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))\} \[0-9a-fx]* <top(\\(int\\)|)>"
+ if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" "mips-sgi-irix6*" }
+ gdb_test "whatis top" \
+ "(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))"
+ if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
+ gdb_test "ptype top" "(short|int) \\((|void|int|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
+
+ if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" }
+ setup_xfail "mips-sgi-irix6*"
+ gdb_test "p middle" \
+ "\{(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))\} \[0-9a-fx]* <middle(\\(int\\)|)>"
+ if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix5*" }
+ setup_xfail "mips-sgi-irix6*"
+ gdb_test "whatis middle" \
+ "(<(text variable|function), no debug info>|short \\(int\\)|short \\(\\))"
+ setup_xfail "mips-sgi-irix6*"
+ gdb_test "ptype middle" "(short|int) \\((|void|int|<non-float parameter>|<non-float parameter>, <non-float parameter>)\\)"
+
+ gdb_test "p dataglobal" "= 3"
+ gdb_test "whatis dataglobal" \
+ "<(data variable|variable), no debug info>|int"
+ gdb_test "ptype dataglobal" "<(data variable|variable), no debug info>|int"
+
+ # The only symbol xcoff puts out for statics is for the TOC entry.
+ # Possible, but hairy, for gdb to deal. Right now it doesn't, it
+ # doesn't know the variables exist at all.
+ setup_xfail "rs6000*-*-aix*"
+ setup_xfail "powerpc*-*-aix*"
+ if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
+ if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
+ gdb_test "p datalocal" "= 4"
+ setup_xfail "rs6000*-*-aix*"
+ setup_xfail "powerpc*-*-aix*"
+ if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
+ if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
+ gdb_test "whatis datalocal" "<(data variable|variable), no debug info>"
+ setup_xfail "rs6000*-*-aix*"
+ setup_xfail "powerpc*-*-aix*"
+ if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
+ if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
+ gdb_test "ptype datalocal" "<(data variable|variable), no debug info>"
+
+ gdb_test "p bssglobal" "= 0"
+ gdb_test "whatis bssglobal" "<(data variable|variable), no debug info>|int"
+ gdb_test "ptype bssglobal" "<(data variable|variable), no debug info>|int"
+
+ setup_xfail "rs6000*-*-aix*"
+ setup_xfail "powerpc*-*-aix*"
+ if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
+ if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
+ gdb_test "p bsslocal" "= 0"
+ setup_xfail "rs6000*-*-aix*"
+ setup_xfail "powerpc*-*-aix*"
+ if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
+ if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
+ gdb_test "whatis bsslocal" "<(data variable|variable), no debug info>"
+ setup_xfail "rs6000*-*-aix*"
+ setup_xfail "powerpc*-*-aix*"
+ if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
+ if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
+ gdb_test "ptype bsslocal" "<(data variable|variable), no debug info>"
+
+ if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
+ gdb_test "backtrace 10" "#0.*inner.*#1.*middle.*#2.*top.*#3.*main.*" \
+ "backtrace from inner in nodebug.exp"
+ # Or if that doesn't work, at least hope for the external symbols
+ # Commented out because if we aren't going to xfail the above test
+ # ever, why bother with a weaker test?
+ #gdb_test "backtrace 10" "#0.*inner.*#1.*#2.*top.*#3.*main.*" \
+ # "backtrace from inner in nodebug.exp for externals"
+
+ # This test is not as obscure as it might look. `p getenv ("TERM")'
+ # is a real-world example, at least on many systems.
+ if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
+ if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "p/c array_index(\"abcdef\",2)"
+ } else {
+ #
+ # On HP-UX, a support function (__d_plt_call) necessary to
+ # implement an inferior call is normally only available when
+ # the inferior was compiled with -g. Thus, we expect this
+ # testpoint to fail on HP-UX.
+ if { [istarget "hppa*-hpux*"] } {
+ send_gdb "p/c array_index(\"abcdef\",2)\n"
+ gdb_expect {
+ -re ".*Suggest linking executable with -g.*$gdb_prompt $" { pass "p/c array_index(\"abcdef\",2)" }
+ -re ".*Cannot find __wdb_call_dummy in.*end.o.*" { pass "p/c array_index(\"abcdef\",2)" }
+ -re ".*99 'c'.*" { pass "p/c array_index(\"abcdef\",2)" }
+ timeout { fail "(timeout) p/c array_index" }
+ }
+ } else {
+ # We need to up this because this can be really slow on some boards.
+ # (malloc() is called as part of the test).
+ set timeout 60;
+ gdb_test {p/c array_index("abcdef",2)} " = 99 'c'"
+ }
+ }
+
+ # Now, try that we can give names of file-local symbols which happen
+ # to be unique, and have it still work
+ if {$gcc_compiled} then { setup_xfail "mips-sgi-irix6*" }
+ if [runto middle] then {
+ gdb_test "backtrace 10" "#0.*middle.*#1.*top.*#2.*main.*" \
+ "backtrace from middle in nodebug.exp"
+ }
+}
diff --git a/gdb/testsuite/gdb.base/opaque.exp b/gdb/testsuite/gdb.base/opaque.exp
new file mode 100644
index 00000000000..4030b4f528a
--- /dev/null
+++ b/gdb/testsuite/gdb.base/opaque.exp
@@ -0,0 +1,267 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2002 Free Software
+# Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "opaque"
+set binfile ${objdir}/${subdir}/opaque
+
+#if { [gdb_compile "${srcdir}/${subdir}/opaque0.c ${srcdir}/${subdir}/opaque1.c" "${binfile}" executable {debug}] != "" } {
+# gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+#}
+
+if { [gdb_compile "${srcdir}/${subdir}/opaque0.c" "${binfile}0.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/opaque1.c" "${binfile}1.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${binfile}0.o ${binfile}1.o" ${binfile} executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# Test basic opaque structure handling (statically).
+# The ordering of the tests is significant. We first try the things that
+# might fail if gdb fails to connect the uses of opaque structures to
+# the actual opaque structure definition.
+
+# When we start up, gdb sets the file containing main() as the current
+# source file. The actual structure foo is defined in a different file.
+# A pointer (foop) to an instance of the opaque struct is defined in the same
+# source file as main(). Ensure that gdb correctly "connected" the definition
+# in the other file with the pointer to the opaque struct in the file containing
+# "foop".
+
+# Define a procedure to set up an xfail for all targets that do not support
+# this sort of cross reference.
+# Any target gcc that has a DBX_NO_XREFS definition in its config file will
+# not support it (FIXME: Is this still true; I suspect maybe not).
+
+# Native alpha ecoff doesn't support it either.
+# I don't think this type of cross reference works for any COFF target
+# either.
+
+proc setup_xfail_on_opaque_pointer {} {
+ global gcc_compiled
+
+ setup_xfail "vax-*-*" "i*86-sequent-bsd*"
+ if {!$gcc_compiled} then {
+ setup_xfail "alpha-*-*" "mips-sgi-irix5*"
+ }
+}
+
+# This seems easier than trying to track different versions of xlc; I'm
+# not sure there is much rhyme or reason regarding which tests it fails
+# and which ones it passes.
+if {[istarget "rs6000-*-aix*"] && !$gcc_compiled} then {
+ warning "xfails in opaque.exp may not be set up correctly for xlc"
+}
+
+setup_xfail_on_opaque_pointer
+gdb_test "whatis foop" \
+ "type = struct foo \[*\]+" \
+ "whatis on opaque struct pointer (statically)"
+
+
+# Ensure that we know the form of the structure that foop points to.
+
+setup_xfail_on_opaque_pointer
+if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+gdb_test "ptype foop" \
+ "type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\} \[*\]+" \
+ "ptype on opaque struct pointer (statically)"
+
+
+# An instance of the opaque structure (afoo) is defined in a different file.
+# Ensure that we can locate afoo and the structure definition.
+
+gdb_test "whatis afoo" \
+ "type = struct foo" \
+ "whatis on opaque struct instance (statically)"
+
+
+# Ensure that we know the form of "afoo".
+
+gdb_test "ptype afoo" \
+ "type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
+ "ptype on opaque struct instance (statically)"
+
+
+# Ensure that we know what a struct foo looks like.
+
+gdb_test "ptype struct foo" \
+ "type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
+ "ptype on opaque struct tagname (statically)"
+
+
+#
+# Done with static tests, now test dynamic opaque structure handling.
+# We reload the symbol table so we forget about anything we might
+# have learned during the static tests.
+#
+
+if [istarget "mips-idt-*"] then {
+ # Restart because IDT/SIM runs out of file descriptors.
+ gdb_exit
+ gdb_start
+}
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Run to main, where struct foo is incomplete.
+if ![runto_main] {
+ perror "cannot run to breakpoint at main"
+}
+
+
+# The current source file is now the one containing main(). The structure foo
+# is defined in a different file, but we have a pointer to an instance of
+# the opaque structure in the current file. Ensure we know it's type.
+
+setup_xfail_on_opaque_pointer
+gdb_test "whatis foop" \
+ "type = struct foo \[*\]+" \
+ "whatis on opaque struct pointer (dynamically)"
+
+
+# Ensure that we know the form of the thing foop points to.
+
+setup_xfail_on_opaque_pointer
+if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+gdb_test "ptype foop" \
+ "type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\} \[*\]+" \
+ "ptype on opaque struct pointer (dynamically) 1"
+
+gdb_test "whatis afoo" \
+ "type = struct foo" \
+ "whatis on opaque struct instance (dynamically) 1"
+
+
+# Ensure that we know the form of afoo, an instance of a struct foo.
+
+gdb_test "ptype afoo" \
+ "type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
+ "ptype on opaque struct instance (dynamically) xyz 1"
+
+
+# Ensure that we know the form of an explicit struct foo.
+
+if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+gdb_test "ptype struct foo" \
+ "type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
+ "ptype on opaque struct tagname (dynamically) 1"
+
+
+# Now reload the symbols again so we forget about anything we might
+# have learned reading the symbols during the previous tests.
+
+if [istarget "mips-idt-*"] then {
+ # Restart because IDT/SIM runs out of file descriptors.
+ gdb_exit
+ gdb_start
+}
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Run to getfoo, where struct foo is complete.
+if ![runto getfoo] {
+ perror "cannot run to breakpoint at getfoo"
+}
+
+
+# Ensure that we know what foop is.
+
+setup_xfail_on_opaque_pointer
+gdb_test "whatis foop" \
+ "type = struct foo \[*\]+" \
+ "whatis on opaque struct pointer (dynamically) 1"
+
+
+# Ensure that we know the form of the thing foop points to.
+
+setup_xfail_on_opaque_pointer
+if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+gdb_test "ptype foop" \
+ "type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\} \[*\]+" \
+ "ptype on opaque struct pointer (dynamically) 2"
+
+gdb_test "whatis afoo" \
+ "type = struct foo" \
+ "whatis on opaque struct instance (dynamically) 1"
+
+
+# Ensure that we know the form of afoo, an instance of a struct foo.
+
+gdb_test "ptype afoo" \
+ "type = struct foo \{\r\n int a;\r\n int b;\r\n\}" \
+ "ptype on opaque struct instance (dynamically) 1"
+
+gdb_test "ptype afoo" \
+ "type = struct foo \{\[\r\n\]*.*int a;\[\r\n\]*.*int b;\[\r\n\]*}\[\r\n\]*" \
+ "ptype on opaque struct instance (dynamically) pqr 1"
+
+
+# Ensure that we know the form of an explicit struct foo.
+
+gdb_test "ptype foop" \
+ "type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\} \[*\]+" \
+ "ptype on opaque struct pointer (dynamically) 2"
+
+gdb_test "whatis afoo" \
+ "type = struct foo" \
+ "whatis on opaque struct instance (dynamically) 2"
+
+
+# Ensure that we know the form of afoo, an instance of a struct foo.
+
+gdb_test "ptype afoo" \
+ "type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
+ "ptype on opaque struct instance (dynamically) 2"
+
+
+# Ensure that we know the form of an explicit struct foo.
+
+gdb_test "ptype struct foo" \
+ "type = struct foo \{\[\r\n\]+ int a;\[\r\n\]+ int b;\[\r\n\]+\}" \
+ "ptype on opaque struct tagname (dynamically) 2"
diff --git a/gdb/testsuite/gdb.base/opaque0.c b/gdb/testsuite/gdb.base/opaque0.c
new file mode 100644
index 00000000000..5ec4a2aa082
--- /dev/null
+++ b/gdb/testsuite/gdb.base/opaque0.c
@@ -0,0 +1,23 @@
+/* Note that struct foo is opaque (never defined) in this file. This
+ is allowed by C since this file does not reference any members of
+ the structure. The debugger needs to be able to associate this
+ opaque structure definition with the full definition in another
+ file.
+*/
+
+struct foo *foop;
+extern struct foo *getfoo ();
+#ifdef PROTOTYPES
+extern void putfoo (struct foo *foop);
+#endif
+
+int main ()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ foop = getfoo ();
+ putfoo (foop);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/opaque1.c b/gdb/testsuite/gdb.base/opaque1.c
new file mode 100644
index 00000000000..c34f7aaaae1
--- /dev/null
+++ b/gdb/testsuite/gdb.base/opaque1.c
@@ -0,0 +1,18 @@
+struct foo {
+ int a;
+ int b;
+} afoo = { 1, 2};
+
+struct foo *getfoo ()
+{
+ return (&afoo);
+}
+
+#ifdef PROTOTYPES
+void putfoo (struct foo *foop)
+#else
+void putfoo (foop)
+ struct foo *foop;
+#endif
+{
+}
diff --git a/gdb/testsuite/gdb.base/overlays.c b/gdb/testsuite/gdb.base/overlays.c
new file mode 100644
index 00000000000..d02ed707cd1
--- /dev/null
+++ b/gdb/testsuite/gdb.base/overlays.c
@@ -0,0 +1,34 @@
+/* Support program for testing gdb's ability to debug overlays
+ in the inferior. */
+
+#include "ovlymgr.h"
+
+extern int foo PARAMS((int));
+extern int bar PARAMS((int));
+extern int baz PARAMS((int));
+extern int grbx PARAMS((int));
+
+int main ()
+{
+ int a, b, c, d, e;
+
+ OverlayLoad (0);
+ OverlayLoad (4);
+ a = foo (1);
+ OverlayLoad (1);
+ OverlayLoad (5);
+ b = bar (1);
+ OverlayLoad (2);
+ OverlayLoad (6);
+ c = baz (1);
+ OverlayLoad (3);
+ OverlayLoad (7);
+ d = grbx (1);
+ e = a + b + c + d;
+ return (e != ('f' + 'o' +'o'
+ + 'b' + 'a' + 'r'
+ + 'b' + 'a' + 'z'
+ + 'g' + 'r' + 'b' + 'x'));
+
+}
+
diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp
new file mode 100644
index 00000000000..9188b278014
--- /dev/null
+++ b/gdb/testsuite/gdb.base/overlays.exp
@@ -0,0 +1,282 @@
+# Copyright 1997, 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+#
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# test running programs
+#
+
+set prms_id 0
+set bug_id 0
+
+if [istarget "d10v-*-*"] then {
+ set linker_script "${srcdir}/${subdir}/d10v.ld";
+} elseif [istarget "m32r-*-*"] then {
+ set linker_script "${srcdir}/${subdir}/m32r.ld";
+} else {
+ verbose "Skipping overlay test -- not implemented for this target."
+ return
+}
+
+set testfile "overlays"
+set binfile ${objdir}/${subdir}/${testfile}
+set srcfile ${srcdir}/${subdir}/${testfile}.c
+set foo ${srcdir}/${subdir}/foo.c
+set bar ${srcdir}/${subdir}/bar.c
+set baz ${srcdir}/${subdir}/baz.c
+set grbx ${srcdir}/${subdir}/grbx.c
+
+if {[gdb_compile "${srcfile}" "${testfile}.o" object {debug}] != ""} then {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+if {[gdb_compile "${srcdir}/${subdir}/ovlymgr.c" ovlymgr.o object {debug}] != ""} then {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+if {[gdb_compile "${foo}" foo.o object {debug} ] != ""} then {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if {[gdb_compile "${bar}" bar.o object {debug}] != ""} then {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+if {[gdb_compile "${baz}" baz.o object {debug}] != ""} then {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+if {[gdb_compile "${grbx}" grbx.o object {debug}] != ""} then {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+if {[gdb_compile "${testfile}.o ovlymgr.o foo.o bar.o baz.o grbx.o" ${binfile} executable "ldscript=-Wl,-T$linker_script"] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+remote_exec build "mv ${testfile}.o foo.o bar.o baz.o grbx.o ovlymgr.o ${objdir}/${subdir}"
+
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+
+if ![runto_main] then {
+ gdb_suppress_tests;
+}
+
+# couple of convenience variables
+set fptrcast [string_to_regexp "(int (*)(int))"]
+set iptrcast [string_to_regexp "(int *)"]
+
+gdb_test "overlay manual" ""
+gdb_test "overlay list" "No sections are mapped." "List with none mapped"
+
+# capture the LMA addresses of [foo bar baz grbx foox barx bazx grbxx]
+
+gdb_test "print \$foo_lma = &foo" \
+ ".* $fptrcast 0x.* <\\*foo\\*>" "foo load addr"
+gdb_test "print \$bar_lma = &bar" \
+ ".* $fptrcast 0x.* <\\*bar\\*>" "bar load addr"
+gdb_test "print \$baz_lma = &baz" \
+ ".* $fptrcast 0x.* <\\*baz\\*>" "baz load addr"
+gdb_test "print \$grbx_lma = &grbx" \
+ ".* $fptrcast 0x.* <\\*grbx\\*>" "grbx load addr"
+gdb_test "print \$foox_lma = &foox" \
+ ".* $iptrcast 0x.*" "foox load addr"
+gdb_test "print \$barx_lma = &barx" \
+ ".* $iptrcast 0x.*" "barx load addr"
+gdb_test "print \$bazx_lma = &bazx" \
+ ".* $iptrcast 0x.*" "bazx load addr"
+gdb_test "print \$grbxx_lma = &grbxx" \
+ ".* $iptrcast 0x.*" "grbxx load addr"
+
+# map each overlay successively, and
+# capture the VMA addresses of [foo bar baz grbx foox barx bazx grbxx]
+
+gdb_test "overlay map .ovly0" ""
+gdb_test "overlay list" "Section .ovly0, loaded at.*, mapped at.*" "List ovly0"
+gdb_test "print \$foo_vma = &foo" \
+ ".* $fptrcast 0x.* <foo>" "foo runtime addr"
+
+gdb_test "overlay map .ovly1" ""
+gdb_test "overlay list" "Section .ovly1, loaded at.*, mapped at.*" "List ovly1"
+gdb_test "print \$bar_vma = &bar" \
+ ".* $fptrcast 0x.* <bar>" "bar runtime addr"
+
+gdb_test "overlay map .ovly2" ""
+gdb_test "overlay list" "Section .ovly2, loaded at.*, mapped at.*" "List ovly2"
+gdb_test "print \$baz_vma = &baz" \
+ ".* $fptrcast 0x.* <baz>" "baz runtime addr"
+
+gdb_test "overlay map .ovly3" ""
+gdb_test "overlay list" "Section .ovly3, loaded at.*, mapped at.*" "List ovly3"
+gdb_test "print \$grbx_vma = &grbx" \
+ ".* $fptrcast 0x.* <grbx>" "grbx runtime addr"
+
+gdb_test "overlay map .data00" ""
+gdb_test "overlay list" "Section .data00, loaded .*, mapped .*" "List data00"
+gdb_test "print \$foox_vma = &foox" \
+ ".* $iptrcast 0x.*" "foox runtime addr"
+
+gdb_test "overlay map .data01" ""
+gdb_test "overlay list" "Section .data01, loaded .*, mapped .*" "List data01"
+gdb_test "print \$barx_vma = &barx" \
+ ".* $iptrcast 0x.*" "barx runtime addr"
+
+gdb_test "overlay map .data02" ""
+gdb_test "overlay list" "Section .data02, loaded .*, mapped .*" "List data02"
+gdb_test "print \$bazx_vma = &bazx" \
+ ".* $iptrcast 0x.*" "bazx runtime addr"
+
+gdb_test "overlay map .data03" ""
+gdb_test "overlay list" "Section .data03, loaded .*, mapped .*" "List data03"
+gdb_test "print \$grbxx_vma = &grbxx" \
+ ".* $iptrcast 0x.*" "grbxx runtime addr"
+
+# Verify that LMA != VMA
+
+gdb_test "print \$foo_lma != \$foo_vma" ".* = 1" "foo's LMA != VMA"
+gdb_test "print \$bar_lma != \$bar_vma" ".* = 1" "bar's LMA != VMA"
+gdb_test "print \$baz_lma != \$baz_vma" ".* = 1" "baz's LMA != VMA"
+gdb_test "print \$grbx_lma != \$grbx_vma" ".* = 1" "grbx's LMA != VMA"
+gdb_test "print \$foox_lma != \$foox_vma" ".* = 1" "foox's LMA != VMA"
+gdb_test "print \$barx_lma != \$barx_vma" ".* = 1" "barx's LMA != VMA"
+gdb_test "print \$bazx_lma != \$bazx_vma" ".* = 1" "bazx's LMA != VMA"
+gdb_test "print \$grbxx_lma != \$grbxx_vma" ".* = 1" "grbxx's LMA != VMA"
+
+# Verify that early-mapped overlays have been bumped out
+# by later-mapped overlays layed over in the same VMA range.
+
+send_gdb "overlay list\n"
+gdb_expect {
+ -re ".*ovly0, " { fail ".ovly0 not unmapped by .ovly1" }
+ -re ".*ovly2, " { fail ".ovly2 not unmapped by .ovly3" }
+ -re ".*data00," { fail ".data00 not unmapped by .data01" }
+ -re ".*data02," { fail ".data02 not unmapped by .data03" }
+ -re ".*$gdb_prompt $" { pass "Automatic unmapping" }
+ timeout { fail "(timeout) Automatic unmapping" }
+}
+
+# Verify that both sec1 and sec2 can be loaded simultaneously.
+proc simultaneous_pair { sec1 sec2 } {
+ global gdb_prompt
+
+ set pairname "$sec1 and $sec2 mapped simultaneously"
+ gdb_test "overlay map $sec1" "" "$pairname: map $sec1"
+ gdb_test "overlay map $sec2" "" "$pairname: map $sec2"
+
+ set seen_sec1 0
+ set seen_sec2 0
+
+ send_gdb "overlay list\n"
+ gdb_expect {
+ -re ".*[string_to_regexp $sec1], " { set seen_sec1 1; exp_continue }
+ -re ".*[string_to_regexp $sec2], " { set seen_sec2 1; exp_continue }
+ -re ".*$gdb_prompt $" {
+ if {$seen_sec1 && $seen_sec2} {
+ pass "$pairname"
+ } else {
+ fail "$pairname"
+ }
+ }
+ timeout { fail "(timeout) $pairname" }
+ }
+}
+
+simultaneous_pair .ovly0 .ovly2
+simultaneous_pair .ovly0 .ovly3
+simultaneous_pair .ovly1 .ovly2
+simultaneous_pair .ovly1 .ovly3
+
+simultaneous_pair .data00 .data02
+simultaneous_pair .data00 .data03
+simultaneous_pair .data01 .data02
+simultaneous_pair .data01 .data03
+
+# test automatic mode
+
+gdb_test "overlay auto" ""
+gdb_test "overlay list" "No sections are mapped." "List none mapped (auto)"
+gdb_test "break foo" "Breakpoint .*at .*file .*foo.c.*" "break foo"
+gdb_test "break bar" "Breakpoint .*at .*file .*bar.c.*" "break bar"
+gdb_test "break baz" "Breakpoint .*at .*file .*baz.c.*" "break baz"
+gdb_test "break grbx" "Breakpoint .*at .*file .*grbx.c.*" "break grbx"
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Breakpoint .* foo .x=1. at .*$gdb_prompt $" { pass "hit foo" }
+ -re ".*$gdb_prompt $" { fail "hit foo" }
+ timeout { fail "(timeout) hit foo" }
+}
+
+send_gdb "backtrace\n"
+gdb_expect {
+ -re "#0 .*foo .*#1 .*main .*$gdb_prompt $" { pass "BT foo" }
+ -re ".*$gdb_prompt $" { fail "BT foo" }
+ timeout { fail "(timeout) BT foo" }
+}
+
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Breakpoint .* bar .x=1. at .*$gdb_prompt $" { pass "hit bar" }
+ -re ".*$gdb_prompt $" { fail "hit bar" }
+ timeout { fail "(timeout) hit bar" }
+}
+
+send_gdb "backtrace\n"
+gdb_expect {
+ -re "#0 .*bar .*#1 .*main .*$gdb_prompt $" { pass "BT bar" }
+ -re ".*$gdb_prompt $" { fail "BT bar" }
+ timeout { fail "(timeout) BT bar" }
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Breakpoint .* baz .x=1. at .*$gdb_prompt $" { pass "hit baz" }
+ -re ".*$gdb_prompt $" { fail "hit baz" }
+ timeout { fail "(timeout) hit baz" }
+}
+
+send_gdb "backtrace\n"
+gdb_expect {
+ -re "#0 .*baz .*#1 .*main .*$gdb_prompt $" { pass "BT baz" }
+ -re ".*$gdb_prompt $" { fail "BT baz" }
+ timeout { fail "(timeout) BT baz" }
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Breakpoint .* grbx .x=1. at .*$gdb_prompt $" { pass "hit grbx" }
+ -re ".*$gdb_prompt $" { fail "hit grbx" }
+ timeout { fail "(timeout) hit grbx" }
+}
+
+send_gdb "backtrace\n"
+gdb_expect {
+ -re "#0 .*grbx .*#1 .*main .*$gdb_prompt $" { pass "BT grbx" }
+ -re ".*$gdb_prompt $" { fail "BT grbx" }
+ timeout { fail "(timeout) BT grbx" }
+}
+
diff --git a/gdb/testsuite/gdb.base/ovlymgr.c b/gdb/testsuite/gdb.base/ovlymgr.c
new file mode 100644
index 00000000000..f4958ed14a3
--- /dev/null
+++ b/gdb/testsuite/gdb.base/ovlymgr.c
@@ -0,0 +1,233 @@
+
+/*
+ * Ovlymgr.c -- Runtime Overlay Manager for the GDB testsuite.
+ */
+
+#include "ovlymgr.h"
+
+/* Local functions and data: */
+
+extern unsigned long _ovly_table[][4];
+extern unsigned long _novlys __attribute__ ((section (".data")));
+enum ovly_index { VMA, SIZE, LMA, MAPPED};
+
+static void ovly_copy (unsigned long dst, unsigned long src, long size);
+
+/* Flush the data and instruction caches at address START for SIZE bytes.
+ Support for each new port must be added here. */
+/* FIXME: Might be better to have a standard libgloss function that
+ ports provide that we can then use. Use libgloss instead of newlib
+ since libgloss is the one intended to handle low level system issues.
+ I would suggest something like _flush_cache to avoid the user's namespace
+ but not be completely obscure as other things may need this facility. */
+
+static void
+FlushCache (void)
+{
+#ifdef __M32R__
+ volatile char *mspr = (char *) 0xfffffff7;
+ *mspr = 1;
+#endif
+}
+
+/* _ovly_debug_event:
+ * Debuggers may set a breakpoint here, to be notified
+ * when the overlay table has been modified.
+ */
+static void
+_ovly_debug_event (void)
+{
+}
+
+/* OverlayLoad:
+ * Copy the overlay into its runtime region,
+ * and mark the overlay as "mapped".
+ */
+
+bool
+OverlayLoad (unsigned long ovlyno)
+{
+ unsigned long i;
+
+ if (ovlyno < 0 || ovlyno >= _novlys)
+ exit (-1); /* fail, bad ovly number */
+
+ if (_ovly_table[ovlyno][MAPPED])
+ return TRUE; /* this overlay already mapped -- nothing to do! */
+
+ for (i = 0; i < _novlys; i++)
+ if (i == ovlyno)
+ _ovly_table[i][MAPPED] = 1; /* this one now mapped */
+ else if (_ovly_table[i][VMA] == _ovly_table[ovlyno][VMA])
+ _ovly_table[i][MAPPED] = 0; /* this one now un-mapped */
+
+ ovly_copy (_ovly_table[ovlyno][VMA],
+ _ovly_table[ovlyno][LMA],
+ _ovly_table[ovlyno][SIZE]);
+
+ FlushCache ();
+ _ovly_debug_event ();
+ return TRUE;
+}
+
+/* OverlayUnload:
+ * Copy the overlay back into its "load" region.
+ * Does NOT mark overlay as "unmapped", therefore may be called
+ * more than once for the same mapped overlay.
+ */
+
+bool
+OverlayUnload (unsigned long ovlyno)
+{
+ if (ovlyno < 0 || ovlyno >= _novlys)
+ exit (-1); /* fail, bad ovly number */
+
+ if (!_ovly_table[ovlyno][MAPPED])
+ exit (-1); /* error, can't copy out a segment that's not "in" */
+
+ ovly_copy (_ovly_table[ovlyno][LMA],
+ _ovly_table[ovlyno][VMA],
+ _ovly_table[ovlyno][SIZE]);
+
+ _ovly_debug_event ();
+ return TRUE;
+}
+
+#ifdef __D10V__
+#define IMAP0 (*(short *)(0xff00))
+#define IMAP1 (*(short *)(0xff02))
+#define DMAP (*(short *)(0xff04))
+
+static void
+D10VTranslate (unsigned long logical,
+ short *dmap,
+ unsigned long **addr)
+{
+ unsigned long physical;
+ unsigned long seg;
+ unsigned long off;
+
+ /* to access data, we use the following mapping
+ 0x00xxxxxx: Logical data address segment (DMAP translated memory)
+ 0x01xxxxxx: Logical instruction address segment (IMAP translated memory)
+ 0x10xxxxxx: Physical data memory segment (On-chip data memory)
+ 0x11xxxxxx: Physical instruction memory segment (On-chip insn memory)
+ 0x12xxxxxx: Phisical unified memory segment (Unified memory)
+ */
+
+ /* Addresses must be correctly aligned */
+ if (logical & (sizeof (**addr) - 1))
+ exit (-1);
+
+ /* If the address is in one of the two logical address spaces, it is
+ first translated into a physical address */
+ seg = (logical >> 24);
+ off = (logical & 0xffffffL);
+ switch (seg)
+ {
+ case 0x00: /* in logical data address segment */
+ if (off <= 0x7fffL)
+ physical = (0x10L << 24) + off;
+ else
+ /* Logical address out side of on-chip segment, not
+ supported */
+ exit (-1);
+ break;
+ case 0x01: /* in logical instruction address segment */
+ {
+ short map;
+ if (off <= 0x1ffffL)
+ map = IMAP0;
+ else if (off <= 0x3ffffL)
+ map = IMAP1;
+ else
+ /* Logical address outside of IMAP[01] segment, not
+ supported */
+ exit (-1);
+ if (map & 0x1000L)
+ {
+ /* Instruction memory */
+ physical = (0x11L << 24) | off;
+ }
+ else
+ {
+ /* Unified memory */
+ physical = ((map & 0x7fL) << 17) + (off & 0x1ffffL);
+ if (physical > 0xffffffL)
+ /* Address outside of unified address segment */
+ exit (-1);
+ physical |= (0x12L << 24);
+ }
+ break;
+ }
+ case 0x10:
+ case 0x11:
+ case 0x12:
+ physical = logical;
+ break;
+ default:
+ exit (-1); /* error */
+ }
+
+ seg = (physical >> 24);
+ off = (physical & 0xffffffL);
+ switch (seg)
+ {
+ case 0x10: /* dst is a 15 bit offset into the on-chip memory */
+ *dmap = 0;
+ *addr = (long *) (0x0000 + ((short)off & 0x7fff));
+ break;
+ case 0x11: /* dst is an 18-bit offset into the on-chip
+ instruction memory */
+ *dmap = 0x1000L | ((off & 0x3ffffL) >> 14);
+ *addr = (long *) (0x8000 + ((short)off & 0x3fff));
+ break;
+ case 0x12: /* dst is a 24-bit offset into unified memory */
+ *dmap = off >> 14;
+ *addr = (long *) (0x8000 + ((short)off & 0x3fff));
+ break;
+ default:
+ exit (-1); /* error */
+ }
+}
+#endif /* __D10V__ */
+
+static void
+ovly_copy (unsigned long dst, unsigned long src, long size)
+{
+#ifdef __D10V__
+ unsigned long *s, *d, tmp;
+ short dmap_src, dmap_dst;
+ short dmap_save;
+
+ /* all section sizes should by multiples of 4 bytes */
+ dmap_save = DMAP;
+
+ D10VTranslate (src, &dmap_src, &s);
+ D10VTranslate (dst, &dmap_dst, &d);
+
+ while (size > 0)
+ {
+ /* NB: Transfer 4 byte (long) quantites, problems occure
+ when only two bytes are transfered */
+ DMAP = dmap_src;
+ tmp = *s;
+ DMAP = dmap_dst;
+ *d = tmp;
+ d++;
+ s++;
+ size -= sizeof (tmp);
+ src += sizeof (tmp);
+ dst += sizeof (tmp);
+ if ((src & 0x3fff) == 0)
+ D10VTranslate (src, &dmap_src, &s);
+ if ((dst & 0x3fff) == 0)
+ D10VTranslate (dst, &dmap_dst, &d);
+ }
+ DMAP = dmap_save;
+#else
+ memcpy ((void *) dst, (void *) src, size);
+#endif /* D10V */
+ return;
+}
+
diff --git a/gdb/testsuite/gdb.base/ovlymgr.h b/gdb/testsuite/gdb.base/ovlymgr.h
new file mode 100644
index 00000000000..bd0d40a2640
--- /dev/null
+++ b/gdb/testsuite/gdb.base/ovlymgr.h
@@ -0,0 +1,17 @@
+/*
+ * Sample runtime overlay manager.
+ */
+
+#ifdef NO_PROTOTYPES
+#define PARAMS(paramlist) ()
+#else
+#define PARAMS(paramlist) paramlist
+#endif
+
+typedef enum { FALSE, TRUE } bool;
+
+/* Entry Points: */
+
+bool OverlayLoad PARAMS((unsigned long ovlyno));
+bool OverlayUnload PARAMS((unsigned long ovlyno));
+
diff --git a/gdb/testsuite/gdb.base/page.exp b/gdb/testsuite/gdb.base/page.exp
new file mode 100644
index 00000000000..9791a607599
--- /dev/null
+++ b/gdb/testsuite/gdb.base/page.exp
@@ -0,0 +1,40 @@
+# Copyright 1992, 1994, 1995, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+global message
+global timeout
+
+set timeout 200
+
+gdb_exit
+gdb_start
+gdb_test "set pagination off" ""
+gdb_test "info set" ".*pagination: State of pagination is off.*"
+gdb_test "set pagination on" ""
+gdb_test "info set" ".*pagination: State of pagination is on.*"
+
+gdb_exit
+return 0
+
diff --git a/gdb/testsuite/gdb.base/pointers.c b/gdb/testsuite/gdb.base/pointers.c
new file mode 100644
index 00000000000..85bfdc98917
--- /dev/null
+++ b/gdb/testsuite/gdb.base/pointers.c
@@ -0,0 +1,216 @@
+
+#if !defined (__STDC__) && !defined (_AIX)
+#define signed /**/
+#endif
+
+char v_char;
+signed char v_signed_char;
+unsigned char v_unsigned_char;
+
+short v_short;
+signed short v_signed_short;
+unsigned short v_unsigned_short;
+
+int v_int;
+signed int v_signed_int;
+unsigned int v_unsigned_int;
+
+long v_long;
+signed long v_signed_long;
+unsigned long v_unsigned_long;
+
+float v_float;
+double v_double;
+
+
+
+char *v_char_pointer;
+signed char *v_signed_char_pointer;
+unsigned char *v_unsigned_char_pointer;
+
+short *v_short_pointer;
+signed short *v_signed_short_pointer;
+unsigned short *v_unsigned_short_pointer;
+
+int *v_int_pointer;
+int *v_int_pointer2;
+signed int *v_signed_int_pointer;
+unsigned int *v_unsigned_int_pointer;
+
+long *v_long_pointer;
+signed long *v_signed_long_pointer;
+unsigned long *v_unsigned_long_pointer;
+
+float *v_float_pointer;
+double *v_double_pointer;
+
+
+char v_char_array[2];
+signed char v_signed_char_array[2];
+unsigned char v_unsigned_char_array[2];
+
+short v_short_array[2];
+signed short v_signed_short_array[2];
+unsigned short v_unsigned_short_array[2];
+
+int v_int_array[2];
+signed int v_signed_int_array[2];
+unsigned int v_unsigned_int_array[2];
+
+long v_long_array[2];
+signed long v_signed_long_array[2];
+unsigned long v_unsigned_long_array[2];
+
+float v_float_array[2];
+double v_double_array[2];
+
+int matrix[2][3] = { { 0, 1, 2}, {3, 4, 5}};
+int (*rptr)[3] = matrix;
+
+float ** ptr_to_ptr_to_float;
+
+int y;
+
+/* Do nothing function used for forcing some of the above variables to
+ be referenced by the program source. If the variables are not
+ referenced, some linkers will remove the symbol from the symbol
+ table making it impossible to refer to the variable in gdb. */
+void usevar (void *var) {}
+
+int main ()
+{
+ void dummy();
+ int more_code();
+
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ dummy();
+
+ more_code ();
+
+ usevar (&v_int_pointer2);
+ usevar (&rptr);
+ usevar (&y);
+
+ return 0;
+
+}
+
+void dummy()
+{
+
+
+ v_char = 0;
+ v_signed_char = 1;
+ v_unsigned_char = 2;
+
+ v_short = 3;
+ v_signed_short = 4;
+ v_unsigned_short = 5;
+
+ v_int = 6;
+ v_signed_int = 7;
+ v_unsigned_int = 8;
+
+ v_long = 9;
+ v_signed_long = 10;
+ v_unsigned_long = 11;
+
+ v_float = 100.0;
+ v_double = 200.0;
+
+
+
+ v_char_pointer = &v_char;
+ v_signed_char_pointer = &v_signed_char;
+ v_unsigned_char_pointer = &v_unsigned_char;
+
+ v_short_pointer = &v_short;
+ v_signed_short_pointer = &v_signed_short;
+ v_unsigned_short_pointer = &v_unsigned_short;
+
+ v_int_pointer = &v_int;
+ v_signed_int_pointer = &v_signed_int;
+ v_unsigned_int_pointer = &v_unsigned_int;
+
+ v_long_pointer = &v_long;
+ v_signed_long_pointer = &v_signed_long;
+ v_unsigned_long_pointer = &v_unsigned_long;
+
+ v_float_pointer = &v_float;
+ v_double_pointer = &v_double;
+
+ ptr_to_ptr_to_float = &v_float_pointer;
+
+
+ v_char_array[0] = v_char;
+ v_signed_char_array[0] = v_signed_char;
+ v_unsigned_char_array[0] = v_unsigned_char;
+
+ v_short_array[0] = v_short;
+ v_signed_short_array[0] = v_signed_short;
+ v_unsigned_short_array[0] = v_unsigned_short;
+
+ v_int_array[0] = v_int;
+ v_int_array[1] = v_int * 3;
+
+ v_signed_int_array[0] = v_signed_int;
+ v_unsigned_int_array[0] = v_unsigned_int;
+
+ v_long_array[0] = v_long;
+ v_signed_long_array[0] = v_signed_long;
+ v_unsigned_long_array[0] = v_unsigned_long;
+
+ v_float_array[0] = v_float;
+ v_double_array[0] = v_double;
+
+}
+
+void marker1 ()
+{
+}
+
+int more_code()
+{
+ char C, *pC, **ppC, ***pppC, ****ppppC, *****pppppC, ******ppppppC;
+ unsigned char UC, *pUC;
+ short S, *pS;
+ unsigned short US, *pUS;
+ int I, *pI;
+ unsigned int UI, *pUI;
+ long L, *pL;
+ unsigned long UL, *pUL;
+ float F, *pF;
+ double D, *pD;
+
+ C = 'A';
+ UC = 21;
+ S = -14;
+ US = 7;
+ I = 102;
+ UI = 1002;
+ L = -234;
+ UL = 234;
+ F = 1.25E10;
+ D = -1.25E-37;
+ pC = &C;
+ ppC = &pC;
+ pppC = &ppC;
+ ppppC = &pppC;
+ pppppC = &ppppC;
+ ppppppC = &pppppC;
+ pUC = &UC;
+ pS = &S;
+ pUS = &US;
+ pI = &I;
+ pUI = &UI;
+ pL = &L;
+ pUL = &UL;
+ pF = &F;
+ pD = &D;
+
+ marker1();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp
new file mode 100644
index 00000000000..5f406ad1533
--- /dev/null
+++ b/gdb/testsuite/gdb.base/pointers.exp
@@ -0,0 +1,596 @@
+# Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This file is part of the gdb testsuite
+#
+# tests for pointer arithmetic and pointer dereferencing
+# with integer type variables and pointers to integers
+#
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "pointers"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+gdb_test "next " "more_code.*;" "continuing after dummy()"
+
+
+#
+# let's see if gdb catches some illegal operations on pointers
+#
+# I must comment these out because strict type checking is not
+# supported in this version of GDB. I do not really know
+# what the expected gdb reply is.
+#
+
+#send_gdb "print v_int_pointer2 = &v_int_pointer\n"
+#gdb_expect {
+# -re ".*.*$gdb_prompt $" {
+# pass "illegal pointer assignment rejected"
+# }
+# -re ".*$gdb_prompt $" { fail "illegal pointer assignment rejected" }
+# timeout { fail "(timeout) illegal pointer assignment rejected" }
+# }
+
+
+#send_gdb "print v_unsigned_int_pointer = &v_int\n"
+#gdb_expect {
+# -re ".*.*$gdb_prompt $" {
+# pass "illegal pointer assignment rejected"
+# }
+# -re ".*$gdb_prompt $" { fail "illegal pointer assignment rejected" }
+# timeout { fail "(timeout) ilegal pointer assignment rejected" }
+# }
+
+#send_gdb "print v_unsigned_int_pointer == v_double_pointer\n"
+#gdb_expect {
+# -re ".*.*$gdb_prompt $" {
+# pass "illegal pointer operation (+) rejected"
+# }
+# -re ".*$gdb_prompt $" { fail "illegal pointer operation (+) rejected" }
+# timeout { fail "(timeout) illegal pointer operation (+) rejected" }
+# }
+
+
+#send_gdb "print v_unsigned_int_pointer * v_double_pointer\n"
+#gdb_expect {
+# -re ".*Argument to arithmetic operation not a number or boolean.*$gdb_prompt $" {
+# pass "illegal pointer operation (*) rejected"
+# }
+# -re ".*$gdb_prompt $" { fail "illegal pointer operation (*) rejected" }
+# timeout { fail "(timeout) illegal pointer operation (*) rejected" }
+# }
+
+
+#send_gdb "print v_unsigned_int_pointer = v_double_pointer\n"
+#gdb_expect {
+# -re ".*.*$gdb_prompt $" {
+# pass "ilegal pointer assignment rejected"
+# }
+# -re ".*$gdb_prompt $" { fail "illegal pointer assignment rejected" }
+# timeout { fail "(timeout) illegal pointer assignment rejected" }
+# }
+
+
+#send_gdb "print v_unsigned_int_pointer = v_unsigned_int\n"
+#gdb_expect {
+# -re ".*.*$gdb_prompt $" {
+# pass "illegal pointer assignment rejected"
+# }
+# -re ".*$gdb_prompt $" { fail "illegal pointer assignment rejected" }
+# timeout { fail "(timeout) illegal pointer assignment rejected" }
+# }
+
+gdb_test "set variable v_int_pointer=&v_int_array\[0\]" "" "set pointer to beginning of array"
+gdb_test "set variable v_int_pointer2=&v_int_array\[1\]" "" "set pointer to end of array"
+
+
+send_gdb "print *v_int_pointer\n"
+gdb_expect {
+ -re ".*= 6.*$gdb_prompt $" {
+ pass "print object pointed to"
+ }
+ -re ".*$gdb_prompt $" { fail "print object pointed to" }
+ timeout { fail "(timeout) print object pointed to" }
+ }
+
+send_gdb "print *v_int_pointer2\n"
+gdb_expect {
+ -re ".*= 18.*$gdb_prompt $" {
+ pass "print object pointed to"
+ }
+ -re ".*$gdb_prompt $" { fail "print object pointed to" }
+ timeout { fail "(timeout) print object pointed to" }
+ }
+
+
+send_gdb "print v_int_pointer == v_int_pointer2\n"
+gdb_expect {
+ -re ".*= $false.*$gdb_prompt $" {
+ pass "pointer1==pointer2"
+ }
+ -re ".*$gdb_prompt $" { fail "pointer1==pointer2" }
+ timeout { fail "(timeout) pointer1==pointer2" }
+ }
+
+send_gdb "print v_int_pointer != v_int_pointer2\n"
+gdb_expect {
+ -re ".*= $true.*$gdb_prompt $" {
+ pass "pointer1!=pointer2"
+ }
+ -re ".*$gdb_prompt $" { fail "pointer1!=pointer2" }
+ timeout { fail "(timeout) pointer1!=pointer2" }
+ }
+
+
+send_gdb "print v_int_pointer <= v_int_pointer2\n"
+gdb_expect {
+ -re ".*= $true.*$gdb_prompt $" {
+ pass "pointer1<=pointer2"
+ }
+ -re ".*$gdb_prompt $" { fail "pointer1<=pointer2" }
+ timeout { fail "(timeout) pointer1<=pointer2" }
+ }
+
+
+send_gdb "print v_int_pointer >= v_int_pointer2\n"
+gdb_expect {
+ -re ".*= $false.*$gdb_prompt $" {
+ pass "pointer1>=pointer2"
+ }
+ -re ".*$gdb_prompt $" { fail "pointer1>=pointer2" }
+ timeout { fail "(timeout) pointer1>=pointer2" }
+ }
+
+
+send_gdb "print v_int_pointer < v_int_pointer2\n"
+gdb_expect {
+ -re ".*= $true.*$gdb_prompt $" {
+ pass "pointer1<pointer2"
+ }
+ -re ".*$gdb_prompt $" { fail "pointer1<pointer2" }
+ timeout { fail "(timeout) pointer1<pointer2" }
+ }
+
+send_gdb "print v_int_pointer > v_int_pointer2\n"
+gdb_expect {
+ -re ".*= $false.*$gdb_prompt $" {
+ pass "pointer1>pointer2"
+ }
+ -re ".*$gdb_prompt $" { fail "pointer1>pointer2" }
+ timeout { fail "(timeout) pointer1>pointer2" }
+ }
+
+
+gdb_test "set variable y = *v_int_pointer++" "" "set y = *v_int_pointer++"
+send_gdb "print y\n"
+gdb_expect {
+ -re ".*= 6.*$gdb_prompt $" {
+ send_gdb "print *v_int_pointer\n"
+ gdb_expect {
+ -re ".*= 18.*$gdb_prompt $" {
+ pass "pointer assignment and increment"
+ }
+ -re ".*$gdb_prompt $" { fail "pointer assignment and increment" }
+ timeout { fail "(timeout) pointer assignment and increment" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "pointer assignment and increment" }
+ timeout { fail "(timeout) pointer assignment and increment" }
+ }
+
+
+
+
+gdb_test "set variable y = *--v_int_pointer2" "" "set y = *--v_int_pointer2"
+send_gdb "print y\n"
+gdb_expect {
+ -re ".*= 6.*$gdb_prompt $" {
+ send_gdb "print *v_int_pointer2\n"
+ gdb_expect {
+ -re ".*= 6.*$gdb_prompt $" {
+ pass "pointer decrement and assignment"
+ }
+ -re ".*$gdb_prompt $" { fail "pointer decrement and assignment" }
+ timeout { fail "(timeout) pointer decrement and assignment" }
+ }
+ }
+ -re ".*$gdb_prompt $" { fail "pointer decrement and assignment" }
+ timeout { fail "(timeout) pointer decrement and assignment" }
+ }
+
+gdb_test "set variable y =v_int_pointer-v_int_pointer2" "" "set y =v_int_pointer-v_int_pointer2"
+send_gdb "print y\n"
+gdb_expect {
+ -re ".*= 1.*$gdb_prompt $" {
+ pass "pointer1-pointer2"
+ }
+ -re ".*$gdb_prompt $" { fail "pointer1-pointer2" }
+ timeout { fail "(timeout) pointer1-pointer2" }
+ }
+
+gdb_test "set variable v_int_pointer=v_int_array" "" "set v_int_pointer=v_int_array"
+send_gdb "print *v_int_pointer\n"
+gdb_expect {
+ -re ".*= 6.*$gdb_prompt $" {
+ pass "print array element through pointer"
+ }
+ -re ".*$gdb_prompt $" { fail "print array element through pointer" }
+ timeout { fail "(timeout) print array element through pointer" }
+ }
+
+
+send_gdb "print *(v_int_pointer+1)\n"
+gdb_expect {
+ -re ".*= 18.*$gdb_prompt $" {
+ pass "print array element through pointer"
+ }
+ -re ".*$gdb_prompt $" { fail "print array element through pointer" }
+ timeout { fail "(timeout) print array element through pointer" }
+ }
+
+# test print elements of array through pointers
+
+send_gdb "print (*rptr)\[0\]\n"
+gdb_expect {
+ -re ".*= 0.*$gdb_prompt $" {
+ pass "print array element through pointer"
+ }
+ -re ".*$gdb_prompt $" { fail "print array element through pointer" }
+ timeout { fail "(timeout) print array element through pointer" }
+ }
+
+send_gdb "print (*rptr)\[1\]\n"
+gdb_expect {
+ -re ".*= 1.*$gdb_prompt $" {
+ pass "print array element through pointer"
+ }
+ -re ".*$gdb_prompt $" { fail "print array element through pointer" }
+ timeout { fail "(timeout) print array element through pointer" }
+ }
+
+
+send_gdb "print (*rptr)\[2\]\n"
+gdb_expect {
+ -re ".*= 2.*$gdb_prompt $" {
+ pass "print array element through pointer"
+ }
+ -re ".*$gdb_prompt $" { fail "print array element through pointer" }
+ timeout { fail "(timeout) print array element through pointer" }
+ }
+
+gdb_test "set variable rptr = rptr+1" "" "increment rptr"
+
+send_gdb "print (*rptr)\[0\]\n"
+gdb_expect {
+ -re ".*= 3.*$gdb_prompt $" {
+ pass "print array element through pointer"
+ }
+ -re ".*$gdb_prompt $" { fail "print array element through pointer" }
+ timeout { fail "(timeout) print array element through pointer" }
+ }
+
+
+send_gdb "print (*rptr)\[1\]\n"
+gdb_expect {
+ -re ".*= 4.*$gdb_prompt $" {
+ pass "print array element through pointer"
+ }
+ -re ".*$gdb_prompt $" { fail "print array element through pointer" }
+ timeout { fail "(timeout) print array element through pointer" }
+ }
+
+
+send_gdb "print (*rptr)\[2\]\n"
+gdb_expect {
+ -re ".*= 5.*$gdb_prompt $" {
+ pass "print array element through pointer"
+ }
+ -re ".*$gdb_prompt $" { fail "print array element through pointer" }
+ timeout { fail "(timeout) print array element through pointer" }
+ }
+
+
+send_gdb "print *( *(matrix+1) +2)\n"
+gdb_expect {
+ -re ".*= 5.*$gdb_prompt $" {
+ pass "print array element w/ pointer arithmetic"
+ }
+ -re ".*$gdb_prompt $" { fail "print array element w/ pointer arithemtic" }
+ timeout { fail "(timeout) print array element w/ pointer arithmetic" }
+ }
+
+
+send_gdb "print **ptr_to_ptr_to_float\n"
+gdb_expect {
+ -re ".*= 100.*$gdb_prompt $" {
+ pass "print through ptr to ptr"
+ }
+ -re ".*$gdb_prompt $" { fail "print through ptr to ptr" }
+ timeout { fail "(timeout) print through ptr to ptr" }
+ }
+
+# tests for pointers
+# with elementary type variables and pointers.
+#
+
+send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
+
+ send_gdb "cont\n"
+ gdb_expect {
+ -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
+ send_gdb "up\n"
+ gdb_expect {
+ -re ".*more_code.*$gdb_prompt $" {
+ pass "up from marker1"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "up from marker1"
+ }
+ timeout { fail "up from marker1 (timeout)" }
+ }
+ }
+ -re "$gdb_prompt $" { fail "continue to marker1" }
+ timeout { fail "(timeout) continue to marker1" }
+ }
+
+
+send_gdb "print *pUC\n"
+gdb_expect {
+ -re ".\[0-9\]* = 21 \'.025\'.*$gdb_prompt $" {
+ pass "print value of *pUC"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of *pUC" }
+ timeout { fail "(timeout) print value of *pUC" }
+ }
+
+
+send_gdb "ptype pUC\n"
+gdb_expect {
+ -re "type = unsigned char \\*.*$gdb_prompt $" { pass "ptype pUC" }
+ -re ".*$gdb_prompt $" { fail "ptype pUC" }
+ timeout { fail "(timeout) ptype pUC" }
+}
+
+send_gdb "print *pS\n"
+gdb_expect {
+ -re ".\[0-9\]* = -14.*$gdb_prompt $" {
+ pass "print value of *pS"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of *pS" }
+ timeout { fail "(timeout) print value of *pS" }
+ }
+
+
+send_gdb "ptype pS\n"
+gdb_expect {
+ -re "type = short \\*.*$gdb_prompt $" { pass "ptype pS" }
+ -re "type = short int \\*.*$gdb_prompt $" { pass "ptype pS" }
+ -re ".*$gdb_prompt $" { fail "ptype pS" }
+ timeout { fail "(timeout) ptype pS" }
+}
+
+send_gdb "print *pUS\n"
+gdb_expect {
+ -re ".\[0-9\]* = 7.*$gdb_prompt $" {
+ pass "print value of *pUS"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of *pUS" }
+ timeout { fail "(timeout) print value of *pUS" }
+ }
+
+
+send_gdb "ptype pUS\n"
+gdb_expect {
+ -re "type = unsigned short \\*.*$gdb_prompt $" { pass "ptype pUS" }
+ -re "type = short unsigned int \\*.*$gdb_prompt $" { pass "ptype pUS" }
+ -re ".*$gdb_prompt $" { fail "ptype pUS" }
+ timeout { fail "(timeout) ptype pUS" }
+}
+
+send_gdb "print *pI\n"
+gdb_expect {
+ -re ".\[0-9\]* = 102.*$gdb_prompt $" {
+ pass "print value of *pI"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of *pI" }
+ timeout { fail "(timeout) print value of *pI" }
+ }
+
+
+send_gdb "ptype pI\n"
+gdb_expect {
+ -re "type = int \\*.*$gdb_prompt $" { pass "ptype pI" }
+ -re ".*$gdb_prompt $" { fail "ptype pI" }
+ timeout { fail "(timeout) ptype pI" }
+}
+
+send_gdb "print *pUI\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1002.*$gdb_prompt $" {
+ pass "print value of *pUI"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of *pUI" }
+ timeout { fail "(timeout) print value of *pUI" }
+ }
+
+
+send_gdb "ptype pUI\n"
+gdb_expect {
+ -re "type = unsigned int \\*.*$gdb_prompt $" { pass "ptype pUI" }
+ -re ".*$gdb_prompt $" { fail "ptype pUI" }
+ timeout { fail "(timeout) ptype pUI" }
+}
+
+send_gdb "print *pL\n"
+gdb_expect {
+ -re ".\[0-9\]* = -234.*$gdb_prompt $" {
+ pass "print value of *pL"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of *pL" }
+ timeout { fail "(timeout) print value of *pL" }
+ }
+
+
+send_gdb "ptype pL\n"
+gdb_expect {
+ -re "type = long \\*.*$gdb_prompt $" { pass "ptype pL" }
+ -re "type = long int \\*.*$gdb_prompt $" { pass "ptype pL" }
+ -re ".*$gdb_prompt $" { fail "ptype pL" }
+ timeout { fail "(timeout) ptype pL" }
+}
+
+send_gdb "print *pUL\n"
+gdb_expect {
+ -re ".\[0-9\]* = 234.*$gdb_prompt $" {
+ pass "print value of *pUL"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of *pUL" }
+ timeout { fail "(timeout) print value of *pUL" }
+ }
+
+
+send_gdb "ptype pUL\n"
+gdb_expect {
+ -re "type = unsigned long \\*.*$gdb_prompt $" { pass "ptype pUL" }
+ -re "type = long unsigned int \\*.*$gdb_prompt $" { pass "ptype pUL" }
+ -re ".*$gdb_prompt $" { fail "ptype pUL" }
+ timeout { fail "(timeout) ptype pUL" }
+}
+
+send_gdb "print *pF\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.2\[0-9\]*e\\+10.*$gdb_prompt $" {
+ pass "print value of *pF"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of *pF" }
+ timeout { fail "(timeout) print value of *pF" }
+ }
+
+
+send_gdb "ptype pF\n"
+gdb_expect {
+ -re "type = float \\*.*$gdb_prompt $" { pass "ptype pF" }
+ -re ".*$gdb_prompt $" { fail "ptype pF" }
+ timeout { fail "(timeout) ptype pF" }
+}
+
+send_gdb "print *pD\n"
+gdb_expect {
+ -re ".\[0-9\]* = -1.2\[0-9\]*e\\-37.*$gdb_prompt $" {
+ pass "print value of *pD"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of *pD" }
+ timeout { fail "(timeout) print value of *pD" }
+ }
+
+
+send_gdb "ptype pD\n"
+gdb_expect {
+ -re "type = double \\*.*$gdb_prompt $" { pass "ptype pD" }
+ -re ".*$gdb_prompt $" { fail "ptype pD" }
+ timeout { fail "(timeout) ptype pD" }
+}
+
+send_gdb "print ******ppppppC\n"
+gdb_expect {
+ -re ".\[0-9\]* = 65 \'A\'.*$gdb_prompt $" {
+ pass "print value of ******ppppppC"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of ******ppppppC" }
+ timeout { fail "(timeout) print value of ******ppppppC" }
+ }
+
+
+send_gdb "ptype pC\n"
+gdb_expect {
+ -re "type = char \\*.*$gdb_prompt $" { pass "ptype pC" }
+ -re ".*$gdb_prompt $" { fail "ptype pC" }
+ timeout { fail "(timeout) ptype pC" }
+}
+
+send_gdb "ptype ppC\n"
+gdb_expect {
+ -re "type = char \\*\\*.*$gdb_prompt $" { pass "ptype ppC" }
+ -re ".*$gdb_prompt $" { fail "ptype ppC" }
+ timeout { fail "(timeout) ptype ppC" }
+}
+
+send_gdb "ptype pppC\n"
+gdb_expect {
+ -re "type = char \\*\\*\\*.*$gdb_prompt $" { pass "ptype pppC" }
+ -re ".*$gdb_prompt $" { fail "ptype pppC" }
+ timeout { fail "(timeout) ptype pppC" }
+}
+
+send_gdb "ptype ppppC\n"
+gdb_expect {
+ -re "type = char \\*\\*\\*\\*.*$gdb_prompt $" { pass "ptype ppppC" }
+ -re ".*$gdb_prompt $" { fail "ptype ppppC" }
+ timeout { fail "(timeout) ptype ppppC" }
+}
+
+send_gdb "ptype pppppC\n"
+gdb_expect {
+ -re "type = char \\*\\*\\*\\*\\*.*$gdb_prompt $" { pass "ptype pppppC" }
+ -re ".*$gdb_prompt $" { fail "ptype pppppC" }
+ timeout { fail "(timeout) ptype pppppC" }
+}
+
+send_gdb "ptype ppppppC\n"
+gdb_expect {
+ -re "type = char \\*\\*\\*\\*\\*\\*.*$gdb_prompt $" { pass "ptype ppppppC" }
+ -re ".*$gdb_prompt $" { fail "ptype ppppppC" }
+ timeout { fail "(timeout) ptype ppppppC" }
+}
+
diff --git a/gdb/testsuite/gdb.base/printcmds.c b/gdb/testsuite/gdb.base/printcmds.c
new file mode 100644
index 00000000000..8eddeeeccf8
--- /dev/null
+++ b/gdb/testsuite/gdb.base/printcmds.c
@@ -0,0 +1,107 @@
+/* This table is used as a source for every ascii character.
+ It is explicitly unsigned to avoid differences due to native characters
+ being either signed or unsigned. */
+#include <stdlib.h>
+unsigned char ctable1[256] = {
+ 0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007,
+ 0010, 0011, 0012, 0013, 0014, 0015, 0016, 0017,
+ 0020, 0021, 0022, 0023, 0024, 0025, 0026, 0027,
+ 0030, 0031, 0032, 0033, 0034, 0035, 0036, 0037,
+ 0040, 0041, 0042, 0043, 0044, 0045, 0046, 0047,
+ 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057,
+ 0060, 0061, 0062, 0063, 0064, 0065, 0066, 0067,
+ 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077,
+ 0100, 0101, 0102, 0103, 0104, 0105, 0106, 0107,
+ 0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117,
+ 0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127,
+ 0130, 0131, 0132, 0133, 0134, 0135, 0136, 0137,
+ 0140, 0141, 0142, 0143, 0144, 0145, 0146, 0147,
+ 0150, 0151, 0152, 0153, 0154, 0155, 0156, 0157,
+ 0160, 0161, 0162, 0163, 0164, 0165, 0166, 0167,
+ 0170, 0171, 0172, 0173, 0174, 0175, 0176, 0177,
+ 0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207,
+ 0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217,
+ 0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227,
+ 0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237,
+ 0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247,
+ 0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257,
+ 0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267,
+ 0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277,
+ 0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
+ 0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
+ 0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327,
+ 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337,
+ 0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347,
+ 0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357,
+ 0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367,
+ 0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377
+};
+
+unsigned char ctable2[] = {
+ 'a','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X',
+ 'a','a','X','X','X','X','X','X','X','X','X','X','X','X','X','X',
+ 'a','a','a','X','X','X','X','X','X','X','X','X','X','X','X','X',
+ 'a','a','a','a','X','X','X','X','X','X','X','X','X','X','X','X',
+ 'a','a','a','a','a','X','X','X','X','X','X','X','X','X','X','X',
+ 'a','a','a','a','a','a','X','X','X','X','X','X','X','X','X','X',
+ 'a','a','a','a','a','a','a','X','X','X','X','X','X','X','X','X',
+ 'a','a','a','a','a','a','a','a','X','X','X','X','X','X','X','X',
+ 'a','a','a','a','a','a','a','a','a','X','X','X','X','X','X','X',
+ 'a','a','a','a','a','a','a','a','a','a','X','X','X','X','X','X',
+ 'a','a','a','a','a','a','a','a','a','a','a','X','X','X','X','X',
+ 'a','a','a','a','a','a','a','a','a','a','a','a','X','X','X','X',
+ 'a','a','a','a','a','a','a','a','a','a','a','a','a','X','X','X',
+ 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','X','X',
+ 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','X',
+ 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a', 0
+};
+
+/* Single and multidimensional arrays to test access and printing of array
+ members. */
+
+typedef int ArrayInt [10];
+ArrayInt a1 = {2,4,6,8,10,12,14,16,18,20};
+
+typedef char ArrayChar [5];
+ArrayChar a2 = {'a','b','c','d','\0'};
+
+int int1dim[12] = {0,1,2,3,4,5,6,7,8,9,10,11};
+int int2dim[3][4] = {{0,1,2,3},{4,5,6,7},{8,9,10,11}};
+int int3dim[2][3][2] = {{{0,1},{2,3},{4,5}},{{6,7},{8,9},{10,11}}};
+int int4dim[1][2][3][2] = {{{{0,1},{2,3},{4,5}},{{6,7},{8,9},{10,11}}}};
+
+char *teststring = (char*)"teststring contents";
+
+/* Test printing of a struct containing character arrays. */
+
+struct some_arrays {
+ unsigned char array1[4];
+ unsigned char array2[1];
+ unsigned char array3[1];
+ unsigned char array4[2];
+ unsigned char array5[4];
+} arrays = {
+ {'a', 'b', 'c', '\0'},
+ {'d'},
+ {'e'},
+ {'f', 'g' },
+ {'h', 'i', 'j', '\0'}
+};
+
+struct some_arrays *parrays = &arrays;
+
+/* -- */
+
+int main ()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ malloc(1);
+
+ /* Prevent AIX linker from removing variables. */
+ return ctable1[0] + ctable2[0] + int1dim[0] + int2dim[0][0]
+ + int3dim[0][0][0] + int4dim[0][0][0][0] + teststring[0] +
+ *parrays -> array1 + a1[0] + a2[0];
+}
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
new file mode 100644
index 00000000000..7062fc55dc7
--- /dev/null
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -0,0 +1,715 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002 Free
+# Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "printcmds"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Set the current language to C. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_c {} {
+ global gdb_prompt
+
+ if [gdb_test "set language c" "" "set language c"] {
+ return 0
+ }
+
+ if [gdb_test "show language" ".* source language is \"c\".*"] {
+ return 0
+ }
+ return 1;
+}
+
+proc test_integer_literals_accepted {} {
+ global gdb_prompt
+
+ # Test various decimal values.
+
+ gdb_test "p 123" " = 123"
+ gdb_test "p -123" " = -123"
+ gdb_test "p/d 123" " = 123"
+
+ # Test various octal values.
+
+ gdb_test "p 0123" " = 83"
+ gdb_test "p 00123" " = 83"
+ gdb_test "p -0123" " = -83"
+ gdb_test "p/o 0123" " = 0123"
+
+ # Test various hexadecimal values.
+
+ gdb_test "p 0x123" " = 291"
+ gdb_test "p -0x123" " = -291"
+ gdb_test "p 0x0123" " = 291"
+ gdb_test "p -0x0123" " = -291"
+ gdb_test "p 0xABCDEF" " = 11259375"
+ gdb_test "p 0xabcdef" " = 11259375"
+ gdb_test "p 0xAbCdEf" " = 11259375"
+ gdb_test "p/x 0x123" " = 0x123"
+}
+
+proc test_character_literals_accepted {} {
+ global gdb_prompt
+
+ gdb_test "p 'a'" " = 97 'a'"
+ gdb_test "p/c 'a'" " = 97 'a'"
+ gdb_test "p/x 'a'" " = 0x61"
+ gdb_test "p/d 'a'" " = 97"
+ gdb_test "p/t 'a'" " = 1100001"
+ gdb_test "p '\\141'" " = 97 'a'"
+ gdb_test "p/x '\\377'" " = 0xff"
+ # Note "p '\''" => "= 39 '\''"
+ gdb_test "p '\\''" " = 39 '\\\\''"
+ # Note "p '\\'" => "= 92 '\\'"
+ gdb_test "p '\\\\'" " = 92 '\\\\\\\\'"
+}
+
+proc test_integer_literals_rejected {} {
+ global gdb_prompt
+
+ test_print_reject "p 0x"
+ gdb_test "p ''" "(Empty character constant\\.|A character constant must contain at least one character\\.)"
+ gdb_test "p '''" "(Empty character constant\\.|A character constant must contain at least one character\\.)"
+ test_print_reject "p '\\'"
+
+ # Note that this turns into "p '\\\'" at gdb's input.
+ test_print_reject "p '\\\\\\'"
+
+ # Test various decimal values.
+
+ test_print_reject "p DEADBEEF"
+
+ # Gdb currently fails this test for all configurations. The C
+ # lexer thinks that 123DEADBEEF is a floating point number, but
+ # then fails to notice that atof() only eats the 123 part.
+ # FIXME: This should be put into PRMS.
+ # Fixed, 4/25/97, by Bob Manson.
+
+ test_print_reject "p 123DEADBEEF"
+ test_print_reject "p 123foobar.bazfoo3"
+ test_print_reject "p 123EEEEEEEEEEEEEEEEE33333k333"
+ gdb_test "p 123.4+56.7" "180.(099\[0-9]*|100\[0-9\]*)" "check for floating addition"
+
+ # Test various octal values.
+
+ test_print_reject "p 09"
+ test_print_reject "p 079"
+
+ # Test various hexadecimal values.
+
+ test_print_reject "p 0xG"
+ test_print_reject "p 0xAG"
+}
+
+proc test_print_all_chars {} {
+ global gdb_prompt
+
+ gdb_test "p ctable1\[0\]" " = 0 '\\\\0'"
+ gdb_test "p ctable1\[1\]" " = 1 '\\\\001'"
+ gdb_test "p ctable1\[2\]" " = 2 '\\\\002'"
+ gdb_test "p ctable1\[3\]" " = 3 '\\\\003'"
+ gdb_test "p ctable1\[4\]" " = 4 '\\\\004'"
+ gdb_test "p ctable1\[5\]" " = 5 '\\\\005'"
+ gdb_test "p ctable1\[6\]" " = 6 '\\\\006'"
+ gdb_test "p ctable1\[7\]" " = 7 '\\\\a'"
+ gdb_test "p ctable1\[8\]" " = 8 '\\\\b'"
+ gdb_test "p ctable1\[9\]" " = 9 '\\\\t'"
+ gdb_test "p ctable1\[10\]" " = 10 '\\\\n'"
+ gdb_test "p ctable1\[11\]" " = 11 '\\\\v'"
+ gdb_test "p ctable1\[12\]" " = 12 '\\\\f'"
+ gdb_test "p ctable1\[13\]" " = 13 '\\\\r'"
+ gdb_test "p ctable1\[14\]" " = 14 '\\\\016'"
+ gdb_test "p ctable1\[15\]" " = 15 '\\\\017'"
+ gdb_test "p ctable1\[16\]" " = 16 '\\\\020'"
+ gdb_test "p ctable1\[17\]" " = 17 '\\\\021'"
+ gdb_test "p ctable1\[18\]" " = 18 '\\\\022'"
+ gdb_test "p ctable1\[19\]" " = 19 '\\\\023'"
+ gdb_test "p ctable1\[20\]" " = 20 '\\\\024'"
+ gdb_test "p ctable1\[21\]" " = 21 '\\\\025'"
+ gdb_test "p ctable1\[22\]" " = 22 '\\\\026'"
+ gdb_test "p ctable1\[23\]" " = 23 '\\\\027'"
+ gdb_test "p ctable1\[24\]" " = 24 '\\\\030'"
+ gdb_test "p ctable1\[25\]" " = 25 '\\\\031'"
+ gdb_test "p ctable1\[26\]" " = 26 '\\\\032'"
+ gdb_test "p ctable1\[27\]" " = 27 '\\\\e'"
+ gdb_test "p ctable1\[28\]" " = 28 '\\\\034'"
+ gdb_test "p ctable1\[29\]" " = 29 '\\\\035'"
+ gdb_test "p ctable1\[30\]" " = 30 '\\\\036'"
+ gdb_test "p ctable1\[31\]" " = 31 '\\\\037'"
+ gdb_test "p ctable1\[32\]" " = 32 ' '"
+ gdb_test "p ctable1\[33\]" " = 33 '!'"
+ gdb_test "p ctable1\[34\]" " = 34 '\"'"
+ gdb_test "p ctable1\[35\]" " = 35 '#'"
+ gdb_test "p ctable1\[36\]" " = 36 '\\\$'"
+ gdb_test "p ctable1\[37\]" " = 37 '%'"
+ gdb_test "p ctable1\[38\]" " = 38 '&'"
+ gdb_test "p ctable1\[39\]" " = 39 '\\\\''"
+ gdb_test "p ctable1\[40\]" " = 40 '\\('"
+ gdb_test "p ctable1\[41\]" " = 41 '\\)'"
+ gdb_test "p ctable1\[42\]" " = 42 '\\*'"
+ gdb_test "p ctable1\[43\]" " = 43 '\\+'"
+ gdb_test "p ctable1\[44\]" " = 44 ','"
+ gdb_test "p ctable1\[45\]" " = 45 '-'"
+ gdb_test "p ctable1\[46\]" " = 46 '.'"
+ gdb_test "p ctable1\[47\]" " = 47 '/'"
+ gdb_test "p ctable1\[48\]" " = 48 '0'"
+ gdb_test "p ctable1\[49\]" " = 49 '1'"
+ gdb_test "p ctable1\[50\]" " = 50 '2'"
+ gdb_test "p ctable1\[51\]" " = 51 '3'"
+ gdb_test "p ctable1\[52\]" " = 52 '4'"
+ gdb_test "p ctable1\[53\]" " = 53 '5'"
+ gdb_test "p ctable1\[54\]" " = 54 '6'"
+ gdb_test "p ctable1\[55\]" " = 55 '7'"
+ gdb_test "p ctable1\[56\]" " = 56 '8'"
+ gdb_test "p ctable1\[57\]" " = 57 '9'"
+ gdb_test "p ctable1\[58\]" " = 58 ':'"
+ gdb_test "p ctable1\[59\]" " = 59 ';'"
+ gdb_test "p ctable1\[60\]" " = 60 '<'"
+ gdb_test "p ctable1\[61\]" " = 61 '='"
+ gdb_test "p ctable1\[62\]" " = 62 '>'"
+ gdb_test "p ctable1\[63\]" " = 63 '\\?'"
+ gdb_test "p ctable1\[64\]" " = 64 '@'"
+ gdb_test "p ctable1\[65\]" " = 65 'A'"
+ gdb_test "p ctable1\[66\]" " = 66 'B'"
+ gdb_test "p ctable1\[67\]" " = 67 'C'"
+ gdb_test "p ctable1\[68\]" " = 68 'D'"
+ gdb_test "p ctable1\[69\]" " = 69 'E'"
+ gdb_test "p ctable1\[70\]" " = 70 'F'"
+ gdb_test "p ctable1\[71\]" " = 71 'G'"
+ gdb_test "p ctable1\[72\]" " = 72 'H'"
+ gdb_test "p ctable1\[73\]" " = 73 'I'"
+ gdb_test "p ctable1\[74\]" " = 74 'J'"
+ gdb_test "p ctable1\[75\]" " = 75 'K'"
+ gdb_test "p ctable1\[76\]" " = 76 'L'"
+ gdb_test "p ctable1\[77\]" " = 77 'M'"
+ gdb_test "p ctable1\[78\]" " = 78 'N'"
+ gdb_test "p ctable1\[79\]" " = 79 'O'"
+ gdb_test "p ctable1\[80\]" " = 80 'P'"
+ gdb_test "p ctable1\[81\]" " = 81 'Q'"
+ gdb_test "p ctable1\[82\]" " = 82 'R'"
+ gdb_test "p ctable1\[83\]" " = 83 'S'"
+ gdb_test "p ctable1\[84\]" " = 84 'T'"
+ gdb_test "p ctable1\[85\]" " = 85 'U'"
+ gdb_test "p ctable1\[86\]" " = 86 'V'"
+ gdb_test "p ctable1\[87\]" " = 87 'W'"
+ gdb_test "p ctable1\[88\]" " = 88 'X'"
+ gdb_test "p ctable1\[89\]" " = 89 'Y'"
+ gdb_test "p ctable1\[90\]" " = 90 'Z'"
+ gdb_test "p ctable1\[91\]" " = 91 '\\\['"
+ gdb_test "p ctable1\[92\]" " = 92 '\\\\\\\\'"
+ gdb_test "p ctable1\[93\]" " = 93 '\\\]'"
+ gdb_test "p ctable1\[94\]" " = 94 '\\^'"
+ gdb_test "p ctable1\[95\]" " = 95 '_'"
+ gdb_test "p ctable1\[96\]" " = 96 '`'"
+ gdb_test "p ctable1\[97\]" " = 97 'a'"
+ gdb_test "p ctable1\[98\]" " = 98 'b'"
+ gdb_test "p ctable1\[99\]" " = 99 'c'"
+ gdb_test "p ctable1\[100\]" " = 100 'd'"
+ gdb_test "p ctable1\[101\]" " = 101 'e'"
+ gdb_test "p ctable1\[102\]" " = 102 'f'"
+ gdb_test "p ctable1\[103\]" " = 103 'g'"
+ gdb_test "p ctable1\[104\]" " = 104 'h'"
+ gdb_test "p ctable1\[105\]" " = 105 'i'"
+ gdb_test "p ctable1\[106\]" " = 106 'j'"
+ gdb_test "p ctable1\[107\]" " = 107 'k'"
+ gdb_test "p ctable1\[108\]" " = 108 'l'"
+ gdb_test "p ctable1\[109\]" " = 109 'm'"
+ gdb_test "p ctable1\[110\]" " = 110 'n'"
+ gdb_test "p ctable1\[111\]" " = 111 'o'"
+ gdb_test "p ctable1\[112\]" " = 112 'p'"
+ gdb_test "p ctable1\[113\]" " = 113 'q'"
+ gdb_test "p ctable1\[114\]" " = 114 'r'"
+ gdb_test "p ctable1\[115\]" " = 115 's'"
+ gdb_test "p ctable1\[116\]" " = 116 't'"
+ gdb_test "p ctable1\[117\]" " = 117 'u'"
+ gdb_test "p ctable1\[118\]" " = 118 'v'"
+ gdb_test "p ctable1\[119\]" " = 119 'w'"
+ gdb_test "p ctable1\[120\]" " = 120 'x'"
+ gdb_test "p ctable1\[121\]" " = 121 'y'"
+ gdb_test "p ctable1\[122\]" " = 122 'z'"
+ gdb_test "p ctable1\[123\]" " = 123 '\[{\]+'"
+ gdb_test "p ctable1\[124\]" " = 124 '\[|\]+'"
+ gdb_test "p ctable1\[125\]" " = 125 '\[}\]+'"
+ gdb_test "p ctable1\[126\]" " = 126 '\[~\]'"
+ gdb_test "p ctable1\[127\]" " = 127 '\\\\177'"
+ gdb_test "p ctable1\[128\]" " = 128 '\\\\200'"
+ gdb_test "p ctable1\[129\]" " = 129 '\\\\201'"
+ gdb_test "p ctable1\[130\]" " = 130 '\\\\202'"
+ gdb_test "p ctable1\[131\]" " = 131 '\\\\203'"
+ gdb_test "p ctable1\[132\]" " = 132 '\\\\204'"
+ gdb_test "p ctable1\[133\]" " = 133 '\\\\205'"
+ gdb_test "p ctable1\[134\]" " = 134 '\\\\206'"
+ gdb_test "p ctable1\[135\]" " = 135 '\\\\207'"
+ gdb_test "p ctable1\[136\]" " = 136 '\\\\210'"
+ gdb_test "p ctable1\[137\]" " = 137 '\\\\211'"
+ gdb_test "p ctable1\[138\]" " = 138 '\\\\212'"
+ gdb_test "p ctable1\[139\]" " = 139 '\\\\213'"
+ gdb_test "p ctable1\[140\]" " = 140 '\\\\214'"
+ gdb_test "p ctable1\[141\]" " = 141 '\\\\215'"
+ gdb_test "p ctable1\[142\]" " = 142 '\\\\216'"
+ gdb_test "p ctable1\[143\]" " = 143 '\\\\217'"
+ gdb_test "p ctable1\[144\]" " = 144 '\\\\220'"
+ gdb_test "p ctable1\[145\]" " = 145 '\\\\221'"
+ gdb_test "p ctable1\[146\]" " = 146 '\\\\222'"
+ gdb_test "p ctable1\[147\]" " = 147 '\\\\223'"
+ gdb_test "p ctable1\[148\]" " = 148 '\\\\224'"
+ gdb_test "p ctable1\[149\]" " = 149 '\\\\225'"
+ gdb_test "p ctable1\[150\]" " = 150 '\\\\226'"
+ gdb_test "p ctable1\[151\]" " = 151 '\\\\227'"
+ gdb_test "p ctable1\[152\]" " = 152 '\\\\230'"
+ gdb_test "p ctable1\[153\]" " = 153 '\\\\231'"
+ gdb_test "p ctable1\[154\]" " = 154 '\\\\232'"
+ gdb_test "p ctable1\[155\]" " = 155 '\\\\233'"
+ gdb_test "p ctable1\[156\]" " = 156 '\\\\234'"
+ gdb_test "p ctable1\[157\]" " = 157 '\\\\235'"
+ gdb_test "p ctable1\[158\]" " = 158 '\\\\236'"
+ gdb_test "p ctable1\[159\]" " = 159 '\\\\237'"
+ gdb_test "p ctable1\[160\]" " = 160 '\\\\240'"
+ gdb_test "p ctable1\[161\]" " = 161 '\\\\241'"
+ gdb_test "p ctable1\[162\]" " = 162 '\\\\242'"
+ gdb_test "p ctable1\[163\]" " = 163 '\\\\243'"
+ gdb_test "p ctable1\[164\]" " = 164 '\\\\244'"
+ gdb_test "p ctable1\[165\]" " = 165 '\\\\245'"
+ gdb_test "p ctable1\[166\]" " = 166 '\\\\246'"
+ gdb_test "p ctable1\[167\]" " = 167 '\\\\247'"
+ gdb_test "p ctable1\[168\]" " = 168 '\\\\250'"
+ gdb_test "p ctable1\[169\]" " = 169 '\\\\251'"
+ gdb_test "p ctable1\[170\]" " = 170 '\\\\252'"
+ gdb_test "p ctable1\[171\]" " = 171 '\\\\253'"
+ gdb_test "p ctable1\[172\]" " = 172 '\\\\254'"
+ gdb_test "p ctable1\[173\]" " = 173 '\\\\255'"
+ gdb_test "p ctable1\[174\]" " = 174 '\\\\256'"
+ gdb_test "p ctable1\[175\]" " = 175 '\\\\257'"
+ gdb_test "p ctable1\[176\]" " = 176 '\\\\260'"
+ gdb_test "p ctable1\[177\]" " = 177 '\\\\261'"
+ gdb_test "p ctable1\[178\]" " = 178 '\\\\262'"
+ gdb_test "p ctable1\[179\]" " = 179 '\\\\263'"
+ gdb_test "p ctable1\[180\]" " = 180 '\\\\264'"
+ gdb_test "p ctable1\[181\]" " = 181 '\\\\265'"
+ gdb_test "p ctable1\[182\]" " = 182 '\\\\266'"
+ gdb_test "p ctable1\[183\]" " = 183 '\\\\267'"
+ gdb_test "p ctable1\[184\]" " = 184 '\\\\270'"
+ gdb_test "p ctable1\[185\]" " = 185 '\\\\271'"
+ gdb_test "p ctable1\[186\]" " = 186 '\\\\272'"
+ gdb_test "p ctable1\[187\]" " = 187 '\\\\273'"
+ gdb_test "p ctable1\[188\]" " = 188 '\\\\274'"
+ gdb_test "p ctable1\[189\]" " = 189 '\\\\275'"
+ gdb_test "p ctable1\[190\]" " = 190 '\\\\276'"
+ gdb_test "p ctable1\[191\]" " = 191 '\\\\277'"
+ gdb_test "p ctable1\[192\]" " = 192 '\\\\300'"
+ gdb_test "p ctable1\[193\]" " = 193 '\\\\301'"
+ gdb_test "p ctable1\[194\]" " = 194 '\\\\302'"
+ gdb_test "p ctable1\[195\]" " = 195 '\\\\303'"
+ gdb_test "p ctable1\[196\]" " = 196 '\\\\304'"
+ gdb_test "p ctable1\[197\]" " = 197 '\\\\305'"
+ gdb_test "p ctable1\[198\]" " = 198 '\\\\306'"
+ gdb_test "p ctable1\[199\]" " = 199 '\\\\307'"
+ gdb_test "p ctable1\[200\]" " = 200 '\\\\310'"
+ gdb_test "p ctable1\[201\]" " = 201 '\\\\311'"
+ gdb_test "p ctable1\[202\]" " = 202 '\\\\312'"
+ gdb_test "p ctable1\[203\]" " = 203 '\\\\313'"
+ gdb_test "p ctable1\[204\]" " = 204 '\\\\314'"
+ gdb_test "p ctable1\[205\]" " = 205 '\\\\315'"
+ gdb_test "p ctable1\[206\]" " = 206 '\\\\316'"
+ gdb_test "p ctable1\[207\]" " = 207 '\\\\317'"
+ gdb_test "p ctable1\[208\]" " = 208 '\\\\320'"
+ gdb_test "p ctable1\[209\]" " = 209 '\\\\321'"
+ gdb_test "p ctable1\[210\]" " = 210 '\\\\322'"
+ gdb_test "p ctable1\[211\]" " = 211 '\\\\323'"
+ gdb_test "p ctable1\[212\]" " = 212 '\\\\324'"
+ gdb_test "p ctable1\[213\]" " = 213 '\\\\325'"
+ gdb_test "p ctable1\[214\]" " = 214 '\\\\326'"
+ gdb_test "p ctable1\[215\]" " = 215 '\\\\327'"
+ gdb_test "p ctable1\[216\]" " = 216 '\\\\330'"
+ gdb_test "p ctable1\[217\]" " = 217 '\\\\331'"
+ gdb_test "p ctable1\[218\]" " = 218 '\\\\332'"
+ gdb_test "p ctable1\[219\]" " = 219 '\\\\333'"
+ gdb_test "p ctable1\[220\]" " = 220 '\\\\334'"
+ gdb_test "p ctable1\[221\]" " = 221 '\\\\335'"
+ gdb_test "p ctable1\[222\]" " = 222 '\\\\336'"
+ gdb_test "p ctable1\[223\]" " = 223 '\\\\337'"
+ gdb_test "p ctable1\[224\]" " = 224 '\\\\340'"
+ gdb_test "p ctable1\[225\]" " = 225 '\\\\341'"
+ gdb_test "p ctable1\[226\]" " = 226 '\\\\342'"
+ gdb_test "p ctable1\[227\]" " = 227 '\\\\343'"
+ gdb_test "p ctable1\[228\]" " = 228 '\\\\344'"
+ gdb_test "p ctable1\[229\]" " = 229 '\\\\345'"
+ gdb_test "p ctable1\[230\]" " = 230 '\\\\346'"
+ gdb_test "p ctable1\[231\]" " = 231 '\\\\347'"
+ gdb_test "p ctable1\[232\]" " = 232 '\\\\350'"
+ gdb_test "p ctable1\[233\]" " = 233 '\\\\351'"
+ gdb_test "p ctable1\[234\]" " = 234 '\\\\352'"
+ gdb_test "p ctable1\[235\]" " = 235 '\\\\353'"
+ gdb_test "p ctable1\[236\]" " = 236 '\\\\354'"
+ gdb_test "p ctable1\[237\]" " = 237 '\\\\355'"
+ gdb_test "p ctable1\[238\]" " = 238 '\\\\356'"
+ gdb_test "p ctable1\[239\]" " = 239 '\\\\357'"
+ gdb_test "p ctable1\[240\]" " = 240 '\\\\360'"
+ gdb_test "p ctable1\[241\]" " = 241 '\\\\361'"
+ gdb_test "p ctable1\[242\]" " = 242 '\\\\362'"
+ gdb_test "p ctable1\[243\]" " = 243 '\\\\363'"
+ gdb_test "p ctable1\[244\]" " = 244 '\\\\364'"
+ gdb_test "p ctable1\[245\]" " = 245 '\\\\365'"
+ gdb_test "p ctable1\[246\]" " = 246 '\\\\366'"
+ gdb_test "p ctable1\[247\]" " = 247 '\\\\367'"
+ gdb_test "p ctable1\[248\]" " = 248 '\\\\370'"
+ gdb_test "p ctable1\[249\]" " = 249 '\\\\371'"
+ gdb_test "p ctable1\[250\]" " = 250 '\\\\372'"
+ gdb_test "p ctable1\[251\]" " = 251 '\\\\373'"
+ gdb_test "p ctable1\[252\]" " = 252 '\\\\374'"
+ gdb_test "p ctable1\[253\]" " = 253 '\\\\375'"
+ gdb_test "p ctable1\[254\]" " = 254 '\\\\376'"
+ gdb_test "p ctable1\[255\]" " = 255 '\\\\377'"
+}
+
+# Test interaction of the number of print elements to print and the
+# repeat count, set to the default of 10.
+
+proc test_print_repeats_10 {} {
+ global gdb_prompt
+
+ for { set x 1; } { $x <= 16 } { incr x; } {
+ gdb_test "set print elements $x" ""
+ for { set e 1; } { $e <= 16 } {incr e; } {
+ set v [expr $e - 1];
+ set command "p &ctable2\[${v}*16\]"
+ if { $x < $e } {
+ set aval $x;
+ } else {
+ set aval $e;
+ }
+ set xval [expr $x - $e];
+ if { $xval < 0 } {
+ set xval 0;
+ }
+ if { $aval > 10 } {
+ set a "'a' <repeats $aval times>";
+ if { $xval > 0 } {
+ set a "${a}, \\\"";
+ }
+ } else {
+ set a "\\\"[string range "aaaaaaaaaaaaaaaa" 1 $aval]";
+ if { $xval > 10 } {
+ set a "$a\\\", ";
+ }
+ }
+ set xstr "";
+ if { $xval > 10 } {
+ set xstr "'X' <repeats $xval times>";
+ } else {
+ if { $xval > 0 } {
+ set xstr "[string range "XXXXXXXXXXXXXXXX" 1 $xval]\\\"";
+ } else {
+ if { $aval <= 10 } {
+ set xstr "\\\"";
+ }
+ }
+ }
+ if { $aval < 16 } {
+ set xstr "${xstr}\[.\]\[.\]\[.\]"
+ }
+ set string " = \[(\]unsigned char \[*\]\[)\] ${a}${xstr}";
+ gdb_test "$command" "$string" "$command with print elements set to $x";
+ }
+ }
+}
+
+proc test_print_strings {} {
+ global gdb_prompt
+
+ # We accept "(unsigned char *) " before the string. char vs. unsigned char
+ # is already tested elsewhere.
+
+ # Test that setting print elements unlimited doesn't completely suppress
+ # printing; this was a bug in older gdb's.
+ gdb_test "set print elements 0" ""
+ gdb_test "p teststring" \
+ " = (.unsigned char .. )?\"teststring contents\"" "p teststring with elements set to 0"
+ gdb_test "set print elements 1" ""
+ gdb_test "p teststring" \
+ " = (.unsigned char .. )?\"t\"\\.\\.\\." "p teststring with elements set to 1"
+ gdb_test "set print elements 5" ""
+ gdb_test "p teststring" \
+ " = (.unsigned char .. )?\"tests\"\\.\\.\\." "p teststring with elements set to 5"
+ gdb_test "set print elements 19" ""
+ gdb_test "p teststring" \
+ " = (.unsigned char .. )?\"teststring contents\"" "p teststring with elements set to 19"
+ gdb_test "set print elements 20" ""
+ gdb_test "p teststring" \
+ " = (.unsigned char .. )?\"teststring contents\"" "p teststring with elements set to 20"
+
+ gdb_test "set print elements 8" ""
+
+ gdb_test "p &ctable1\[0\]" \
+ " = \\(unsigned char \\*\\) \"\""
+ gdb_test "p &ctable1\[1\]" \
+ " = \\(unsigned char \\*\\) \"\\\\001\\\\002\\\\003\\\\004\\\\005\\\\006\\\\a\\\\b\"..."
+ gdb_test "p &ctable1\[1*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\b\\\\t\\\\n\\\\v\\\\f\\\\r\\\\016\\\\017\"..."
+ gdb_test "p &ctable1\[2*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\020\\\\021\\\\022\\\\023\\\\024\\\\025\\\\026\\\\027\"..."
+ gdb_test "p &ctable1\[3*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\030\\\\031\\\\032\\\\e\\\\034\\\\035\\\\036\\\\037\"..."
+ gdb_test "p &ctable1\[4*8\]" \
+ " = \\(unsigned char \\*\\) \" !\\\\\"#\\\$%&'\"..."
+ gdb_test "p &ctable1\[5*8\]" \
+ " = \\(unsigned char \\*\\) \"\\(\\)\\*\\+,-./\"..."
+ gdb_test "p &ctable1\[6*8\]" \
+ " = \\(unsigned char \\*\\) \"01234567\"..."
+ gdb_test "p &ctable1\[7*8\]" \
+ " = \\(unsigned char \\*\\) \"89:;<=>\\?\"..."
+ gdb_test "p &ctable1\[8*8\]" \
+ " = \\(unsigned char \\*\\) \"@ABCDEFG\"..."
+ gdb_test "p &ctable1\[9*8\]" \
+ " = \\(unsigned char \\*\\) \"HIJKLMNO\"..."
+ gdb_test "p &ctable1\[10*8\]" \
+ " = \\(unsigned char \\*\\) \"PQRSTUVW\"..."
+ gdb_test "p &ctable1\[11*8\]" \
+ " = \\(unsigned char \\*\\) \"XYZ\\\[\\\\\\\\\\\]\\^_\"..."
+ gdb_test "p &ctable1\[12*8\]" \
+ " = \\(unsigned char \\*\\) \"`abcdefg\"..."
+ gdb_test "p &ctable1\[13*8\]" \
+ " = \\(unsigned char \\*\\) \"hijklmno\"..."
+ gdb_test "p &ctable1\[14*8\]" \
+ " = \\(unsigned char \\*\\) \"pqrstuvw\"..."
+ gdb_test "p &ctable1\[15*8\]" \
+ " = \\(unsigned char \\*\\) \"xyz\[{|}\]+\\~\\\\177\"..."
+ gdb_test "p &ctable1\[16*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\200\\\\201\\\\202\\\\203\\\\204\\\\205\\\\206\\\\207\"..."
+ gdb_test "p &ctable1\[17*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\210\\\\211\\\\212\\\\213\\\\214\\\\215\\\\216\\\\217\"..."
+ gdb_test "p &ctable1\[18*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\220\\\\221\\\\222\\\\223\\\\224\\\\225\\\\226\\\\227\"..."
+ gdb_test "p &ctable1\[19*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\230\\\\231\\\\232\\\\233\\\\234\\\\235\\\\236\\\\237\"..."
+ gdb_test "p &ctable1\[20*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\240\\\\241\\\\242\\\\243\\\\244\\\\245\\\\246\\\\247\"..."
+ gdb_test "p &ctable1\[21*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\250\\\\251\\\\252\\\\253\\\\254\\\\255\\\\256\\\\257\"..."
+ gdb_test "p &ctable1\[22*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\260\\\\261\\\\262\\\\263\\\\264\\\\265\\\\266\\\\267\"..."
+ gdb_test "p &ctable1\[23*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\270\\\\271\\\\272\\\\273\\\\274\\\\275\\\\276\\\\277\"..."
+ gdb_test "p &ctable1\[24*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\300\\\\301\\\\302\\\\303\\\\304\\\\305\\\\306\\\\307\"..."
+ gdb_test "p &ctable1\[25*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\310\\\\311\\\\312\\\\313\\\\314\\\\315\\\\316\\\\317\"..."
+ gdb_test "p &ctable1\[26*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\320\\\\321\\\\322\\\\323\\\\324\\\\325\\\\326\\\\327\"..."
+ gdb_test "p &ctable1\[27*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\330\\\\331\\\\332\\\\333\\\\334\\\\335\\\\336\\\\337\"..."
+ gdb_test "p &ctable1\[28*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\340\\\\341\\\\342\\\\343\\\\344\\\\345\\\\346\\\\347\"..."
+ gdb_test "p &ctable1\[29*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\350\\\\351\\\\352\\\\353\\\\354\\\\355\\\\356\\\\357\"..."
+ gdb_test "p &ctable1\[30*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\360\\\\361\\\\362\\\\363\\\\364\\\\365\\\\366\\\\367\"..."
+ gdb_test "p &ctable1\[31*8\]" \
+ " = \\(unsigned char \\*\\) \"\\\\370\\\\371\\\\372\\\\373\\\\374\\\\375\\\\376\\\\377\"..."
+}
+
+proc test_print_int_arrays {} {
+ global gdb_prompt
+
+ gdb_test "set print elements 24" ""
+
+ gdb_test_escape_braces "p int1dim" \
+ " = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}"
+ gdb_test_escape_braces "p int2dim" \
+ " = {{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}}"
+ gdb_test_escape_braces "p int3dim" \
+ " = {{{0, 1}, {2, 3}, {4, 5}}, {{6, 7}, {8, 9}, {10, 11}}}"
+ gdb_test_escape_braces "p int4dim" \
+ " = {{{{0, 1}, {2, 3}, {4, 5}}, {{6, 7}, {8, 9}, {10, 11}}}}"
+}
+
+proc test_print_typedef_arrays {} {
+ global gdb_prompt
+
+ gdb_test "set print elements 24" ""
+
+ gdb_test_escape_braces "p a1" \
+ " = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20}"
+ gdb_test "p a1\[0\]" " = 2"
+ gdb_test "p a1\[9\]" " = 20"
+
+ gdb_test "p a2" \
+ " = \"abcd\""
+ gdb_test "p a2\[0\]" " = 97 'a'"
+ gdb_test "p a2\[3\]" " = 100 'd'"
+}
+
+proc test_artificial_arrays {} {
+ # Send \026@ instead of just @ in case the kill character is @.
+ gdb_test_escape_braces "p int1dim\[0\]\026@2" " = {0, 1}" {p int1dim[0]@2}
+ gdb_test_escape_braces "p int1dim\[0\]\026@2\026@3" \
+ "({{0, 1}, {2, 3}, {4, 5}}|\[Cc\]annot.*)" \
+ {p int1dim[0]@2@3}
+ gdb_test_escape_braces {p/x (short [])0x12345678} \
+ " = ({0x1234, 0x5678}|{0x5678, 0x1234})"
+}
+
+proc test_print_char_arrays {} {
+ global gdb_prompt
+ global hex
+
+ gdb_test "set print elements 24" ""
+ gdb_test "set print address on" ""
+
+ gdb_test "p arrays" \
+ " = {array1 = \"abc\", array2 = \"d\", array3 = \"e\", array4 = \"fg\", array5 = \"hij\"}"
+
+ gdb_test "p parrays" " = \\(struct some_arrays \\*\\) $hex"
+ gdb_test "p parrays->array1" " = \"abc\""
+ gdb_test "p &parrays->array1" " = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex"
+ gdb_test "p parrays->array2" " = \"d\""
+ gdb_test "p &parrays->array2" " = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex"
+ gdb_test "p parrays->array3" " = \"e\""
+ gdb_test "p &parrays->array3" " = \\(unsigned char \\(\\*\\)\\\[1\\\]\\) $hex"
+ gdb_test "p parrays->array4" " = \"fg\""
+ gdb_test "p &parrays->array4" " = \\(unsigned char \\(\\*\\)\\\[2\\\]\\) $hex"
+ gdb_test "p parrays->array5" " = \"hij\""
+ gdb_test "p &parrays->array5" " = \\(unsigned char \\(\\*\\)\\\[4\\\]\\) $hex"
+
+ gdb_test "set print address off" ""
+}
+
+proc test_print_string_constants {} {
+ global gdb_prompt
+
+ gdb_test "set print elements 50" ""
+
+ if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ return
+ }
+
+ # We need to up this because this can be really slow on some boards.
+ # (Test may involve inferior malloc() calls).
+ set timeout 60;
+
+ gdb_test "p \"a string\"" " = \"a string\""
+ gdb_test "p \"embedded \\000 null\"" " = \"embedded \\\\0 null\""
+ gdb_test "p \"abcd\"\[2\]" " = 99 'c'"
+ gdb_test "p sizeof (\"abcdef\")" " = 7"
+ gdb_test "ptype \"foo\"" " = char \\\[4\\\]"
+ gdb_test "p *\"foo\"" " = 102 'f'"
+ gdb_test "ptype *\"foo\"" " = char"
+ gdb_test "p &*\"foo\"" " = \"foo\""
+ # setup_kfail "gdb/538"
+ gdb_test "ptype &*\"foo\"" "type = char \\*"
+ gdb_test "p (char *)\"foo\"" " = \"foo\""
+}
+
+proc test_print_array_constants {} {
+
+ if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ return
+ }
+
+ # We need to up this because this can be really slow on some boards.
+ # (Test may involve inferior malloc() calls).
+ set timeout 60;
+
+ gdb_test "print {'a','b','c'}" " = \"abc\""
+ gdb_test_escape_braces "print {0,1,2}" " = {0, 1, 2}"
+ gdb_test_escape_braces "print {(long)0,(long)1,(long)2}" " = {0, 1, 2}"
+ gdb_test_escape_braces "print {{0,1,2},{3,4,5}}" " = {{0, 1, 2}, {3, 4, 5}}"
+ gdb_test "print {4,5,6}\[2\]" " = 6"
+ gdb_test "print *&{4,5,6}\[1\]" " = 5"
+}
+
+proc test_printf {} {
+ gdb_test "printf \"x=%d,y=%d,z=%d\\n\", 5, 6, 7" "x=5,y=6,z=7"
+ gdb_test "printf \"string=%.4sxx\\n\", teststring" "string=testxx"
+ gdb_test "printf \"string=%sxx\\n\", teststring" \
+ "string=teststring contentsxx"
+
+ gdb_test "printf \"%f is fun\\n\", 1.0" "1\.0+ is fun"
+
+ # Test mixing args of different sizes.
+ gdb_test "printf \"x=%d,y=%f,z=%d\\n\", 5, 6.0, 7" "x=5,y=6\.0+,z=7"
+ gdb_test "printf \"%x %f, %c %x, %x, %f\\n\", 0xbad, -99.541, 'z',\
+0xfeedface, 0xdeadbeef, 5.0" "bad -99.54\[0-9\]+, z feedface, deadbeef, 5.0+"
+}
+
+# Escape a left curly brace to prevent it from being interpreted as
+# the beginning of a bound
+proc gdb_test_escape_braces { args } {
+
+ set pattern [lindex $args 1]
+ regsub -all {\{[0-9]} $pattern {\\&} esc_pattern
+ gdb_test [lindex $args 0] $esc_pattern [lindex $args 2]
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "print \$pc" "No registers\\."
+# FIXME: should also test "print $pc" when there is an execfile but no
+# remote debugging target, process or corefile.
+
+gdb_load ${binfile}
+
+gdb_test "set print sevenbit-strings" ""
+gdb_test "set print address off" ""
+gdb_test "set width 0" ""
+
+if [set_lang_c] then {
+ gdb_test "p ctable1\[120\]" "120 'x'" "p ctable1\[120\] #1"
+
+ if [runto_main] then {
+ test_integer_literals_accepted
+ test_integer_literals_rejected
+ test_character_literals_accepted
+ test_print_all_chars
+ test_print_repeats_10
+ test_print_strings
+ test_print_int_arrays
+ test_print_typedef_arrays
+ test_artificial_arrays
+ test_print_char_arrays
+# We used to do the runto main here.
+ test_print_string_constants
+ test_print_array_constants
+ test_printf
+ }
+} else {
+ fail "C print command tests suppressed"
+}
diff --git a/gdb/testsuite/gdb.base/ptype.c b/gdb/testsuite/gdb.base/ptype.c
new file mode 100644
index 00000000000..2c85c7c88fc
--- /dev/null
+++ b/gdb/testsuite/gdb.base/ptype.c
@@ -0,0 +1,346 @@
+/*
+ * Test file with lots of different types, for testing the
+ * "ptype" command.
+ */
+
+/*
+ * First the basic C types.
+ */
+#include <stdlib.h>
+
+#if !defined (__STDC__) && !defined (_AIX)
+#define signed /**/
+#endif
+
+char v_char;
+signed char v_signed_char;
+unsigned char v_unsigned_char;
+
+short v_short;
+signed short v_signed_short;
+unsigned short v_unsigned_short;
+
+int v_int;
+signed int v_signed_int;
+unsigned int v_unsigned_int;
+
+long v_long;
+signed long v_signed_long;
+unsigned long v_unsigned_long;
+
+float v_float;
+double v_double;
+
+/*
+ * Now some derived types, which are arrays, functions-returning,
+ * pointers, structures, unions, and enumerations.
+ */
+
+/**** arrays *******/
+
+char v_char_array[2];
+signed char v_signed_char_array[2];
+unsigned char v_unsigned_char_array[2];
+
+short v_short_array[2];
+signed short v_signed_short_array[2];
+unsigned short v_unsigned_short_array[2];
+
+int v_int_array[2];
+signed int v_signed_int_array[2];
+unsigned int v_unsigned_int_array[2];
+
+long v_long_array[2];
+signed long v_signed_long_array[2];
+unsigned long v_unsigned_long_array[2];
+
+float v_float_array[2];
+double v_double_array[2];
+
+/* PR 3742 */
+typedef char t_char_array[];
+
+/**** pointers *******/
+
+char *v_char_pointer;
+signed char *v_signed_char_pointer;
+unsigned char *v_unsigned_char_pointer;
+
+short *v_short_pointer;
+signed short *v_signed_short_pointer;
+unsigned short *v_unsigned_short_pointer;
+
+int *v_int_pointer;
+signed int *v_signed_int_pointer;
+unsigned int *v_unsigned_int_pointer;
+
+long *v_long_pointer;
+signed long *v_signed_long_pointer;
+unsigned long *v_unsigned_long_pointer;
+
+float *v_float_pointer;
+double *v_double_pointer;
+
+/**** structs *******/
+
+struct t_struct {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_struct1;
+
+struct t_struct *v_t_struct_p;
+
+struct {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_struct2;
+
+/* typedef'd struct without a tag. */
+typedef struct {
+ double v_double_member;
+ int v_int_member;
+} t_struct3;
+/* GCC seems to want a variable of this type, or else it won't put out
+ a symbol. */
+t_struct3 v_struct3;
+
+/**** unions *******/
+
+union t_union {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_union;
+
+union {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_union2;
+
+/* typedef'd union without a tag. */
+typedef union {
+ double v_double_member;
+ int v_int_member;
+} t_union3;
+/* GCC seems to want a variable of this type, or else it won't put out
+ a symbol. */
+t_union3 v_union3;
+
+/*** Functions returning type ********/
+
+char v_char_func () { return(0); }
+signed char v_signed_char_func () { return (0); }
+unsigned char v_unsigned_char_func () { return (0); }
+
+short v_short_func () { return (0); }
+signed short v_signed_short_func () { return (0); }
+unsigned short v_unsigned_short_func () { return (0); }
+
+int v_int_func () { return (0); }
+signed int v_signed_int_func () { return (0); }
+unsigned int v_unsigned_int_func () { return (0); }
+
+long v_long_func () { return (0); }
+signed long v_signed_long_func () { return (0); }
+unsigned long v_unsigned_long_func () { return (0); }
+
+float v_float_func () { return (0.0); }
+double v_double_func () { return (0.0); }
+
+/**** Some misc more complicated things *******/
+
+struct link {
+ struct link *next;
+#ifdef __STDC__
+ struct link *(*linkfunc) (struct link *this, int flags);
+#else
+ struct link *(*linkfunc) ();
+#endif
+ struct t_struct stuff[1][2][3];
+} *s_link;
+
+union tu_link {
+ struct link *next;
+#ifdef __STDC__
+ struct link *(*linkfunc) (struct link *this, int flags);
+#else
+ struct link *(*linkfunc) ();
+#endif
+ struct t_struct stuff[1][2][3];
+} u_link;
+
+struct outer_struct {
+ int outer_int;
+ struct inner_struct {
+ int inner_int;
+ long inner_long;
+ }inner_struct_instance;
+ union inner_union {
+ int inner_union_int;
+ long inner_union_long;
+ }inner_union_instance;
+ long outer_long;
+} nested_su;
+
+/**** Enumerations *******/
+
+enum
+/* Work around the bug for compilers which don't put out the right stabs. */
+#if __GNUC__ < 2 && !defined (_AIX)
+primary1_tag
+#endif
+{red1, green1, blue1} primary1;
+
+enum {red, green, blue} primary;
+enum colors {yellow, purple, pink} nonprimary;
+
+enum {chevy, ford} clunker;
+enum cars {bmw, porsche} sportscar;
+
+#undef FALSE
+#undef TRUE
+typedef enum {FALSE, TRUE} boolean;
+boolean v_boolean;
+/*note: aCC has bool type predefined with 'false' and 'true'*/
+typedef enum bvals {my_false, my_true} boolean2;
+boolean2 v_boolean2;
+
+enum misordered {two = 2, one = 1, zero = 0, three = 3};
+
+/* Seems like we need a variable of this type to get the type to be put
+ in the executable, at least for AIX xlc. */
+enum misordered v_misordered = three;
+
+/**** Pointers to functions *******/
+
+typedef int (*func_type) (int (*) (int, float), float);
+double (*old_fptr) ();
+double (*new_fptr) (void);
+int (*fptr) (int, float);
+int *(*fptr2) (int (*) (int, float), float);
+int (*xptr) (int (*) (), int (*) (void), int);
+int (*(*ffptr) (char)) (short);
+int (*(*(*fffptr) (char)) (short)) (long);
+
+/* Here are the sort of stabs we expect to see for the above:
+
+ .stabs "func_type:t(0,100)=*(0,101)=g(0,1)(0,102)=*(0,103)=g(0,1)(0,1)(0,14)#(0,14)#",128,0,234,0
+ .stabs "old_fptr:G(0,110)=*(0,111)=f(0,15)",32,0,231,0
+ .stabs "new_fptr:G(0,120)=*(0,121)=g(0,15)(0,122)=(0,122)#",32,0,232,0
+ .stabs "fptr:G(0,130)=*(0,103)#",32,0,233,0
+ .stabs "fptr2:G(0,140)=*(0,141)=g(0,142)=*(0,1)(0,102)(0,14)#",32,0,235,0
+ .stabs "xptr:G(0,150)=*(0,151)=g(0,1)(0,152)=*(0,153)=f(0,1)(0,154)=*(0,155)=g(0,1)(0,122)#(0,1)#",32,0,236,0
+ .stabs "ffptr:G(0,160)=*(0,161)=g(0,162)=*(0,163)=g(0,1)(0,8)#(0,2)#",32,0,237,0\
+ .stabs "fffptr:G(0,170)=*(0,171)=g(0,172)=*(0,173)=g(0,174)=*(0,175)=g(0,1)(0,3)#(0,8)#(0,2)#",32,0,237,0
+
+ Most of these use Sun's extension for prototyped function types ---
+ the 'g' type descriptor. As of around 9 Feb 2002, GCC didn't emit
+ those, but GDB can read them, so the related tests in ptype.exp
+ will all xfail. */
+
+
+/***********/
+
+int main ()
+{
+ /* Ensure that malloc is a pointer type; avoid use of "void" and any include files. */
+/* extern char *malloc();*/
+
+ /* Some of the tests in ptype.exp require invoking malloc, so make
+ sure it is linked in to this program. */
+ v_char_pointer = (char *) malloc (1);
+
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ /* Some linkers (e.g. on AIX) remove unreferenced variables,
+ so make sure to reference them. */
+ primary = blue;
+ primary1 = blue1;
+ nonprimary = pink;
+ sportscar = porsche;
+ clunker = ford;
+ v_struct1.v_int_member = 5;
+ v_struct2.v_int_member = 6;
+ v_struct3.v_int_member = 7;
+
+ v_char = 0;
+ v_signed_char = 0;
+ v_unsigned_char = 0;
+
+ v_short = 0;
+ v_signed_short = 0;
+ v_unsigned_short = 0;
+
+ v_int = 0;
+ v_signed_int = 0;
+ v_unsigned_int = 0;
+
+ v_long = 0;
+ v_signed_long = 0;
+ v_unsigned_long = 0;
+
+ v_float = 0;
+ v_double = 0;
+
+ v_char_array[0] = 0;
+ v_signed_char_array[0] = 0;
+ v_unsigned_char_array[0] = 0;
+
+ v_short_array[0] = 0;
+ v_signed_short_array[0] = 0;
+ v_unsigned_short_array[0] = 0;
+
+ v_int_array[0] = 0;
+ v_signed_int_array[0] = 0;
+ v_unsigned_int_array[0] = 0;
+
+ v_long_array[0] = 0;
+ v_signed_long_array[0] = 0;
+ v_unsigned_long_array[0] = 0;
+
+ v_float_array[0] = 0;
+ v_double_array[0] = 0;
+
+ v_char_pointer = 0;
+ v_signed_char_pointer = 0;
+ v_unsigned_char_pointer = 0;
+
+ v_short_pointer = 0;
+ v_signed_short_pointer = 0;
+ v_unsigned_short_pointer = 0;
+
+ v_int_pointer = 0;
+ v_signed_int_pointer = 0;
+ v_unsigned_int_pointer = 0;
+
+ v_long_pointer = 0;
+ v_signed_long_pointer = 0;
+ v_unsigned_long_pointer = 0;
+
+ v_float_pointer = 0;
+ v_double_pointer = 0;
+
+ nested_su.outer_int = 0;
+ v_t_struct_p = 0;
+
+ v_boolean = FALSE;
+ v_boolean2 = my_false;
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptype.exp
new file mode 100644
index 00000000000..8ef738e28ab
--- /dev/null
+++ b/gdb/testsuite/gdb.base/ptype.exp
@@ -0,0 +1,609 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999,
+# 2000, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "ptype"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Test ptype of unnamed enumeration members before any action causes
+# the partial symbol table to be expanded to full symbols. This fails
+# with stabs compilers which fail to use a nameless stab (such as
+# pre-2.4.5 versions of gcc and most non-gcc compilers).
+
+send_gdb "ptype red1\n"
+gdb_expect {
+ -re "type = enum primary1_tag \{red1, green1, blue1\}.*$gdb_prompt $"\
+ {
+ # The workaround is in effect. As this is a compiler, not GDB,
+ # bug, we'll make it a PASS but perhaps it should be an XFAIL.
+ pass "ptype unnamed enumeration member (worked around)"
+ }
+ -re "type = enum \{red1, green1, blue1\}.*$gdb_prompt $"\
+ { pass "ptype unnamed enumeration member" }
+ -re ".*$gdb_prompt $" { fail "ptype unnamed enumeration member" }
+ timeout { fail "(timeout) ptype unnamed enumeration member" }
+}
+
+#
+# test ptype command with structures
+#
+# Here and elsewhere, we accept
+# "long", "long int", or "int" for long variables (whatis.exp already
+# has an XFAIL for "int" (Sun cc bug), so no need to fail it here).
+gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\] (unsigned |)char v_char_member;.*\[\r\n\] (short|short int) v_short_member;.*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long_member;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_member;.*\[\r\n\]\}.*" "ptype structure"
+
+
+# Test the equivalence between '.' and '->' for struct member references.
+
+if [gdb_test "ptype v_struct1.v_float_member" "type = float"]<0 then {
+ return -1
+}
+if [gdb_test "ptype v_struct1->v_float_member" "type = float"]<0 then {
+ return -1
+}
+if [gdb_test "ptype v_t_struct_p.v_float_member" "type = float"]<0 then {
+ return -1
+}
+if [gdb_test "ptype v_t_struct_p->v_float_member" "type = float"]<0 then {
+ return -1
+}
+
+
+# IBM's xlc puts out bogus stabs--the stuff field is type 42,
+# which isn't defined.
+
+gdb_test "ptype struct link" "type = struct link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list structure"
+
+#
+# test ptype command with unions
+#
+gdb_test "ptype union t_union" "type = union t_union \{.*\[\r\n\] (unsigned |)char v_char_member;.*\[\r\n\] (short|short int) v_short_member;.*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long_member;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_member;.*\[\r\n\]\}.*" "ptype union"
+
+# IBM's xlc puts out bogus stabs--the stuff field is type 42,
+# which isn't defined.
+gdb_test "ptype union tu_link" "type = union tu_link \{\[\r\n\]+\[ \t\]+struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[\r\n\]+\}.*" "ptype linked list union"
+
+#
+# test ptype command with enums
+#
+
+gdb_test "ptype primary" "type = enum .red, green, blue.*" "ptype unnamed enumeration"
+
+gdb_test "ptype enum colors" "type = enum colors \{yellow, purple, pink\}.*" "ptype named enumeration"
+
+
+#
+# test ptype command with enums as typedef
+#
+gdb_test "ptype boolean" "type = enum (boolean |)\{FALSE, TRUE\}.*" "ptype unnamed typedef'd enumeration"
+
+# And check that whatis shows the name, not "enum {...}".
+# This probably fails for all DWARF 1 cases, so assume so for now. -fnf
+# The problem with xlc is that the stabs look like
+# :t51=eFALSE:0,TRUE:1,;
+# boolean:t55=51
+# v_boolean:G51
+# GDB's behavior is correct; the type which the variable is defined
+# as (51) doesn't have a name. Only 55 has a name.
+
+if {!$gcc_compiled && !$hp_aCC_compiler} {
+ setup_xfail "rs6000-*-*" "i*86-*-sysv4*"
+ setup_xfail "hppa*-*-*" CLLbs14773
+}
+
+# For get_debug_format to do its job, we need to have a current source file.
+gdb_test "list main" ""
+get_debug_format
+setup_xfail_format "DWARF 1"
+gdb_test "whatis v_boolean" "type = (enum |)boolean" \
+ "whatis unnamed typedef'd enum (compiler bug in IBM's xlc)"
+
+# Same thing with struct and union.
+gdb_test "ptype t_struct3" "type = struct (t_struct3 |)\{.*
+ *double v_double_member;.*
+ *int v_int_member;.*\}" "printing typedef'd struct"
+
+gdb_test "ptype t_union3" "type = union (t_union3 |)\{.*
+ *double v_double_member;.*
+ *int v_int_member;.*\}" "printing typedef'd union"
+
+gdb_test "ptype enum bvals" "type = enum bvals \{my_false, my_true\}.*" "ptype named typedef'd enumf'd enum"
+
+#
+# test ptype command with out-of-order enum values
+#
+gdb_test "ptype enum misordered" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype misordered enumeration"
+
+#
+# test ptype command with a named enum's value
+#
+gdb_test "ptype three" "type = enum misordered \{two = 2, one = 1, zero = 0, three = 3\}.*" "ptype named enumeration member"
+
+gdb_test "ptype red" "type = enum \{red, green, blue\}.*" "ptype unnamed enumeration member #2"
+
+#
+# test ptype command with basic C types
+#
+# I've commented most of this out because it duplicates tests in whatis.exp.
+# I've just left in a token test or 2 which is designed to test that ptype
+# acts like whatis for basic types. If it is thought to be necessary to
+# test both whatis and ptype for all the types, the tests should be
+# merged into whatis.exp, or else maintenance will be a royal pain -kingdon
+#setup_xfail "i960-*-*" 1821
+#setup_xfail "mips-idt-*" "mips-sgi-*"
+#send "ptype v_char\n"
+#gdb_expect {
+# -re "type = char.*$gdb_prompt $" { pass "ptype char" }
+# -re ".*$gdb_prompt $" { fail "ptype char" }
+# timeout { fail "(timeout) ptype char" }
+#}
+#
+#
+#setup_xfail "mips-*-*"
+#send "ptype v_signed_char\n"
+#gdb_expect {
+# -re "type = signed char.*$gdb_prompt $" { pass "ptype signed char" }
+# -re ".*$gdb_prompt $" { fail "ptype signed char" }
+# timeout { fail "(timeout) ptype signed char" }
+#}
+#
+#
+#send "ptype v_unsigned_char\n"
+#gdb_expect {
+# -re "type = unsigned char.*$gdb_prompt $" { pass "ptype unsigned char" }
+# -re ".*$gdb_prompt $" { fail "ptype unsigned char" }
+# timeout { fail "(timeout) ptype unsigned char" }
+#}
+
+gdb_test "ptype v_short" "type = short(| int).*" "ptype short"
+
+#send "ptype v_signed_short\n"
+#gdb_expect {
+# -re "type = short.*$gdb_prompt $" { pass "ptype signed short" }
+# -re ".*$gdb_prompt $" { fail "ptype signed short" }
+# timeout { fail "(timeout) ptype signed short" }
+#}
+#
+#
+#send "ptype v_unsigned_short\n"
+#gdb_expect {
+# -re "type = unsigned short.*$gdb_prompt $" { pass "ptype unsigned short" }
+# -re ".*$gdb_prompt $" { fail "ptype unsigned short" }
+# timeout { fail "(timeout) ptype unsigned short" }
+#}
+
+
+gdb_test "ptype v_int" "type = int.*" "ptype int"
+
+#send "ptype v_signed_int\n"
+#gdb_expect {
+# -re "type = int.*$gdb_prompt $" { pass "ptype signed int" }
+# -re ".*$gdb_prompt $" { fail "ptype signed int" }
+# timeout { fail "(timeout) ptype signed int" }
+#}
+#
+#
+#send "ptype v_unsigned_int\n"
+#gdb_expect {
+# -re "type = unsigned int.*$gdb_prompt $" { pass "ptype unsigned int" }
+# -re ".*$gdb_prompt $" { fail "ptype unsigned int" }
+# timeout { fail "(timeout) ptype unsigned int" }
+#}
+#
+#
+#send "ptype v_long\n"
+#gdb_expect {
+# -re "type = long.*$gdb_prompt $" { pass "ptype long" }
+# -re ".*$gdb_prompt $" { fail "ptype long" }
+# timeout { fail "(timeout) ptype long" }
+#}
+#
+#
+#send "ptype v_signed_long\n"
+#gdb_expect {
+# -re "type = long.*$gdb_prompt $" { pass "ptype signed long" }
+# -re ".*$gdb_prompt $" { fail "ptype signed long" }
+# timeout { fail "(timeout) ptype signed long" }
+#}
+#
+#
+#send "ptype v_unsigned_long\n"
+#gdb_expect {
+# -re "type = unsigned long.*$gdb_prompt $" { pass "ptype unsigned long" }
+# -re ".*$gdb_prompt $" { fail "ptype unsigned long" }
+# timeout { fail "(timeout) ptype unsigned long" }
+#}
+#
+#
+#send "ptype v_float\n"
+#gdb_expect {
+# -re "type = float.*$gdb_prompt $" { pass "ptype float" }
+# -re ".*$gdb_prompt $" { fail "ptype float" }
+# timeout { fail "(timeout) ptype float" }
+#}
+#
+#
+#send "ptype v_double\n"
+#gdb_expect {
+# -re "type = double.*$gdb_prompt $" { pass "ptype double" }
+# -re ".*$gdb_prompt $" { fail "ptype double" }
+# timeout { fail "(timeout) ptype double" }
+#}
+
+
+#
+# test ptype command with arrays
+#
+#setup_xfail "i960-*-*" 1821
+#setup_xfail "mips-idt-*" "mips-sgi-*"
+#send "ptype v_char_array\n"
+#gdb_expect {
+# -re "type = char .2..*$gdb_prompt $" { pass "ptype char array" }
+# -re ".*$gdb_prompt $" { fail "ptype char array" }
+# timeout { fail "(timeout) ptype char array" }
+#}
+#
+#
+#setup_xfail "mips-*-*"
+#send "ptype v_signed_char_array\n"
+#gdb_expect {
+# -re "type = (|signed )char .2..*$gdb_prompt $" { pass "ptype signed char array" }
+# -re ".*$gdb_prompt $" { fail "ptype signed char array" }
+# timeout { fail "(timeout) ptype signed char array" }
+#}
+#
+#
+#send "ptype v_unsigned_char_array\n"
+#gdb_expect {
+# -re "type = unsigned char .2..*$gdb_prompt $" { pass "ptype unsigned char array" }
+# -re ".*$gdb_prompt $" { fail "ptype unsigned char array" }
+# timeout { fail "(timeout) ptype unsigned char array" }
+#}
+#
+#
+#
+#send "ptype v_int_array\n"
+#gdb_expect {
+# -re "type = int .2..*$gdb_prompt $" { pass "ptype int array" }
+# -re ".*$gdb_prompt $" { fail "ptype int array" }
+# timeout { fail "(timeout) ptype int array" }
+#}
+#
+#
+#send "ptype v_signed_int_array\n"
+#gdb_expect {
+# -re "type = int .2..*$gdb_prompt $" { pass "ptype signed int array" }
+# -re ".*$gdb_prompt $" { fail "ptype signed int array" }
+# timeout { fail "(timeout) ptype signed int array" }
+#}
+#
+#
+#send "ptype v_unsigned_int_array\n"
+#gdb_expect {
+# -re "type = unsigned int .2..*$gdb_prompt $" { pass "ptype unsigned int array" }
+# -re ".*$gdb_prompt $" { fail "ptype unsigned int array" }
+# timeout { fail "(timeout) ptype unsigned int array" }
+#}
+#
+#
+#send "ptype v_long_array\n"
+#gdb_expect {
+# -re "type = (long|int|long int) .2..*$gdb_prompt $" {
+# pass "ptype long array" }
+# -re ".*$gdb_prompt $" { fail "ptype long array" }
+# timeout { fail "(timeout) ptype long array" }
+#}
+#
+#
+#send "ptype v_signed_long_array\n"
+#gdb_expect {
+# -re "type = (long|int|long int) .2..*$gdb_prompt $" {
+# pass "ptype signed long array" }
+# -re ".*$gdb_prompt $" { fail "ptype signed long array" }
+# timeout { fail "(timeout) ptype signed long array" }
+#}
+#
+#
+#send "ptype v_unsigned_long_array\n"
+#gdb_expect {
+# -re "type = unsigned long .2..*$gdb_prompt $" { pass "ptype unsigned long array" }
+# -re ".*$gdb_prompt $" { fail "ptype unsigned long array" }
+# timeout { fail "(timeout) ptype unsigned long array" }
+#}
+#
+#
+#send "ptype v_float_array\n"
+#gdb_expect {
+# -re "type = float .2..*$gdb_prompt $" { pass "ptype float array" }
+# -re ".*$gdb_prompt $" { fail "ptype float array" }
+# timeout { fail "(timeout) ptype float array" }
+#}
+#
+#
+#send "ptype v_double_array\n"
+#gdb_expect {
+# -re "type = double .2..*$gdb_prompt $" { pass "ptype double array" }
+# -re ".*$gdb_prompt $" { fail "ptype double array" }
+# timeout { fail "(timeout) ptype double array" }
+#}
+#
+
+if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" "i*86-*-sysv4*" }
+setup_xfail_format "DWARF 1"
+if {$hp_aCC_compiler} {setup_xfail "hppa*-*-*"}
+gdb_test "ptype t_char_array" "type = (|unsigned )char \\\[0?\\\]"
+
+#
+##
+## test ptype command with pointers
+##
+#setup_xfail "i960-*-*" 1821
+#setup_xfail "mips-idt-*" "mips-sgi-*"
+#send "ptype v_char_pointer\n"
+#gdb_expect {
+# -re "type = char \*.*$gdb_prompt $" { pass "ptype char pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype char pointer" }
+# timeout { fail "(timeout) ptype char pointer" }
+#}
+#
+#
+#setup_xfail "mips-*-*"
+#send "ptype v_signed_char_pointer\n"
+#gdb_expect {
+# -re "type = (|signed )char \*.*$gdb_prompt $"
+# { pass "ptype signed char pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype signed char pointer" }
+# timeout { fail "(timeout) ptype signed char pointer" }
+#}
+#
+#
+#send "ptype v_unsigned_char_pointer\n"
+#gdb_expect {
+# -re "type = unsigned char \*.*$gdb_prompt $" { pass "ptype unsigned char pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype unsigned char pointer" }
+# timeout { fail "(timeout) ptype unsigned char pointer" }
+#}
+#
+#
+#send "ptype v_short_pointer\n"
+#gdb_expect {
+# -re "type = (short|short int) \*.*$gdb_prompt $" { pass "ptype short pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype short pointer" }
+# timeout { fail "(timeout) ptype short pointer" }
+#}
+#
+#
+#send "ptype v_signed_short_pointer\n"
+#gdb_expect {
+# -re "type = short \*.*$gdb_prompt $" { pass "ptype signed short pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype signed short pointer" }
+# timeout { fail "(timeout) ptype signed short pointer" }
+#}
+#
+#
+#send "ptype v_unsigned_short_pointer\n"
+#gdb_expect {
+# -re "type = unsigned short \*.*$gdb_prompt $" { pass "ptype unsigned short pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype unsigned short pointer" }
+# timeout { fail "(timeout) ptype unsigned short pointer" }
+#}
+#
+#
+#send "ptype v_int_pointer\n"
+#gdb_expect {
+# -re "type = int \*.*$gdb_prompt $" { pass "ptype int pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype int pointer" }
+# timeout { fail "(timeout) ptype int pointer" }
+#}
+#
+#
+#send "ptype v_signed_int_pointer\n"
+#gdb_expect {
+# -re "type = int \*.*$gdb_prompt $" { pass "ptype signed int pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype signed int pointer" }
+# timeout { fail "(timeout) ptype signed int pointer" }
+#}
+#
+#
+#send "ptype v_unsigned_int_pointer\n"
+#gdb_expect {
+# -re "type = unsigned int \*.*$gdb_prompt $" { pass "ptype unsigned int pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype unsigned int pointer" }
+# timeout { fail "(timeout) ptype unsigned int pointer" }
+#}
+#
+#
+#send "ptype v_long_pointer\n"
+#gdb_expect {
+# -re "type = long \*.*$gdb_prompt $" { pass "ptype long pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype long pointer" }
+# timeout { fail "(timeout) ptype long pointer" }
+#}
+#
+#
+#send "ptype v_signed_long_pointer\n"
+#gdb_expect {
+# -re "type = long \*.*$gdb_prompt $" { pass "ptype signed long pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype signed long pointer" }
+# timeout { fail "(timeout) ptype signed long pointer" }
+#}
+#
+#
+#send "ptype v_unsigned_long_pointer\n"
+#gdb_expect {
+# -re "type = unsigned long \*.*$gdb_prompt $" { pass "ptype unsigned long pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype unsigned long pointer" }
+# timeout { fail "(timeout) ptype unsigned long pointer" }
+#}
+#
+#
+#send "ptype v_float_pointer\n"
+#gdb_expect {
+# -re "type = float \*.*$gdb_prompt $" { pass "ptype float pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype float pointer" }
+# timeout { fail "(timeout) ptype float pointer" }
+#}
+#
+#
+#send "ptype v_double_pointer\n"
+#gdb_expect {
+# -re "type = double \*.*$gdb_prompt $" { pass "ptype double pointer" }
+# -re ".*$gdb_prompt $" { fail "ptype double pointer" }
+# timeout { fail "(timeout) ptype double pointer" }
+#}
+
+#
+# test ptype command with nested structure and union
+#
+if {$hp_aCC_compiler} {
+ set outer "outer_struct::"
+ set struct ""
+ set union ""
+} else {
+ set outer ""
+ set struct "struct"
+ set union "union"
+}
+gdb_test "ptype struct outer_struct" "type = struct outer_struct \{.*\[\r\n\]+\
+.*int outer_int;.*\[\r\n\]+\
+.*(struct|) ${outer}inner_struct inner_struct_instance;.*\[\r\n\]+\
+.*(union|) ${outer}inner_union inner_union_instance;.*\[\r\n\]+\
+.*(long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype outer structure"
+
+gdb_test "ptype ${struct} ${outer}inner_struct" "type = struct ${outer}inner_struct \{.*\[\r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_long;.*\[\r\n\]\}.*" "ptype inner structure"
+
+gdb_test "ptype ${union} ${outer}inner_union" "type = union ${outer}inner_union \{.*\[\r\n\] int inner_union_int;.*\[\r\n\] (long|long int|int) inner_union_long;.*\[\r\n\]\}.*" "ptype inner union"
+
+gdb_test "ptype nested_su" "type = struct outer_struct \{.*\[\r\n\] int outer_int;.*\[\r\n\] (struct |)${outer}inner_struct inner_struct_instance;.*\[\r\n\] (union |)${outer}inner_union inner_union_instance;.*\[\r\n\] (long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype nested structure"
+
+gdb_test "ptype nested_su.outer_int" "type = int.*" "ptype outer int"
+
+gdb_test "ptype nested_su.inner_struct_instance" "type = struct ${outer}inner_struct \{.*\[\r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_long;.*\[\r\n\]\}.*" "ptype nested structure #2"
+
+gdb_test "ptype nested_su.inner_struct_instance.inner_int" "type = int.*" "ptype inner int"
+
+gdb_test "ptype nested_su.inner_union_instance" "type = union ${outer}inner_union \{.*\[\r\n\] int inner_union_int;.*\[\r\n\] (long|long int|int) inner_union_long;.*\[\r\n\]\}.*" "ptype nested union"
+
+
+get_debug_format
+
+# Print the type of the identifier ID, and check the response:
+# - Expect to see PROTOTYPED as the type. PROTOTYPED is not a regular
+# expression; it's a literal string.
+# - If we instead see the unprototyped type PLAIN, and we're using STABS
+# generated by GCC, that's an xfail; as of 9 Feb 2002, GCC never emits
+# prototyped function types in STABS. Like PROTOTYPED, PLAIN is a
+# literal string, not a regular expression.
+# - Otherwise, it's a failure.
+proc ptype_maybe_prototyped { id prototyped plain } {
+ global gdb_prompt
+ global gcc_compiled
+
+ # Turn `prototyped' and `plain', which are literal strings, into
+ # regular expressions by quoting any special characters they contain.
+ regsub -all "\[\]\[*()\]" $prototyped "\\\\&" prototyped
+ regsub -all "\[\]\[*()\]" $plain "\\\\&" plain
+
+ send_gdb "ptype $id\n"
+ gdb_expect {
+ -re "type = $prototyped\[\r\n\]+$gdb_prompt $" {
+ pass "ptype $id"
+ }
+ -re "type = $plain\[\r\n\]+$gdb_prompt $" {
+ if {$gcc_compiled} { setup_xfail_format "stabs" }
+ fail "ptype $id (compiler doesn't emit prototyped types)"
+ }
+ -re "$gdb_prompt $" {
+ fail "ptype $id"
+ }
+ timeout {
+ fail "ptype $id (timeout)"
+ }
+ }
+}
+
+ptype_maybe_prototyped "func_type" "int (*)(int (*)(int, float), float)" \
+ "int (*)()"
+ptype_maybe_prototyped "old_fptr" "double (*)()" "double (*)()"
+ptype_maybe_prototyped "new_fptr" "double (*)(void)" "double (*)()"
+ptype_maybe_prototyped "fptr" "int (*)(int, float)" "int (*)()"
+ptype_maybe_prototyped "fptr2" "int *(*)(int (*)(int, float), float)" \
+ "int *(*)()"
+ptype_maybe_prototyped "xptr" "int (*)(int (*)(), int (*)(void), int)" \
+ "int (*)()"
+ptype_maybe_prototyped "ffptr" "int (*(*)(char))(short int)" \
+ "int (*(*)())()"
+ptype_maybe_prototyped "fffptr" "int (*(*(*)(char))(short int))(long int)" \
+ "int (*(*(*)())())()"
+
+# Test printing type of string constants and array constants, but
+# requires a running process. These call malloc, and can take a long
+# time to execute over a slow serial link, so increase the timeout.
+
+# UDI can't do this (PR 2416). XFAIL is not suitable, because attempting
+# the operation causes a slow painful death rather than a nice simple failure.
+
+if [runto_main] then {
+
+ if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ continue
+ }
+
+ # We need to up this because this can be really slow on some boards.
+ # (malloc() is called as part of the test).
+ set timeout 60;
+
+ gdb_test "ptype \"abc\"" "type = char \\\[4\\\]"
+ gdb_test "ptype {'a','b','c'}" "type = char \\\[3\\\]"
+ gdb_test "ptype {0,1,2}" "type = int \\\[3\\\]"
+ gdb_test "ptype {(long)0,(long)1,(long)2}" "type = long \\\[3\\\]"
+ gdb_test "ptype {(float)0,(float)1,(float)2}" "type = float \\\[3\\\]"
+ gdb_test "ptype {{0,1,2},{3,4,5}}" "type = int \\\[2\\\]\\\[3\\\]"
+ gdb_test "ptype {4,5,6}\[2\]" "type = int"
+ gdb_test "ptype *&{4,5,6}\[1\]" "type = int"
+}
diff --git a/gdb/testsuite/gdb.base/radix.exp b/gdb/testsuite/gdb.base/radix.exp
new file mode 100644
index 00000000000..057751f9aab
--- /dev/null
+++ b/gdb/testsuite/gdb.base/radix.exp
@@ -0,0 +1,201 @@
+# Copyright 1993, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+proc test_input_radix_2 {} {
+ gdb_test "set radix" \
+ "Input and output radices now set to decimal 10, hex a, octal 12." \
+ "set radix #1"
+ gdb_test "set input-radix 2" \
+ "Input radix now set to decimal 2, hex 2, octal 2."
+ gdb_test "show radix" \
+ "Input radix set to decimal 2, hex 2, octal 2.\r\nOutput radix set to decimal 10, hex a, octal 12." \
+ "show radix #1"
+ gdb_test "p 010" "8"
+ gdb_test "p 20." "20"
+ gdb_test "p (int) 20." "20"
+ gdb_test "p 0xf" "15"
+ gdb_test "p 10" "2"
+ gdb_test "p -101" "-5"
+ gdb_test "p 101" "5"
+ gdb_test "p 10101" "21"
+ gdb_test "p 4" "Invalid number \"4\"\\."
+ gdb_test "p -2" "Invalid number \"2\"\\."
+}
+
+# Test input radix 3 (an non-typical radix)
+
+proc test_input_radix_3 {} {
+ gdb_test "set radix" \
+ "Input and output radices now set to decimal 10, hex a, octal 12." \
+ "set radix #2"
+ gdb_test "set input-radix 3" \
+ "Input radix now set to decimal 3, hex 3, octal 3."
+ gdb_test "show radix" \
+ "Input radix set to decimal 3, hex 3, octal 3.\r\nOutput radix set to decimal 10, hex a, octal 12." \
+ "show radix #2"
+ gdb_test "p 010" "8"
+ gdb_test "p 20." "20"
+ gdb_test "p (int) 20." "20"
+ gdb_test "p 0xf" "15"
+ gdb_test "p 10" "3"
+ gdb_test "p 0" "0"
+ gdb_test "p 1" "1"
+ gdb_test "p 2" "2"
+ gdb_test "p 10" "3"
+ gdb_test "p 20" "6"
+ gdb_test "p 100" "9"
+ gdb_test "p -100" "-9"
+ gdb_test "p 3" "Invalid number \"3\"."
+ gdb_test "p 30" "Invalid number \"30\"."
+}
+
+proc test_input_radix_8 {} {
+ gdb_test "set radix" \
+ "Input and output radices now set to decimal 10, hex a, octal 12." \
+ "set radix #3"
+ gdb_test "set input-radix 8" \
+ "Input radix now set to decimal 8, hex 8, octal 10."
+ gdb_test "show radix" \
+ "Input radix set to decimal 8, hex 8, octal 10.\r\nOutput radix set to decimal 10, hex a, octal 12." \
+ "set radix #3"
+ gdb_test "p 010" "8"
+ gdb_test "p 20." "20"
+ gdb_test "p (int) 20." "20"
+ gdb_test "p 0xf" "15"
+ gdb_test "p 10" "8"
+ gdb_test "p 20" "16"
+ gdb_test "p -20" "-16"
+ gdb_test "p 100" "64"
+ gdb_test "p 8" "Invalid number \"8\"."
+ gdb_test "p -9" "Invalid number \"9\"."
+}
+
+proc test_input_radix_10 {} {
+ gdb_test "set radix" \
+ "Input and output radices now set to decimal 10, hex a, octal 12." \
+ "set radix #4"
+ gdb_test "set input-radix 10" \
+ "Input radix now set to decimal 10, hex a, octal 12."
+ gdb_test "show radix" \
+ "Input and output radices set to decimal 10, hex a, octal 12." \
+ "show radix #4"
+ gdb_test "p 010" "8"
+ gdb_test "p 20." "20"
+ gdb_test "p (int) 20." "20"
+ gdb_test "p 0xf" "15"
+ gdb_test "p 10" "10"
+ gdb_test "p -12" "-12"
+}
+
+proc test_input_radix_16 {} {
+ gdb_test "set radix" \
+ "Input and output radices now set to decimal 10, hex a, octal 12." \
+ "set radix #5"
+ gdb_test "set input-radix 16" \
+ "Input radix now set to decimal 16, hex 10, octal 20."
+ gdb_test "show radix" \
+ "Input radix set to decimal 16, hex 10, octal 20.\r\nOutput radix set to decimal 10, hex a, octal 12." \
+ "show radix #5"
+ gdb_test "p 010" "8"
+ gdb_test "p 20." "20"
+ gdb_test "p (int) 20." "20"
+ gdb_test "p 0xf" "15"
+ gdb_test "p 10" "16"
+ gdb_test "p 100" "256"
+}
+
+proc test_output_radix_8 {} {
+ gdb_test "set radix" \
+ "Input and output radices now set to decimal 10, hex a, octal 12." \
+ "set radix #6"
+ gdb_test "set output-radix 8" \
+ "Output radix now set to decimal 8, hex 8, octal 10."
+ gdb_test "show radix" \
+ "Input radix set to decimal 10, hex a, octal 12.\r\nOutput radix set to decimal 8, hex 8, octal 10." \
+ "show radix #6"
+ gdb_test "p 010" "010"
+ # FIXME: If gdb can't handle float printing in different radices, it
+ # should at least warn once the first time that is attempted.
+ setup_xfail "*-*-*"
+ gdb_test "p 20." "24" "Float printing when output radix is 8"
+ gdb_test "p (int) 20." "24"
+ gdb_test "p 0xf" "17"
+ gdb_test "p 10" "12"
+ gdb_test "p 100" "144"
+}
+
+proc test_output_radix_10 {} {
+ gdb_test "set radix" \
+ "Input and output radices now set to decimal 10, hex a, octal 12." \
+ "set radix #7"
+ gdb_test "set output-radix 10" \
+ "Output radix now set to decimal 10, hex a, octal 12."
+ gdb_test "show radix" \
+ "Input and output radices set to decimal 10, hex a, octal 12." \
+ "show radix #7"
+ gdb_test "p 010" "8"
+ gdb_test "p 20." "20"
+ gdb_test "p (int) 20." "20"
+ gdb_test "p 0xf" "15"
+ gdb_test "p 10" "10"
+ gdb_test "p 100" "100"
+}
+
+proc test_output_radix_16 {} {
+ gdb_test "set radix" \
+ "Input and output radices now set to decimal 10, hex a, octal 12." \
+ "set radix #8"
+ gdb_test "set output-radix 16" \
+ "Output radix now set to decimal 16, hex 10, octal 20."
+ gdb_test "show radix" \
+ "Input radix set to decimal 10, hex a, octal 12.\r\nOutput radix set to decimal 16, hex 10, octal 20." \
+ "show radix #8"
+ gdb_test "p 010" "8"
+ # FIXME: If gdb can't handle float printing in different radices, it
+ # should at least warn once the first time that is attempted.
+ setup_xfail "*-*-*"
+ gdb_test "p 20." "14" "Float printing when output radix is 16"
+ gdb_test "p (int) 20." "14"
+ gdb_test "p 0xf" "f"
+ gdb_test "p 10" "a"
+ gdb_test "p 100" "64"
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+
+test_input_radix_2
+test_input_radix_3
+test_input_radix_8
+test_input_radix_10
+test_input_radix_16
+test_output_radix_8
+test_output_radix_10
+test_output_radix_16
diff --git a/gdb/testsuite/gdb.base/recurse.c b/gdb/testsuite/gdb.base/recurse.c
new file mode 100644
index 00000000000..798177888c9
--- /dev/null
+++ b/gdb/testsuite/gdb.base/recurse.c
@@ -0,0 +1,31 @@
+/* Trivial code used to test watchpoints in recursive code and
+ auto-deletion of watchpoints as they go out of scope. */
+
+#ifdef PROTOTYPES
+static int
+recurse (int a)
+#else
+static int
+recurse (a)
+ int a;
+#endif
+{
+ int b = 0;
+
+ if (a == 1)
+ return 1;
+
+ b = a;
+ b *= recurse (a - 1);
+ return b;
+}
+
+int main()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ recurse (10);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/recurse.exp b/gdb/testsuite/gdb.base/recurse.exp
new file mode 100644
index 00000000000..bd1ecee60d9
--- /dev/null
+++ b/gdb/testsuite/gdb.base/recurse.exp
@@ -0,0 +1,168 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Jeff Law. (law@cs.utah.edu)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "recurse"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+proc recurse_tests {} {
+
+ # Disable hardware watchpoints if necessary.
+ if [target_info exists gdb,no_hardware_watchpoints] {
+ gdb_test "set can-use-hw-watchpoints 0" "" ""
+ }
+
+ if [runto recurse] then {
+ # First we need to step over the assignment of b, so it has a known
+ # value.
+ gdb_test "next" "if \\(a == 1\\)" "next over b = 0 in first instance"
+ gdb_test "watch b" ".*\[Ww\]atchpoint \[0-9]*: b" \
+ "set first instance watchpoint"
+
+ # Continue until initial set of b.
+ if [gdb_test "continue" \
+ "Continuing.*\[Ww\]atchpoint.*: b.*Old value = 0.*New value = 10.*" \
+ "continue to first instance watchpoint, first time"] then {
+ gdb_suppress_tests;
+ }
+
+ # Continue inward for a few iterations
+ gdb_test "continue" "Breakpoint.* recurse \\(a=9\\).*" \
+ "continue to recurse (a = 9)"
+ gdb_test "continue" "Breakpoint.* recurse \\(a=8\\).*" \
+ "continue to recurse (a = 8)"
+ gdb_test "continue" "Breakpoint.* recurse \\(a=7\\).*" \
+ "continue to recurse (a = 7)"
+ gdb_test "continue" "Breakpoint.* recurse \\(a=6\\).*" \
+ "continue to recurse (a = 6)"
+ gdb_test "continue" "Breakpoint.* recurse \\(a=5\\).*" \
+ "continue to recurse (a = 5)"
+
+ # Put a watchpoint on another instance of b
+ # First we need to step over the assignment of b, so it has a known
+ # value.
+ gdb_test "next" "if \\(a == 1\\)" "next over b = 0 in second instance"
+ gdb_test "watch b" ".*\[Ww\]atchpoint \[0-9]*: b" \
+ "set second instance watchpoint"
+
+ # Continue until initial set of b (second instance).
+ if [gdb_test "continue" \
+ "Continuing.*\[Ww\]atchpoint.*: b.*Old value = 0.*New value = 5.*"\
+ "continue to second instance watchpoint, first time"] then {
+ gdb_suppress_tests;
+ }
+
+ # Continue inward for a few iterations
+ gdb_test "continue" "Breakpoint.* recurse \\(a=4\\).*" \
+ "continue to recurse (a = 4)"
+ gdb_test "continue" "Breakpoint.* recurse \\(a=3\\).*" \
+ "continue to recurse (a = 3)"
+ gdb_test "continue" "Breakpoint.* recurse \\(a=2\\).*" \
+ "continue to recurse (a = 2)"
+ gdb_test "continue" "Breakpoint.* recurse \\(a=1\\).*" \
+ "continue to recurse (a = 1)"
+
+ # Continue until second set of b (second instance).
+ if [gdb_test "continue" \
+ "Continuing.*\[Ww\]atchpoint.*: b.*Old value = 5.*New value = 120.*return.*" \
+ "continue to second instance watchpoint, second time"] then {
+ gdb_suppress_tests;
+ }
+
+ # Continue again. We should have a watchpoint go out of scope now
+ if [gdb_test "continue" \
+ "Continuing.*\[Ww\]atchpoint.*deleted.*recurse \\(a=6\\) .*" \
+ "second instance watchpoint deleted when leaving scope"] then {
+ gdb_suppress_tests;
+ }
+
+ # Continue until second set of b (first instance).
+ # 24320 is allowed as the final value for b as that's the value
+ # b would have on systems with 16bit integers.
+ #
+ # We could fix the test program to deal with this too.
+ if [gdb_test "continue" \
+ "Continuing.*\[Ww\]atchpoint.*b.*Old value = 10.*New value = \(3628800|24320\).*return.*" \
+ "continue to first instance watchpoint, second time"] then {
+ gdb_suppress_tests
+ }
+
+ # Continue again. We should have a watchpoint go out of scope now.
+ #
+ # The former version expected the test to return to main().
+ # Now it expects the test to return to main or to stop in the
+ # function's epilogue.
+ #
+ # The problem is that gdb needs to (but doesn't) understand
+ # function epilogues in the same way as for prologues.
+ #
+ # If there is no hardware watchpoint (such as a x86 debug register),
+ # then watchpoints are done "the hard way" by single-stepping the
+ # target until the value of the watched variable changes. If you
+ # are single-stepping, you will eventually step into an epilogue.
+ # When you do that, the "top" stack frame may become partially
+ # deconstructed (as when you pop the frame pointer, for instance),
+ # and from that point on, GDB can no longer make sense of the stack.
+ #
+ # A test which stops in the epilogue is trying to determine when GDB
+ # leaves the stack frame in which the watchpoint was created. It does
+ # this basically by watching for the frame pointer to change. When
+ # the frame pointer changes, the test expects to be back in main, but
+ # instead it is still in the epilogue of the callee.
+ if [gdb_test "continue" \
+ "Continuing.*\[Ww\]atchpoint.*deleted.*\(main \\(\\) \|21.*\}\).*" \
+ "first instance watchpoint deleted when leaving scope"] then {
+ gdb_suppress_tests;
+ }
+ }
+ gdb_stop_suppressing_tests;
+}
+
+# Preserve the old timeout, and set a new one that should be
+# sufficient to avoid timing out during this test.
+set oldtimeout $timeout
+set timeout [expr "$timeout + 60"]
+verbose "Timeout is now $timeout seconds" 2
+
+recurse_tests
+
+# Restore the preserved old timeout value.
+set timeout $oldtimeout
+verbose "Timeout is now $timeout seconds" 2
+
diff --git a/gdb/testsuite/gdb.base/regs.exp b/gdb/testsuite/gdb.base/regs.exp
new file mode 100644
index 00000000000..93ee35a989e
--- /dev/null
+++ b/gdb/testsuite/gdb.base/regs.exp
@@ -0,0 +1,86 @@
+# Tests of register displays for GDB.
+# Copyright 1994, 1995 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Stan Shebs. (shebs@cygnus.com)
+
+# This does not (yet) have an associated executable, since the IDT board
+# will display registers even without a program being loaded.
+# A more comprehensive register test would actually test reading
+# and writing of registers in a real program, although some care
+# would be required in the writing of the tests.
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+# These tests exercise IDT-specific MIPS registers for several
+# different processor models.
+
+# This should detect the actual processor in use and change
+# the expected results appropriately. FIXME
+
+proc idt_register_tests { } {
+ # Test the generic IDT chip.
+ gdb_test "info registers" ".*"
+ gdb_test "info register zero" "zero(r0): 0x0;"
+ # FIXME access each generic register individually
+ # Test the 3041.
+ gdb_test "set processor r3041" ".*"
+ gdb_test "info registers" ".*"
+ gdb_test "info register bus" "bus.*0x.*"
+ gdb_test "info register ccfg" "ccfg.*0x.*"
+ gdb_test "info register port" "port.*0x.*"
+ gdb_test "info register cmp" "cmp.*0x.*"
+ gdb_test "info register elo" "elo: invalid register"
+ gdb_test "info register ehi" "ehi: invalid register"
+ gdb_test "info register cfg" "cfg: invalid register"
+ gdb_test "info register ctxt" "ctxt: invalid register"
+ # Test the 3051.
+ gdb_test "set processor r3051" ".*"
+ gdb_test "info registers" ".*"
+ gdb_test "info register bus" "bus: invalid register"
+ gdb_test "info register ccfg" "ccfg: invalid register"
+ gdb_test "info register port" "port: invalid register"
+ gdb_test "info register cmp" "cmp: invalid register"
+ gdb_test "info register elo" "elo.*0x.*"
+ gdb_test "info register ehi" "ehi.*0x.*"
+ gdb_test "info register cfg" "cfg: invalid register"
+ gdb_test "info register ctxt" "ctxt: invalid register"
+ # Test the 3071.
+ gdb_test "set processor r3071" ".*"
+ gdb_test "info registers" ".*"
+ gdb_test "info register bus" "bus: invalid register"
+ gdb_test "info register ccfg" "ccfg: invalid register"
+ gdb_test "info register port" "port: invalid register"
+ gdb_test "info register cmp" "cmp: invalid register"
+ gdb_test "info register elo" "elo.*0x.*"
+ gdb_test "info register ehi" "ehi.*0x.*"
+ gdb_test "info register cfg" "cfg.*0x.*"
+ gdb_test "info register ctxt" "ctxt.*0x.*"
+}
+
+if [istarget "mips*-idt-*"] then {
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ idt_register_tests
+} else {
+ verbose "regs.exp tests ignored for this target"
+}
diff --git a/gdb/testsuite/gdb.base/relational.exp b/gdb/testsuite/gdb.base/relational.exp
new file mode 100644
index 00000000000..562a6fc3dce
--- /dev/null
+++ b/gdb/testsuite/gdb.base/relational.exp
@@ -0,0 +1,484 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This file is part of the gdb testsuite
+#
+# tests for correctenss of relational operators, associativity and precedence
+# with integer type variables
+#
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "int-type"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+#
+# test expressions with "int" types
+#
+
+gdb_test "set variable x=14" "" "set variable x=14"
+gdb_test "set variable y=2" "" "set variable y=2"
+gdb_test "set variable z=2" "" "set variable z=2"
+gdb_test "set variable w=3" "" "set variable w=3"
+
+send_gdb "print x\n"
+gdb_expect {
+ -re ".*14.*$gdb_prompt $" {
+ pass "print value of x"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x" }
+ timeout { fail "(timeout) print value of x" }
+ }
+
+
+send_gdb "print y\n"
+gdb_expect {
+ -re ".*2.*$gdb_prompt $" {
+ pass "print value of y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of y" }
+ timeout { fail "(timeout) print value of y" }
+ }
+
+send_gdb "print z\n"
+gdb_expect {
+ -re ".*2.*$gdb_prompt $" {
+ pass "print value of z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of z" }
+ timeout { fail "(timeout) print value of z" }
+ }
+
+send_gdb "print w\n"
+gdb_expect {
+ -re ".*3.*$gdb_prompt $" {
+ pass "print value of w"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of w" }
+ timeout { fail "(timeout) print value of w" }
+ }
+
+
+
+send_gdb "print x < y\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x<y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<y" }
+ timeout { fail "(timeout) print value of x<y" }
+ }
+
+send_gdb "print x <= y\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x<=y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<=y" }
+ timeout { fail "(timeout) print value of x<=y" }
+ }
+
+send_gdb "print x > y\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x>y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>y" }
+ timeout { fail "(timeout) print value of x>y" }
+ }
+
+send_gdb "print x >= y\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x>=y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>=y" }
+ timeout { fail "(timeout) print value of x>=y" }
+ }
+
+send_gdb "print x == y\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x==y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x==y" }
+ timeout { fail "(timeout) print value of x==y" }
+ }
+
+send_gdb "print x != y\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x!=y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x!=y" }
+ timeout { fail "(timeout) print value of x!=y" }
+ }
+
+
+
+# Test associativity of <, >, <=, >=, ==, !=
+
+gdb_test "set variable x=3" "" "set variable x"
+gdb_test "set variable y=5" "" "set variable y"
+gdb_test "set variable z=2" "" "set variable z"
+
+
+
+send_gdb "print x < y < z\n"
+gdb_expect {
+ -re ".*$true.*\r\n$gdb_prompt $" {
+ pass "print value of x<y<z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<y<z" }
+ timeout { fail "(timeout) print value of x<y<z" }
+ }
+
+send_gdb "print x <= y <= z\n"
+gdb_expect {
+ -re ".*$true\r\n$gdb_prompt $" {
+ pass "print value of x<=y<=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<=y<=z" }
+ timeout { fail "(timeout) print value of x<=y<=z" }
+ }
+
+send_gdb "print x > y > z\n"
+gdb_expect {
+ -re ".*$false.*\r\n$gdb_prompt $" {
+ pass "print value of x>y>z"
+ }
+ -re 8".*$gdb_prompt $" { fail "print value of x>y>z" }
+ timeout { fail "(timeout) print value of x>y>z" }
+ }
+
+send_gdb "print x >= y >= z\n"
+gdb_expect {
+ -re ".*$false.*\r\n$gdb_prompt $" {
+ pass "print value of x>=y>=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>=y>=z" }
+ timeout { fail "(timeout) print value of x>=y>=z" }
+ }
+
+gdb_test "set variable x=2" "" "set variable x"
+gdb_test "set variable y=2" "" "set variable y"
+gdb_test "set variable z=1" "" "set variable z"
+
+
+send_gdb "print x == y == z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x==y==z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x==y==z" }
+ timeout { fail "(timeout) print value of x==y==z" }
+ }
+
+gdb_test "set variable z=0" "" "set variable z"
+
+
+send_gdb "print x != y != z\n"
+gdb_expect {
+ -re ".*$false\r\n$gdb_prompt $" {
+ pass "print value of x!=y!=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x!=y!=z" }
+ timeout { fail "(timeout) print value of x!=y!=z" }
+ }
+
+
+# test precedence rules on pairs of relational operators
+
+gdb_test "set variable x=0" "" "set variable x"
+gdb_test "set variable y=2" "" "set variable y"
+gdb_test "set variable z=2" "" "set variable z"
+
+
+send_gdb "print x < y == z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x<y==z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<y==z" }
+ timeout { fail "(timeout) print value of x<y==z" }
+ }
+
+# 0 2 2
+send_gdb "print x < y != z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x<y!=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<y!=z" }
+ timeout { fail "(timeout) print value of x<y!=z" }
+ }
+
+gdb_test "set variable x=2" "" "set variable x"
+gdb_test "set variable y=3" "" "set variable y"
+gdb_test "set variable z=1" "" "set variable z"
+
+
+# 2 3 1
+send_gdb "print x < y <= z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x<y<=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<y<=z" }
+ timeout { fail "(timeout) print value of x<y<=z" }
+ }
+
+
+# 2 3 1
+send_gdb "print x < y >= z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x<y>=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<y>=z" }
+ timeout { fail "(timeout) print value of x<y>=z" }
+ }
+
+
+gdb_test "set variable z=0" "" " set variable z"
+
+
+# 2 3 0
+send_gdb "print x < y > z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x<y>z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<y>z" }
+ timeout { fail "(timeout) print value of x<y>z" }
+ }
+
+
+gdb_test "set variable x=1" "" " set variable x"
+
+# 1 3 0
+send_gdb "print x > y >= z\n"
+gdb_expect {
+ -re ".*$true.*$gdb_prompt $" {
+ pass "print value of x>y>=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>y>=z" }
+ timeout { fail "(timeout) print value of x>y>=z" }
+ }
+
+
+gdb_test "set variable z=2" "" " set variable z"
+
+# 1 3 2
+send_gdb "print x > y == z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x>y==z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>y==z" }
+ timeout { fail "(timeout) print value of x>y==z" }
+ }
+
+
+gdb_test "set variable x=2" "" " set variable x"
+gdb_test "set variable z=0" "" " set variable z"
+
+# 2 3 0
+send_gdb "print x > y != z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x>y!=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>y!=z" }
+ timeout { fail "(timeout) print value of x>y!=z" }
+ }
+
+
+gdb_test "set variable x=4" "" "set x to 4"
+
+# 4 3 0
+send_gdb "print x > y <= z\n"
+gdb_expect {
+ -re ".*$false.*$gdb_prompt $" {
+ pass "print value of x>y<=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>y<=z" }
+ timeout { fail "(timeout) print value of x>y<=z" }
+ }
+
+# 4 3 0
+send_gdb "print x >= y == z\n"
+gdb_expect {
+ -re ".*$false\r\n$gdb_prompt $" {
+ pass "print value of x>=y==z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>=y==z" }
+ timeout { fail "(timeout) print value of x>=y==z" }
+ }
+
+
+gdb_test "set variable x=2" "" " set variable x"
+
+# 2 3 0
+send_gdb "print x >= y != z\n"
+gdb_expect {
+ -re ".*$false\r\n$gdb_prompt $" {
+ pass "print value of x>=y!=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>=y!=z" }
+ timeout { fail "(timeout) print value of x>=y!=z" }
+ }
+
+
+gdb_test "set variable x=0" "" " set variable x"
+gdb_test "set variable z=4" "" " set variable z"
+
+# 0 3 4
+send_gdb "print x >= y <= z\n"
+gdb_expect {
+ -re ".*$true\r\n$gdb_prompt $" {
+ pass "print value of x>=y<=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>=y<=z" }
+ timeout { fail "(timeout) print value of x>=y<=z" }
+ }
+
+# 0 3 4
+send_gdb "print x <= y == z\n"
+gdb_expect {
+ -re ".*$false\r\n$gdb_prompt $" {
+ pass "print value of x<=y==z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<=y==z" }
+ timeout { fail "(timeout) print value of x<=y==z" }
+ }
+
+gdb_test "set variable x=2" "" " set variable x"
+
+# 2 3 4
+send_gdb "print x <= y != z\n"
+gdb_expect {
+ -re ".*$true\r\n$gdb_prompt $" {
+ pass "print value of x<=y!=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x<=y!=z" }
+ timeout { fail "(timeout) print value of x<=y!=z" }
+ }
+
+
+# 2 3 4
+send_gdb "print x == y != z\n"
+gdb_expect {
+ -re ".*$true\r\n$gdb_prompt $" {
+ pass "print value of x==y!=z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x==y!=z" }
+ timeout { fail "(timeout) print value of x==y!=z" }
+ }
+
+
+
+# test use of parenthesis to enforce different order of evaluation
+
+
+gdb_test "set variable z=0" "" " set variable z"
+
+# 2 3 0
+send_gdb "print x >= (y < z)\n"
+gdb_expect {
+ -re ".*$true\r\n$gdb_prompt $" {
+ pass "print value of x>=(y<z)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>=(y<z)" }
+ timeout { fail "(timeout) print value of x>=(y<z)" }
+ }
+
+
+# 2 3 0
+send_gdb "print x >= (y != z)\n"
+gdb_expect {
+ -re ".*$true\r\n$gdb_prompt $" {
+ pass "print value of x>=(y!=z)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x>=(y*!=z)" }
+ timeout { fail "(timeout) print value of x>=(y!=z)" }
+ }
+
+# 2 3 0
+send_gdb "print x == (y == z)\n"
+gdb_expect {
+ -re ".*$false\r\n$gdb_prompt $" {
+ pass "print value of x==(y==z)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x==(y==z)" }
+ timeout { fail "(timeout) print value of x==(y==z)" }
+ }
+
+
+gdb_test "set variable x=1" "" " set variable x"
+gdb_test "set variable z=4" "" " set variable z"
+
+# 1 3 4
+send_gdb "print (x == y) < z\n"
+gdb_expect {
+ -re ".*$true\r\n$gdb_prompt $" {
+ pass "print value of (x==y)<z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of (x==y)<z" }
+ timeout { fail "(timeout) print value of (x==y)<z" }
+ }
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.base/relocate.c b/gdb/testsuite/gdb.base/relocate.c
new file mode 100644
index 00000000000..d2023920fb4
--- /dev/null
+++ b/gdb/testsuite/gdb.base/relocate.c
@@ -0,0 +1,17 @@
+static int static_foo = 1;
+static int static_bar = 2;
+
+int global_foo = 3;
+int global_bar = 4;
+
+int
+function_foo ()
+{
+ return 5;
+}
+
+int
+function_bar ()
+{
+ return 6;
+}
diff --git a/gdb/testsuite/gdb.base/relocate.exp b/gdb/testsuite/gdb.base/relocate.exp
new file mode 100644
index 00000000000..c4e25ded7ca
--- /dev/null
+++ b/gdb/testsuite/gdb.base/relocate.exp
@@ -0,0 +1,108 @@
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# relocate.exp -- Expect script to test loading symbols from unrelocated
+# object files.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile relocate
+set srcfile ${srcdir}/${subdir}/${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}.o
+
+remote_exec build "rm -f ${binfile}"
+if { [gdb_compile "${srcfile}" "${binfile}" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc get_var_address { var } {
+ global gdb_prompt hex
+
+ send_gdb "print &${var}\n"
+ # Match output like:
+ # $1 = (int *) 0x0
+ # $5 = (int (*)()) 0
+ # $6 = (int (*)()) 0x24 <function_bar>
+ gdb_expect {
+ -re "\\\$\[0-9\]+ = \\(.*\\) (0|$hex)( <${var}>)?\[\r\n\]+${gdb_prompt} $"
+ {
+ pass "get address of ${var}"
+ if { $expect_out(1,string) == "0" } {
+ return "0x0"
+ } else {
+ return $expect_out(1,string)
+ }
+ }
+ -re "${gdb_prompt} $"
+ { fail "get address of ${var} (unknown output)" }
+ timeout
+ { fail "get address of ${var} (timeout)" }
+ }
+ return ""
+}
+
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+# Load the object file.
+gdb_test "add-symbol-file ${binfile} 0" \
+ "Reading symbols from .*${testfile}\\.o\\.\\.\\.done\\." \
+ "add-symbol-file ${testfile}.o 0" \
+ "add symbol table from file \".*${testfile}\\.o\" at\[ \t\r\n\]+\.text_addr = 0x0\[\r\n\]+\\(y or n\\) " \
+ "y"
+
+# Print the addresses of static variables.
+set static_foo_addr [get_var_address static_foo]
+set static_bar_addr [get_var_address static_bar]
+
+# Make sure they have different addresses.
+if { "${static_foo_addr}" == "${static_bar_addr}" } {
+ fail "static variables have different addresses"
+} else {
+ pass "static variables have different addresses"
+}
+
+# Print the addresses of global variables.
+set global_foo_addr [get_var_address global_foo]
+set global_bar_addr [get_var_address global_bar]
+
+# Make sure they have different addresses.
+if { "${global_foo_addr}" == "${global_bar_addr}" } {
+ fail "global variables have different addresses"
+} else {
+ pass "global variables have different addresses"
+}
+
+# Print the addresses of functions.
+set function_foo_addr [get_var_address function_foo]
+set function_bar_addr [get_var_address function_bar]
+
+# Make sure they have different addresses.
+if { "${function_foo_addr}" == "${function_bar_addr}" } {
+ fail "functions have different addresses"
+} else {
+ pass "functions have different addresses"
+}
+
+return 0
diff --git a/gdb/testsuite/gdb.base/remote.c b/gdb/testsuite/gdb.base/remote.c
new file mode 100644
index 00000000000..a43c40bc9d8
--- /dev/null
+++ b/gdb/testsuite/gdb.base/remote.c
@@ -0,0 +1,6194 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+/**************************************************************************
+ * TESTS :
+ * -- downloading of a rather large executable
+ ***************************************************************************/
+
+
+/* A large array in .data. If RLE compression becomes available during
+ downloads, this would have to become a bunch of real random data.
+ Here's a quick way of generating such a bunch:
+
+awk < /dev/null '
+BEGIN {
+ for (i = 0; i < 3; i++) {
+ for (j = 0; j < 16384; j++) {
+ printf ("%4d,", rand()*256);
+ if (j % 8 == 7) print;
+ }
+ }
+}'
+
+*/
+
+#include <limits.h>
+/* For targets with 16bit int, use a 1k buffer. */
+#if INT_MAX < 32768
+# define RANDOM_DATA_SIZE (1024)
+#else
+/* Use a character buffer to avoid byte order problems. 48k is
+ chosen so that the buffer required at least 3 16k packets but
+ targets often have no more than 64k of data. */
+/* If you change this data, you will also have to change the checks
+ for the data in remote.c */
+# define RANDOM_DATA_SIZE (3 * 2048 * 8)
+# define BIG_RANDOM_DATA
+#endif
+
+unsigned char random_data[RANDOM_DATA_SIZE] = {
+ 60, 74, 216, 38, 149, 49, 207, 44,
+ 124, 38, 93, 125, 232, 67, 228, 56,
+ 161, 146, 85, 26, 128, 145, 218, 10,
+ 27, 163, 3, 184, 26, 123, 65, 173,
+ 229, 194, 184, 232, 237, 96, 230, 199,
+ 83, 49, 254, 41, 181, 128, 239, 183,
+ 26, 53, 143, 180, 20, 130, 50, 70,
+ 163, 114, 10, 119, 19, 9, 40, 101,
+ 176, 136, 175, 69, 119, 70, 115, 239,
+ 22, 116, 242, 219, 30, 3, 60, 221,
+ 111, 197, 223, 96, 241, 204, 214, 242,
+ 150, 153, 81, 107, 231, 40, 213, 187,
+ 125, 54, 30, 12, 109, 83, 26, 109,
+ 159, 158, 199, 124, 253, 237, 164, 191,
+ 244, 132, 56, 76, 207, 1, 71, 235,
+ 94, 104, 223, 243, 253, 38, 140, 60,
+ 197, 117, 187, 50, 121, 236, 219, 242,
+ 102, 88, 51, 82, 86, 146, 111, 223,
+ 164, 132, 229, 214, 163, 121, 108, 2,
+ 155, 237, 89, 64, 105, 63, 250, 120,
+ 174, 205, 217, 70, 154, 180, 34, 194,
+ 96, 40, 165, 162, 143, 52, 243, 232,
+ 108, 165, 241, 193, 194, 10, 245, 83,
+ 188, 156, 143, 141, 179, 64, 124, 66,
+ 183, 115, 165, 30, 11, 231, 217, 63,
+ 152, 203, 30, 116, 6, 118, 85, 250,
+ 127, 100, 59, 222, 88, 196, 199, 98,
+ 80, 169, 234, 83, 146, 141, 5, 180,
+ 129, 91, 161, 60, 241, 19, 214, 54,
+ 95, 4, 167, 54, 106, 94, 70, 178,
+ 87, 73, 10, 205, 215, 205, 33, 221,
+ 122, 9, 151, 75, 139, 8, 74, 2,
+ 117, 27, 58, 69, 45, 6, 70, 222,
+ 169, 199, 60, 66, 184, 14, 8, 136,
+ 236, 39, 6, 94, 35, 234, 77, 157,
+ 70, 49, 132, 23, 164, 169, 93, 222,
+ 58, 219, 23, 9, 28, 243, 41, 137,
+ 141, 52, 107, 214, 52, 122, 45, 133,
+ 206, 217, 167, 126, 76, 110, 76, 198,
+ 208, 103, 178, 62, 70, 145, 148, 10,
+ 37, 96, 166, 211, 217, 32, 254, 168,
+ 112, 172, 238, 166, 181, 189, 70, 50,
+ 90, 96, 191, 226, 205, 26, 183, 254,
+ 47, 180, 203, 111, 24, 118, 85, 143,
+ 106, 130, 139, 168, 155, 197, 78, 220,
+ 16, 124, 82, 135, 1, 47, 181, 132,
+ 93, 4, 131, 208, 63, 139, 82, 35,
+ 138, 61, 124, 194, 84, 232, 242, 24,
+ 121, 31, 242, 204, 237, 235, 148, 4,
+ 177, 159, 70, 251, 185, 255, 50, 140,
+ 237, 172, 143, 93, 119, 47, 46, 94,
+ 18, 221, 76, 101, 219, 48, 191, 42,
+ 173, 57, 226, 126, 67, 146, 110, 127,
+ 252, 78, 213, 215, 7, 188, 64, 158,
+ 162, 38, 247, 54, 194, 20, 55, 194,
+ 0, 124, 63, 148, 124, 111, 136, 1,
+ 33, 19, 224, 205, 185, 77, 82, 3,
+ 163, 234, 230, 160, 160, 210, 95, 77,
+ 249, 137, 230, 94, 141, 188, 26, 44,
+ 9, 86, 188, 151, 200, 135, 178, 96,
+ 153, 124, 250, 62, 208, 63, 191, 187,
+ 10, 224, 184, 191, 124, 188, 90, 253,
+ 36, 27, 81, 19, 40, 95, 34, 34,
+ 159, 223, 115, 239, 95, 232, 233, 10,
+ 30, 255, 205, 134, 212, 38, 42, 205,
+ 184, 158, 63, 223, 178, 17, 94, 88,
+ 226, 201, 39, 181, 113, 139, 184, 194,
+ 24, 212, 108, 52, 188, 110, 207, 104,
+ 228, 222, 29, 238, 45, 237, 169, 180,
+ 148, 76, 12, 136, 69, 159, 157, 193,
+ 220, 45, 65, 105, 200, 235, 13, 173,
+ 140, 255, 239, 79, 55, 33, 44, 75,
+ 74, 24, 158, 115, 153, 196, 146, 74,
+ 233, 40, 8, 186, 204, 42, 131, 102,
+ 47, 87, 12, 126, 10, 194, 132, 157,
+ 114, 222, 18, 207, 62, 13, 118, 90,
+ 57, 86, 69, 114, 96, 10, 190, 82,
+ 159, 172, 53, 122, 26, 183, 120, 85,
+ 131, 196, 45, 246, 225, 239, 157, 41,
+ 41, 25, 104, 160, 193, 237, 57, 131,
+ 155, 58, 173, 71, 11, 158, 232, 209,
+ 250, 2, 188, 136, 179, 55, 157, 205,
+ 36, 49, 175, 186, 124, 1, 158, 16,
+ 239, 1, 209, 15, 28, 146, 237, 39,
+ 126, 195, 54, 150, 160, 94, 177, 81,
+ 254, 51, 173, 199, 127, 247, 77, 208,
+ 148, 194, 184, 154, 138, 39, 81, 122,
+ 147, 252, 156, 93, 75, 132, 8, 164,
+ 223, 141, 213, 224, 127, 103, 57, 51,
+ 54, 243, 123, 47, 103, 5, 210, 247,
+ 40, 216, 146, 15, 16, 175, 192, 175,
+ 177, 130, 145, 174, 65, 47, 86, 212,
+ 151, 206, 100, 5, 100, 22, 103, 102,
+ 153, 70, 14, 141, 133, 210, 162, 55,
+ 249, 178, 77, 215, 254, 80, 202, 94,
+ 90, 247, 84, 160, 37, 46, 210, 177,
+ 62, 19, 244, 115, 219, 20, 72, 126,
+ 113, 237, 29, 132, 138, 92, 83, 124,
+ 84, 231, 246, 7, 182, 119, 38, 215,
+ 90, 236, 154, 220, 11, 98, 54, 206,
+ 156, 1, 6, 107, 129, 233, 79, 232,
+ 47, 61, 202, 80, 34, 197, 252, 246,
+ 169, 246, 205, 204, 28, 231, 69, 160,
+ 151, 236, 141, 178, 224, 179, 101, 164,
+ 184, 172, 32, 252, 17, 89, 216, 73,
+ 55, 84, 217, 99, 192, 20, 144, 229,
+ 204, 194, 202, 129, 248, 30, 246, 80,
+ 61, 215, 180, 192, 34, 89, 39, 196,
+ 197, 204, 55, 185, 162, 241, 218, 9,
+ 70, 17, 97, 132, 73, 70, 60, 229,
+ 220, 170, 118, 147, 123, 193, 97, 249,
+ 230, 115, 38, 7, 187, 32, 196, 124,
+ 41, 74, 70, 87, 177, 137, 211, 10,
+ 95, 56, 156, 92, 112, 1, 230, 178,
+ 117, 63, 193, 185, 216, 206, 31, 92,
+ 52, 233, 169, 203, 36, 76, 16, 214,
+ 162, 218, 147, 53, 39, 1, 11, 81,
+ 99, 197, 73, 147, 217, 22, 252, 216,
+ 130, 249, 141, 8, 201, 43, 37, 11,
+ 127, 166, 174, 105, 138, 78, 203, 244,
+ 63, 133, 221, 143, 24, 235, 246, 85,
+ 142, 42, 135, 248, 249, 224, 146, 8,
+ 72, 9, 194, 154, 105, 137, 229, 26,
+ 3, 172, 120, 156, 232, 248, 206, 113,
+ 75, 223, 21, 60, 62, 73, 155, 254,
+ 196, 13, 161, 122, 145, 141, 102, 233,
+ 227, 112, 121, 67, 111, 148, 160, 32,
+ 199, 117, 223, 105, 184, 131, 119, 182,
+#ifdef BIG_RANDOM_DATA
+ 60, 26, 169, 194, 173, 164, 249, 135,
+ 178, 57, 50, 44, 12, 159, 167, 240,
+ 249, 188, 86, 192, 73, 47, 74, 77,
+ 250, 114, 15, 247, 240, 191, 49, 125,
+ 92, 113, 173, 235, 52, 208, 206, 146,
+ 160, 65, 188, 78, 220, 66, 44, 15,
+ 128, 250, 61, 172, 65, 225, 2, 201,
+ 62, 30, 136, 64, 195, 59, 242, 47,
+ 73, 243, 181, 99, 7, 1, 136, 59,
+ 117, 167, 211, 224, 127, 38, 22, 16,
+ 204, 35, 228, 46, 93, 168, 246, 240,
+ 99, 114, 106, 91, 26, 75, 200, 37,
+ 150, 68, 48, 101, 53, 3, 150, 55,
+ 121, 54, 132, 96, 163, 207, 223, 96,
+ 90, 152, 68, 133, 103, 105, 51, 114,
+ 144, 24, 88, 28, 87, 74, 121, 194,
+ 181, 107, 206, 214, 215, 96, 155, 17,
+ 184, 140, 108, 235, 18, 41, 58, 6,
+ 42, 14, 60, 154, 66, 56, 41, 140,
+ 255, 106, 197, 223, 43, 244, 25, 176,
+ 244, 36, 137, 190, 194, 89, 145, 11,
+ 65, 197, 38, 202, 154, 121, 218, 52,
+ 204, 17, 151, 255, 105, 156, 14, 159,
+ 183, 16, 44, 132, 206, 72, 10, 192,
+ 44, 250, 209, 168, 8, 164, 181, 110,
+ 251, 103, 83, 102, 144, 202, 208, 250,
+ 8, 69, 223, 33, 89, 130, 15, 15,
+ 121, 62, 30, 73, 62, 87, 8, 252,
+ 33, 170, 105, 44, 134, 24, 35, 100,
+ 42, 80, 27, 181, 46, 9, 61, 10,
+ 28, 179, 178, 27, 184, 198, 101, 29,
+ 46, 91, 224, 174, 246, 1, 194, 239,
+ 234, 187, 99, 108, 17, 198, 53, 48,
+ 151, 235, 81, 225, 171, 124, 119, 128,
+ 197, 164, 197, 31, 162, 177, 193, 58,
+ 120, 151, 224, 31, 119, 127, 123, 157,
+ 71, 177, 222, 101, 125, 160, 4, 47,
+ 128, 155, 80, 127, 136, 198, 208, 236,
+ 160, 83, 111, 39, 237, 83, 113, 159,
+ 250, 218, 137, 128, 130, 69, 52, 30,
+ 218, 61, 170, 187, 130, 183, 232, 128,
+ 107, 189, 159, 75, 199, 63, 191, 132,
+ 40, 238, 13, 176, 98, 35, 94, 214,
+ 110, 79, 110, 229, 100, 224, 125, 197,
+ 118, 85, 187, 56, 216, 221, 12, 140,
+ 39, 120, 247, 127, 69, 22, 3, 164,
+ 247, 102, 141, 123, 207, 64, 223, 218,
+ 181, 63, 192, 66, 136, 188, 219, 181,
+ 243, 158, 89, 220, 148, 124, 252, 104,
+ 38, 197, 17, 217, 24, 215, 92, 133,
+ 115, 129, 50, 148, 183, 21, 236, 90,
+ 169, 23, 253, 97, 65, 190, 131, 250,
+ 80, 11, 67, 28, 250, 6, 147, 187,
+ 51, 43, 170, 240, 7, 10, 174, 166,
+ 12, 153, 21, 228, 36, 4, 223, 148,
+ 212, 148, 215, 95, 28, 247, 173, 161,
+ 63, 153, 117, 10, 135, 132, 236, 18,
+ 216, 233, 194, 219, 178, 15, 148, 8,
+ 138, 188, 80, 8, 29, 10, 101, 15,
+ 38, 35, 133, 198, 133, 9, 3, 84,
+ 95, 163, 191, 185, 192, 84, 16, 67,
+ 111, 25, 10, 17, 28, 203, 113, 125,
+ 23, 44, 17, 53, 58, 25, 174, 130,
+ 22, 238, 77, 105, 97, 15, 176, 240,
+ 137, 255, 9, 145, 21, 1, 20, 237,
+ 215, 154, 117, 40, 55, 203, 212, 94,
+ 26, 107, 115, 145, 155, 1, 16, 55,
+ 91, 224, 167, 44, 53, 57, 141, 236,
+ 143, 79, 9, 202, 30, 47, 114, 226,
+ 251, 6, 24, 52, 255, 113, 239, 6,
+ 51, 68, 122, 180, 205, 123, 254, 21,
+ 3, 81, 186, 28, 44, 221, 205, 86,
+ 86, 96, 241, 6, 8, 29, 10, 226,
+ 124, 242, 26, 81, 29, 242, 80, 107,
+ 215, 75, 220, 120, 121, 137, 192, 27,
+ 251, 163, 207, 5, 62, 203, 184, 72,
+ 151, 161, 107, 138, 185, 44, 14, 10,
+ 17, 41, 93, 93, 207, 190, 196, 248,
+ 60, 183, 107, 56, 180, 179, 200, 203,
+ 28, 215, 244, 33, 254, 203, 34, 120,
+ 217, 202, 209, 217, 246, 1, 228, 96,
+ 82, 109, 190, 220, 206, 31, 139, 99,
+ 174, 138, 2, 124, 5, 198, 226, 222,
+ 129, 80, 86, 148, 96, 24, 96, 248,
+ 153, 5, 144, 74, 119, 134, 145, 162,
+ 204, 41, 135, 86, 21, 217, 210, 15,
+ 198, 49, 106, 31, 210, 155, 103, 132,
+ 92, 81, 114, 112, 59, 94, 215, 176,
+ 122, 75, 37, 28, 30, 2, 99, 182,
+ 35, 226, 191, 142, 173, 57, 156, 74,
+ 213, 215, 84, 89, 32, 2, 224, 97,
+ 178, 8, 157, 253, 22, 119, 111, 9,
+ 15, 160, 235, 98, 233, 123, 29, 233,
+ 19, 155, 242, 7, 225, 179, 195, 137,
+ 187, 38, 69, 24, 180, 27, 159, 252,
+ 77, 191, 47, 107, 201, 160, 81, 203,
+ 23, 60, 89, 119, 121, 221, 147, 182,
+ 153, 88, 230, 148, 206, 106, 181, 138,
+ 97, 182, 15, 48, 50, 19, 116, 39,
+ 48, 205, 203, 225, 88, 200, 209, 224,
+ 129, 108, 206, 184, 51, 81, 59, 79,
+ 235, 221, 229, 198, 122, 61, 199, 130,
+ 168, 238, 7, 187, 214, 118, 114, 191,
+ 126, 174, 25, 227, 132, 213, 161, 184,
+ 245, 78, 198, 63, 28, 176, 103, 0,
+ 89, 63, 212, 162, 12, 193, 76, 173,
+ 99, 115, 164, 215, 234, 95, 134, 182,
+ 132, 79, 49, 137, 82, 35, 4, 133,
+ 242, 192, 121, 173, 254, 58, 137, 116,
+ 82, 55, 254, 120, 182, 125, 0, 169,
+ 151, 159, 90, 49, 168, 26, 218, 89,
+ 7, 33, 5, 137, 95, 0, 185, 175,
+ 253, 195, 3, 32, 208, 55, 56, 145,
+ 209, 165, 71, 84, 22, 98, 16, 116,
+ 232, 140, 99, 77, 172, 51, 234, 111,
+ 190, 240, 122, 204, 239, 244, 122, 108,
+ 45, 166, 83, 82, 140, 22, 138, 220,
+ 20, 18, 138, 65, 191, 191, 104, 0,
+ 159, 250, 43, 211, 238, 201, 34, 42,
+ 76, 81, 219, 58, 59, 245, 164, 162,
+ 102, 106, 138, 91, 147, 203, 93, 46,
+ 211, 27, 111, 133, 232, 248, 108, 84,
+ 224, 67, 145, 62, 114, 92, 203, 138,
+ 122, 244, 193, 176, 165, 31, 139, 185,
+ 96, 179, 6, 146, 168, 51, 16, 36,
+ 54, 193, 2, 193, 129, 233, 234, 138,
+ 132, 176, 132, 115, 60, 95, 137, 213,
+ 39, 2, 61, 121, 110, 19, 181, 28,
+ 134, 17, 109, 0, 204, 41, 88, 43,
+ 70, 182, 60, 36, 28, 136, 221, 189,
+ 1, 147, 209, 67, 160, 107, 246, 113,
+ 102, 39, 216, 125, 157, 41, 226, 66,
+ 246, 252, 143, 56, 108, 124, 161, 215,
+ 153, 155, 93, 222, 200, 179, 61, 194,
+ 115, 248, 107, 168, 7, 145, 102, 142,
+ 145, 206, 72, 183, 202, 128, 157, 36,
+ 53, 162, 163, 112, 153, 241, 29, 100,
+ 26, 86, 122, 151, 31, 252, 186, 188,
+ 79, 33, 101, 5, 113, 103, 216, 62,
+ 102, 62, 188, 89, 130, 101, 167, 158,
+ 155, 43, 99, 208, 76, 237, 197, 94,
+ 250, 87, 54, 254, 177, 239, 177, 37,
+ 29, 137, 49, 56, 201, 48, 191, 80,
+ 31, 103, 30, 233, 106, 7, 43, 97,
+ 4, 167, 23, 177, 163, 193, 37, 64,
+ 151, 18, 169, 201, 198, 128, 60, 140,
+ 173, 18, 24, 137, 241, 201, 8, 111,
+ 173, 105, 194, 69, 171, 82, 241, 140,
+ 183, 27, 235, 56, 38, 235, 74, 68,
+ 156, 211, 209, 131, 115, 37, 74, 103,
+ 240, 34, 91, 36, 85, 20, 100, 132,
+ 235, 10, 244, 94, 102, 146, 243, 247,
+ 159, 183, 104, 12, 205, 243, 52, 203,
+ 222, 135, 81, 23, 152, 213, 97, 15,
+ 34, 58, 195, 180, 126, 135, 246, 163,
+ 13, 208, 22, 193, 20, 5, 146, 73,
+ 101, 81, 137, 175, 155, 230, 43, 200,
+ 155, 108, 240, 99, 137, 211, 59, 44,
+ 78, 169, 206, 36, 57, 158, 34, 14,
+ 24, 13, 108, 211, 101, 88, 80, 239,
+ 166, 15, 28, 234, 222, 18, 222, 188,
+ 68, 149, 173, 69, 26, 124, 139, 174,
+ 232, 172, 97, 224, 103, 94, 2, 15,
+ 224, 246, 183, 203, 209, 99, 173, 18,
+ 99, 237, 157, 57, 31, 75, 19, 174,
+ 27, 11, 111, 248, 204, 8, 52, 131,
+ 45, 251, 32, 89, 247, 25, 40, 65,
+ 78, 187, 142, 243, 76, 156, 140, 51,
+ 67, 95, 73, 39, 58, 24, 213, 25,
+ 175, 92, 161, 188, 56, 196, 115, 91,
+ 8, 105, 73, 177, 15, 17, 32, 0,
+ 247, 174, 122, 75, 174, 92, 111, 211,
+ 192, 93, 151, 182, 1, 20, 195, 222,
+ 234, 89, 82, 31, 39, 92, 223, 12,
+ 8, 41, 130, 122, 148, 188, 253, 76,
+ 7, 149, 136, 212, 113, 253, 49, 116,
+ 211, 29, 69, 127, 152, 109, 135, 54,
+ 147, 53, 241, 42, 239, 98, 189, 197,
+ 47, 120, 41, 57, 74, 107, 108, 99,
+ 17, 140, 215, 134, 226, 82, 37, 229,
+ 67, 218, 145, 147, 168, 107, 73, 51,
+ 141, 224, 255, 39, 131, 99, 112, 121,
+ 162, 37, 160, 52, 241, 238, 58, 66,
+ 215, 96, 53, 166, 164, 213, 73, 29,
+ 58, 128, 0, 152, 6, 141, 196, 87,
+ 140, 126, 168, 151, 249, 183, 125, 172,
+ 37, 79, 136, 210, 61, 170, 13, 31,
+ 171, 131, 9, 236, 62, 100, 74, 141,
+ 104, 249, 140, 52, 159, 233, 28, 170,
+ 138, 138, 178, 54, 153, 10, 132, 39,
+ 76, 237, 33, 18, 1, 60, 126, 86,
+ 182, 236, 147, 55, 13, 87, 116, 175,
+ 48, 48, 200, 206, 92, 32, 120, 4,
+ 130, 43, 194, 188, 115, 241, 158, 195,
+ 19, 155, 110, 172, 86, 99, 131, 47,
+ 178, 188, 168, 231, 75, 149, 35, 139,
+ 133, 18, 71, 231, 208, 237, 151, 34,
+ 172, 95, 149, 47, 57, 189, 229, 49,
+ 31, 64, 83, 84, 145, 16, 102, 29,
+ 9, 157, 213, 226, 57, 174, 94, 142,
+ 190, 135, 86, 178, 211, 75, 80, 210,
+ 254, 192, 125, 241, 226, 128, 68, 87,
+ 243, 97, 13, 100, 200, 75, 122, 44,
+ 233, 145, 121, 197, 91, 126, 10, 144,
+ 163, 234, 209, 162, 144, 39, 74, 247,
+ 86, 235, 26, 84, 18, 247, 41, 72,
+ 137, 220, 49, 194, 211, 57, 87, 97,
+ 254, 211, 182, 240, 158, 253, 140, 75,
+ 211, 41, 220, 175, 250, 74, 29, 27,
+ 220, 89, 74, 45, 173, 242, 73, 60,
+ 158, 171, 16, 216, 36, 158, 203, 180,
+ 70, 192, 133, 225, 96, 106, 251, 158,
+ 137, 91, 253, 141, 181, 255, 246, 77,
+ 56, 83, 167, 186, 177, 219, 36, 173,
+ 137, 187, 126, 81, 139, 226, 67, 66,
+ 22, 204, 188, 91, 88, 229, 48, 3,
+ 45, 9, 184, 179, 254, 28, 55, 20,
+ 110, 185, 230, 148, 134, 208, 12, 171,
+ 87, 103, 63, 99, 2, 206, 131, 201,
+ 138, 15, 240, 80, 187, 183, 85, 222,
+ 57, 55, 197, 122, 122, 113, 190, 246,
+ 74, 241, 172, 94, 57, 93, 11, 148,
+ 80, 206, 32, 171, 142, 210, 20, 42,
+ 247, 179, 14, 103, 77, 125, 129, 175,
+ 184, 112, 36, 34, 62, 118, 139, 249,
+ 178, 153, 45, 180, 132, 145, 60, 147,
+ 251, 58, 158, 161, 111, 242, 188, 70,
+ 86, 70, 151, 83, 10, 96, 62, 120,
+ 176, 117, 240, 106, 219, 153, 144, 218,
+ 204, 120, 214, 16, 110, 121, 14, 94,
+ 45, 77, 249, 135, 89, 109, 152, 143,
+ 67, 81, 185, 6, 132, 6, 181, 110,
+ 222, 3, 37, 100, 218, 101, 95, 18,
+ 171, 217, 141, 18, 163, 224, 116, 111,
+ 169, 72, 233, 88, 75, 7, 78, 164,
+ 235, 130, 213, 224, 64, 127, 248, 168,
+ 30, 14, 120, 83, 237, 125, 87, 35,
+ 156, 114, 131, 241, 107, 121, 216, 6,
+ 83, 76, 212, 45, 155, 51, 195, 6,
+ 88, 18, 25, 158, 165, 90, 200, 167,
+ 170, 208, 52, 15, 117, 213, 231, 147,
+ 108, 249, 12, 175, 144, 4, 115, 28,
+ 101, 78, 166, 242, 249, 72, 236, 215,
+ 90, 48, 16, 81, 208, 200, 113, 143,
+ 157, 21, 105, 87, 212, 44, 79, 235,
+ 94, 226, 211, 63, 185, 145, 151, 235,
+ 56, 12, 57, 213, 9, 204, 211, 44,
+ 63, 88, 247, 156, 247, 192, 104, 19,
+ 227, 24, 40, 157, 114, 90, 237, 89,
+ 83, 95, 15, 159, 163, 22, 51, 152,
+ 231, 142, 128, 122, 194, 175, 134, 225,
+ 18, 35, 116, 68, 13, 126, 13, 171,
+ 193, 42, 130, 86, 130, 210, 190, 28,
+ 254, 210, 18, 203, 93, 245, 224, 25,
+ 37, 95, 52, 61, 10, 222, 10, 74,
+ 163, 154, 54, 46, 238, 87, 106, 78,
+ 102, 143, 45, 159, 250, 231, 65, 149,
+ 245, 5, 164, 72, 95, 146, 43, 19,
+ 161, 33, 155, 94, 13, 148, 117, 135,
+ 171, 31, 100, 113, 240, 254, 169, 106,
+ 149, 23, 109, 240, 194, 128, 157, 156,
+ 110, 128, 75, 169, 158, 127, 152, 190,
+ 29, 82, 143, 154, 120, 131, 205, 113,
+ 11, 66, 112, 95, 183, 33, 111, 214,
+ 102, 147, 51, 45, 21, 87, 236, 226,
+ 231, 140, 212, 51, 198, 242, 5, 166,
+ 200, 99, 194, 207, 99, 217, 96, 11,
+ 43, 143, 1, 241, 239, 152, 2, 152,
+ 175, 28, 13, 207, 80, 238, 138, 248,
+ 121, 197, 110, 12, 139, 36, 226, 255,
+ 82, 226, 124, 245, 120, 70, 183, 195,
+ 5, 118, 214, 141, 175, 31, 245, 91,
+ 239, 34, 79, 100, 188, 168, 139, 114,
+ 254, 210, 6, 205, 191, 196, 107, 51,
+ 151, 89, 40, 139, 100, 197, 209, 252,
+ 140, 141, 127, 110, 7, 10, 162, 81,
+ 110, 123, 75, 156, 138, 20, 13, 134,
+ 75, 186, 199, 83, 119, 89, 89, 171,
+ 141, 10, 255, 120, 190, 118, 57, 63,
+ 182, 140, 26, 201, 232, 222, 58, 41,
+ 75, 155, 0, 188, 101, 240, 98, 97,
+ 52, 58, 7, 199, 140, 247, 42, 193,
+ 26, 66, 206, 51, 248, 202, 198, 83,
+ 224, 96, 206, 214, 224, 130, 212, 67,
+ 190, 10, 166, 48, 69, 82, 216, 36,
+ 223, 166, 249, 113, 203, 37, 208, 94,
+ 105, 105, 225, 160, 22, 80, 144, 70,
+ 210, 236, 182, 158, 124, 182, 224, 43,
+ 198, 198, 130, 231, 216, 58, 156, 208,
+ 11, 19, 218, 102, 94, 136, 74, 100,
+ 167, 117, 168, 161, 107, 50, 133, 102,
+ 198, 149, 107, 76, 206, 163, 230, 165,
+ 175, 85, 134, 203, 29, 246, 27, 250,
+ 161, 155, 13, 216, 253, 206, 45, 150,
+ 255, 225, 129, 152, 232, 121, 191, 145,
+ 126, 52, 211, 80, 7, 231, 18, 217,
+ 160, 35, 11, 227, 30, 186, 139, 150,
+ 170, 133, 235, 73, 210, 28, 129, 40,
+ 158, 71, 233, 84, 135, 13, 116, 58,
+ 208, 60, 136, 87, 250, 225, 134, 53,
+ 139, 18, 221, 251, 242, 13, 8, 170,
+ 70, 83, 43, 40, 247, 36, 187, 186,
+ 155, 29, 181, 158, 23, 214, 104, 231,
+ 28, 239, 64, 71, 46, 65, 27, 187,
+ 222, 233, 204, 235, 165, 48, 199, 113,
+ 246, 226, 44, 255, 27, 157, 198, 100,
+ 172, 149, 234, 113, 127, 243, 46, 254,
+ 58, 195, 26, 21, 246, 124, 178, 62,
+ 80, 46, 41, 27, 41, 50, 220, 34,
+ 118, 161, 202, 193, 230, 161, 91, 247,
+ 21, 202, 105, 128, 87, 192, 167, 196,
+ 179, 243, 59, 105, 171, 198, 129, 96,
+ 73, 22, 1, 167, 216, 159, 17, 8,
+ 235, 24, 23, 51, 208, 150, 251, 168,
+ 61, 40, 154, 25, 12, 58, 57, 116,
+ 55, 81, 102, 92, 217, 140, 202, 27,
+ 73, 114, 142, 184, 234, 199, 234, 96,
+ 2, 204, 142, 116, 21, 113, 105, 126,
+ 72, 177, 50, 138, 74, 242, 182, 106,
+ 94, 153, 3, 174, 116, 246, 86, 160,
+ 182, 184, 95, 55, 215, 233, 241, 221,
+ 245, 12, 64, 17, 167, 163, 75, 137,
+ 178, 76, 102, 114, 173, 231, 91, 147,
+ 228, 75, 168, 130, 14, 217, 244, 61,
+ 176, 63, 248, 226, 170, 148, 245, 247,
+ 196, 82, 198, 219, 77, 182, 52, 125,
+ 46, 97, 236, 54, 40, 222, 73, 167,
+ 64, 67, 242, 102, 93, 179, 83, 10,
+ 194, 34, 90, 49, 26, 12, 233, 222,
+ 235, 44, 61, 229, 136, 212, 94, 16,
+ 93, 195, 54, 228, 203, 39, 186, 158,
+ 234, 146, 20, 35, 252, 241, 47, 224,
+ 31, 23, 250, 165, 58, 47, 39, 235,
+ 62, 4, 224, 45, 227, 23, 148, 195,
+ 37, 17, 72, 112, 79, 153, 64, 129,
+ 197, 183, 29, 123, 46, 130, 141, 80,
+ 114, 204, 254, 25, 37, 15, 238, 217,
+ 6, 67, 40, 177, 133, 228, 245, 82,
+ 22, 76, 49, 252, 35, 222, 125, 103,
+ 250, 14, 50, 46, 31, 79, 47, 79,
+ 103, 97, 6, 65, 112, 152, 131, 193,
+ 198, 166, 212, 184, 207, 100, 40, 78,
+ 96, 168, 25, 105, 2, 66, 196, 137,
+ 64, 94, 217, 7, 138, 23, 103, 218,
+ 166, 165, 190, 227, 242, 225, 186, 192,
+ 4, 44, 221, 99, 71, 60, 143, 165,
+ 242, 36, 32, 68, 35, 160, 7, 1,
+ 16, 66, 113, 145, 224, 15, 95, 198,
+ 39, 46, 111, 224, 120, 252, 190, 132,
+ 43, 255, 183, 135, 236, 21, 100, 196,
+ 108, 133, 239, 241, 52, 248, 129, 193,
+ 31, 248, 0, 138, 162, 9, 227, 138,
+ 48, 238, 210, 197, 166, 97, 34, 38,
+ 83, 48, 148, 219, 24, 168, 78, 65,
+ 101, 133, 202, 237, 141, 149, 151, 168,
+ 235, 92, 238, 206, 222, 61, 3, 43,
+ 90, 202, 171, 35, 32, 222, 98, 142,
+ 141, 69, 205, 186, 207, 52, 248, 100,
+ 234, 217, 203, 255, 248, 121, 59, 90,
+ 83, 84, 222, 129, 138, 110, 249, 42,
+ 24, 235, 177, 87, 185, 219, 2, 85,
+ 133, 25, 245, 14, 182, 5, 70, 171,
+ 49, 252, 233, 119, 13, 165, 77, 57,
+ 150, 132, 83, 50, 112, 115, 159, 250,
+ 196, 111, 147, 179, 145, 244, 130, 16,
+ 86, 35, 222, 173, 226, 218, 63, 41,
+ 3, 207, 207, 199, 64, 124, 214, 42,
+ 126, 93, 222, 105, 216, 210, 252, 21,
+ 0, 177, 9, 194, 157, 160, 245, 122,
+ 148, 138, 152, 79, 84, 154, 70, 119,
+ 115, 93, 213, 226, 136, 214, 15, 165,
+ 42, 125, 175, 31, 147, 51, 45, 242,
+ 97, 245, 168, 58, 47, 177, 194, 24,
+ 59, 25, 199, 169, 132, 195, 236, 240,
+ 191, 142, 86, 151, 19, 233, 20, 147,
+ 240, 207, 56, 17, 227, 224, 245, 246,
+ 167, 177, 115, 17, 177, 166, 33, 182,
+ 64, 217, 40, 125, 24, 94, 214, 73,
+ 167, 125, 96, 232, 190, 205, 115, 157,
+ 26, 202, 234, 125, 176, 222, 208, 50,
+ 39, 208, 11, 58, 236, 174, 198, 2,
+ 28, 227, 141, 17, 212, 193, 178, 114,
+ 1, 87, 238, 1, 235, 255, 146, 131,
+ 82, 139, 156, 128, 96, 85, 75, 243,
+ 165, 24, 42, 220, 131, 165, 91, 156,
+ 118, 159, 28, 52, 147, 105, 179, 91,
+ 216, 56, 32, 222, 172, 31, 188, 215,
+ 161, 139, 9, 186, 152, 105, 155, 195,
+ 147, 159, 217, 198, 116, 58, 61, 89,
+ 60, 202, 220, 176, 114, 36, 150, 151,
+ 239, 221, 223, 202, 202, 93, 225, 51,
+ 191, 92, 220, 60, 146, 222, 210, 119,
+ 144, 187, 151, 26, 192, 27, 184, 46,
+ 206, 234, 31, 179, 28, 208, 43, 3,
+ 59, 92, 58, 231, 7, 196, 155, 61,
+ 201, 211, 141, 38, 143, 43, 238, 129,
+ 33, 250, 192, 53, 112, 173, 6, 67,
+ 13, 234, 154, 13, 50, 201, 97, 80,
+ 45, 13, 215, 162, 255, 224, 20, 211,
+ 47, 12, 73, 220, 186, 141, 5, 149,
+ 81, 232, 3, 195, 223, 152, 199, 149,
+ 128, 160, 83, 112, 64, 107, 110, 170,
+ 6, 65, 41, 48, 244, 144, 206, 151,
+ 106, 248, 31, 174, 217, 199, 73, 107,
+ 101, 38, 92, 204, 121, 127, 195, 209,
+ 187, 86, 99, 150, 95, 192, 16, 62,
+ 75, 35, 197, 197, 166, 187, 143, 191,
+ 203, 20, 240, 171, 56, 62, 212, 37,
+ 14, 17, 213, 181, 78, 21, 171, 44,
+ 204, 32, 144, 208, 60, 171, 85, 92,
+ 157, 198, 247, 235, 124, 74, 225, 76,
+ 69, 100, 19, 237, 181, 255, 106, 208,
+ 247, 83, 31, 152, 24, 220, 173, 104,
+ 191, 35, 185, 24, 216, 233, 39, 115,
+ 151, 93, 35, 201, 133, 20, 211, 159,
+ 180, 164, 80, 137, 199, 155, 192, 207,
+ 224, 182, 108, 186, 208, 123, 167, 116,
+ 148, 36, 245, 50, 221, 51, 143, 45,
+ 244, 235, 215, 84, 158, 128, 205, 19,
+ 119, 139, 121, 46, 46, 152, 104, 95,
+ 178, 210, 107, 132, 96, 14, 118, 54,
+ 89, 18, 42, 3, 236, 20, 136, 32,
+ 125, 160, 106, 239, 4, 216, 119, 43,
+ 208, 33, 170, 114, 13, 206, 157, 126,
+ 53, 161, 91, 43, 167, 78, 195, 87,
+ 124, 114, 164, 130, 181, 69, 114, 103,
+ 83, 43, 127, 30, 158, 108, 127, 247,
+ 130, 252, 42, 88, 241, 89, 185, 108,
+ 63, 170, 46, 143, 157, 20, 74, 164,
+ 182, 225, 228, 209, 230, 111, 143, 12,
+ 173, 23, 7, 12, 228, 92, 136, 89,
+ 122, 37, 151, 165, 115, 17, 144, 197,
+ 102, 194, 238, 149, 228, 167, 255, 124,
+ 238, 147, 21, 203, 16, 131, 235, 62,
+ 106, 233, 8, 166, 18, 145, 137, 11,
+ 7, 50, 139, 124, 214, 144, 253, 60,
+ 231, 22, 165, 67, 87, 162, 70, 253,
+ 222, 195, 149, 124, 235, 122, 135, 53,
+ 77, 84, 97, 70, 163, 43, 133, 255,
+ 37, 188, 97, 213, 231, 119, 61, 164,
+ 103, 85, 235, 207, 119, 118, 242, 225,
+ 116, 138, 85, 102, 234, 213, 20, 126,
+ 104, 112, 23, 42, 188, 69, 81, 89,
+ 139, 22, 147, 106, 250, 247, 52, 27,
+ 49, 215, 26, 114, 21, 92, 89, 56,
+ 251, 145, 13, 248, 115, 251, 48, 125,
+ 210, 51, 122, 29, 73, 206, 206, 243,
+ 176, 18, 231, 207, 71, 132, 41, 144,
+ 229, 208, 160, 24, 142, 129, 99, 216,
+ 98, 184, 30, 8, 222, 242, 113, 218,
+ 74, 98, 140, 72, 141, 223, 56, 195,
+ 218, 110, 216, 211, 202, 255, 26, 76,
+ 35, 62, 176, 198, 34, 123, 179, 175,
+ 64, 78, 71, 186, 182, 230, 100, 54,
+ 106, 229, 2, 76, 26, 233, 221, 141,
+ 160, 135, 87, 158, 35, 76, 220, 194,
+ 146, 51, 75, 218, 92, 191, 151, 250,
+ 178, 209, 218, 184, 171, 29, 247, 65,
+ 164, 48, 121, 7, 230, 30, 226, 189,
+ 43, 4, 215, 162, 161, 188, 8, 44,
+ 106, 27, 226, 4, 127, 51, 227, 36,
+ 114, 185, 116, 42, 17, 117, 172, 23,
+ 252, 255, 75, 102, 79, 45, 187, 91,
+ 227, 58, 216, 252, 72, 36, 230, 121,
+ 173, 248, 211, 47, 239, 135, 129, 52,
+ 5, 223, 152, 67, 96, 88, 153, 62,
+ 111, 232, 240, 214, 245, 216, 149, 193,
+ 197, 156, 63, 225, 157, 166, 211, 62,
+ 90, 60, 64, 192, 244, 215, 251, 110,
+ 39, 155, 198, 215, 77, 250, 18, 15,
+ 14, 90, 193, 17, 62, 249, 84, 55,
+ 114, 75, 71, 143, 180, 154, 20, 193,
+ 186, 141, 189, 172, 52, 181, 233, 239,
+ 207, 103, 171, 12, 100, 254, 60, 171,
+ 148, 132, 91, 80, 40, 189, 127, 68,
+ 225, 33, 2, 160, 70, 26, 88, 178,
+ 239, 47, 240, 228, 188, 184, 38, 77,
+ 233, 175, 135, 212, 207, 225, 240, 255,
+ 90, 27, 45, 107, 101, 186, 241, 100,
+ 175, 246, 133, 57, 212, 232, 169, 100,
+ 241, 174, 91, 143, 69, 47, 30, 237,
+ 85, 0, 13, 113, 111, 172, 87, 235,
+ 112, 203, 27, 68, 2, 129, 197, 167,
+ 200, 202, 107, 178, 204, 37, 215, 199,
+ 246, 231, 203, 136, 64, 102, 180, 157,
+ 77, 212, 169, 120, 89, 74, 73, 164,
+ 192, 237, 88, 189, 120, 105, 205, 125,
+ 115, 248, 50, 6, 239, 153, 253, 238,
+ 157, 249, 136, 206, 253, 28, 10, 95,
+ 96, 109, 222, 78, 250, 81, 61, 173,
+ 120, 148, 216, 218, 92, 34, 201, 146,
+ 93, 200, 122, 70, 107, 67, 10, 1,
+ 232, 180, 61, 125, 228, 152, 54, 132,
+ 88, 1, 122, 211, 30, 103, 12, 204,
+ 185, 18, 207, 71, 177, 127, 252, 112,
+ 104, 155, 162, 145, 42, 39, 22, 180,
+ 173, 53, 3, 1, 29, 39, 135, 231,
+ 85, 51, 129, 124, 205, 11, 185, 50,
+ 198, 159, 122, 214, 249, 195, 85, 179,
+ 123, 246, 61, 169, 237, 248, 250, 227,
+ 151, 213, 82, 54, 207, 6, 138, 227,
+ 229, 95, 51, 81, 185, 197, 146, 75,
+ 93, 45, 117, 39, 167, 164, 20, 125,
+ 24, 186, 76, 118, 158, 180, 104, 21,
+ 75, 79, 81, 111, 150, 30, 6, 91,
+ 142, 16, 140, 90, 102, 31, 82, 24,
+ 184, 51, 9, 3, 198, 27, 206, 74,
+ 65, 126, 40, 21, 13, 7, 235, 131,
+ 88, 170, 225, 177, 183, 66, 38, 11,
+ 107, 158, 240, 169, 111, 1, 76, 170,
+ 215, 76, 116, 27, 191, 211, 81, 105,
+ 36, 112, 231, 133, 58, 162, 184, 4,
+ 84, 165, 20, 171, 201, 207, 43, 186,
+ 202, 87, 178, 24, 56, 138, 163, 92,
+ 143, 153, 156, 98, 126, 77, 152, 217,
+ 88, 128, 149, 163, 171, 150, 25, 113,
+ 28, 253, 174, 102, 169, 207, 219, 70,
+ 229, 213, 127, 238, 240, 60, 230, 190,
+ 11, 127, 155, 90, 46, 127, 233, 13,
+ 126, 101, 234, 36, 199, 128, 132, 217,
+ 126, 147, 62, 8, 216, 3, 189, 136,
+ 224, 147, 172, 228, 111, 19, 111, 254,
+ 152, 52, 150, 21, 98, 250, 212, 44,
+ 172, 65, 229, 144, 38, 63, 177, 205,
+ 202, 121, 224, 138, 89, 53, 124, 98,
+ 55, 183, 165, 149, 210, 185, 120, 131,
+ 3, 159, 249, 40, 168, 145, 159, 30,
+ 131, 110, 147, 90, 219, 96, 57, 184,
+ 75, 138, 147, 108, 112, 45, 182, 151,
+ 42, 214, 187, 43, 62, 173, 172, 68,
+ 120, 15, 37, 135, 130, 86, 130, 46,
+ 112, 85, 230, 12, 76, 254, 203, 150,
+ 16, 240, 122, 212, 10, 134, 232, 32,
+ 215, 125, 19, 230, 159, 24, 156, 159,
+ 62, 56, 97, 9, 155, 59, 89, 221,
+ 76, 223, 58, 21, 118, 175, 104, 180,
+ 62, 210, 62, 174, 220, 147, 42, 85,
+ 43, 231, 18, 80, 254, 171, 239, 104,
+ 120, 157, 37, 167, 254, 128, 175, 32,
+ 118, 92, 105, 182, 180, 127, 22, 38,
+ 23, 146, 102, 113, 247, 224, 0, 216,
+ 86, 105, 80, 240, 8, 164, 68, 131,
+ 188, 29, 39, 195, 254, 88, 54, 130,
+ 97, 156, 178, 40, 216, 64, 244, 51,
+ 5, 68, 243, 208, 99, 142, 227, 15,
+ 246, 8, 89, 87, 2, 242, 90, 211,
+ 113, 150, 62, 60, 189, 109, 141, 3,
+ 96, 201, 127, 51, 179, 201, 239, 6,
+ 152, 255, 112, 104, 72, 73, 34, 120,
+ 226, 50, 34, 43, 207, 20, 151, 84,
+ 114, 153, 92, 91, 180, 234, 108, 206,
+ 106, 28, 68, 28, 93, 81, 133, 139,
+ 207, 195, 147, 246, 132, 104, 119, 110,
+ 118, 208, 39, 42, 28, 119, 75, 188,
+ 82, 144, 205, 138, 247, 132, 136, 232,
+ 177, 49, 100, 23, 224, 208, 215, 112,
+ 112, 225, 73, 146, 220, 254, 119, 90,
+ 140, 175, 218, 170, 191, 87, 171, 29,
+ 183, 20, 112, 36, 14, 123, 73, 180,
+ 208, 21, 50, 143, 225, 102, 242, 193,
+ 132, 23, 14, 147, 251, 115, 225, 88,
+ 40, 80, 122, 151, 15, 90, 22, 105,
+ 250, 199, 81, 73, 206, 86, 63, 241,
+ 34, 134, 158, 127, 79, 39, 151, 7,
+ 232, 50, 196, 161, 160, 24, 114, 255,
+ 174, 137, 52, 244, 75, 246, 20, 203,
+ 224, 80, 116, 130, 254, 71, 251, 204,
+ 226, 20, 164, 134, 237, 223, 160, 37,
+ 61, 76, 223, 219, 79, 48, 137, 178,
+ 2, 125, 21, 36, 127, 149, 255, 249,
+ 192, 18, 92, 42, 129, 192, 177, 212,
+ 90, 249, 120, 200, 239, 135, 143, 119,
+ 170, 110, 16, 176, 200, 59, 58, 233,
+ 115, 168, 156, 231, 222, 242, 190, 158,
+ 238, 98, 229, 227, 43, 39, 243, 213,
+ 234, 142, 20, 1, 225, 130, 167, 229,
+ 49, 17, 237, 60, 109, 246, 168, 171,
+ 40, 61, 98, 225, 119, 118, 112, 49,
+ 68, 160, 203, 76, 13, 191, 147, 238,
+ 231, 95, 40, 24, 159, 46, 166, 80,
+ 191, 207, 128, 73, 132, 190, 167, 27,
+ 195, 95, 70, 36, 23, 214, 116, 99,
+ 197, 171, 143, 186, 226, 214, 171, 150,
+ 36, 57, 59, 28, 158, 70, 44, 93,
+ 111, 92, 153, 6, 253, 166, 82, 123,
+ 184, 27, 252, 116, 235, 91, 141, 209,
+ 114, 61, 138, 151, 86, 234, 216, 191,
+ 31, 71, 96, 255, 46, 212, 36, 227,
+ 179, 51, 124, 1, 191, 103, 130, 69,
+ 164, 235, 16, 40, 254, 114, 213, 155,
+ 71, 214, 145, 115, 73, 245, 139, 176,
+ 234, 37, 66, 224, 39, 83, 177, 32,
+ 125, 23, 30, 27, 194, 21, 144, 73,
+ 100, 97, 213, 193, 29, 170, 124, 238,
+ 44, 182, 78, 165, 143, 103, 39, 71,
+ 143, 239, 238, 28, 241, 22, 249, 173,
+ 225, 94, 95, 31, 134, 9, 78, 243,
+ 223, 239, 23, 21, 136, 93, 249, 64,
+ 22, 168, 28, 101, 91, 231, 151, 129,
+ 167, 233, 202, 241, 68, 246, 22, 148,
+ 171, 201, 229, 168, 189, 77, 151, 251,
+ 92, 50, 244, 17, 188, 56, 39, 83,
+ 9, 87, 252, 140, 244, 27, 99, 242,
+ 225, 208, 237, 222, 244, 238, 156, 125,
+ 219, 59, 90, 225, 234, 57, 45, 12,
+ 252, 19, 41, 177, 15, 9, 73, 96,
+ 9, 37, 139, 230, 205, 101, 230, 141,
+ 118, 64, 50, 119, 109, 132, 24, 196,
+ 141, 115, 28, 217, 39, 190, 186, 23,
+ 74, 62, 79, 11, 68, 107, 190, 200,
+ 32, 29, 169, 157, 185, 29, 15, 240,
+ 193, 174, 140, 129, 112, 12, 137, 101,
+ 160, 250, 220, 198, 0, 45, 57, 54,
+ 73, 115, 37, 52, 61, 135, 232, 241,
+ 22, 161, 136, 86, 187, 162, 47, 166,
+ 231, 25, 144, 254, 130, 154, 95, 237,
+ 96, 124, 86, 126, 60, 247, 14, 88,
+ 150, 230, 242, 54, 162, 96, 41, 73,
+ 102, 15, 173, 103, 132, 148, 133, 70,
+ 244, 129, 3, 115, 127, 8, 109, 14,
+ 8, 228, 171, 171, 217, 19, 73, 147,
+ 6, 43, 96, 158, 37, 14, 255, 22,
+ 184, 65, 151, 82, 244, 36, 203, 178,
+ 204, 93, 91, 221, 120, 215, 196, 37,
+ 162, 248, 119, 180, 171, 185, 17, 168,
+ 143, 129, 184, 90, 187, 228, 46, 148,
+ 164, 82, 185, 62, 210, 87, 158, 146,
+ 20, 23, 139, 10, 19, 129, 143, 152,
+ 125, 40, 212, 174, 193, 10, 157, 163,
+ 207, 47, 205, 243, 1, 0, 23, 207,
+ 16, 168, 250, 239, 20, 223, 146, 94,
+ 187, 23, 245, 109, 69, 10, 47, 210,
+ 203, 66, 246, 161, 90, 108, 21, 164,
+ 38, 222, 57, 245, 218, 8, 156, 65,
+ 147, 77, 139, 94, 182, 84, 231, 252,
+ 20, 159, 169, 188, 62, 205, 101, 226,
+ 11, 224, 142, 79, 90, 248, 156, 107,
+ 154, 103, 90, 92, 92, 116, 67, 84,
+ 252, 247, 230, 251, 218, 108, 203, 134,
+ 158, 147, 0, 70, 81, 128, 83, 30,
+ 96, 86, 247, 82, 191, 212, 120, 158,
+ 125, 183, 172, 134, 143, 44, 109, 0,
+ 77, 217, 55, 238, 66, 42, 38, 59,
+ 218, 132, 65, 127, 76, 178, 148, 160,
+ 129, 15, 95, 186, 178, 78, 185, 84,
+ 188, 22, 114, 207, 67, 135, 219, 215,
+ 206, 181, 177, 140, 249, 196, 75, 233,
+ 124, 125, 196, 21, 150, 233, 7, 104,
+ 190, 182, 8, 200, 156, 20, 179, 48,
+ 232, 148, 27, 170, 215, 68, 68, 146,
+ 107, 163, 146, 213, 255, 38, 97, 60,
+ 192, 1, 128, 204, 127, 20, 180, 53,
+ 69, 165, 95, 18, 96, 26, 110, 42,
+ 65, 180, 132, 200, 79, 43, 2, 209,
+ 135, 56, 197, 190, 130, 206, 184, 53,
+ 178, 119, 140, 35, 13, 20, 124, 59,
+ 241, 250, 194, 95, 115, 39, 88, 64,
+ 213, 240, 155, 114, 183, 252, 142, 250,
+ 158, 48, 5, 5, 44, 141, 201, 138,
+ 139, 11, 216, 87, 108, 32, 86, 156,
+ 65, 161, 179, 20, 46, 157, 200, 9,
+ 190, 67, 11, 91, 134, 137, 91, 227,
+ 28, 225, 159, 34, 240, 169, 222, 145,
+ 8, 149, 185, 198, 218, 87, 147, 133,
+ 127, 66, 161, 21, 60, 149, 213, 170,
+ 155, 54, 169, 97, 93, 236, 230, 133,
+ 182, 187, 193, 237, 122, 68, 207, 90,
+ 102, 63, 151, 3, 36, 122, 23, 89,
+ 250, 174, 194, 241, 142, 86, 96, 31,
+ 98, 110, 201, 79, 217, 52, 23, 51,
+ 20, 180, 214, 199, 113, 79, 224, 233,
+ 126, 55, 253, 216, 48, 195, 72, 200,
+ 11, 172, 194, 255, 148, 105, 20, 175,
+ 230, 144, 241, 78, 58, 33, 167, 93,
+ 24, 217, 199, 66, 134, 86, 176, 23,
+ 86, 237, 241, 21, 144, 167, 1, 252,
+ 170, 108, 94, 236, 67, 164, 195, 38,
+ 148, 93, 173, 135, 187, 211, 6, 27,
+ 208, 167, 111, 224, 47, 15, 248, 119,
+ 175, 173, 133, 182, 121, 194, 138, 149,
+ 66, 5, 4, 152, 2, 23, 198, 173,
+ 61, 47, 126, 185, 218, 129, 223, 247,
+ 209, 153, 219, 98, 184, 104, 127, 214,
+ 196, 181, 203, 91, 3, 4, 0, 171,
+ 24, 118, 99, 166, 74, 14, 52, 200,
+ 38, 212, 91, 22, 234, 241, 12, 221,
+ 132, 243, 211, 2, 18, 11, 130, 49,
+ 223, 100, 27, 148, 87, 225, 119, 186,
+ 191, 195, 92, 95, 118, 60, 234, 40,
+ 87, 213, 143, 105, 235, 202, 194, 148,
+ 45, 9, 107, 35, 139, 11, 226, 166,
+ 92, 39, 131, 135, 140, 141, 56, 80,
+ 199, 42, 208, 27, 41, 94, 39, 77,
+ 33, 125, 148, 126, 111, 124, 89, 221,
+ 208, 164, 167, 185, 196, 71, 121, 88,
+ 189, 216, 109, 196, 166, 29, 216, 151,
+ 90, 183, 22, 140, 201, 179, 219, 51,
+ 9, 152, 2, 237, 184, 123, 16, 62,
+ 71, 178, 213, 97, 109, 79, 246, 82,
+ 122, 253, 132, 16, 157, 213, 38, 237,
+ 24, 233, 4, 46, 140, 179, 1, 35,
+ 160, 52, 179, 34, 159, 248, 214, 167,
+ 75, 242, 172, 113, 184, 50, 139, 73,
+ 33, 143, 83, 250, 23, 239, 135, 226,
+ 153, 175, 60, 5, 184, 148, 199, 208,
+ 105, 107, 89, 17, 141, 157, 219, 34,
+ 213, 170, 12, 121, 200, 190, 17, 139,
+ 136, 13, 29, 187, 145, 184, 165, 190,
+ 167, 171, 218, 103, 26, 28, 63, 224,
+ 21, 200, 234, 138, 130, 88, 255, 74,
+ 61, 233, 91, 19, 70, 210, 27, 61,
+ 204, 32, 26, 50, 34, 169, 139, 37,
+ 212, 16, 22, 206, 99, 42, 251, 100,
+ 208, 41, 58, 200, 101, 65, 100, 57,
+ 228, 240, 105, 49, 240, 1, 141, 21,
+ 35, 65, 252, 142, 70, 235, 169, 81,
+ 252, 215, 62, 88, 117, 180, 148, 169,
+ 114, 93, 231, 105, 194, 193, 12, 74,
+ 52, 143, 163, 233, 188, 215, 20, 225,
+ 2, 28, 79, 113, 27, 166, 204, 160,
+ 177, 199, 150, 249, 36, 31, 132, 84,
+ 125, 184, 128, 230, 39, 139, 197, 169,
+ 153, 2, 52, 37, 39, 180, 202, 237,
+ 46, 43, 185, 255, 235, 149, 230, 227,
+ 186, 248, 81, 198, 122, 15, 185, 44,
+ 137, 112, 218, 156, 94, 107, 181, 233,
+ 121, 28, 6, 194, 153, 174, 144, 146,
+ 174, 253, 111, 138, 49, 253, 158, 80,
+ 23, 174, 167, 203, 235, 112, 196, 66,
+ 251, 123, 97, 137, 21, 218, 131, 28,
+ 31, 83, 121, 160, 84, 31, 13, 60,
+ 103, 33, 32, 12, 161, 136, 107, 38,
+ 30, 111, 53, 176, 192, 122, 166, 47,
+ 160, 122, 22, 117, 224, 150, 128, 249,
+ 21, 27, 222, 119, 38, 182, 73, 248,
+ 246, 101, 240, 33, 30, 189, 13, 37,
+ 211, 123, 70, 50, 163, 104, 170, 166,
+ 33, 131, 13, 34, 252, 127, 156, 187,
+ 14, 135, 40, 125, 156, 169, 229, 77,
+ 110, 143, 155, 61, 198, 49, 87, 118,
+ 229, 27, 204, 141, 7, 174, 222, 126,
+ 248, 15, 132, 101, 251, 123, 117, 138,
+ 166, 132, 252, 35, 218, 35, 27, 17,
+ 119, 103, 136, 167, 101, 114, 151, 106,
+ 229, 44, 95, 2, 106, 21, 187, 221,
+ 97, 110, 144, 140, 12, 168, 99, 114,
+ 250, 34, 159, 60, 229, 203, 25, 135,
+ 23, 179, 240, 182, 232, 64, 182, 156,
+ 183, 132, 17, 25, 199, 165, 36, 28,
+ 44, 177, 23, 18, 142, 4, 142, 53,
+ 186, 182, 218, 180, 215, 243, 5, 124,
+ 227, 108, 20, 121, 235, 131, 237, 211,
+ 0, 95, 97, 204, 225, 156, 122, 219,
+ 73, 217, 102, 114, 27, 126, 241, 235,
+ 14, 173, 234, 208, 155, 181, 60, 84,
+ 7, 247, 174, 151, 215, 141, 41, 225,
+ 101, 119, 145, 89, 255, 35, 64, 108,
+ 30, 53, 72, 215, 219, 106, 160, 90,
+ 17, 235, 159, 119, 107, 112, 236, 208,
+ 61, 81, 203, 182, 58, 39, 251, 251,
+ 90, 188, 137, 106, 7, 129, 92, 166,
+ 127, 230, 89, 116, 243, 228, 208, 222,
+ 140, 118, 71, 226, 152, 213, 41, 48,
+ 40, 215, 110, 69, 211, 252, 222, 68,
+ 187, 77, 166, 165, 201, 9, 118, 149,
+ 203, 19, 235, 199, 50, 210, 44, 62,
+ 41, 201, 65, 173, 29, 10, 219, 24,
+ 106, 53, 235, 37, 77, 73, 68, 159,
+ 92, 229, 80, 87, 217, 53, 219, 91,
+ 66, 155, 16, 3, 232, 184, 151, 36,
+ 155, 226, 197, 93, 50, 91, 140, 180,
+ 140, 250, 63, 18, 15, 237, 49, 237,
+ 58, 225, 135, 81, 90, 209, 103, 50,
+ 70, 49, 248, 42, 253, 42, 104, 146,
+ 92, 157, 75, 104, 115, 78, 102, 209,
+ 6, 242, 24, 101, 175, 243, 147, 239,
+ 213, 37, 124, 85, 139, 103, 195, 5,
+ 161, 177, 180, 157, 86, 237, 18, 173,
+ 143, 84, 177, 228, 63, 203, 128, 12,
+ 7, 71, 90, 105, 87, 137, 118, 177,
+ 147, 27, 108, 199, 152, 0, 50, 120,
+ 170, 163, 206, 203, 245, 94, 240, 76,
+ 234, 53, 158, 17, 95, 198, 151, 157,
+ 144, 168, 14, 189, 176, 68, 52, 9,
+ 46, 171, 1, 141, 245, 184, 190, 95,
+ 16, 197, 99, 185, 167, 185, 102, 245,
+ 74, 252, 224, 32, 236, 108, 121, 129,
+ 200, 34, 140, 228, 109, 228, 150, 41,
+ 68, 177, 120, 17, 17, 68, 188, 103,
+ 10, 216, 164, 154, 248, 232, 53, 31,
+ 85, 243, 4, 100, 43, 195, 96, 240,
+ 153, 167, 100, 21, 89, 141, 151, 197,
+ 113, 114, 0, 245, 173, 108, 203, 220,
+ 162, 5, 191, 102, 31, 133, 123, 198,
+ 194, 163, 195, 175, 28, 150, 23, 224,
+ 2, 143, 115, 225, 197, 91, 133, 202,
+ 123, 244, 5, 23, 91, 24, 127, 138,
+ 99, 7, 161, 153, 130, 183, 214, 43,
+ 30, 35, 136, 179, 118, 215, 200, 97,
+ 8, 108, 129, 219, 105, 0, 198, 55,
+ 170, 170, 159, 77, 185, 133, 98, 4,
+ 10, 202, 48, 79, 213, 80, 23, 217,
+ 124, 64, 239, 12, 162, 186, 154, 157,
+ 44, 160, 129, 70, 162, 40, 242, 110,
+ 99, 104, 127, 219, 243, 114, 253, 96,
+ 103, 9, 162, 36, 219, 178, 222, 253,
+ 32, 168, 91, 210, 169, 113, 210, 219,
+ 71, 201, 164, 13, 13, 212, 11, 181,
+ 95, 255, 76, 5, 139, 237, 242, 253,
+ 199, 247, 71, 28, 109, 132, 94, 219,
+ 27, 10, 22, 185, 115, 13, 170, 215,
+ 119, 249, 64, 226, 11, 254, 109, 208,
+ 56, 184, 147, 134, 249, 246, 86, 190,
+ 199, 106, 143, 107, 29, 251, 248, 25,
+ 194, 30, 240, 153, 11, 222, 185, 1,
+ 202, 111, 125, 138, 95, 106, 32, 128,
+ 127, 203, 209, 93, 74, 60, 57, 1,
+ 248, 64, 92, 202, 79, 173, 136, 163,
+ 174, 197, 126, 241, 254, 169, 128, 248,
+ 241, 49, 20, 31, 29, 139, 91, 147,
+ 76, 223, 102, 96, 87, 173, 108, 51,
+ 158, 45, 152, 182, 178, 170, 196, 134,
+ 165, 149, 47, 59, 25, 211, 212, 159,
+ 14, 139, 22, 117, 224, 0, 128, 0,
+ 203, 157, 250, 69, 129, 187, 189, 181,
+ 246, 83, 29, 109, 26, 163, 71, 246,
+ 187, 58, 43, 42, 211, 84, 76, 62,
+ 112, 132, 164, 194, 77, 168, 60, 136,
+ 104, 207, 48, 135, 52, 161, 213, 115,
+ 161, 57, 240, 162, 77, 17, 152, 61,
+ 211, 2, 62, 87, 43, 255, 159, 174,
+ 58, 81, 199, 167, 168, 40, 41, 244,
+ 146, 141, 210, 84, 15, 205, 130, 121,
+ 204, 233, 86, 113, 21, 93, 83, 15,
+ 73, 117, 159, 115, 200, 21, 83, 195,
+ 72, 236, 174, 252, 164, 225, 106, 211,
+ 162, 210, 89, 142, 47, 4, 120, 25,
+ 83, 68, 230, 51, 69, 222, 28, 239,
+ 242, 49, 136, 180, 180, 83, 1, 60,
+ 141, 84, 252, 164, 205, 246, 235, 126,
+ 11, 221, 49, 65, 14, 145, 10, 214,
+ 192, 23, 137, 159, 252, 80, 95, 169,
+ 30, 189, 49, 249, 14, 98, 37, 110,
+ 90, 9, 5, 170, 139, 245, 200, 107,
+ 62, 151, 38, 86, 91, 211, 237, 65,
+ 133, 108, 160, 230, 196, 225, 209, 196,
+ 245, 126, 50, 230, 57, 59, 120, 5,
+ 90, 87, 251, 201, 192, 171, 41, 53,
+ 18, 68, 134, 148, 38, 49, 7, 200,
+ 224, 105, 8, 5, 85, 181, 95, 125,
+ 59, 109, 102, 117, 215, 253, 107, 198,
+ 208, 213, 128, 11, 1, 202, 54, 116,
+ 12, 50, 137, 228, 184, 166, 231, 109,
+ 217, 122, 96, 37, 6, 215, 156, 145,
+ 15, 66, 40, 98, 158, 22, 28, 118,
+ 205, 201, 147, 83, 254, 40, 93, 112,
+ 180, 58, 207, 245, 38, 46, 247, 215,
+ 65, 74, 79, 165, 91, 186, 56, 115,
+ 224, 71, 188, 148, 145, 253, 196, 148,
+ 106, 234, 246, 248, 194, 248, 109, 121,
+ 172, 53, 26, 210, 121, 97, 206, 168,
+ 34, 130, 168, 174, 134, 34, 180, 195,
+ 5, 46, 144, 47, 69, 98, 217, 166,
+ 112, 3, 86, 85, 126, 220, 76, 1,
+ 60, 12, 1, 40, 87, 78, 38, 103,
+ 177, 1, 166, 1, 188, 244, 104, 73,
+ 144, 77, 225, 115, 112, 53, 201, 51,
+ 29, 20, 12, 207, 200, 53, 175, 91,
+ 145, 171, 126, 248, 89, 39, 208, 243,
+ 118, 30, 204, 83, 117, 41, 237, 243,
+ 34, 179, 226, 40, 138, 99, 10, 122,
+ 126, 212, 42, 168, 132, 209, 211, 15,
+ 27, 29, 70, 157, 236, 19, 122, 44,
+ 45, 211, 213, 146, 134, 239, 56, 200,
+ 21, 247, 106, 219, 16, 217, 13, 43,
+ 63, 76, 27, 227, 25, 200, 36, 181,
+ 97, 224, 216, 49, 89, 41, 29, 147,
+ 177, 126, 209, 71, 112, 94, 82, 116,
+ 39, 10, 50, 188, 32, 42, 165, 35,
+ 248, 35, 203, 80, 34, 245, 5, 32,
+ 62, 133, 34, 15, 34, 157, 201, 246,
+ 202, 159, 50, 184, 167, 223, 168, 190,
+ 181, 32, 251, 11, 229, 243, 30, 94,
+ 170, 198, 170, 195, 140, 176, 102, 200,
+ 168, 128, 178, 11, 53, 82, 230, 151,
+ 21, 231, 46, 159, 254, 80, 197, 236,
+ 246, 41, 229, 6, 48, 214, 249, 242,
+ 21, 225, 50, 84, 74, 79, 112, 174,
+ 51, 86, 102, 137, 38, 239, 230, 176,
+ 80, 130, 58, 226, 194, 107, 41, 223,
+ 255, 250, 6, 236, 223, 254, 93, 8,
+ 206, 121, 61, 201, 122, 224, 168, 81,
+ 210, 132, 144, 198, 25, 255, 151, 173,
+ 148, 195, 98, 97, 177, 118, 99, 90,
+ 131, 105, 111, 160, 118, 112, 99, 120,
+ 90, 140, 224, 42, 122, 234, 152, 204,
+ 35, 137, 18, 57, 40, 14, 191, 15,
+ 145, 204, 175, 114, 221, 7, 230, 229,
+ 224, 231, 211, 179, 178, 15, 24, 231,
+ 96, 157, 102, 224, 193, 106, 187, 142,
+ 18, 163, 105, 131, 131, 26, 199, 92,
+ 31, 130, 227, 148, 11, 111, 201, 76,
+ 182, 37, 198, 61, 173, 16, 137, 227,
+ 111, 80, 123, 245, 223, 120, 68, 104,
+ 242, 4, 62, 102, 117, 53, 68, 214,
+ 163, 83, 197, 162, 170, 144, 118, 86,
+ 61, 17, 197, 119, 135, 159, 134, 231,
+ 132, 235, 204, 141, 248, 180, 66, 85,
+ 248, 98, 229, 104, 131, 74, 166, 198,
+ 72, 43, 192, 204, 59, 4, 81, 7,
+ 45, 243, 48, 222, 239, 120, 92, 203,
+ 27, 151, 140, 107, 227, 40, 145, 131,
+ 136, 198, 45, 163, 216, 29, 243, 151,
+ 234, 176, 83, 253, 141, 3, 90, 151,
+ 169, 110, 229, 108, 12, 147, 122, 254,
+ 234, 182, 68, 60, 240, 50, 135, 128,
+ 226, 200, 49, 180, 255, 166, 108, 181,
+ 225, 162, 110, 169, 174, 0, 7, 53,
+ 40, 89, 56, 39, 160, 252, 199, 227,
+ 122, 7, 114, 86, 127, 16, 147, 27,
+ 226, 15, 178, 139, 168, 156, 51, 30,
+ 206, 33, 30, 172, 175, 9, 161, 74,
+ 184, 158, 11, 23, 171, 37, 36, 14,
+ 196, 8, 69, 53, 104, 240, 112, 83,
+ 28, 77, 2, 2, 169, 22, 203, 172,
+ 78, 189, 103, 21, 22, 29, 82, 123,
+ 213, 13, 53, 213, 209, 153, 124, 247,
+ 254, 113, 200, 71, 88, 235, 7, 233,
+ 249, 172, 55, 223, 123, 174, 205, 155,
+ 188, 219, 135, 55, 64, 226, 44, 229,
+ 131, 143, 166, 81, 119, 155, 170, 110,
+ 119, 188, 242, 90, 74, 187, 14, 43,
+ 121, 123, 126, 39, 61, 9, 181, 4,
+ 194, 41, 63, 85, 115, 198, 66, 23,
+ 37, 90, 47, 1, 154, 23, 15, 14,
+ 127, 72, 144, 232, 212, 220, 198, 191,
+ 107, 162, 130, 253, 172, 121, 21, 209,
+ 173, 52, 107, 172, 142, 187, 161, 37,
+ 180, 91, 173, 36, 192, 106, 216, 80,
+ 12, 254, 89, 164, 95, 110, 154, 19,
+ 143, 13, 53, 114, 123, 49, 54, 249,
+ 34, 98, 184, 43, 242, 52, 75, 113,
+ 203, 251, 252, 150, 174, 189, 203, 75,
+ 147, 35, 11, 224, 188, 130, 66, 173,
+ 80, 211, 208, 125, 247, 12, 222, 139,
+ 192, 43, 216, 103, 35, 196, 233, 158,
+ 249, 166, 203, 139, 245, 206, 30, 43,
+ 42, 132, 40, 136, 247, 145, 164, 51,
+ 65, 118, 233, 100, 150, 205, 198, 233,
+ 75, 3, 47, 33, 86, 161, 19, 222,
+ 218, 215, 110, 28, 217, 164, 240, 131,
+ 166, 178, 147, 79, 210, 20, 194, 19,
+ 230, 183, 53, 44, 56, 23, 162, 98,
+ 142, 102, 205, 240, 181, 159, 61, 54,
+ 221, 168, 51, 41, 247, 22, 66, 109,
+ 241, 26, 162, 153, 42, 207, 2, 68,
+ 186, 163, 8, 158, 108, 50, 27, 102,
+ 106, 154, 188, 18, 180, 199, 166, 128,
+ 87, 197, 226, 187, 96, 80, 212, 123,
+ 45, 193, 16, 226, 247, 186, 205, 180,
+ 107, 160, 205, 6, 29, 191, 34, 176,
+ 23, 229, 213, 139, 42, 103, 158, 123,
+ 36, 87, 128, 120, 143, 209, 63, 48,
+ 74, 237, 134, 177, 129, 132, 200, 130,
+ 38, 46, 205, 57, 108, 135, 238, 89,
+ 243, 175, 194, 118, 61, 228, 100, 188,
+ 130, 101, 32, 129, 210, 166, 33, 79,
+ 16, 33, 4, 251, 181, 131, 55, 162,
+ 67, 16, 22, 52, 243, 22, 199, 222,
+ 195, 153, 36, 79, 183, 85, 209, 245,
+ 77, 206, 70, 214, 168, 231, 24, 99,
+ 80, 215, 137, 10, 142, 86, 217, 0,
+ 46, 252, 54, 162, 42, 25, 114, 102,
+ 22, 216, 79, 140, 113, 214, 146, 21,
+ 122, 155, 29, 240, 150, 184, 8, 25,
+ 58, 62, 58, 240, 115, 171, 77, 145,
+ 162, 185, 237, 224, 247, 190, 156, 96,
+ 249, 30, 109, 36, 122, 76, 65, 143,
+ 93, 164, 123, 35, 11, 35, 134, 215,
+ 174, 55, 65, 207, 38, 0, 0, 47,
+ 43, 98, 5, 47, 73, 188, 34, 57,
+ 18, 97, 238, 95, 53, 200, 222, 89,
+ 244, 18, 2, 153, 82, 90, 115, 174,
+ 237, 39, 24, 139, 54, 132, 22, 184,
+ 113, 94, 63, 55, 245, 146, 242, 235,
+ 9, 119, 155, 22, 98, 164, 51, 145,
+ 53, 177, 212, 223, 3, 137, 96, 15,
+ 70, 136, 87, 126, 126, 126, 173, 217,
+ 59, 65, 113, 186, 118, 153, 210, 229,
+ 70, 53, 148, 202, 147, 113, 202, 191,
+ 210, 212, 110, 192, 27, 143, 61, 42,
+ 81, 106, 245, 44, 177, 200, 128, 242,
+ 81, 145, 200, 189, 79, 65, 45, 55,
+ 174, 74, 96, 194, 102, 154, 43, 97,
+ 18, 230, 198, 201, 83, 180, 195, 9,
+ 145, 233, 104, 230, 101, 19, 236, 40,
+ 106, 219, 149, 12, 165, 120, 93, 163,
+ 216, 109, 56, 203, 60, 7, 198, 153,
+ 109, 220, 156, 184, 71, 132, 174, 0,
+ 106, 96, 141, 63, 7, 136, 122, 203,
+ 93, 37, 227, 51, 116, 162, 217, 136,
+ 210, 50, 244, 91, 245, 32, 130, 148,
+ 123, 65, 11, 94, 19, 214, 224, 114,
+ 92, 196, 171, 17, 36, 17, 58, 164,
+ 127, 21, 33, 198, 62, 155, 63, 24,
+ 134, 190, 137, 198, 205, 148, 45, 155,
+ 119, 20, 205, 20, 153, 71, 72, 179,
+ 20, 162, 225, 233, 113, 235, 183, 20,
+ 58, 29, 80, 197, 103, 65, 201, 155,
+ 206, 194, 30, 19, 52, 182, 74, 197,
+ 7, 18, 113, 133, 91, 60, 175, 11,
+ 208, 123, 140, 177, 194, 253, 161, 33,
+ 54, 88, 31, 93, 249, 57, 81, 216,
+ 150, 32, 230, 180, 73, 119, 19, 139,
+ 160, 109, 129, 26, 98, 171, 95, 116,
+ 22, 248, 225, 82, 62, 246, 11, 69,
+ 98, 179, 120, 224, 34, 236, 135, 85,
+ 24, 54, 73, 125, 52, 126, 68, 75,
+ 94, 208, 85, 177, 237, 156, 168, 120,
+ 244, 129, 50, 245, 242, 148, 181, 236,
+ 68, 99, 193, 187, 244, 70, 30, 181,
+ 213, 188, 113, 186, 50, 69, 208, 112,
+ 221, 95, 122, 221, 137, 232, 92, 115,
+ 107, 77, 160, 222, 213, 224, 37, 136,
+ 60, 180, 149, 184, 164, 43, 129, 154,
+ 208, 26, 152, 204, 75, 143, 219, 57,
+ 10, 95, 17, 255, 156, 68, 189, 177,
+ 51, 102, 91, 78, 227, 153, 133, 202,
+ 46, 239, 171, 160, 231, 5, 187, 144,
+ 77, 190, 120, 170, 239, 192, 48, 13,
+ 109, 231, 196, 77, 54, 146, 6, 113,
+ 190, 94, 61, 18, 243, 24, 161, 221,
+ 146, 40, 224, 132, 176, 49, 204, 157,
+ 184, 80, 29, 105, 248, 212, 14, 24,
+ 120, 137, 137, 37, 105, 38, 216, 11,
+ 113, 205, 28, 255, 152, 30, 232, 22,
+ 6, 177, 82, 57, 63, 250, 139, 216,
+ 150, 15, 186, 170, 106, 154, 168, 21,
+ 252, 193, 15, 69, 216, 222, 80, 14,
+ 109, 171, 190, 177, 202, 108, 73, 220,
+ 4, 228, 104, 24, 74, 22, 179, 107,
+ 188, 218, 68, 61, 17, 31, 56, 176,
+ 58, 195, 233, 82, 121, 82, 93, 207,
+ 156, 184, 184, 81, 111, 87, 110, 116,
+ 38, 121, 178, 241, 236, 119, 80, 230,
+ 246, 176, 91, 197, 96, 8, 30, 27,
+ 220, 236, 49, 9, 231, 55, 70, 180,
+ 96, 30, 208, 155, 7, 81, 45, 49,
+ 22, 126, 151, 225, 248, 172, 23, 212,
+ 175, 243, 48, 65, 97, 153, 74, 133,
+ 72, 50, 132, 254, 80, 174, 126, 26,
+ 211, 140, 221, 76, 164, 18, 135, 174,
+ 39, 217, 203, 183, 47, 128, 103, 93,
+ 14, 105, 47, 143, 152, 182, 210, 175,
+ 155, 204, 214, 190, 246, 60, 241, 82,
+ 113, 65, 220, 228, 53, 98, 148, 170,
+ 41, 192, 162, 155, 71, 95, 51, 227,
+ 214, 7, 73, 170, 68, 142, 19, 92,
+ 142, 19, 18, 98, 17, 143, 170, 126,
+ 10, 231, 52, 216, 234, 114, 32, 71,
+ 32, 235, 163, 211, 83, 187, 24, 39,
+ 144, 191, 79, 231, 158, 112, 31, 186,
+ 135, 93, 27, 17, 78, 64, 146, 3,
+ 68, 33, 5, 59, 157, 50, 220, 6,
+ 198, 105, 4, 75, 170, 222, 193, 152,
+ 159, 232, 147, 215, 101, 121, 214, 100,
+ 119, 137, 236, 254, 142, 56, 182, 193,
+ 169, 221, 181, 160, 18, 50, 121, 154,
+ 134, 41, 253, 81, 12, 37, 76, 220,
+ 156, 235, 211, 113, 226, 1, 188, 67,
+ 160, 187, 204, 27, 91, 237, 240, 53,
+ 87, 93, 152, 54, 104, 69, 75, 18,
+ 124, 128, 204, 119, 86, 24, 176, 80,
+ 57, 204, 164, 9, 131, 89, 190, 54,
+ 192, 172, 171, 57, 113, 40, 234, 147,
+ 112, 37, 198, 216, 10, 132, 30, 164,
+ 206, 204, 29, 42, 79, 156, 121, 21,
+ 1, 212, 70, 40, 42, 230, 41, 202,
+ 133, 82, 109, 200, 182, 166, 220, 52,
+ 145, 42, 96, 201, 15, 90, 109, 234,
+ 106, 55, 175, 6, 30, 207, 32, 89,
+ 37, 201, 211, 87, 176, 111, 165, 101,
+ 18, 189, 246, 104, 145, 123, 14, 127,
+ 164, 107, 67, 78, 211, 241, 150, 101,
+ 49, 79, 122, 202, 102, 223, 244, 246,
+ 203, 17, 58, 100, 75, 116, 63, 196,
+ 23, 133, 78, 4, 171, 136, 188, 77,
+ 119, 216, 161, 176, 11, 121, 99, 206,
+ 6, 181, 187, 218, 169, 201, 35, 72,
+ 18, 230, 61, 238, 93, 3, 104, 122,
+ 55, 46, 151, 40, 164, 178, 49, 214,
+ 65, 133, 212, 167, 153, 47, 149, 198,
+ 22, 144, 90, 192, 159, 148, 138, 85,
+ 103, 161, 6, 81, 198, 5, 202, 225,
+ 103, 181, 185, 101, 237, 169, 247, 110,
+ 70, 232, 153, 164, 30, 129, 79, 85,
+ 11, 199, 161, 75, 20, 55, 128, 147,
+ 122, 184, 166, 4, 8, 112, 234, 34,
+ 81, 232, 16, 181, 103, 153, 112, 177,
+ 55, 12, 179, 77, 125, 18, 216, 239,
+ 127, 217, 154, 58, 207, 89, 175, 23,
+ 185, 191, 17, 215, 221, 167, 137, 240,
+ 166, 96, 197, 178, 92, 83, 193, 8,
+ 241, 138, 46, 76, 206, 29, 115, 126,
+ 69, 231, 50, 71, 127, 255, 147, 13,
+ 197, 108, 113, 121, 234, 212, 247, 72,
+ 49, 65, 247, 94, 248, 104, 26, 81,
+ 93, 17, 94, 219, 237, 198, 181, 53,
+ 14, 169, 227, 178, 12, 188, 212, 141,
+ 76, 94, 53, 19, 187, 68, 53, 220,
+ 60, 1, 180, 16, 99, 37, 45, 31,
+ 169, 216, 37, 243, 17, 132, 3, 73,
+ 49, 99, 170, 42, 42, 189, 203, 144,
+ 253, 111, 232, 210, 167, 159, 232, 25,
+ 91, 82, 176, 169, 17, 43, 125, 219,
+ 236, 75, 38, 20, 219, 144, 197, 212,
+ 126, 98, 21, 34, 223, 179, 64, 141,
+ 235, 33, 52, 239, 52, 106, 70, 130,
+ 132, 56, 72, 172, 209, 255, 30, 199,
+ 160, 197, 184, 201, 78, 82, 156, 205,
+ 48, 219, 5, 47, 237, 184, 73, 70,
+ 181, 158, 113, 25, 184, 161, 186, 21,
+ 103, 24, 193, 211, 254, 124, 87, 68,
+ 143, 182, 203, 166, 55, 252, 209, 80,
+ 178, 199, 233, 200, 124, 188, 74, 53,
+ 86, 139, 123, 175, 25, 95, 226, 102,
+ 158, 231, 148, 101, 101, 131, 75, 235,
+ 176, 105, 51, 130, 212, 112, 61, 110,
+ 74, 79, 127, 108, 37, 110, 181, 107,
+ 9, 123, 148, 77, 238, 168, 190, 37,
+ 62, 0, 211, 210, 78, 165, 233, 120,
+ 47, 250, 160, 215, 212, 166, 246, 169,
+ 112, 90, 35, 159, 92, 166, 220, 51,
+ 190, 57, 233, 3, 99, 69, 171, 74,
+ 50, 198, 44, 145, 21, 97, 77, 254,
+ 103, 155, 29, 241, 98, 160, 14, 88,
+ 168, 40, 149, 186, 41, 222, 73, 83,
+ 206, 98, 175, 158, 70, 4, 42, 104,
+ 105, 60, 14, 92, 1, 235, 100, 147,
+ 141, 46, 5, 218, 128, 119, 32, 145,
+ 236, 16, 176, 12, 179, 143, 194, 129,
+ 187, 165, 168, 11, 81, 253, 71, 122,
+ 64, 109, 254, 20, 117, 195, 193, 41,
+ 196, 226, 211, 54, 214, 229, 62, 231,
+ 15, 165, 95, 136, 103, 177, 4, 210,
+ 53, 229, 131, 202, 207, 250, 98, 204,
+ 8, 22, 115, 117, 96, 196, 88, 229,
+ 20, 25, 244, 117, 236, 13, 158, 138,
+ 154, 74, 87, 10, 154, 93, 222, 154,
+ 63, 231, 243, 68, 65, 137, 3, 68,
+ 178, 177, 197, 59, 254, 192, 233, 174,
+ 144, 100, 154, 113, 87, 149, 124, 140,
+ 49, 145, 26, 129, 50, 55, 9, 63,
+ 36, 168, 114, 65, 59, 158, 107, 115,
+ 138, 253, 115, 211, 152, 241, 214, 235,
+ 4, 249, 110, 90, 103, 6, 144, 43,
+ 118, 205, 216, 114, 207, 174, 72, 135,
+ 111, 98, 166, 232, 113, 117, 186, 108,
+ 30, 227, 31, 30, 222, 200, 119, 7,
+ 107, 6, 120, 207, 100, 225, 110, 159,
+ 48, 74, 204, 255, 54, 64, 127, 163,
+ 75, 190, 0, 60, 218, 69, 185, 67,
+ 65, 180, 136, 33, 18, 233, 212, 217,
+ 210, 65, 155, 3, 9, 154, 198, 60,
+ 9, 226, 84, 36, 210, 27, 162, 18,
+ 116, 27, 3, 117, 235, 166, 19, 49,
+ 21, 52, 82, 49, 249, 112, 120, 228,
+ 235, 99, 50, 151, 121, 231, 134, 183,
+ 2, 206, 205, 4, 68, 195, 102, 178,
+ 112, 112, 172, 135, 205, 135, 202, 12,
+ 193, 74, 107, 126, 103, 60, 21, 232,
+ 41, 197, 201, 210, 109, 51, 111, 121,
+ 91, 176, 213, 167, 195, 102, 120, 236,
+ 8, 12, 130, 110, 20, 40, 89, 110,
+ 163, 246, 39, 33, 146, 10, 239, 218,
+ 62, 112, 8, 129, 105, 240, 167, 169,
+ 120, 70, 74, 143, 82, 185, 108, 220,
+ 77, 250, 129, 79, 214, 161, 173, 111,
+ 185, 37, 163, 11, 71, 93, 70, 112,
+ 53, 254, 209, 63, 115, 227, 92, 184,
+ 105, 62, 230, 169, 15, 135, 116, 125,
+ 138, 12, 122, 143, 183, 16, 127, 34,
+ 24, 64, 97, 243, 254, 237, 200, 6,
+ 119, 128, 1, 107, 91, 2, 172, 37,
+ 108, 182, 70, 152, 82, 190, 155, 232,
+ 227, 101, 180, 139, 44, 218, 73, 3,
+ 40, 204, 215, 31, 125, 195, 51, 105,
+ 104, 58, 122, 237, 208, 45, 229, 79,
+ 141, 116, 29, 45, 181, 42, 167, 49,
+ 61, 184, 71, 254, 15, 142, 177, 202,
+ 10, 107, 95, 94, 76, 20, 27, 146,
+ 18, 20, 127, 218, 221, 138, 175, 27,
+ 210, 24, 177, 3, 194, 93, 70, 42,
+ 143, 67, 207, 251, 214, 32, 35, 76,
+ 24, 240, 15, 140, 80, 132, 238, 86,
+ 145, 11, 248, 200, 245, 219, 42, 184,
+ 44, 74, 119, 44, 86, 254, 47, 109,
+ 38, 110, 108, 124, 11, 188, 135, 145,
+ 253, 92, 187, 7, 28, 55, 202, 221,
+ 241, 113, 76, 42, 180, 100, 128, 83,
+ 108, 29, 33, 228, 66, 136, 178, 66,
+ 133, 85, 80, 38, 70, 106, 182, 207,
+ 191, 207, 92, 172, 48, 31, 117, 6,
+ 17, 10, 210, 200, 164, 207, 135, 180,
+ 254, 118, 163, 250, 248, 40, 150, 188,
+ 42, 151, 20, 31, 220, 99, 244, 241,
+ 78, 9, 17, 45, 100, 47, 12, 253,
+ 111, 187, 229, 154, 255, 127, 210, 62,
+ 92, 126, 98, 164, 45, 224, 34, 168,
+ 253, 78, 117, 188, 39, 221, 173, 108,
+ 59, 151, 68, 117, 148, 9, 16, 34,
+ 45, 0, 200, 109, 60, 196, 120, 119,
+ 238, 145, 140, 133, 173, 68, 1, 44,
+ 195, 216, 247, 211, 54, 43, 28, 107,
+ 117, 134, 179, 24, 71, 83, 81, 193,
+ 124, 98, 253, 252, 124, 78, 141, 234,
+ 105, 203, 112, 158, 127, 162, 74, 72,
+ 151, 13, 201, 240, 206, 123, 231, 35,
+ 187, 255, 116, 9, 19, 35, 70, 115,
+ 115, 60, 169, 230, 170, 35, 155, 137,
+ 27, 167, 44, 218, 30, 32, 76, 16,
+ 232, 223, 179, 233, 20, 49, 156, 18,
+ 152, 76, 101, 173, 0, 82, 19, 144,
+ 243, 240, 237, 105, 184, 70, 48, 153,
+ 101, 214, 117, 244, 150, 225, 42, 194,
+ 207, 152, 137, 87, 210, 186, 222, 153,
+ 152, 13, 22, 41, 77, 147, 7, 123,
+ 184, 98, 72, 243, 22, 177, 59, 87,
+ 254, 43, 6, 37, 69, 145, 162, 138,
+ 106, 29, 6, 27, 77, 233, 252, 148,
+ 225, 70, 243, 244, 70, 90, 235, 222,
+ 207, 188, 37, 221, 36, 84, 238, 84,
+ 43, 160, 149, 44, 14, 57, 251, 202,
+ 99, 236, 68, 23, 209, 176, 73, 226,
+ 239, 6, 47, 125, 16, 24, 148, 76,
+ 174, 247, 234, 1, 179, 238, 70, 68,
+ 112, 118, 155, 224, 114, 20, 159, 9,
+ 38, 45, 72, 149, 127, 123, 16, 241,
+ 56, 43, 32, 103, 193, 172, 139, 90,
+ 22, 60, 26, 62, 147, 130, 214, 2,
+ 163, 56, 101, 115, 173, 168, 115, 214,
+ 195, 7, 30, 240, 160, 234, 204, 187,
+ 194, 241, 110, 127, 152, 44, 121, 39,
+ 31, 10, 11, 191, 174, 244, 56, 169,
+ 31, 187, 156, 15, 35, 194, 203, 242,
+ 31, 104, 253, 125, 249, 10, 252, 52,
+ 96, 128, 231, 169, 85, 224, 59, 81,
+ 142, 168, 230, 121, 252, 210, 213, 120,
+ 177, 22, 138, 55, 224, 83, 41, 237,
+ 244, 19, 3, 164, 142, 90, 22, 216,
+ 202, 56, 184, 80, 125, 246, 30, 61,
+ 71, 83, 18, 192, 180, 237, 150, 182,
+ 113, 14, 29, 65, 3, 207, 193, 225,
+ 73, 71, 197, 190, 201, 197, 249, 89,
+ 218, 193, 106, 192, 161, 220, 46, 188,
+ 100, 75, 197, 193, 148, 105, 226, 147,
+ 170, 53, 109, 77, 161, 203, 184, 172,
+ 191, 195, 103, 246, 80, 103, 63, 9,
+ 66, 250, 75, 200, 191, 221, 27, 98,
+ 182, 200, 137, 61, 42, 193, 119, 233,
+ 248, 21, 86, 90, 42, 236, 205, 22,
+ 94, 35, 226, 171, 112, 106, 196, 158,
+ 95, 202, 138, 43, 8, 54, 242, 87,
+ 162, 104, 41, 189, 39, 9, 157, 71,
+ 124, 234, 56, 217, 164, 92, 9, 200,
+ 140, 244, 234, 59, 162, 225, 235, 46,
+ 40, 116, 61, 252, 218, 245, 88, 14,
+ 215, 96, 158, 201, 138, 2, 236, 228,
+ 250, 80, 171, 214, 194, 143, 166, 4,
+ 40, 10, 181, 38, 144, 84, 242, 82,
+ 28, 166, 210, 219, 17, 4, 92, 254,
+ 103, 144, 78, 117, 127, 28, 99, 224,
+ 203, 3, 220, 128, 221, 230, 175, 59,
+ 48, 26, 85, 247, 217, 196, 242, 27,
+ 144, 206, 202, 165, 155, 243, 2, 218,
+ 59, 217, 162, 45, 47, 27, 0, 250,
+ 75, 246, 204, 143, 30, 197, 202, 242,
+ 252, 178, 216, 104, 189, 175, 2, 30,
+ 197, 152, 115, 133, 137, 230, 229, 76,
+ 220, 43, 160, 32, 60, 160, 129, 76,
+ 80, 44, 173, 138, 113, 33, 93, 141,
+ 167, 252, 244, 205, 146, 133, 161, 49,
+ 255, 202, 112, 11, 255, 2, 220, 24,
+ 241, 148, 193, 240, 12, 12, 6, 82,
+ 72, 21, 164, 195, 137, 83, 69, 66,
+ 244, 204, 53, 242, 162, 165, 195, 137,
+ 34, 150, 27, 165, 139, 112, 188, 153,
+ 196, 101, 134, 194, 99, 228, 49, 129,
+ 174, 91, 230, 87, 121, 214, 99, 10,
+ 7, 252, 202, 92, 226, 131, 181, 180,
+ 127, 239, 251, 250, 252, 217, 242, 227,
+ 120, 57, 42, 55, 68, 75, 157, 229,
+ 251, 160, 100, 237, 64, 134, 201, 189,
+ 138, 192, 178, 85, 250, 190, 72, 106,
+ 0, 28, 193, 77, 189, 122, 20, 217,
+ 63, 197, 136, 235, 207, 1, 130, 48,
+ 140, 114, 202, 67, 25, 124, 135, 143,
+ 139, 85, 178, 148, 24, 205, 130, 2,
+ 241, 237, 231, 228, 190, 176, 148, 13,
+ 70, 113, 169, 237, 56, 213, 187, 183,
+ 87, 187, 169, 234, 112, 57, 247, 130,
+ 66, 245, 74, 68, 3, 75, 181, 182,
+ 210, 148, 225, 159, 26, 46, 8, 72,
+ 13, 149, 129, 80, 82, 212, 5, 145,
+ 4, 206, 18, 43, 168, 48, 192, 76,
+ 162, 84, 233, 2, 207, 82, 84, 70,
+ 51, 27, 0, 190, 111, 4, 17, 88,
+ 202, 115, 97, 153, 111, 42, 225, 57,
+ 245, 158, 136, 248, 50, 42, 172, 239,
+ 228, 46, 115, 118, 194, 120, 46, 1,
+ 149, 118, 21, 48, 94, 103, 175, 189,
+ 83, 212, 37, 119, 76, 82, 227, 231,
+ 182, 200, 244, 156, 205, 141, 217, 123,
+ 208, 186, 188, 140, 222, 51, 122, 173,
+ 201, 201, 136, 248, 252, 14, 103, 50,
+ 165, 6, 160, 15, 58, 28, 85, 74,
+ 232, 113, 106, 156, 199, 116, 99, 71,
+ 118, 234, 96, 35, 155, 201, 202, 96,
+ 214, 236, 28, 123, 226, 146, 80, 163,
+ 120, 157, 21, 98, 180, 152, 127, 54,
+ 254, 242, 143, 93, 235, 196, 64, 17,
+ 203, 135, 20, 243, 38, 160, 78, 24,
+ 225, 106, 98, 95, 110, 214, 8, 174,
+ 181, 85, 101, 159, 188, 17, 92, 69,
+ 182, 32, 189, 133, 249, 92, 164, 26,
+ 4, 101, 136, 36, 237, 184, 24, 239,
+ 219, 247, 115, 86, 232, 56, 220, 84,
+ 242, 8, 106, 30, 182, 54, 108, 107,
+ 94, 238, 75, 55, 251, 60, 77, 25,
+ 160, 181, 168, 206, 111, 190, 214, 184,
+ 34, 133, 229, 84, 42, 50, 224, 149,
+ 235, 80, 240, 173, 191, 27, 97, 24,
+ 56, 246, 123, 116, 209, 117, 144, 149,
+ 251, 132, 168, 150, 79, 103, 87, 50,
+ 42, 157, 243, 220, 21, 241, 70, 57,
+ 65, 171, 202, 128, 183, 36, 143, 238,
+ 220, 40, 95, 91, 151, 229, 254, 159,
+ 84, 252, 203, 58, 248, 206, 135, 169,
+ 47, 20, 105, 147, 198, 166, 60, 39,
+ 120, 105, 22, 213, 241, 82, 106, 163,
+ 154, 21, 138, 91, 209, 98, 248, 243,
+ 120, 32, 183, 6, 110, 197, 248, 34,
+ 192, 179, 144, 165, 151, 221, 22, 87,
+ 3, 205, 78, 5, 41, 185, 167, 131,
+ 172, 11, 103, 255, 228, 227, 131, 215,
+ 212, 159, 218, 211, 162, 41, 211, 2,
+ 23, 128, 20, 218, 129, 190, 230, 94,
+ 200, 222, 180, 165, 248, 99, 6, 161,
+ 182, 65, 157, 110, 209, 201, 188, 52,
+ 85, 12, 19, 129, 71, 63, 98, 34,
+ 214, 103, 12, 163, 129, 152, 239, 243,
+ 192, 15, 20, 62, 247, 158, 34, 207,
+ 218, 66, 65, 38, 9, 141, 100, 57,
+ 216, 179, 134, 40, 81, 36, 39, 62,
+ 191, 212, 174, 48, 238, 213, 51, 252,
+ 218, 142, 52, 44, 143, 150, 56, 238,
+ 48, 205, 59, 12, 213, 146, 199, 28,
+ 41, 60, 190, 6, 69, 168, 203, 161,
+ 9, 21, 185, 58, 211, 194, 182, 119,
+ 134, 155, 217, 209, 112, 146, 97, 60,
+ 126, 191, 230, 240, 125, 225, 27, 244,
+ 167, 45, 86, 168, 205, 244, 51, 243,
+ 199, 117, 166, 149, 106, 158, 154, 116,
+ 3, 56, 101, 245, 140, 196, 179, 227,
+ 176, 236, 249, 206, 97, 40, 68, 110,
+ 170, 105, 111, 181, 93, 40, 202, 211,
+ 233, 163, 222, 177, 115, 42, 161, 39,
+ 194, 156, 109, 221, 112, 210, 14, 141,
+ 77, 51, 35, 160, 130, 157, 145, 56,
+ 102, 189, 101, 50, 38, 90, 77, 20,
+ 138, 48, 197, 47, 206, 104, 220, 224,
+ 25, 126, 115, 255, 195, 118, 89, 10,
+ 246, 239, 190, 31, 72, 141, 251, 165,
+ 15, 126, 52, 145, 186, 133, 89, 66,
+ 229, 196, 117, 233, 19, 180, 220, 158,
+ 59, 168, 133, 245, 199, 214, 99, 177,
+ 228, 8, 168, 43, 200, 90, 147, 250,
+ 183, 28, 78, 117, 207, 28, 48, 186,
+ 235, 177, 225, 175, 23, 244, 213, 238,
+ 108, 223, 222, 162, 24, 114, 124, 114,
+ 98, 33, 64, 137, 22, 17, 183, 198,
+ 69, 121, 11, 197, 75, 164, 231, 205,
+ 145, 6, 239, 2, 183, 147, 50, 109,
+ 21, 155, 145, 89, 47, 147, 68, 41,
+ 49, 218, 6, 206, 41, 188, 182, 109,
+ 138, 217, 78, 30, 59, 107, 38, 18,
+ 195, 164, 83, 107, 95, 52, 34, 142,
+ 110, 76, 238, 7, 121, 246, 105, 203,
+ 236, 45, 182, 204, 222, 149, 91, 161,
+ 26, 37, 235, 54, 218, 194, 143, 32,
+ 38, 21, 24, 207, 98, 149, 2, 24,
+ 179, 69, 158, 206, 98, 167, 208, 2,
+ 221, 227, 178, 219, 152, 79, 189, 71,
+ 32, 111, 141, 200, 52, 91, 110, 49,
+ 214, 42, 149, 244, 40, 75, 217, 72,
+ 149, 132, 139, 5, 251, 100, 48, 28,
+ 74, 1, 205, 171, 65, 157, 62, 88,
+ 126, 106, 160, 123, 61, 204, 237, 19,
+ 41, 65, 17, 116, 9, 11, 35, 215,
+ 28, 186, 137, 235, 146, 99, 102, 68,
+ 39, 218, 181, 78, 157, 90, 162, 194,
+ 50, 192, 137, 190, 26, 136, 186, 144,
+ 186, 79, 68, 109, 184, 146, 218, 111,
+ 243, 127, 132, 128, 228, 20, 49, 124,
+ 125, 75, 247, 56, 213, 20, 109, 235,
+ 86, 246, 114, 176, 125, 106, 125, 167,
+ 233, 250, 110, 119, 131, 166, 126, 154,
+ 85, 222, 202, 93, 192, 39, 107, 147,
+ 109, 35, 113, 15, 105, 11, 206, 1,
+ 193, 75, 9, 35, 172, 102, 246, 177,
+ 1, 70, 179, 108, 254, 217, 73, 61,
+ 188, 65, 193, 165, 186, 236, 105, 230,
+ 50, 41, 98, 56, 76, 185, 165, 251,
+ 242, 101, 21, 146, 252, 122, 33, 11,
+ 5, 116, 236, 111, 22, 148, 46, 132,
+ 98, 45, 138, 75, 114, 222, 114, 223,
+ 3, 117, 132, 237, 249, 200, 201, 139,
+ 214, 224, 3, 176, 22, 13, 191, 192,
+ 7, 186, 38, 37, 254, 71, 133, 65,
+ 130, 67, 233, 164, 144, 250, 224, 19,
+ 60, 159, 215, 36, 221, 131, 126, 113,
+ 214, 235, 125, 122, 244, 22, 34, 40,
+ 156, 137, 248, 14, 163, 210, 86, 185,
+ 230, 112, 187, 46, 13, 127, 95, 98,
+ 216, 92, 74, 67, 12, 213, 97, 56,
+ 24, 28, 204, 226, 240, 175, 112, 119,
+ 49, 88, 125, 124, 196, 73, 138, 13,
+ 81, 58, 223, 112, 106, 74, 93, 154,
+ 58, 17, 53, 19, 150, 21, 134, 92,
+ 72, 198, 64, 53, 76, 111, 151, 52,
+ 189, 181, 196, 104, 58, 144, 73, 48,
+ 160, 92, 139, 152, 24, 120, 219, 179,
+ 15, 89, 157, 169, 127, 224, 24, 49,
+ 77, 25, 252, 237, 156, 12, 132, 182,
+ 14, 140, 8, 204, 22, 160, 174, 255,
+ 58, 25, 137, 243, 62, 156, 55, 113,
+ 131, 185, 204, 99, 120, 255, 92, 164,
+ 107, 172, 226, 47, 158, 53, 106, 39,
+ 221, 162, 10, 68, 213, 31, 79, 239,
+ 76, 215, 112, 137, 1, 220, 144, 159,
+ 249, 150, 64, 191, 160, 185, 234, 55,
+ 81, 78, 59, 215, 228, 104, 30, 45,
+ 185, 193, 142, 164, 69, 243, 243, 45,
+ 71, 208, 196, 2, 159, 214, 72, 203,
+ 132, 81, 181, 46, 45, 138, 47, 154,
+ 70, 41, 88, 247, 45, 151, 191, 156,
+ 63, 74, 142, 100, 131, 210, 194, 15,
+ 231, 87, 225, 227, 192, 80, 240, 233,
+ 128, 192, 128, 33, 219, 197, 253, 79,
+ 157, 216, 176, 149, 253, 28, 74, 3,
+ 197, 84, 248, 62, 50, 37, 82, 153,
+ 106, 46, 49, 208, 167, 239, 187, 64,
+ 146, 71, 117, 163, 45, 92, 246, 61,
+ 103, 191, 182, 227, 123, 58, 215, 22,
+ 96, 239, 84, 215, 170, 109, 124, 99,
+ 187, 156, 127, 63, 144, 128, 105, 234,
+ 171, 44, 77, 40, 238, 236, 59, 216,
+ 177, 97, 247, 245, 17, 91, 95, 36,
+ 120, 113, 175, 225, 7, 90, 244, 94,
+ 141, 190, 143, 54, 38, 226, 34, 180,
+ 251, 113, 20, 66, 158, 149, 211, 58,
+ 250, 177, 148, 16, 74, 33, 56, 153,
+ 137, 221, 180, 95, 204, 72, 171, 102,
+ 3, 131, 195, 83, 211, 61, 40, 211,
+ 0, 78, 119, 101, 81, 140, 101, 22,
+ 120, 111, 101, 119, 210, 50, 87, 207,
+ 65, 241, 211, 218, 52, 40, 134, 20,
+ 210, 98, 153, 192, 162, 196, 121, 117,
+ 230, 251, 61, 220, 113, 68, 127, 121,
+ 42, 191, 207, 26, 60, 116, 14, 151,
+ 116, 41, 136, 85, 157, 73, 176, 180,
+ 55, 251, 78, 34, 96, 136, 92, 93,
+ 171, 34, 136, 218, 103, 204, 227, 92,
+ 204, 49, 168, 123, 173, 4, 212, 22,
+ 7, 218, 180, 232, 17, 152, 172, 127,
+ 225, 122, 58, 221, 161, 27, 144, 119,
+ 115, 176, 140, 254, 66, 193, 59, 101,
+ 36, 244, 14, 74, 191, 205, 101, 217,
+ 3, 140, 225, 127, 201, 122, 46, 102,
+ 97, 175, 210, 51, 188, 24, 118, 33,
+ 68, 204, 167, 14, 218, 190, 26, 231,
+ 24, 192, 60, 234, 239, 195, 217, 224,
+ 187, 111, 88, 105, 1, 174, 45, 15,
+ 138, 197, 162, 67, 95, 240, 103, 218,
+ 139, 24, 22, 89, 27, 86, 188, 224,
+ 212, 227, 46, 237, 187, 32, 250, 253,
+ 138, 107, 235, 180, 46, 93, 195, 36,
+ 212, 167, 218, 150, 175, 37, 71, 139,
+ 88, 255, 13, 232, 167, 193, 169, 193,
+ 130, 190, 169, 152, 92, 53, 22, 210,
+ 65, 154, 3, 5, 180, 226, 241, 123,
+ 64, 226, 38, 134, 118, 221, 184, 68,
+ 92, 115, 204, 232, 62, 250, 219, 176,
+ 147, 193, 175, 107, 139, 134, 131, 14,
+ 121, 100, 25, 72, 165, 104, 141, 98,
+ 9, 227, 122, 41, 78, 150, 33, 121,
+ 121, 135, 111, 22, 216, 129, 67, 197,
+ 132, 45, 198, 34, 88, 111, 65, 130,
+ 28, 32, 38, 218, 188, 174, 41, 106,
+ 77, 116, 250, 112, 78, 6, 75, 168,
+ 27, 232, 208, 14, 9, 228, 149, 40,
+ 234, 154, 5, 145, 23, 155, 169, 35,
+ 136, 161, 233, 143, 248, 133, 231, 241,
+ 212, 78, 120, 199, 93, 127, 248, 114,
+ 249, 104, 127, 88, 218, 29, 227, 104,
+ 150, 92, 127, 215, 70, 135, 10, 39,
+ 72, 110, 73, 6, 180, 222, 73, 150,
+ 10, 5, 117, 195, 202, 21, 189, 217,
+ 193, 145, 160, 169, 141, 35, 75, 54,
+ 209, 214, 103, 127, 26, 196, 231, 111,
+ 17, 251, 138, 130, 7, 239, 224, 181,
+ 4, 124, 68, 161, 32, 25, 139, 132,
+ 237, 109, 198, 160, 190, 162, 11, 161,
+ 254, 125, 85, 155, 35, 45, 84, 156,
+ 11, 84, 91, 16, 239, 56, 207, 218,
+ 223, 84, 24, 226, 248, 182, 143, 81,
+ 226, 130, 43, 185, 221, 40, 95, 48,
+ 7, 111, 238, 9, 205, 181, 36, 54,
+ 49, 187, 61, 69, 53, 21, 202, 207,
+ 75, 143, 49, 81, 107, 246, 123, 105,
+ 214, 157, 61, 252, 159, 170, 76, 74,
+ 200, 29, 185, 220, 9, 94, 251, 6,
+ 91, 182, 198, 181, 238, 189, 151, 118,
+ 203, 228, 199, 191, 118, 6, 87, 58,
+ 189, 233, 163, 128, 169, 8, 57, 64,
+ 175, 158, 167, 117, 43, 80, 134, 183,
+ 115, 177, 247, 44, 65, 12, 220, 39,
+ 183, 233, 58, 166, 156, 24, 129, 88,
+ 245, 51, 48, 207, 122, 198, 17, 218,
+ 248, 177, 141, 151, 246, 241, 247, 82,
+ 9, 208, 134, 116, 49, 201, 64, 11,
+ 239, 183, 118, 237, 244, 76, 134, 67,
+ 45, 208, 80, 249, 2, 59, 124, 43,
+ 202, 114, 232, 19, 99, 233, 161, 20,
+ 198, 189, 233, 43, 56, 20, 60, 244,
+ 221, 24, 190, 91, 115, 244, 77, 66,
+ 118, 166, 117, 240, 182, 200, 162, 154,
+ 76, 218, 114, 104, 89, 81, 163, 173,
+ 125, 3, 119, 169, 115, 179, 191, 175,
+ 102, 221, 202, 191, 11, 145, 213, 2,
+ 211, 35, 29, 31, 90, 214, 2, 204,
+ 62, 38, 58, 157, 135, 41, 61, 3,
+ 192, 170, 213, 13, 34, 94, 82, 47,
+ 72, 6, 97, 212, 201, 23, 89, 207,
+ 118, 236, 220, 147, 91, 254, 153, 229,
+ 192, 50, 154, 244, 69, 233, 150, 20,
+ 23, 143, 57, 172, 95, 30, 205, 52,
+ 17, 220, 155, 166, 56, 14, 16, 227,
+ 7, 36, 67, 158, 116, 119, 67, 130,
+ 169, 227, 129, 9, 50, 112, 116, 53,
+ 223, 180, 194, 228, 66, 149, 197, 13,
+ 19, 116, 73, 19, 42, 132, 84, 202,
+ 182, 147, 38, 130, 128, 26, 0, 192,
+ 243, 142, 130, 199, 176, 71, 91, 115,
+ 2, 59, 231, 71, 101, 51, 103, 121,
+ 85, 241, 151, 207, 221, 238, 210, 218,
+ 254, 65, 224, 84, 204, 15, 146, 60,
+ 32, 161, 171, 221, 77, 193, 246, 213,
+ 138, 76, 49, 115, 9, 206, 219, 238,
+ 99, 173, 193, 236, 112, 197, 144, 71,
+ 218, 1, 131, 4, 30, 30, 222, 210,
+ 96, 226, 170, 91, 162, 254, 113, 115,
+ 175, 150, 221, 67, 119, 223, 88, 174,
+ 159, 55, 7, 229, 211, 166, 128, 127,
+ 193, 161, 246, 194, 210, 100, 161, 193,
+ 99, 14, 235, 57, 251, 241, 199, 82,
+ 159, 208, 68, 77, 27, 247, 230, 74,
+ 247, 185, 165, 22, 220, 108, 179, 142,
+ 143, 19, 23, 53, 83, 50, 4, 101,
+ 71, 241, 77, 239, 237, 95, 210, 129,
+ 24, 246, 58, 177, 144, 233, 152, 55,
+ 111, 118, 91, 47, 214, 86, 213, 151,
+ 56, 46, 240, 194, 39, 200, 137, 237,
+ 251, 231, 32, 27, 13, 213, 39, 199,
+ 151, 219, 41, 69, 60, 34, 108, 100,
+ 29, 195, 218, 182, 34, 214, 100, 243,
+ 6, 30, 83, 167, 218, 223, 68, 140,
+ 125, 203, 186, 168, 7, 218, 92, 116,
+ 107, 165, 87, 232, 210, 106, 162, 17,
+ 136, 227, 19, 233, 64, 22, 173, 229,
+ 20, 4, 199, 239, 183, 65, 46, 42,
+ 17, 49, 77, 90, 48, 87, 30, 182,
+ 146, 187, 0, 61, 95, 204, 48, 78,
+ 18, 236, 162, 196, 154, 255, 243, 250,
+ 24, 108, 19, 238, 205, 18, 158, 28,
+ 231, 162, 74, 82, 44, 136, 253, 105,
+ 15, 102, 79, 33, 140, 46, 64, 201,
+ 173, 192, 170, 235, 1, 175, 149, 169,
+ 174, 117, 100, 28, 94, 140, 182, 200,
+ 249, 71, 161, 210, 41, 72, 255, 145,
+ 77, 78, 139, 234, 183, 232, 54, 73,
+ 53, 215, 156, 55, 55, 42, 36, 61,
+ 169, 188, 171, 121, 139, 42, 70, 46,
+ 208, 27, 109, 154, 35, 33, 138, 154,
+ 1, 80, 114, 254, 45, 110, 55, 228,
+ 164, 79, 58, 59, 235, 128, 41, 215,
+ 77, 178, 207, 45, 186, 113, 57, 51,
+ 122, 28, 238, 24, 97, 96, 242, 63,
+ 141, 25, 4, 187, 163, 218, 35, 89,
+ 48, 205, 5, 60, 102, 139, 200, 113,
+ 46, 217, 83, 222, 8, 79, 125, 78,
+ 105, 215, 113, 148, 182, 64, 219, 220,
+ 45, 159, 158, 204, 58, 113, 86, 250,
+ 74, 132, 192, 171, 43, 85, 45, 122,
+ 45, 252, 41, 227, 84, 142, 193, 59,
+ 87, 70, 94, 191, 32, 18, 82, 224,
+ 249, 253, 185, 92, 55, 90, 179, 228,
+ 178, 184, 244, 91, 230, 175, 32, 79,
+ 41, 124, 90, 99, 178, 48, 126, 231,
+ 190, 48, 196, 123, 187, 151, 115, 160,
+ 64, 223, 171, 229, 87, 173, 168, 242,
+ 119, 55, 227, 14, 100, 145, 11, 57,
+ 53, 94, 66, 151, 38, 231, 35, 123,
+ 193, 31, 222, 254, 17, 99, 67, 61,
+ 59, 244, 80, 135, 226, 150, 123, 46,
+ 230, 218, 54, 28, 203, 236, 59, 101,
+ 225, 60, 159, 82, 130, 0, 231, 166,
+ 214, 155, 22, 210, 105, 221, 126, 190,
+ 157, 72, 46, 133, 50, 219, 205, 68,
+ 124, 95, 110, 210, 100, 111, 168, 222,
+ 61, 127, 23, 61, 37, 72, 195, 132,
+ 164, 130, 129, 147, 246, 58, 119, 179,
+ 167, 248, 128, 98, 249, 116, 163, 137,
+ 99, 153, 182, 130, 111, 171, 16, 241,
+ 45, 205, 31, 161, 161, 137, 48, 6,
+ 161, 184, 138, 243, 209, 79, 13, 171,
+ 244, 34, 168, 219, 182, 132, 201, 69,
+ 165, 20, 231, 75, 186, 99, 66, 127,
+ 255, 22, 84, 121, 194, 134, 10, 175,
+ 50, 179, 70, 61, 120, 240, 163, 74,
+ 66, 194, 37, 31, 148, 55, 192, 36,
+ 190, 116, 247, 102, 17, 33, 19, 64,
+ 13, 45, 206, 112, 249, 41, 48, 210,
+ 138, 20, 8, 217, 41, 54, 226, 214,
+ 249, 161, 124, 51, 183, 128, 198, 108,
+ 128, 103, 178, 109, 209, 19, 147, 146,
+ 169, 253, 119, 58, 192, 203, 122, 172,
+ 96, 166, 228, 92, 76, 240, 58, 125,
+ 64, 101, 133, 25, 80, 16, 53, 243,
+ 104, 95, 198, 215, 249, 12, 77, 91,
+ 136, 86, 199, 192, 234, 27, 237, 120,
+ 140, 149, 111, 152, 207, 178, 136, 130,
+ 35, 160, 212, 139, 12, 211, 64, 192,
+ 40, 218, 72, 25, 45, 192, 83, 252,
+ 250, 114, 172, 108, 56, 178, 94, 190,
+ 101, 74, 166, 243, 227, 30, 155, 219,
+ 65, 198, 223, 48, 65, 118, 106, 210,
+ 50, 248, 208, 202, 214, 36, 128, 8,
+ 95, 38, 231, 210, 237, 219, 83, 224,
+ 118, 230, 126, 78, 0, 137, 11, 47,
+ 208, 164, 48, 61, 17, 81, 18, 58,
+ 21, 93, 119, 164, 101, 184, 181, 175,
+ 34, 206, 59, 115, 38, 132, 67, 169,
+ 243, 154, 142, 114, 144, 44, 8, 74,
+ 16, 240, 33, 98, 217, 67, 22, 72,
+ 65, 17, 220, 179, 215, 87, 96, 192,
+ 231, 207, 161, 143, 107, 190, 158, 21,
+ 251, 122, 200, 201, 83, 95, 143, 96,
+ 4, 53, 115, 132, 214, 232, 34, 55,
+ 149, 12, 177, 23, 208, 133, 53, 87,
+ 38, 98, 214, 252, 129, 196, 110, 97,
+ 252, 138, 253, 142, 186, 195, 13, 30,
+ 15, 48, 146, 107, 175, 197, 14, 79,
+ 97, 61, 240, 200, 32, 129, 65, 41,
+ 248, 153, 41, 148, 83, 241, 7, 2,
+ 124, 69, 15, 99, 194, 82, 178, 183,
+ 236, 96, 228, 187, 163, 198, 254, 147,
+ 160, 81, 104, 57, 190, 243, 75, 113,
+ 211, 169, 166, 39, 236, 91, 188, 185,
+ 68, 65, 207, 138, 77, 91, 121, 136,
+ 185, 75, 183, 103, 44, 59, 138, 236,
+ 42, 27, 227, 4, 133, 199, 240, 233,
+ 131, 172, 65, 148, 134, 141, 144, 12,
+ 82, 97, 196, 135, 217, 139, 66, 47,
+ 143, 116, 47, 210, 153, 151, 42, 202,
+ 28, 133, 190, 125, 113, 188, 46, 1,
+ 171, 82, 122, 102, 193, 126, 56, 124,
+ 190, 142, 24, 102, 194, 59, 196, 125,
+ 201, 129, 232, 21, 81, 219, 200, 242,
+ 14, 242, 246, 124, 68, 53, 30, 162,
+ 78, 144, 36, 171, 56, 200, 213, 39,
+ 136, 77, 212, 173, 57, 123, 170, 57,
+ 173, 221, 175, 72, 224, 11, 214, 242,
+ 120, 55, 180, 37, 225, 16, 17, 189,
+ 16, 138, 240, 178, 49, 105, 230, 164,
+ 50, 75, 177, 115, 175, 116, 242, 188,
+ 61, 38, 60, 141, 105, 50, 37, 51,
+ 37, 28, 152, 221, 18, 49, 211, 34,
+ 178, 215, 130, 187, 131, 89, 128, 9,
+ 86, 43, 216, 17, 141, 56, 114, 32,
+ 253, 172, 245, 214, 225, 183, 170, 35,
+ 90, 14, 52, 22, 38, 56, 246, 6,
+ 144, 129, 52, 101, 207, 181, 90, 140,
+ 216, 137, 253, 173, 33, 20, 208, 14,
+ 53, 113, 255, 105, 155, 192, 244, 25,
+ 53, 206, 172, 191, 240, 196, 231, 154,
+ 113, 244, 175, 51, 140, 13, 22, 109,
+ 152, 112, 130, 15, 72, 186, 218, 215,
+ 132, 122, 80, 49, 233, 147, 182, 17,
+ 32, 84, 107, 145, 202, 192, 198, 87,
+ 217, 14, 115, 67, 249, 83, 224, 185,
+ 67, 64, 238, 16, 36, 244, 3, 56,
+ 170, 169, 18, 174, 110, 98, 124, 178,
+ 129, 45, 236, 221, 162, 137, 35, 149,
+ 137, 56, 108, 248, 6, 28, 137, 34,
+ 146, 21, 37, 109, 39, 1, 217, 93,
+ 215, 39, 89, 66, 214, 141, 158, 190,
+ 19, 126, 16, 218, 154, 97, 185, 147,
+ 161, 21, 88, 82, 166, 135, 64, 131,
+ 196, 178, 195, 231, 220, 223, 23, 194,
+ 107, 126, 44, 155, 254, 122, 44, 174,
+ 219, 200, 166, 73, 211, 246, 140, 22,
+ 79, 187, 180, 186, 215, 96, 131, 21,
+ 43, 81, 190, 230, 232, 193, 30, 245,
+ 29, 118, 184, 143, 28, 187, 122, 141,
+ 12, 29, 247, 146, 244, 174, 65, 226,
+ 247, 80, 162, 72, 207, 16, 147, 88,
+ 11, 206, 182, 146, 114, 138, 76, 184,
+ 54, 98, 253, 251, 118, 163, 81, 44,
+ 245, 156, 229, 184, 175, 59, 81, 160,
+ 92, 16, 202, 161, 2, 133, 155, 199,
+ 24, 214, 189, 165, 102, 133, 122, 151,
+ 14, 198, 86, 114, 46, 168, 54, 66,
+ 96, 87, 234, 222, 140, 205, 176, 167,
+ 247, 153, 226, 178, 194, 86, 175, 186,
+ 136, 63, 210, 68, 207, 27, 211, 10,
+ 108, 106, 102, 221, 128, 209, 254, 243,
+ 143, 117, 45, 220, 24, 106, 10, 103,
+ 119, 66, 227, 230, 108, 7, 207, 231,
+ 190, 123, 33, 136, 13, 136, 32, 46,
+ 245, 75, 190, 236, 148, 202, 13, 109,
+ 197, 175, 142, 27, 233, 153, 64, 56,
+ 210, 180, 103, 42, 128, 48, 234, 115,
+ 178, 132, 201, 152, 180, 136, 146, 255,
+ 106, 209, 174, 46, 0, 254, 242, 130,
+ 247, 36, 1, 25, 131, 142, 245, 109,
+ 175, 147, 121, 229, 237, 188, 164, 98,
+ 222, 255, 136, 149, 29, 61, 108, 97,
+ 173, 107, 87, 236, 183, 197, 51, 248,
+ 168, 55, 82, 59, 212, 21, 77, 31,
+ 212, 59, 101, 230, 22, 1, 116, 39,
+ 171, 117, 13, 194, 74, 220, 219, 69,
+ 23, 197, 244, 244, 243, 230, 104, 96,
+ 133, 134, 160, 36, 178, 168, 21, 196,
+ 87, 209, 183, 165, 98, 6, 105, 71,
+ 71, 207, 101, 131, 193, 45, 143, 60,
+ 167, 255, 235, 162, 104, 155, 148, 60,
+ 115, 198, 1, 214, 235, 56, 87, 44,
+ 103, 205, 179, 202, 203, 63, 103, 18,
+ 136, 150, 88, 162, 126, 90, 160, 183,
+ 125, 113, 102, 90, 64, 169, 10, 143,
+ 22, 183, 219, 142, 54, 76, 17, 105,
+ 58, 242, 151, 249, 0, 106, 178, 249,
+ 201, 47, 178, 115, 161, 48, 108, 19,
+ 18, 254, 161, 9, 164, 56, 117, 233,
+ 175, 177, 135, 115, 171, 3, 47, 151,
+ 100, 24, 226, 173, 237, 84, 103, 239,
+ 133, 221, 128, 255, 90, 250, 178, 47,
+ 161, 7, 98, 163, 76, 87, 230, 253,
+ 180, 143, 30, 85, 161, 179, 28, 87,
+ 73, 225, 219, 219, 69, 248, 242, 188,
+ 235, 157, 17, 178, 226, 78, 98, 117,
+ 115, 21, 30, 195, 252, 114, 92, 11,
+ 189, 69, 184, 100, 104, 152, 47, 148,
+ 172, 142, 60, 41, 125, 228, 212, 89,
+ 55, 184, 183, 17, 12, 191, 239, 144,
+ 152, 250, 157, 234, 65, 40, 37, 218,
+ 106, 136, 221, 127, 51, 79, 166, 239,
+ 209, 172, 135, 205, 197, 184, 116, 95,
+ 253, 14, 192, 163, 241, 84, 201, 60,
+ 82, 113, 52, 49, 164, 0, 12, 201,
+ 15, 199, 44, 149, 45, 93, 242, 158,
+ 45, 105, 146, 15, 244, 200, 34, 90,
+ 18, 202, 220, 232, 168, 151, 39, 192,
+ 187, 89, 68, 134, 174, 212, 175, 25,
+ 162, 128, 0, 51, 130, 41, 25, 234,
+ 150, 29, 235, 177, 105, 221, 61, 58,
+ 72, 9, 172, 158, 242, 187, 248, 74,
+ 187, 240, 34, 198, 199, 211, 157, 172,
+ 116, 160, 54, 99, 193, 179, 82, 127,
+ 232, 123, 139, 128, 72, 107, 197, 215,
+ 161, 126, 102, 15, 166, 206, 142, 74,
+ 163, 231, 110, 28, 241, 160, 185, 92,
+ 220, 220, 15, 146, 187, 212, 190, 84,
+ 114, 94, 15, 121, 87, 148, 206, 23,
+ 32, 205, 107, 94, 26, 19, 94, 26,
+ 10, 45, 244, 187, 142, 44, 216, 76,
+ 237, 35, 135, 73, 253, 79, 207, 184,
+ 51, 190, 62, 135, 242, 184, 143, 49,
+ 175, 22, 37, 204, 154, 41, 115, 23,
+ 255, 109, 138, 123, 28, 214, 50, 14,
+ 235, 250, 141, 72, 28, 218, 47, 161,
+ 255, 15, 136, 224, 116, 67, 90, 123,
+ 73, 181, 19, 45, 65, 159, 185, 196,
+ 241, 230, 161, 48, 92, 52, 129, 111,
+ 147, 26, 100, 97, 176, 127, 55, 107,
+ 42, 105, 240, 227, 155, 43, 93, 13,
+ 36, 74, 22, 177, 218, 78, 102, 101,
+ 211, 93, 217, 245, 203, 253, 12, 247,
+ 242, 127, 200, 228, 191, 238, 143, 143,
+ 158, 39, 7, 124, 192, 26, 150, 223,
+ 148, 168, 214, 23, 182, 111, 51, 37,
+ 11, 172, 221, 57, 110, 240, 95, 242,
+ 13, 113, 210, 131, 3, 59, 166, 209,
+ 58, 43, 15, 171, 215, 52, 66, 102,
+ 177, 199, 120, 83, 161, 7, 109, 64,
+ 158, 119, 109, 56, 54, 66, 58, 45,
+ 173, 117, 90, 25, 7, 151, 38, 196,
+ 236, 243, 112, 48, 75, 226, 193, 86,
+ 254, 212, 235, 161, 16, 68, 105, 116,
+ 33, 254, 56, 167, 151, 246, 232, 246,
+ 103, 57, 189, 192, 252, 162, 116, 174,
+ 218, 233, 148, 107, 160, 227, 73, 251,
+ 194, 59, 142, 48, 56, 165, 230, 132,
+ 252, 105, 161, 216, 26, 85, 131, 48,
+ 166, 0, 26, 33, 184, 223, 163, 143,
+ 131, 244, 36, 112, 82, 20, 106, 104,
+ 61, 40, 202, 219, 31, 137, 253, 31,
+ 30, 87, 254, 149, 140, 117, 107, 211,
+ 12, 202, 138, 135, 41, 158, 76, 39,
+ 16, 165, 17, 178, 149, 223, 218, 157,
+ 216, 103, 151, 207, 117, 91, 223, 219,
+ 69, 230, 190, 217, 47, 178, 227, 138,
+ 139, 165, 198, 127, 94, 2, 146, 21,
+ 10, 47, 159, 242, 6, 113, 218, 23,
+ 64, 10, 229, 4, 141, 139, 171, 202,
+ 33, 32, 181, 66, 184, 36, 247, 3,
+ 206, 89, 224, 10, 168, 245, 28, 44,
+ 210, 227, 149, 42, 10, 228, 129, 90,
+ 193, 89, 40, 158, 249, 217, 181, 250,
+ 225, 160, 121, 169, 92, 64, 202, 85,
+ 250, 193, 64, 159, 161, 51, 73, 83,
+ 130, 34, 21, 28, 141, 104, 127, 192,
+ 202, 176, 180, 66, 206, 122, 68, 101,
+ 133, 59, 126, 54, 90, 81, 85, 36,
+ 125, 93, 103, 15, 5, 33, 77, 32,
+ 3, 153, 196, 206, 178, 52, 142, 79,
+ 168, 209, 112, 105, 67, 248, 243, 212,
+ 116, 238, 152, 244, 52, 255, 85, 79,
+ 17, 82, 241, 147, 199, 16, 100, 231,
+ 10, 31, 59, 201, 49, 176, 112, 59,
+ 235, 160, 227, 178, 44, 113, 215, 93,
+ 152, 23, 78, 169, 251, 81, 117, 242,
+ 79, 183, 199, 204, 237, 59, 91, 95,
+ 248, 188, 139, 61, 114, 0, 80, 249,
+ 203, 59, 165, 232, 225, 212, 169, 29,
+ 12, 165, 153, 206, 206, 35, 115, 132,
+ 214, 200, 91, 34, 51, 152, 128, 138,
+ 169, 229, 174, 223, 144, 1, 60, 39,
+ 200, 171, 93, 138, 251, 210, 47, 200,
+ 223, 46, 215, 210, 35, 152, 139, 219,
+ 146, 90, 39, 21, 80, 172, 11, 4,
+ 193, 76, 138, 252, 253, 77, 70, 18,
+ 77, 242, 219, 188, 144, 57, 87, 100,
+ 9, 163, 114, 64, 100, 215, 91, 50,
+ 250, 85, 120, 172, 68, 196, 79, 249,
+ 222, 141, 108, 252, 253, 58, 97, 41,
+ 213, 50, 188, 183, 137, 184, 129, 96,
+ 142, 102, 56, 92, 245, 128, 91, 238,
+ 73, 112, 134, 214, 131, 143, 147, 84,
+ 161, 43, 39, 37, 114, 185, 203, 25,
+ 12, 231, 164, 52, 110, 198, 42, 52,
+ 215, 74, 139, 239, 198, 34, 84, 78,
+ 164, 28, 201, 13, 210, 34, 27, 249,
+ 134, 243, 240, 237, 39, 137, 179, 136,
+ 187, 119, 47, 185, 114, 243, 83, 226,
+ 72, 129, 221, 211, 83, 175, 158, 232,
+ 89, 223, 182, 57, 200, 92, 177, 82,
+ 126, 166, 203, 62, 247, 195, 221, 233,
+ 209, 117, 170, 25, 223, 10, 62, 22,
+ 96, 235, 218, 161, 196, 24, 103, 11,
+ 40, 241, 255, 210, 244, 15, 9, 144,
+ 131, 115, 97, 137, 19, 198, 79, 10,
+ 130, 178, 107, 221, 209, 36, 7, 80,
+ 210, 175, 131, 215, 135, 37, 14, 103,
+ 70, 252, 54, 255, 91, 13, 96, 222,
+ 132, 80, 142, 133, 73, 38, 16, 226,
+ 88, 3, 28, 251, 5, 68, 90, 187,
+ 166, 129, 35, 231, 255, 103, 115, 155,
+ 141, 141, 96, 84, 100, 110, 254, 130,
+ 246, 87, 225, 244, 187, 10, 21, 151,
+ 73, 181, 147, 100, 137, 144, 225, 179,
+ 99, 230, 189, 69, 107, 121, 224, 39,
+ 36, 91, 90, 182, 195, 36, 2, 135,
+ 216, 102, 236, 53, 92, 109, 79, 168,
+ 171, 199, 195, 201, 13, 104, 35, 201,
+ 75, 110, 86, 86, 189, 48, 204, 90,
+ 231, 72, 156, 1, 111, 110, 240, 230,
+ 62, 32, 20, 208, 219, 240, 136, 210,
+ 135, 26, 127, 8, 153, 122, 45, 144,
+ 119, 53, 122, 229, 94, 63, 103, 139,
+ 231, 65, 248, 188, 224, 227, 106, 66,
+ 169, 149, 203, 40, 149, 229, 142, 57,
+ 1, 196, 142, 155, 3, 39, 240, 60,
+ 171, 1, 87, 20, 69, 17, 107, 83,
+ 155, 56, 57, 169, 23, 7, 238, 45,
+ 77, 98, 50, 13, 254, 134, 88, 224,
+ 251, 122, 130, 27, 150, 195, 84, 204,
+ 1, 123, 97, 192, 255, 102, 242, 218,
+ 27, 20, 208, 176, 147, 254, 65, 235,
+ 128, 76, 116, 10, 240, 126, 184, 185,
+ 126, 12, 168, 171, 210, 195, 0, 171,
+ 172, 3, 24, 93, 111, 218, 46, 202,
+ 2, 60, 229, 252, 4, 242, 32, 110,
+ 208, 3, 17, 16, 150, 239, 208, 204,
+ 70, 201, 229, 124, 63, 148, 96, 98,
+ 222, 63, 255, 255, 102, 89, 51, 79,
+ 99, 51, 228, 119, 118, 184, 163, 35,
+ 112, 229, 239, 224, 95, 24, 209, 80,
+ 92, 4, 176, 131, 71, 71, 242, 159,
+ 163, 187, 25, 136, 99, 145, 91, 94,
+ 154, 127, 124, 128, 115, 147, 1, 210,
+ 214, 232, 248, 143, 127, 79, 27, 98,
+ 44, 18, 142, 206, 98, 195, 38, 4,
+ 68, 68, 67, 169, 3, 54, 133, 233,
+ 28, 0, 120, 239, 167, 74, 110, 222,
+ 196, 180, 148, 244, 12, 222, 46, 139,
+ 143, 64, 196, 11, 83, 70, 229, 136,
+ 68, 93, 229, 73, 218, 54, 149, 47,
+ 175, 43, 171, 31, 178, 180, 135, 93,
+ 70, 62, 205, 76, 156, 184, 27, 71,
+ 90, 232, 182, 25, 221, 3, 8, 76,
+ 144, 212, 126, 129, 184, 62, 39, 67,
+ 68, 189, 172, 83, 158, 12, 235, 175,
+ 99, 248, 236, 249, 215, 6, 145, 33,
+ 97, 37, 49, 132, 202, 175, 56, 124,
+ 218, 192, 9, 228, 26, 175, 223, 142,
+ 185, 101, 133, 56, 236, 116, 210, 24,
+ 86, 36, 112, 13, 197, 224, 40, 130,
+ 106, 33, 58, 24, 27, 35, 111, 0,
+ 212, 82, 211, 139, 201, 241, 53, 121,
+ 54, 226, 54, 212, 225, 204, 124, 224,
+ 216, 197, 190, 150, 156, 45, 78, 176,
+ 214, 7, 139, 86, 6, 62, 187, 149,
+ 85, 94, 66, 93, 13, 236, 123, 53,
+ 155, 32, 88, 69, 185, 139, 163, 249,
+ 29, 142, 155, 97, 66, 106, 237, 88,
+ 121, 180, 204, 231, 11, 123, 124, 80,
+ 163, 119, 2, 204, 190, 243, 108, 163,
+ 134, 188, 145, 114, 63, 188, 156, 116,
+ 58, 248, 142, 42, 88, 167, 87, 45,
+ 52, 192, 22, 28, 91, 22, 172, 1,
+ 96, 163, 0, 13, 250, 117, 170, 69,
+ 101, 190, 3, 188, 71, 234, 228, 2,
+ 145, 45, 142, 208, 59, 40, 128, 250,
+ 174, 123, 99, 110, 234, 102, 182, 90,
+ 209, 212, 161, 95, 82, 191, 98, 233,
+ 166, 56, 170, 234, 167, 67, 184, 242,
+ 235, 121, 164, 252, 164, 251, 41, 94,
+ 30, 53, 82, 173, 196, 112, 114, 210,
+ 117, 118, 132, 126, 244, 159, 228, 74,
+ 9, 12, 200, 16, 251, 223, 226, 115,
+ 160, 47, 0, 59, 100, 229, 223, 141,
+ 8, 107, 218, 196, 42, 225, 59, 12,
+ 224, 130, 225, 51, 243, 85, 63, 229,
+ 29, 200, 179, 90, 158, 86, 73, 52,
+ 174, 83, 79, 244, 239, 24, 118, 149,
+ 202, 29, 202, 143, 0, 114, 69, 187,
+ 50, 182, 53, 41, 200, 173, 248, 1,
+ 14, 214, 231, 226, 194, 164, 24, 185,
+ 232, 232, 36, 136, 109, 76, 218, 227,
+ 79, 41, 238, 25, 251, 54, 67, 36,
+ 166, 136, 187, 174, 4, 68, 41, 71,
+ 16, 195, 30, 188, 19, 93, 146, 64,
+ 147, 227, 215, 199, 223, 86, 235, 182,
+ 211, 158, 46, 46, 161, 231, 163, 213,
+ 140, 193, 235, 180, 98, 90, 92, 106,
+ 65, 40, 11, 205, 114, 138, 67, 43,
+ 20, 56, 192, 46, 123, 86, 57, 137,
+ 179, 161, 187, 182, 237, 49, 85, 252,
+ 132, 64, 239, 244, 56, 98, 170, 186,
+ 126, 156, 89, 109, 203, 93, 157, 49,
+ 21, 236, 180, 148, 234, 214, 141, 97,
+ 0, 46, 93, 254, 230, 137, 95, 236,
+ 174, 154, 78, 176, 11, 104, 211, 21,
+ 61, 72, 22, 136, 18, 86, 130, 150,
+ 207, 144, 190, 58, 144, 201, 83, 6,
+ 167, 98, 25, 6, 55, 141, 137, 14,
+ 79, 63, 52, 109, 207, 122, 53, 179,
+ 80, 170, 24, 227, 64, 222, 15, 36,
+ 17, 197, 89, 68, 27, 168, 9, 10,
+ 56, 149, 148, 123, 4, 100, 81, 255,
+ 153, 232, 152, 164, 13, 224, 245, 51,
+ 124, 146, 26, 45, 132, 6, 157, 108,
+ 252, 187, 245, 133, 79, 162, 168, 80,
+ 178, 203, 210, 9, 150, 32, 47, 126,
+ 190, 242, 95, 47, 169, 222, 146, 227,
+ 142, 166, 137, 202, 168, 184, 221, 238,
+ 180, 14, 83, 110, 23, 33, 43, 100,
+ 249, 142, 9, 14, 115, 196, 195, 93,
+ 69, 221, 130, 144, 113, 103, 154, 23,
+ 169, 196, 241, 117, 124, 25, 133, 130,
+ 61, 50, 183, 6, 168, 80, 160, 83,
+ 31, 241, 251, 145, 178, 225, 95, 29,
+ 15, 111, 158, 72, 39, 185, 157, 43,
+ 209, 91, 37, 205, 133, 98, 81, 6,
+ 21, 105, 215, 239, 16, 60, 160, 154,
+ 40, 49, 64, 179, 119, 59, 152, 221,
+ 187, 62, 206, 63, 166, 65, 88, 2,
+ 198, 184, 46, 171, 196, 74, 204, 9,
+ 59, 242, 249, 161, 242, 146, 230, 5,
+ 247, 242, 132, 54, 23, 119, 149, 165,
+ 20, 178, 250, 33, 219, 120, 164, 117,
+ 208, 245, 195, 72, 171, 252, 3, 24,
+ 129, 89, 73, 90, 150, 54, 208, 249,
+ 43, 107, 31, 151, 210, 106, 72, 3,
+ 65, 16, 80, 247, 57, 146, 148, 91,
+ 20, 66, 237, 178, 252, 200, 210, 13,
+ 0, 249, 155, 141, 32, 7, 12, 4,
+ 247, 123, 177, 201, 64, 213, 122, 143,
+ 65, 60, 94, 58, 178, 86, 204, 156,
+ 146, 85, 158, 73, 70, 73, 98, 228,
+ 62, 135, 225, 120, 174, 127, 121, 164,
+ 16, 47, 199, 153, 4, 76, 80, 146,
+ 162, 243, 234, 35, 181, 74, 166, 186,
+ 253, 235, 157, 153, 98, 53, 66, 67,
+ 61, 216, 102, 135, 142, 155, 159, 150,
+ 17, 195, 140, 205, 162, 29, 173, 239,
+ 43, 138, 196, 119, 206, 154, 55, 201,
+ 31, 189, 7, 77, 151, 250, 222, 29,
+ 164, 134, 254, 173, 44, 166, 74, 91,
+ 139, 82, 236, 240, 61, 141, 31, 194,
+ 182, 160, 196, 122, 197, 107, 37, 34,
+ 13, 170, 68, 167, 220, 31, 99, 160,
+ 121, 223, 103, 245, 144, 47, 198, 216,
+ 156, 40, 246, 152, 182, 99, 82, 126,
+ 8, 205, 68, 18, 172, 228, 174, 205,
+ 139, 147, 224, 120, 114, 81, 110, 18,
+ 152, 151, 68, 113, 23, 98, 190, 73,
+ 156, 136, 120, 181, 67, 99, 37, 220,
+ 124, 65, 187, 129, 236, 17, 51, 65,
+ 236, 49, 216, 181, 212, 56, 216, 81,
+ 49, 152, 142, 30, 78, 21, 237, 137,
+ 178, 168, 65, 248, 92, 175, 45, 54,
+ 4, 72, 91, 8, 236, 154, 104, 244,
+ 135, 104, 224, 83, 164, 18, 37, 190,
+ 85, 153, 10, 34, 132, 66, 140, 40,
+ 176, 41, 223, 34, 133, 171, 135, 4,
+ 69, 1, 130, 110, 128, 180, 245, 226,
+ 19, 236, 161, 118, 174, 135, 216, 10,
+ 163, 49, 80, 159, 180, 162, 44, 222,
+ 135, 201, 193, 29, 204, 250, 49, 53,
+ 126, 217, 226, 206, 105, 209, 198, 77,
+ 181, 150, 233, 142, 160, 197, 132, 217,
+ 115, 126, 160, 37, 104, 244, 28, 205,
+ 247, 214, 248, 126, 41, 176, 180, 250,
+ 252, 126, 237, 109, 34, 24, 250, 13,
+ 249, 155, 17, 192, 71, 31, 42, 206,
+ 0, 80, 239, 164, 70, 114, 81, 216,
+ 161, 99, 129, 78, 72, 122, 176, 47,
+ 9, 235, 185, 35, 244, 187, 8, 190,
+ 85, 63, 205, 110, 52, 184, 145, 4,
+ 130, 35, 72, 176, 165, 194, 143, 135,
+ 93, 85, 212, 253, 174, 99, 93, 89,
+ 216, 198, 51, 86, 110, 104, 118, 111,
+ 10, 28, 220, 35, 67, 110, 60, 60,
+ 141, 124, 33, 103, 218, 43, 4, 166,
+ 10, 139, 217, 34, 156, 77, 124, 133,
+ 112, 42, 77, 66, 253, 6, 197, 26,
+ 89, 39, 149, 201, 130, 20, 24, 155,
+ 191, 8, 184, 94, 32, 176, 55, 148,
+ 234, 190, 188, 106, 205, 43, 133, 93,
+ 35, 87, 173, 28, 132, 251, 106, 117,
+ 146, 110, 146, 214, 68, 128, 189, 74,
+ 199, 232, 79, 42, 86, 91, 1, 11,
+ 151, 112, 146, 47, 124, 248, 126, 239,
+ 25, 103, 169, 166, 173, 114, 141, 230,
+ 14, 164, 109, 240, 4, 29, 185, 120,
+ 128, 57, 151, 183, 104, 159, 52, 30,
+ 221, 153, 4, 209, 252, 130, 223, 3,
+ 91, 8, 37, 170, 165, 16, 133, 24,
+ 134, 25, 239, 51, 180, 113, 187, 130,
+ 106, 186, 229, 59, 150, 152, 163, 59,
+ 171, 61, 108, 233, 225, 96, 79, 105,
+ 208, 121, 32, 206, 64, 205, 180, 194,
+ 102, 212, 196, 200, 230, 159, 23, 152,
+ 209, 105, 33, 137, 41, 93, 124, 89,
+ 243, 247, 201, 198, 72, 40, 43, 134,
+ 143, 180, 94, 4, 20, 154, 178, 57,
+ 82, 66, 117, 42, 155, 87, 218, 69,
+ 255, 228, 32, 182, 78, 242, 45, 216,
+ 22, 130, 107, 77, 174, 253, 102, 55,
+ 176, 209, 159, 224, 173, 98, 37, 139,
+ 96, 37, 238, 212, 115, 139, 35, 245,
+ 94, 127, 9, 50, 143, 12, 101, 89,
+ 81, 26, 225, 41, 81, 125, 3, 146,
+ 71, 166, 170, 191, 90, 12, 70, 153,
+ 219, 81, 123, 22, 109, 71, 140, 140,
+ 113, 145, 71, 150, 136, 182, 143, 165,
+ 40, 148, 226, 144, 142, 245, 44, 221,
+ 175, 78, 47, 221, 63, 100, 240, 80,
+ 118, 100, 56, 172, 55, 90, 79, 174,
+ 46, 55, 106, 249, 5, 107, 197, 23,
+ 49, 19, 60, 142, 11, 15, 162, 234,
+ 144, 59, 251, 85, 97, 168, 65, 28,
+ 109, 232, 255, 109, 181, 66, 206, 64,
+ 209, 25, 176, 57, 239, 126, 36, 76,
+ 225, 195, 83, 225, 215, 3, 224, 143,
+ 222, 14, 235, 42, 143, 127, 208, 70,
+ 170, 227, 143, 198, 33, 113, 31, 78,
+ 134, 240, 234, 240, 92, 33, 57, 107,
+ 126, 187, 73, 85, 101, 7, 241, 130,
+ 189, 184, 14, 112, 24, 89, 118, 227,
+ 204, 203, 56, 237, 47, 254, 63, 17,
+ 43, 219, 20, 4, 131, 167, 244, 213,
+ 153, 237, 207, 166, 169, 138, 26, 249,
+ 7, 242, 29, 172, 44, 252, 67, 238,
+ 209, 97, 39, 73, 186, 218, 40, 175,
+ 159, 137, 122, 214, 248, 49, 156, 26,
+ 213, 31, 117, 218, 226, 211, 85, 19,
+ 204, 218, 74, 98, 188, 50, 21, 226,
+ 173, 230, 212, 4, 3, 66, 83, 126,
+ 90, 111, 115, 247, 159, 148, 106, 3,
+ 240, 191, 101, 15, 153, 180, 173, 180,
+ 167, 196, 113, 157, 154, 222, 204, 158,
+ 255, 39, 112, 43, 5, 46, 221, 125,
+ 7, 129, 87, 80, 129, 30, 56, 14,
+ 46, 164, 126, 97, 52, 138, 157, 106,
+ 68, 143, 242, 174, 224, 246, 217, 135,
+ 109, 66, 71, 74, 141, 225, 95, 186,
+ 41, 157, 149, 52, 200, 50, 54, 39,
+ 231, 77, 92, 246, 170, 88, 12, 179,
+ 120, 233, 134, 33, 255, 203, 105, 105,
+ 145, 2, 45, 51, 98, 63, 189, 196,
+ 69, 157, 237, 111, 141, 198, 212, 3,
+ 167, 38, 135, 188, 70, 228, 78, 147,
+ 35, 21, 196, 164, 155, 116, 251, 105,
+ 171, 242, 61, 202, 171, 11, 198, 239,
+ 141, 34, 87, 31, 82, 137, 176, 151,
+ 228, 65, 55, 226, 58, 70, 250, 114,
+ 91, 226, 3, 2, 205, 55, 161, 50,
+ 52, 98, 149, 247, 55, 244, 184, 254,
+ 155, 137, 248, 134, 76, 32, 36, 203,
+ 241, 121, 53, 123, 96, 175, 67, 102,
+ 124, 64, 229, 128, 244, 240, 89, 5,
+ 248, 53, 0, 172, 184, 126, 110, 252,
+ 30, 117, 149, 232, 113, 34, 185, 158,
+ 223, 23, 249, 52, 123, 117, 232, 67,
+ 37, 41, 43, 249, 48, 210, 4, 57,
+ 155, 49, 40, 96, 84, 13, 11, 167,
+ 49, 41, 175, 251, 28, 64, 12, 254,
+ 119, 172, 40, 136, 56, 123, 226, 94,
+ 158, 131, 4, 249, 233, 67, 72, 65,
+ 119, 119, 36, 221, 91, 202, 198, 229,
+ 91, 241, 217, 75, 110, 39, 198, 165,
+ 189, 182, 234, 101, 219, 195, 7, 45,
+ 86, 129, 122, 171, 125, 130, 188, 87,
+ 137, 178, 18, 103, 116, 128, 40, 89,
+ 131, 50, 46, 75, 140, 153, 151, 15,
+ 188, 228, 109, 165, 33, 3, 97, 0,
+ 131, 135, 128, 106, 173, 246, 55, 175,
+ 39, 75, 40, 132, 78, 21, 251, 86,
+ 72, 34, 110, 220, 3, 202, 112, 45,
+ 228, 207, 53, 16, 212, 219, 8, 94,
+ 224, 91, 6, 132, 7, 195, 27, 164,
+ 86, 105, 208, 69, 198, 238, 71, 203,
+ 254, 44, 120, 5, 158, 54, 69, 1,
+ 230, 84, 250, 27, 31, 128, 128, 4,
+ 140, 13, 119, 36, 27, 83, 2, 41,
+ 117, 157, 34, 113, 134, 129, 216, 33,
+ 67, 177, 141, 145, 91, 203, 249, 221,
+ 172, 225, 241, 197, 161, 169, 8, 233,
+ 68, 75, 207, 214, 154, 181, 90, 177,
+ 26, 235, 49, 247, 229, 45, 248, 246,
+ 35, 156, 162, 64, 119, 188, 190, 165,
+ 249, 244, 16, 47, 176, 48, 53, 193,
+ 206, 70, 107, 134, 217, 220, 5, 122,
+ 24, 58, 171, 50, 180, 141, 174, 241,
+ 163, 49, 194, 30, 233, 226, 192, 108,
+ 77, 63, 5, 166, 80, 89, 66, 134,
+ 209, 161, 120, 18, 200, 34, 212, 239,
+ 218, 12, 3, 233, 23, 16, 6, 42,
+ 199, 105, 170, 33, 222, 157, 66, 60,
+ 48, 64, 112, 32, 81, 134, 72, 23,
+ 93, 201, 79, 41, 6, 11, 134, 159,
+ 217, 133, 183, 108, 249, 167, 153, 61,
+ 110, 48, 78, 56, 27, 219, 72, 149,
+ 213, 218, 129, 210, 43, 109, 244, 197,
+ 103, 223, 242, 186, 221, 178, 161, 124,
+ 136, 140, 117, 140, 156, 163, 206, 149,
+ 255, 169, 202, 169, 70, 137, 198, 246,
+ 55, 168, 200, 25, 160, 232, 0, 94,
+ 39, 119, 161, 167, 179, 57, 216, 178,
+ 55, 239, 91, 84, 252, 149, 210, 65,
+ 113, 192, 249, 20, 240, 57, 206, 164,
+ 127, 0, 210, 254, 107, 95, 37, 140,
+ 108, 94, 25, 247, 169, 75, 199, 80,
+ 220, 82, 222, 123, 31, 238, 132, 131,
+ 44, 247, 160, 231, 112, 54, 45, 101,
+ 13, 213, 239, 143, 119, 120, 214, 253,
+ 116, 21, 188, 111, 169, 130, 52, 108,
+ 91, 182, 11, 7, 157, 112, 177, 35,
+ 227, 220, 241, 226, 27, 234, 143, 14,
+ 15, 226, 224, 75, 171, 208, 93, 201,
+ 40, 66, 57, 227, 46, 246, 70, 34,
+ 117, 84, 207, 239, 222, 98, 229, 18,
+ 9, 170, 145, 2, 57, 103, 204, 218,
+ 176, 159, 46, 166, 30, 245, 242, 103,
+ 124, 57, 169, 83, 213, 9, 117, 209,
+ 136, 147, 155, 57, 169, 91, 126, 98,
+ 63, 49, 20, 47, 26, 170, 184, 199,
+ 170, 138, 214, 129, 82, 175, 121, 162,
+ 228, 29, 1, 47, 37, 108, 143, 4,
+ 88, 40, 24, 246, 88, 61, 80, 89,
+ 4, 149, 152, 209, 56, 5, 223, 144,
+ 47, 94, 5, 36, 25, 11, 115, 240,
+ 41, 211, 38, 251, 5, 123, 77, 213,
+ 105, 5, 62, 232, 68, 194, 37, 100,
+ 149, 169, 217, 244, 158, 86, 30, 201,
+ 83, 41, 171, 254, 174, 39, 202, 174,
+ 204, 205, 252, 34, 143, 30, 35, 123,
+ 164, 188, 178, 10, 72, 152, 242, 246,
+ 140, 37, 246, 47, 53, 21, 165, 213,
+ 51, 57, 93, 118, 130, 246, 230, 16,
+ 227, 10, 6, 12, 135, 212, 170, 20,
+ 25, 88, 65, 133, 72, 109, 209, 103,
+ 16, 234, 223, 125, 212, 243, 188, 16,
+ 58, 229, 227, 145, 185, 131, 50, 254,
+ 203, 200, 235, 122, 153, 188, 55, 219,
+ 152, 74, 85, 157, 54, 40, 31, 171,
+ 208, 199, 247, 44, 65, 231, 188, 240,
+ 41, 134, 253, 128, 118, 93, 109, 80,
+ 91, 97, 109, 245, 202, 117, 137, 163,
+ 251, 60, 194, 10, 119, 72, 176, 193,
+ 171, 138, 8, 220, 208, 140, 157, 215,
+ 188, 160, 50, 236, 112, 162, 161, 108,
+ 53, 33, 155, 53, 241, 41, 5, 157,
+ 231, 61, 218, 17, 58, 89, 5, 214,
+ 157, 149, 193, 3, 234, 166, 150, 192,
+ 71, 69, 197, 60, 153, 7, 88, 179,
+ 21, 130, 120, 67, 184, 65, 228, 224,
+ 29, 223, 234, 97, 170, 90, 27, 199,
+ 82, 90, 55, 7, 148, 49, 8, 197,
+ 101, 152, 132, 244, 151, 56, 165, 219,
+ 252, 152, 205, 191, 232, 237, 139, 115,
+ 176, 139, 156, 214, 48, 53, 12, 169,
+ 63, 0, 4, 238, 149, 44, 236, 51,
+ 120, 62, 123, 21, 28, 116, 39, 61,
+ 192, 56, 123, 51, 117, 90, 59, 88,
+ 56, 34, 132, 47, 137, 165, 108, 191,
+ 25, 81, 89, 237, 31, 40, 237, 83,
+ 236, 112, 101, 253, 53, 219, 182, 179,
+ 75, 24, 216, 192, 174, 57, 172, 92,
+ 232, 132, 91, 139, 193, 205, 119, 182,
+ 183, 187, 170, 64, 108, 89, 141, 6,
+ 68, 192, 213, 241, 102, 142, 203, 139,
+ 195, 63, 115, 233, 67, 127, 216, 16,
+ 51, 184, 231, 112, 22, 131, 66, 92,
+ 173, 6, 244, 20, 60, 42, 126, 106,
+ 219, 65, 62, 116, 80, 6, 185, 5,
+ 29, 246, 182, 101, 159, 75, 168, 144,
+ 21, 113, 252, 190, 140, 3, 186, 114,
+ 46, 217, 25, 134, 223, 108, 114, 183,
+ 119, 77, 63, 165, 51, 254, 138, 77,
+ 141, 1, 234, 46, 173, 133, 150, 201,
+ 130, 105, 218, 240, 115, 181, 18, 191,
+ 198, 187, 207, 12, 54, 180, 31, 250,
+ 59, 122, 238, 62, 69, 255, 4, 34,
+ 24, 206, 52, 211, 31, 200, 89, 110,
+ 224, 221, 155, 40, 44, 230, 88, 135,
+ 96, 121, 0, 223, 76, 190, 118, 238,
+ 59, 122, 31, 83, 82, 220, 42, 183,
+ 184, 163, 209, 127, 4, 154, 100, 230,
+ 79, 42, 26, 142, 68, 86, 22, 220,
+ 151, 103, 115, 170, 95, 126, 120, 180,
+ 46, 29, 92, 161, 160, 164, 199, 223,
+ 174, 226, 182, 213, 157, 247, 102, 70,
+ 35, 191, 231, 19, 249, 82, 218, 58,
+ 180, 180, 147, 224, 159, 21, 3, 62,
+ 185, 216, 44, 126, 90, 132, 59, 244,
+ 152, 105, 232, 237, 136, 236, 211, 35,
+ 77, 104, 246, 58, 144, 167, 131, 27,
+ 130, 246, 160, 255, 125, 246, 171, 217,
+ 247, 83, 245, 149, 58, 1, 225, 143,
+ 113, 39, 253, 155, 146, 248, 62, 98,
+ 33, 8, 27, 21, 104, 66, 124, 48,
+ 228, 120, 88, 247, 13, 16, 79, 8,
+ 225, 13, 139, 230, 106, 166, 155, 51,
+ 157, 133, 115, 251, 232, 187, 223, 45,
+ 149, 140, 198, 87, 254, 130, 157, 32,
+ 23, 183, 183, 52, 43, 214, 176, 167,
+ 250, 239, 133, 192, 194, 163, 50, 164,
+ 204, 202, 101, 248, 240, 47, 146, 179,
+ 187, 215, 236, 84, 150, 19, 68, 40,
+ 161, 250, 241, 254, 15, 95, 103, 73,
+ 87, 227, 201, 51, 218, 117, 169, 70,
+ 204, 63, 58, 34, 222, 190, 235, 129,
+ 13, 211, 43, 41, 172, 73, 106, 129,
+ 57, 240, 37, 80, 39, 215, 127, 122,
+ 105, 239, 176, 114, 21, 72, 237, 185,
+ 131, 233, 225, 210, 2, 148, 71, 3,
+ 218, 199, 28, 179, 198, 10, 51, 213,
+ 207, 193, 192, 207, 46, 150, 223, 54,
+ 26, 227, 23, 241, 103, 16, 86, 34,
+ 97, 156, 191, 157, 92, 71, 200, 214,
+ 169, 213, 254, 170, 244, 95, 224, 26,
+ 10, 47, 128, 168, 127, 255, 121, 227,
+ 210, 130, 245, 11, 84, 65, 251, 127,
+ 104, 74, 28, 31, 179, 251, 254, 217,
+ 161, 189, 112, 55, 66, 118, 75, 27,
+ 220, 156, 108, 154, 49, 16, 71, 97,
+ 69, 92, 77, 181, 197, 27, 62, 160,
+ 60, 251, 153, 245, 61, 6, 220, 134,
+ 91, 90, 5, 250, 89, 58, 84, 95,
+ 142, 15, 183, 55, 54, 175, 146, 101,
+ 232, 222, 233, 61, 126, 122, 249, 98,
+ 172, 201, 232, 155, 150, 149, 111, 16,
+ 206, 63, 118, 184, 47, 122, 150, 114,
+ 15, 123, 22, 71, 87, 159, 1, 70,
+ 163, 241, 166, 107, 135, 198, 102, 162,
+ 158, 56, 45, 107, 113, 78, 213, 48,
+ 139, 144, 139, 229, 31, 116, 211, 98,
+ 113, 41, 96, 151, 71, 218, 63, 40,
+ 6, 240, 45, 172, 39, 32, 130, 46,
+ 247, 224, 123, 18, 168, 23, 40, 246,
+ 53, 172, 101, 148, 15, 165, 23, 39,
+ 162, 184, 255, 87, 247, 248, 63, 226,
+ 211, 121, 229, 108, 50, 153, 59, 218,
+ 18, 64, 171, 29, 108, 65, 114, 253,
+ 142, 25, 254, 30, 146, 102, 200, 58,
+ 100, 197, 92, 163, 126, 189, 230, 237,
+ 221, 11, 184, 223, 255, 130, 177, 169,
+ 137, 4, 23, 191, 215, 255, 246, 44,
+ 216, 62, 210, 226, 135, 159, 198, 104,
+ 33, 32, 120, 111, 103, 166, 137, 92,
+ 214, 187, 40, 91, 244, 48, 10, 28,
+ 92, 8, 38, 146, 211, 69, 66, 209,
+ 234, 233, 7, 154, 0, 201, 4, 104,
+ 45, 138, 46, 172, 106, 80, 61, 27,
+ 38, 222, 190, 189, 64, 241, 155, 36,
+ 41, 65, 0, 215, 215, 205, 249, 210,
+ 16, 227, 198, 77, 237, 180, 29, 62,
+ 95, 215, 70, 174, 85, 222, 59, 17,
+ 205, 245, 80, 68, 116, 127, 156, 249,
+ 1, 39, 185, 141, 210, 21, 230, 209,
+ 186, 194, 92, 92, 38, 42, 147, 192,
+ 75, 121, 38, 144, 225, 31, 58, 97,
+ 63, 253, 187, 252, 238, 137, 174, 215,
+ 25, 25, 241, 200, 150, 144, 98, 115,
+ 87, 29, 107, 89, 13, 43, 105, 201,
+ 160, 230, 149, 234, 201, 4, 21, 226,
+ 216, 40, 109, 226, 97, 253, 246, 248,
+ 31, 217, 102, 57, 79, 54, 7, 194,
+ 132, 224, 61, 100, 142, 33, 226, 45,
+ 167, 206, 95, 64, 96, 155, 252, 60,
+ 58, 245, 242, 224, 105, 24, 240, 9,
+ 34, 20, 220, 114, 2, 101, 217, 49,
+ 79, 187, 20, 34, 77, 183, 128, 32,
+ 7, 156, 135, 80, 84, 106, 77, 37,
+ 77, 186, 156, 254, 251, 242, 234, 9,
+ 227, 74, 132, 211, 9, 16, 210, 87,
+ 55, 117, 217, 104, 137, 108, 154, 65,
+ 16, 111, 176, 16, 171, 167, 228, 30,
+ 20, 6, 230, 80, 104, 88, 98, 133,
+ 153, 117, 232, 235, 81, 43, 92, 171,
+ 103, 123, 157, 235, 162, 34, 67, 74,
+ 231, 110, 190, 18, 125, 202, 239, 61,
+ 248, 149, 147, 143, 129, 107, 117, 88,
+ 162, 39, 250, 3, 20, 231, 62, 118,
+ 236, 198, 46, 184, 36, 191, 1, 17,
+ 128, 48, 64, 236, 148, 120, 150, 170,
+ 176, 151, 232, 80, 169, 11, 145, 42,
+ 160, 136, 116, 197, 241, 77, 249, 96,
+ 220, 122, 101, 8, 42, 109, 184, 159,
+ 14, 204, 223, 92, 39, 22, 84, 76,
+ 225, 117, 4, 133, 240, 101, 190, 97,
+ 136, 130, 134, 155, 131, 194, 56, 37,
+ 235, 26, 210, 247, 182, 183, 200, 73,
+ 121, 186, 166, 58, 179, 74, 244, 165,
+ 61, 37, 118, 31, 43, 188, 231, 135,
+ 15, 132, 73, 58, 136, 130, 226, 191,
+ 57, 158, 166, 209, 63, 247, 151, 165,
+ 114, 81, 174, 213, 236, 64, 141, 110,
+ 228, 232, 109, 94, 195, 130, 227, 108,
+ 238, 117, 17, 148, 86, 143, 180, 160,
+ 186, 141, 133, 59, 243, 188, 5, 126,
+ 57, 223, 26, 206, 24, 13, 178, 240,
+ 21, 139, 171, 215, 148, 123, 2, 18,
+ 150, 224, 27, 163, 37, 8, 200, 1,
+ 160, 71, 24, 88, 79, 231, 140, 254,
+ 80, 255, 213, 193, 2, 143, 254, 226,
+ 203, 56, 150, 90, 221, 192, 44, 27,
+ 145, 162, 55, 141, 28, 209, 114, 45,
+ 186, 63, 123, 111, 43, 49, 176, 233,
+ 200, 227, 177, 201, 214, 137, 121, 143,
+ 26, 198, 157, 49, 172, 175, 193, 87,
+ 55, 82, 246, 28, 37, 237, 238, 143,
+ 214, 239, 71, 151, 126, 11, 9, 90,
+ 89, 46, 240, 243, 131, 130, 100, 48,
+ 104, 255, 90, 55, 248, 36, 64, 210,
+ 116, 171, 57, 86, 40, 154, 199, 130,
+ 194, 62, 173, 217, 11, 187, 164, 109,
+ 80, 2, 203, 162, 44, 165, 53, 80,
+ 22, 180, 229, 146, 66, 3, 90, 146,
+ 229, 219, 247, 29, 10, 249, 136, 95,
+ 78, 150, 45, 172, 183, 193, 27, 117,
+ 163, 148, 135, 10, 140, 241, 33, 138,
+ 137, 228, 27, 19, 56, 121, 75, 191,
+ 107, 164, 251, 35, 189, 133, 8, 203,
+ 9, 183, 145, 156, 88, 252, 106, 186,
+ 189, 137, 43, 87, 253, 50, 130, 153,
+ 77, 51, 197, 8, 11, 102, 248, 221,
+ 185, 177, 206, 217, 210, 91, 186, 9,
+ 160, 205, 122, 49, 242, 14, 131, 39,
+ 187, 66, 77, 217, 202, 236, 118, 0,
+ 228, 0, 20, 76, 198, 17, 209, 60,
+ 225, 220, 0, 189, 67, 76, 23, 33,
+ 217, 107, 8, 96, 92, 199, 129, 63,
+ 200, 243, 75, 72, 123, 254, 151, 228,
+ 23, 221, 229, 240, 87, 79, 45, 230,
+ 151, 101, 62, 17, 109, 39, 49, 209,
+ 159, 25, 75, 62, 77, 208, 248, 179,
+ 246, 67, 29, 232, 212, 74, 75, 48,
+ 48, 68, 145, 87, 105, 58, 119, 88,
+ 53, 53, 243, 55, 131, 155, 189, 150,
+ 2, 10, 106, 199, 142, 16, 79, 24,
+ 11, 87, 160, 27, 25, 176, 149, 172,
+ 137, 111, 96, 183, 6, 52, 26, 177,
+ 23, 86, 104, 213, 253, 46, 0, 160,
+ 186, 6, 68, 146, 98, 91, 14, 5,
+ 73, 102, 78, 34, 109, 185, 233, 26,
+ 95, 240, 72, 177, 236, 99, 187, 241,
+ 38, 26, 81, 213, 112, 46, 196, 199,
+ 209, 60, 3, 146, 163, 242, 11, 22,
+ 110, 14, 42, 67, 244, 137, 54, 192,
+ 47, 144, 71, 78, 130, 156, 78, 101,
+ 188, 36, 249, 247, 38, 38, 199, 129,
+ 135, 204, 94, 193, 28, 43, 48, 121,
+ 223, 46, 80, 190, 119, 97, 123, 218,
+ 203, 20, 197, 177, 21, 208, 194, 233,
+ 3, 85, 42, 155, 201, 142, 85, 38,
+ 98, 102, 249, 156, 143, 154, 177, 31,
+ 45, 87, 155, 143, 25, 79, 15, 63,
+ 207, 23, 101, 231, 132, 210, 56, 245,
+ 25, 19, 10, 49, 87, 30, 160, 39,
+ 243, 81, 19, 47, 90, 138, 4, 228,
+ 18, 99, 33, 153, 251, 118, 81, 28,
+ 48, 246, 168, 189, 142, 80, 57, 61,
+ 146, 188, 87, 33, 175, 4, 43, 142,
+ 244, 238, 138, 25, 180, 101, 132, 178,
+ 10, 165, 53, 79, 158, 174, 238, 190,
+ 213, 58, 34, 167, 121, 178, 167, 193,
+ 213, 224, 17, 105, 136, 40, 79, 67,
+ 149, 168, 215, 50, 189, 193, 165, 184,
+ 27, 61, 215, 210, 73, 154, 183, 232,
+ 223, 135, 69, 212, 37, 95, 156, 46,
+ 235, 67, 100, 19, 24, 67, 210, 199,
+ 181, 63, 89, 13, 115, 247, 170, 180,
+ 90, 143, 223, 126, 45, 27, 218, 175,
+ 234, 13, 180, 46, 224, 136, 74, 31,
+ 0, 17, 122, 3, 43, 123, 190, 84,
+ 253, 213, 7, 196, 134, 44, 228, 255,
+ 61, 20, 231, 48, 203, 130, 106, 74,
+ 209, 23, 236, 17, 112, 12, 59, 38,
+ 105, 206, 226, 250, 62, 16, 215, 141,
+ 204, 38, 52, 167, 159, 74, 254, 89,
+ 232, 200, 70, 115, 142, 104, 24, 2,
+ 15, 196, 242, 210, 91, 165, 197, 197,
+ 215, 82, 85, 128, 251, 186, 14, 11,
+ 224, 232, 172, 50, 95, 67, 67, 128,
+ 149, 125, 173, 121, 251, 102, 177, 130,
+ 154, 134, 152, 8, 21, 81, 119, 225,
+ 176, 146, 141, 203, 220, 180, 65, 14,
+ 52, 105, 17, 176, 251, 249, 82, 59,
+ 4, 74, 189, 76, 181, 205, 208, 224,
+ 164, 150, 105, 196, 106, 47, 245, 204,
+ 30, 115, 243, 239, 169, 184, 195, 164,
+ 140, 57, 108, 203, 14, 82, 211, 104,
+ 230, 147, 13, 9, 111, 32, 163, 62,
+ 197, 93, 102, 124, 205, 68, 38, 214,
+ 105, 246, 194, 158, 83, 148, 162, 215,
+ 64, 81, 2, 253, 247, 74, 134, 138,
+ 212, 146, 222, 148, 97, 50, 19, 183,
+ 78, 184, 125, 231, 23, 12, 216, 247,
+ 106, 94, 78, 247, 175, 115, 24, 164,
+ 222, 74, 22, 37, 119, 74, 179, 153,
+ 45, 58, 67, 179, 212, 120, 183, 124,
+ 218, 64, 188, 137, 206, 245, 204, 53,
+ 44, 238, 141, 224, 116, 23, 239, 47,
+ 129, 132, 130, 122, 197, 75, 214, 171,
+ 61, 27, 176, 17, 68, 87, 15, 94,
+ 22, 147, 123, 147, 159, 120, 112, 219,
+ 57, 135, 127, 47, 163, 187, 96, 62,
+ 136, 158, 196, 59, 134, 57, 211, 1,
+ 59, 127, 51, 7, 128, 55, 179, 141,
+ 206, 139, 21, 228, 217, 166, 220, 8,
+ 247, 132, 101, 218, 242, 225, 17, 146,
+ 23, 154, 20, 217, 37, 251, 166, 228,
+ 0, 176, 194, 6, 94, 110, 204, 227,
+ 119, 243, 134, 37, 158, 14, 233, 35,
+ 171, 43, 90, 253, 184, 24, 86, 223,
+ 126, 66, 126, 4, 62, 18, 19, 79,
+ 207, 2, 9, 137, 193, 116, 2, 209,
+ 92, 114, 86, 48, 214, 178, 187, 178,
+ 55, 156, 119, 105, 74, 91, 238, 6,
+ 160, 181, 143, 180, 176, 87, 59, 60,
+ 236, 174, 181, 19, 130, 78, 50, 169,
+ 156, 35, 72, 231, 245, 223, 3, 174,
+ 217, 51, 49, 234, 2, 89, 57, 184,
+ 251, 121, 126, 189, 207, 227, 50, 1,
+ 3, 13, 151, 88, 205, 207, 160, 253,
+ 111, 198, 246, 205, 128, 59, 238, 38,
+ 195, 58, 163, 238, 73, 56, 62, 223,
+ 148, 35, 216, 137, 224, 28, 89, 69,
+ 244, 169, 189, 63, 142, 192, 106, 7,
+ 42, 115, 90, 80, 48, 51, 225, 187,
+ 239, 32, 10, 13, 102, 160, 89, 84,
+ 206, 77, 10, 218, 189, 240, 242, 246,
+ 3, 155, 244, 193, 145, 50, 48, 159,
+ 102, 92, 42, 170, 230, 213, 251, 190,
+ 249, 157, 139, 213, 14, 76, 44, 192,
+ 228, 189, 70, 39, 68, 157, 227, 215,
+ 128, 62, 125, 12, 204, 55, 63, 105,
+ 221, 56, 136, 184, 236, 205, 136, 120,
+ 152, 163, 176, 23, 183, 16, 101, 51,
+ 129, 139, 101, 35, 19, 5, 252, 0,
+ 155, 143, 81, 227, 21, 69, 229, 75,
+ 168, 210, 125, 100, 57, 52, 243, 236,
+ 137, 21, 235, 249, 69, 113, 50, 23,
+ 212, 27, 67, 135, 37, 8, 223, 96,
+ 158, 28, 40, 245, 44, 107, 213, 179,
+ 235, 115, 44, 24, 230, 111, 231, 128,
+ 35, 211, 235, 163, 180, 25, 77, 206,
+ 89, 191, 227, 247, 252, 249, 249, 148,
+ 36, 118, 89, 111, 181, 154, 230, 143,
+ 98, 224, 68, 125, 178, 165, 146, 28,
+ 49, 28, 21, 91, 205, 0, 23, 236,
+ 7, 74, 210, 247, 0, 224, 64, 223,
+ 251, 35, 24, 69, 177, 134, 57, 36,
+ 152, 197, 222, 197, 52, 28, 156, 192,
+ 148, 127, 34, 214, 240, 61, 11, 101,
+ 37, 8, 255, 252, 245, 238, 131, 168,
+ 30, 120, 231, 156, 55, 30, 173, 16,
+ 240, 52, 178, 100, 10, 156, 184, 234,
+ 6, 28, 120, 69, 70, 93, 73, 81,
+ 155, 110, 102, 102, 71, 135, 102, 98,
+ 133, 157, 227, 148, 27, 85, 121, 18,
+ 216, 182, 123, 176, 204, 105, 42, 190,
+ 61, 96, 54, 38, 100, 112, 214, 251,
+ 4, 4, 0, 246, 229, 105, 17, 48,
+ 168, 144, 44, 100, 130, 48, 65, 49,
+ 102, 24, 124, 134, 35, 219, 198, 204,
+ 233, 97, 167, 237, 75, 148, 229, 129,
+ 239, 86, 189, 4, 139, 242, 84, 218,
+ 120, 91, 239, 10, 95, 217, 236, 196,
+ 123, 247, 167, 116, 222, 8, 198, 4,
+ 100, 155, 194, 38, 150, 108, 104, 108,
+ 112, 113, 104, 77, 183, 200, 249, 162,
+ 50, 95, 195, 70, 118, 183, 233, 79,
+ 103, 228, 107, 142, 105, 47, 252, 230,
+ 72, 239, 221, 40, 189, 163, 37, 21,
+ 107, 40, 44, 184, 171, 255, 217, 82,
+ 173, 157, 168, 8, 226, 207, 147, 15,
+ 6, 174, 35, 1, 10, 208, 212, 57,
+ 212, 150, 189, 83, 192, 40, 149, 5,
+ 119, 223, 45, 228, 173, 167, 73, 123,
+ 218, 157, 227, 90, 18, 252, 75, 179,
+ 151, 2, 145, 251, 42, 39, 14, 86,
+ 70, 36, 77, 10, 174, 211, 232, 84,
+ 124, 169, 97, 12, 12, 230, 56, 230,
+ 131, 43, 52, 22, 229, 121, 137, 143,
+ 62, 97, 99, 109, 62, 19, 76, 33,
+ 183, 116, 200, 137, 178, 71, 77, 196,
+ 164, 210, 182, 100, 11, 85, 208, 171,
+ 73, 45, 135, 154, 150, 226, 149, 45,
+ 48, 193, 188, 231, 15, 29, 115, 186,
+ 222, 43, 54, 228, 184, 161, 245, 113,
+ 27, 124, 137, 149, 123, 180, 154, 30,
+ 74, 126, 149, 122, 244, 125, 13, 75,
+ 173, 16, 126, 188, 207, 27, 60, 244,
+ 105, 50, 187, 109, 181, 2, 199, 108,
+ 62, 245, 90, 101, 187, 139, 55, 128,
+ 173, 52, 207, 101, 71, 221, 10, 58,
+ 252, 184, 159, 174, 204, 64, 250, 217,
+ 4, 59, 32, 216, 121, 111, 225, 252,
+ 120, 1, 151, 19, 199, 98, 128, 203,
+ 73, 222, 89, 77, 202, 216, 35, 209,
+ 226, 96, 28, 236, 8, 69, 57, 163,
+ 213, 145, 254, 179, 182, 126, 234, 40,
+ 30, 120, 222, 153, 36, 91, 220, 137,
+ 189, 141, 242, 58, 23, 34, 93, 89,
+ 17, 177, 96, 45, 109, 104, 65, 70,
+ 129, 161, 122, 243, 98, 67, 64, 184,
+ 186, 82, 101, 45, 144, 17, 220, 37,
+ 4, 93, 170, 117, 77, 113, 66, 37,
+ 133, 162, 142, 150, 219, 21, 184, 142,
+ 31, 30, 210, 136, 6, 241, 25, 55,
+ 176, 142, 39, 76, 168, 132, 13, 203,
+ 88, 75, 133, 157, 191, 29, 118, 136,
+ 58, 155, 200, 53, 158, 223, 37, 167,
+ 72, 194, 182, 25, 93, 157, 86, 17,
+ 99, 201, 246, 134, 151, 116, 153, 157,
+ 251, 166, 27, 105, 219, 30, 67, 200,
+ 107, 249, 144, 108, 129, 58, 201, 232,
+ 6, 216, 97, 103, 88, 114, 170, 90,
+ 232, 16, 92, 4, 136, 149, 97, 185,
+ 4, 138, 40, 232, 5, 124, 4, 63,
+ 218, 162, 216, 118, 86, 124, 35, 108,
+ 47, 230, 255, 93, 250, 81, 98, 197,
+ 142, 133, 12, 164, 24, 178, 79, 75,
+ 241, 13, 118, 82, 112, 179, 124, 231,
+ 225, 113, 222, 96, 155, 100, 76, 83,
+ 43, 140, 244, 77, 192, 107, 197, 174,
+ 190, 27, 31, 168, 62, 159, 88, 93,
+ 232, 16, 248, 253, 121, 126, 189, 151,
+ 58, 19, 137, 223, 92, 127, 235, 27,
+ 1, 0, 93, 88, 169, 12, 210, 96,
+ 230, 242, 151, 175, 97, 177, 252, 237,
+ 250, 113, 196, 52, 232, 100, 76, 45,
+ 159, 125, 221, 121, 221, 41, 125, 168,
+ 53, 42, 120, 56, 163, 105, 23, 214,
+ 242, 17, 186, 248, 151, 240, 77, 54,
+ 70, 62, 60, 182, 52, 242, 138, 197,
+ 216, 98, 66, 158, 29, 9, 36, 37,
+ 38, 132, 221, 135, 147, 101, 198, 173,
+ 159, 54, 230, 71, 249, 245, 227, 222,
+ 79, 19, 72, 48, 149, 225, 14, 173,
+ 43, 9, 130, 95, 137, 6, 175, 229,
+ 15, 136, 192, 99, 205, 229, 187, 173,
+ 191, 121, 113, 9, 249, 71, 125, 196,
+ 2, 63, 245, 42, 28, 167, 108, 68,
+ 166, 232, 135, 164, 174, 210, 248, 31,
+ 164, 130, 9, 157, 3, 202, 119, 23,
+ 78, 52, 124, 117, 106, 77, 44, 124,
+ 144, 216, 9, 158, 127, 141, 59, 103,
+ 112, 243, 83, 220, 227, 146, 120, 136,
+ 16, 208, 52, 1, 231, 163, 80, 16,
+ 138, 252, 5, 255, 71, 197, 137, 140,
+ 203, 193, 235, 8, 176, 28, 97, 8,
+ 241, 120, 29, 203, 158, 151, 183, 92,
+ 222, 232, 133, 136, 82, 202, 225, 47,
+ 99, 223, 84, 191, 13, 57, 181, 70,
+ 30, 39, 197, 68, 210, 14, 117, 230,
+ 217, 44, 9, 236, 127, 248, 128, 144,
+ 97, 149, 151, 126, 33, 114, 131, 13,
+ 10, 15, 15, 86, 28, 165, 49, 253,
+ 190, 170, 178, 99, 128, 225, 234, 220,
+ 85, 114, 62, 220, 116, 44, 136, 102,
+ 78, 211, 92, 175, 121, 90, 137, 237,
+ 204, 33, 225, 239, 41, 223, 37, 67,
+ 107, 48, 117, 72, 86, 204, 178, 140,
+ 185, 195, 175, 47, 39, 167, 56, 153,
+ 47, 198, 69, 103, 217, 93, 106, 117,
+ 132, 148, 235, 7, 172, 222, 219, 154,
+ 68, 247, 90, 218, 188, 166, 130, 215,
+ 74, 136, 101, 218, 6, 142, 244, 67,
+ 23, 115, 35, 156, 247, 129, 110, 59,
+ 93, 62, 45, 87, 54, 91, 158, 10,
+ 58, 176, 248, 79, 27, 206, 91, 20,
+ 215, 135, 182, 222, 134, 190, 88, 135,
+ 78, 147, 250, 212, 49, 156, 17, 150,
+ 42, 22, 29, 202, 169, 132, 30, 99,
+ 90, 180, 143, 75, 241, 116, 76, 151,
+ 32, 133, 96, 102, 244, 233, 44, 68,
+ 183, 219, 120, 111, 241, 95, 155, 248,
+ 54, 100, 187, 242, 77, 236, 246, 49,
+ 225, 218, 41, 69, 19, 110, 130, 90,
+ 225, 152, 119, 253, 188, 20, 155, 234,
+ 125, 120, 76, 126, 26, 44, 194, 237,
+ 4, 33, 236, 149, 26, 57, 156, 246,
+ 171, 58, 134, 120, 236, 57, 209, 241,
+ 119, 215, 61, 50, 28, 73, 141, 69,
+ 32, 152, 8, 249, 89, 244, 236, 35,
+ 136, 68, 54, 132, 112, 102, 151, 121,
+ 83, 124, 193, 213, 67, 198, 33, 3,
+ 155, 19, 16, 205, 226, 126, 104, 229,
+ 93, 170, 40, 67, 111, 50, 31, 36,
+ 70, 50, 200, 227, 28, 185, 176, 91,
+ 150, 28, 148, 129, 187, 140, 126, 245,
+ 204, 10, 61, 89, 162, 48, 117, 150,
+ 47, 55, 49, 139, 128, 108, 144, 25,
+ 93, 148, 24, 137, 239, 135, 0, 83,
+ 208, 146, 104, 171, 114, 147, 150, 50,
+ 69, 86, 36, 6, 132, 236, 210, 47,
+ 218, 2, 70, 181, 231, 7, 43, 114,
+ 164, 109, 80, 109, 38, 214, 50, 201,
+ 229, 122, 252, 183, 68, 194, 184, 133,
+ 144, 205, 39, 202, 250, 111, 6, 53,
+ 109, 158, 42, 170, 23, 168, 193, 31,
+ 180, 204, 86, 69, 205, 205, 33, 242,
+ 133, 237, 153, 11, 159, 54, 104, 174,
+ 5, 41, 47, 180, 160, 114, 162, 125,
+ 128, 198, 124, 100, 108, 152, 10, 174,
+ 28, 108, 217, 0, 214, 9, 210, 184,
+ 50, 47, 231, 43, 238, 167, 44, 188,
+ 137, 177, 123, 117, 229, 235, 32, 141,
+ 44, 87, 1, 24, 192, 130, 161, 85,
+ 34, 120, 190, 139, 89, 123, 109, 242,
+ 223, 121, 132, 36, 90, 195, 113, 119,
+ 160, 208, 132, 37, 152, 58, 184, 56,
+ 254, 123, 223, 75, 227, 237, 156, 184,
+ 37, 255, 255, 214, 223, 178, 106, 157,
+ 204, 179, 223, 205, 116, 161, 93, 231,
+ 152, 19, 137, 110, 90, 123, 9, 53,
+ 140, 142, 167, 104, 234, 140, 226, 4,
+ 125, 60, 200, 33, 156, 10, 253, 221,
+ 86, 218, 255, 89, 28, 142, 5, 166,
+ 118, 250, 31, 183, 242, 170, 227, 226,
+ 93, 60, 136, 107, 89, 245, 174, 212,
+ 211, 211, 169, 137, 59, 165, 66, 15,
+ 194, 161, 111, 228, 134, 227, 203, 100,
+ 119, 1, 112, 202, 69, 79, 133, 18,
+ 160, 71, 176, 154, 38, 8, 13, 139,
+ 199, 144, 177, 78, 88, 85, 50, 136,
+ 99, 98, 188, 216, 103, 109, 19, 137,
+ 131, 163, 91, 77, 248, 219, 190, 27,
+ 88, 224, 76, 166, 155, 74, 30, 241,
+ 196, 110, 247, 51, 216, 27, 42, 237,
+ 143, 255, 227, 105, 77, 25, 125, 245,
+ 246, 102, 49, 119, 198, 75, 93, 253,
+ 69, 245, 144, 183, 192, 206, 89, 33,
+ 177, 99, 177, 10, 95, 146, 27, 127,
+ 225, 157, 118, 221, 74, 94, 231, 107,
+ 14, 105, 183, 175, 139, 73, 101, 190,
+ 159, 235, 145, 45, 120, 150, 136, 77,
+ 188, 179, 230, 191, 219, 5, 243, 130,
+ 129, 101, 207, 28, 54, 179, 168, 158,
+ 5, 54, 174, 116, 191, 29, 27, 96,
+ 86, 231, 158, 95, 45, 135, 168, 90,
+ 189, 111, 121, 217, 108, 135, 7, 232,
+ 134, 252, 218, 37, 131, 107, 214, 228,
+ 78, 5, 181, 64, 138, 240, 174, 77,
+ 57, 203, 249, 113, 8, 145, 222, 155,
+ 78, 53, 245, 208, 214, 201, 75, 205,
+ 50, 2, 30, 84, 8, 176, 79, 84,
+ 139, 57, 174, 109, 139, 166, 7, 93,
+ 69, 227, 67, 112, 247, 160, 250, 184,
+ 40, 162, 124, 233, 113, 120, 96, 231,
+ 228, 190, 228, 104, 212, 170, 143, 221,
+ 226, 152, 216, 99, 83, 1, 79, 136,
+ 84, 77, 191, 200, 89, 56, 211, 34,
+ 88, 77, 30, 244, 190, 10, 215, 10,
+ 12, 43, 128, 136, 56, 136, 221, 104,
+ 162, 80, 190, 73, 239, 246, 84, 153,
+ 125, 192, 49, 40, 200, 195, 124, 165,
+ 71, 196, 173, 30, 150, 247, 222, 194,
+ 129, 102, 207, 163, 77, 220, 186, 157,
+ 53, 13, 112, 195, 197, 20, 157, 241,
+ 63, 255, 199, 33, 89, 45, 79, 167,
+ 245, 20, 9, 199, 209, 169, 180, 192,
+ 236, 108, 244, 45, 182, 147, 252, 158,
+ 238, 172, 246, 229, 220, 48, 202, 71,
+ 8, 57, 97, 42, 238, 107, 16, 88,
+ 28, 201, 232, 126, 117, 84, 22, 151,
+ 253, 204, 112, 189, 154, 84, 241, 39,
+ 52, 165, 105, 47, 67, 225, 211, 19,
+ 18, 218, 251, 85, 130, 210, 122, 111,
+ 132, 141, 84, 38, 207, 131, 68, 48,
+ 156, 145, 191, 118, 9, 5, 164, 146,
+ 63, 53, 27, 247, 39, 242, 57, 66,
+ 123, 221, 8, 247, 98, 114, 202, 231,
+ 177, 153, 23, 141, 225, 247, 143, 141,
+ 90, 202, 135, 34, 118, 104, 143, 196,
+ 106, 212, 3, 71, 40, 252, 15, 34,
+ 252, 248, 77, 208, 162, 28, 140, 16,
+ 157, 242, 24, 232, 108, 176, 225, 126,
+ 16, 208, 70, 79, 85, 249, 140, 204,
+ 2, 29, 21, 61, 47, 105, 171, 39,
+ 5, 13, 4, 103, 218, 165, 140, 61,
+ 214, 238, 123, 93, 85, 228, 114, 204,
+ 150, 30, 64, 183, 32, 176, 116, 223,
+ 179, 183, 254, 39, 35, 50, 84, 81,
+ 73, 151, 104, 10, 39, 180, 196, 98,
+ 85, 109, 86, 194, 115, 84, 210, 226,
+ 179, 249, 73, 158, 152, 36, 241, 243,
+ 17, 38, 99, 146, 251, 166, 206, 211,
+ 224, 229, 76, 38, 203, 88, 149, 108,
+ 90, 214, 51, 136, 109, 223, 171, 66,
+ 97, 162, 90, 122, 42, 159, 126, 50,
+ 233, 231, 15, 50, 101, 186, 11, 85,
+ 237, 85, 96, 135, 60, 1, 100, 185,
+ 39, 125, 64, 179, 8, 219, 189, 113,
+ 106, 179, 82, 234, 15, 0, 244, 5,
+ 43, 142, 33, 28, 195, 145, 100, 69,
+ 43, 120, 158, 106, 195, 89, 197, 31,
+ 246, 42, 178, 32, 255, 171, 237, 79,
+ 241, 75, 197, 240, 144, 14, 65, 42,
+ 18, 33, 84, 185, 115, 127, 212, 194,
+ 23, 119, 255, 60, 61, 161, 91, 130,
+ 0, 64, 244, 252, 215, 149, 6, 112,
+ 36, 118, 97, 112, 113, 101, 107, 150,
+ 37, 71, 99, 39, 185, 29, 99, 142,
+ 6, 165, 16, 211, 44, 242, 18, 8,
+ 50, 229, 5, 5, 176, 158, 237, 222,
+ 41, 239, 224, 112, 127, 192, 235, 253,
+ 30, 114, 44, 160, 31, 244, 182, 206,
+ 70, 70, 130, 192, 98, 189, 63, 63,
+ 128, 116, 112, 71, 221, 227, 84, 120,
+ 238, 80, 192, 49, 151, 2, 153, 191,
+ 6, 106, 146, 75, 105, 204, 91, 97,
+ 7, 24, 235, 24, 10, 29, 37, 88,
+ 61, 66, 71, 248, 150, 131, 98, 140,
+ 123, 92, 204, 76, 12, 247, 245, 20,
+ 135, 179, 84, 115, 104, 31, 238, 52,
+ 123, 254, 190, 32, 221, 29, 92, 220,
+ 80, 193, 9, 230, 201, 30, 150, 133,
+ 213, 150, 200, 95, 98, 252, 187, 194,
+ 44, 190, 10, 115, 64, 155, 253, 5,
+ 29, 9, 34, 45, 74, 111, 199, 5,
+ 72, 144, 136, 30, 162, 4, 145, 12,
+ 105, 53, 130, 142, 134, 124, 144, 23,
+ 203, 31, 147, 252, 27, 9, 62, 185,
+ 183, 118, 150, 116, 145, 237, 202, 27,
+ 220, 229, 203, 149, 179, 74, 207, 165,
+ 59, 3, 99, 198, 194, 126, 64, 108,
+ 43, 53, 168, 232, 132, 130, 135, 164,
+ 173, 207, 253, 71, 183, 126, 132, 204,
+ 92, 228, 3, 166, 170, 60, 73, 178,
+ 232, 106, 249, 127, 252, 140, 164, 112,
+ 144, 35, 32, 59, 69, 131, 61, 245,
+ 107, 1, 117, 6, 244, 191, 218, 182,
+ 156, 103, 253, 177, 251, 203, 113, 172,
+ 176, 20, 218, 157, 27, 91, 200, 243,
+ 40, 208, 185, 62, 192, 71, 236, 154,
+ 106, 103, 174, 101, 228, 104, 52, 144,
+ 117, 120, 30, 201, 6, 79, 1, 233,
+ 83, 77, 205, 201, 86, 250, 107, 251,
+ 31, 63, 123, 192, 68, 130, 119, 226,
+ 227, 89, 96, 85, 20, 238, 164, 65,
+ 168, 166, 87, 83, 31, 144, 61, 237,
+ 2, 221, 122, 150, 241, 185, 173, 213,
+ 166, 96, 158, 94, 166, 146, 44, 150,
+ 253, 172, 17, 245, 94, 146, 35, 153,
+ 18, 49, 251, 1, 80, 81, 59, 143,
+ 220, 169, 114, 200, 195, 46, 42, 73,
+ 137, 4, 197, 10, 140, 3, 229, 201,
+ 35, 131, 216, 237, 219, 128, 193, 106,
+ 16, 104, 188, 219, 107, 169, 151, 153,
+ 119, 241, 136, 122, 51, 224, 182, 92,
+ 188, 91, 185, 96, 242, 31, 182, 180,
+ 96, 114, 104, 198, 89, 125, 22, 40,
+ 89, 84, 85, 166, 247, 50, 193, 157,
+ 71, 185, 130, 70, 116, 159, 232, 114,
+ 119, 60, 71, 211, 215, 188, 134, 169,
+ 44, 5, 242, 206, 78, 15, 122, 139,
+ 244, 176, 140, 247, 160, 55, 209, 72,
+ 58, 194, 60, 112, 81, 7, 100, 32,
+ 123, 53, 150, 136, 168, 94, 19, 116,
+ 230, 79, 22, 111, 237, 3, 44, 134,
+ 219, 49, 215, 206, 1, 194, 96, 167,
+ 97, 228, 42, 158, 61, 38, 152, 15,
+ 76, 147, 103, 62, 251, 129, 42, 87,
+ 92, 79, 29, 108, 124, 246, 130, 118,
+ 38, 178, 170, 75, 131, 85, 157, 216,
+ 154, 215, 71, 153, 160, 4, 37, 161,
+ 215, 109, 246, 158, 253, 17, 133, 108,
+ 187, 209, 65, 46, 50, 95, 229, 193,
+ 242, 202, 152, 154, 93, 189, 101, 198,
+ 170, 212, 115, 177, 216, 113, 129, 205,
+ 97, 201, 7, 2, 131, 174, 5, 98,
+ 177, 207, 59, 184, 174, 48, 166, 205,
+ 128, 43, 118, 250, 79, 237, 197, 96,
+ 55, 127, 24, 185, 190, 228, 133, 93,
+ 202, 193, 95, 93, 111, 244, 96, 28,
+ 237, 47, 93, 144, 239, 213, 151, 138,
+ 84, 237, 135, 228, 161, 7, 205, 120,
+ 77, 193, 114, 75, 188, 61, 11, 109,
+ 54, 62, 64, 196, 114, 119, 217, 139,
+ 91, 151, 79, 254, 47, 214, 164, 36,
+ 79, 198, 193, 16, 253, 195, 35, 90,
+ 218, 242, 172, 106, 78, 212, 49, 252,
+ 189, 29, 122, 233, 222, 63, 91, 72,
+ 119, 213, 102, 86, 43, 195, 77, 161,
+ 142, 21, 250, 155, 163, 112, 233, 54,
+ 248, 106, 181, 114, 176, 188, 41, 96,
+ 158, 222, 162, 20, 140, 102, 242, 78,
+ 229, 53, 52, 99, 57, 222, 2, 82,
+ 25, 218, 234, 232, 171, 206, 41, 3,
+ 246, 162, 13, 91, 47, 96, 93, 26,
+ 55, 178, 156, 122, 185, 20, 93, 213,
+ 171, 17, 103, 147, 86, 164, 69, 212,
+ 233, 227, 127, 34, 147, 125, 180, 172,
+ 23, 205, 63, 240, 172, 213, 53, 212,
+ 178, 85, 106, 247, 93, 80, 158, 132,
+ 185, 237, 81, 139, 105, 107, 190, 215,
+ 177, 156, 133, 49, 0, 41, 45, 36,
+ 198, 212, 47, 95, 192, 29, 55, 110,
+ 32, 188, 55, 240, 5, 99, 56, 227,
+ 245, 92, 240, 70, 235, 48, 4, 238,
+ 210, 81, 116, 8, 133, 58, 230, 253,
+ 203, 10, 251, 167, 124, 178, 135, 58,
+ 143, 250, 241, 79, 159, 61, 193, 123,
+ 105, 186, 69, 175, 27, 217, 177, 99,
+ 255, 133, 182, 182, 223, 13, 49, 248,
+ 204, 252, 91, 27, 56, 112, 222, 255,
+ 188, 244, 228, 234, 77, 134, 105, 95,
+ 187, 171, 242, 221, 14, 18, 1, 211,
+ 37, 153, 162, 40, 98, 73, 71, 18,
+ 29, 24, 191, 60, 239, 118, 176, 64,
+ 58, 44, 123, 27, 88, 26, 150, 255,
+ 186, 0, 175, 202, 164, 85, 184, 184,
+ 61, 243, 169, 137, 150, 200, 193, 142,
+ 138, 229, 1, 58, 170, 136, 136, 69,
+ 57, 30, 8, 86, 220, 70, 165, 97,
+ 13, 255, 221, 235, 254, 0, 211, 248,
+ 146, 53, 93, 192, 9, 80, 98, 128,
+ 152, 88, 149, 132, 251, 171, 236, 38,
+ 83, 206, 233, 66, 93, 244, 243, 174,
+ 174, 94, 41, 205, 34, 219, 147, 208,
+ 196, 110, 247, 142, 87, 24, 166, 49,
+ 23, 24, 82, 252, 133, 14, 83, 140,
+ 170, 179, 10, 231, 45, 211, 52, 65,
+ 65, 31, 11, 9, 10, 221, 214, 105,
+ 158, 252, 188, 197, 21, 120, 249, 146,
+ 234, 127, 4, 255, 171, 151, 190, 17,
+ 224, 201, 12, 106, 94, 82, 0, 175,
+ 14, 55, 4, 39, 3, 150, 103, 43,
+ 153, 145, 31, 119, 143, 54, 103, 126,
+ 151, 234, 230, 108, 122, 205, 90, 5,
+ 185, 195, 170, 216, 171, 224, 33, 99,
+ 130, 141, 151, 162, 127, 86, 191, 94,
+ 90, 22, 220, 242, 107, 100, 246, 225,
+ 96, 100, 100, 15, 167, 101, 119, 87,
+ 33, 45, 152, 246, 72, 73, 249, 8,
+ 63, 68, 108, 111, 5, 109, 153, 51,
+ 196, 228, 91, 235, 34, 138, 9, 160,
+ 138, 113, 221, 88, 38, 128, 134, 63,
+ 3, 173, 133, 49, 17, 51, 151, 26,
+ 167, 63, 225, 97, 184, 120, 214, 49,
+ 72, 36, 23, 130, 230, 221, 190, 30,
+ 131, 232, 248, 159, 5, 124, 211, 244,
+ 34, 187, 177, 250, 68, 62, 70, 133,
+ 202, 54, 166, 172, 25, 178, 230, 171,
+ 144, 235, 215, 250, 132, 141, 46, 185,
+ 43, 8, 97, 135, 7, 141, 205, 208,
+ 126, 3, 53, 71, 122, 18, 44, 212,
+ 20, 245, 87, 16, 136, 95, 144, 216,
+ 253, 20, 150, 125, 90, 24, 55, 187,
+ 163, 155, 58, 63, 187, 143, 132, 167,
+ 98, 20, 15, 83, 145, 215, 93, 40,
+ 94, 5, 177, 202, 125, 100, 15, 159,
+ 139, 99, 93, 226, 111, 158, 88, 131,
+ 140, 237, 116, 124, 10, 215, 167, 37,
+ 41, 95, 166, 33, 51, 95, 52, 72,
+ 62, 149, 165, 46, 141, 29, 246, 244,
+ 8, 159, 29, 119, 143, 198, 129, 37,
+ 192, 251, 58, 246, 134, 10, 178, 20,
+ 41, 56, 139, 29, 245, 82, 122, 217,
+ 223, 144, 91, 216, 61, 76, 235, 119,
+ 218, 55, 25, 137, 40, 128, 4, 144,
+ 125, 242, 111, 121, 81, 249, 31, 73,
+ 168, 79, 112, 164, 4, 56, 128, 191,
+ 85, 251, 41, 182, 212, 202, 191, 200,
+ 103, 132, 252, 139, 82, 212, 250, 186,
+ 181, 240, 231, 109, 120, 42, 63, 104,
+ 161, 44, 74, 63, 146, 13, 230, 198,
+ 86, 177, 138, 199, 20, 0, 119, 81,
+ 137, 163, 45, 86, 214, 219, 107, 233,
+ 220, 75, 196, 21, 14, 46, 119, 31,
+ 110, 223, 132, 137, 194, 67, 2, 87,
+ 82, 123, 50, 6, 209, 144, 88, 192,
+ 69, 65, 205, 32, 244, 239, 169, 95,
+ 80, 55, 165, 30, 73, 136, 241, 146,
+ 191, 10, 73, 219, 232, 207, 149, 235,
+ 157, 40, 239, 4, 4, 123, 205, 87,
+ 250, 40, 126, 85, 48, 156, 133, 97,
+ 173, 113, 135, 150, 196, 59, 91, 202,
+ 170, 46, 183, 121, 189, 191, 22, 104,
+ 228, 22, 28, 237, 126, 214, 151, 220,
+ 29, 234, 11, 0, 239, 152, 248, 73,
+ 129, 38, 69, 142, 23, 8, 155, 91,
+ 101, 175, 138, 115, 66, 216, 196, 97,
+ 137, 121, 125, 129, 253, 202, 34, 29,
+ 69, 196, 25, 74, 230, 108, 206, 123,
+ 237, 116, 11, 207, 11, 102, 49, 219,
+ 10, 194, 60, 249, 184, 206, 55, 27,
+ 49, 78, 59, 185, 144, 39, 3, 33,
+ 12, 23, 23, 7, 159, 152, 225, 98,
+ 137, 206, 92, 115, 124, 24, 116, 218,
+ 137, 19, 135, 201, 162, 102, 200, 82,
+ 204, 73, 203, 201, 148, 182, 211, 25,
+ 221, 247, 65, 40, 149, 100, 223, 204,
+ 65, 76, 28, 40, 143, 192, 156, 166,
+ 104, 164, 157, 85, 36, 91, 118, 168,
+ 246, 49, 235, 124, 163, 167, 201, 213,
+ 237, 5, 12, 172, 69, 38, 137, 18,
+ 225, 62, 178, 46, 71, 187, 149, 30,
+ 50, 185, 131, 37, 140, 85, 167, 115,
+ 189, 137, 83, 231, 157, 113, 138, 103,
+ 94, 160, 201, 94, 194, 162, 111, 176,
+ 253, 26, 66, 210, 146, 46, 213, 61,
+ 225, 126, 212, 248, 83, 202, 114, 104,
+ 154, 133, 2, 166, 78, 23, 237, 219,
+ 224, 237, 153, 222, 5, 142, 161, 131,
+ 193, 115, 162, 233, 165, 58, 89, 140,
+ 70, 201, 239, 124, 209, 121, 237, 171,
+ 52, 135, 111, 12, 125, 7, 111, 205,
+ 110, 55, 149, 88, 250, 106, 26, 24,
+ 50, 117, 71, 218, 9, 222, 28, 253,
+ 124, 81, 73, 157, 103, 218, 66, 220,
+ 98, 101, 11, 89, 113, 94, 58, 26,
+ 8, 161, 128, 134, 21, 183, 58, 251,
+ 110, 17, 250, 159, 218, 52, 192, 7,
+ 208, 192, 61, 15, 136, 117, 32, 85,
+ 221, 76, 89, 214, 222, 77, 27, 137,
+ 192, 86, 175, 169, 20, 46, 71, 122,
+ 240, 55, 18, 28, 251, 23, 21, 146,
+ 227, 45, 202, 50, 12, 79, 44, 142,
+ 244, 255, 89, 202, 41, 99, 125, 134,
+ 40, 168, 47, 68, 252, 54, 50, 161,
+ 178, 172, 76, 39, 91, 28, 35, 244,
+ 181, 242, 1, 138, 255, 32, 117, 83,
+ 159, 248, 207, 174, 251, 23, 160, 97,
+ 183, 102, 16, 36, 83, 154, 21, 5,
+ 61, 79, 108, 103, 127, 148, 38, 9,
+ 54, 1, 52, 64, 144, 188, 75, 63,
+ 62, 151, 98, 139, 238, 108, 242, 26,
+ 195, 242, 55, 51, 105, 156, 61, 239,
+ 156, 233, 16, 108, 136, 171, 160, 85,
+ 72, 73, 212, 211, 244, 105, 189, 92,
+ 85, 36, 211, 206, 230, 134, 231, 159,
+ 5, 22, 58, 142, 41, 62, 67, 129,
+ 209, 61, 165, 36, 184, 222, 232, 31,
+ 33, 85, 150, 38, 226, 45, 109, 171,
+ 67, 165, 49, 31, 139, 125, 152, 91,
+ 77, 132, 184, 34, 190, 251, 235, 135,
+ 112, 129, 237, 118, 34, 194, 23, 96,
+ 170, 126, 82, 70, 176, 109, 201, 30,
+ 67, 22, 229, 203, 82, 58, 217, 223,
+ 245, 48, 190, 232, 38, 106, 235, 188,
+ 250, 159, 195, 124, 90, 67, 99, 132,
+ 217, 112, 150, 121, 167, 20, 192, 4,
+ 170, 219, 250, 134, 4, 156, 247, 68,
+ 201, 130, 164, 99, 95, 74, 210, 67,
+ 196, 178, 40, 74, 12, 36, 132, 46,
+ 173, 255, 69, 245, 98, 43, 74, 142,
+ 165, 138, 86, 169, 227, 188, 156, 145,
+ 194, 129, 105, 143, 250, 230, 163, 157,
+ 61, 1, 125, 215, 27, 126, 2, 220,
+ 76, 227, 92, 3, 23, 216, 220, 134,
+ 98, 93, 227, 231, 131, 123, 192, 138,
+ 12, 177, 20, 115, 190, 144, 211, 152,
+ 74, 115, 189, 202, 239, 116, 162, 80,
+ 79, 148, 137, 235, 23, 98, 241, 150,
+ 33, 119, 33, 4, 193, 93, 239, 177,
+ 50, 155, 43, 38, 12, 176, 78, 139,
+ 140, 9, 225, 252, 123, 126, 90, 167,
+ 138, 230, 234, 2, 218, 183, 62, 160,
+ 253, 225, 200, 76, 199, 136, 18, 30,
+ 208, 228, 88, 23, 167, 123, 20, 95,
+ 210, 144, 91, 74, 190, 97, 177, 0,
+ 149, 30, 10, 34, 133, 118, 13, 46,
+ 166, 199, 203, 141, 234, 218, 139, 190,
+ 90, 134, 172, 185, 106, 184, 67, 207,
+ 217, 186, 183, 50, 176, 11, 178, 60,
+ 35, 13, 16, 234, 162, 224, 128, 126,
+ 95, 40, 117, 60, 197, 215, 246, 198,
+ 171, 4, 27, 194, 62, 82, 177, 132,
+ 20, 111, 186, 120, 218, 139, 140, 33,
+ 64, 75, 110, 243, 106, 119, 165, 75,
+ 19, 222, 107, 86, 48, 188, 123, 213,
+ 91, 8, 194, 44, 229, 40, 248, 209,
+ 140, 68, 119, 39, 51, 229, 34, 70,
+ 84, 100, 78, 240, 209, 81, 208, 47,
+ 88, 205, 10, 207, 166, 156, 99, 14,
+ 18, 46, 241, 47, 130, 51, 183, 204,
+ 60, 246, 111, 73, 213, 97, 131, 196,
+ 16, 126, 114, 221, 84, 250, 70, 89,
+ 56, 164, 251, 44, 232, 99, 57, 149,
+ 158, 96, 141, 114, 155, 147, 101, 242,
+ 55, 174, 214, 9, 239, 17, 87, 171,
+ 16, 94, 79, 32, 114, 66, 114, 202,
+ 151, 161, 112, 22, 179, 23, 37, 56,
+ 102, 88, 135, 9, 61, 245, 193, 253,
+ 243, 98, 172, 129, 227, 102, 43, 59,
+ 186, 45, 10, 95, 90, 160, 250, 51,
+ 216, 212, 0, 233, 77, 134, 28, 186,
+ 27, 169, 27, 183, 75, 177, 163, 218,
+ 136, 95, 104, 87, 105, 193, 109, 125,
+ 219, 43, 76, 190, 1, 115, 61, 212,
+ 118, 230, 253, 177, 200, 238, 39, 142,
+ 230, 109, 119, 180, 169, 106, 104, 92,
+ 191, 107, 237, 208, 55, 98, 158, 88,
+ 134, 144, 240, 74, 235, 230, 26, 242,
+ 198, 199, 176, 253, 132, 160, 90, 117,
+ 30, 58, 242, 61, 238, 146, 109, 246,
+ 85, 189, 20, 126, 63, 172, 41, 5,
+ 49, 125, 60, 61, 176, 238, 194, 57,
+ 31, 29, 206, 151, 133, 172, 58, 32,
+ 142, 5, 186, 99, 206, 55, 147, 83,
+ 191, 172, 124, 179, 22, 180, 13, 148,
+ 36, 21, 95, 75, 49, 75, 62, 4,
+ 204, 124, 121, 253, 158, 248, 110, 141,
+ 200, 186, 247, 229, 120, 229, 219, 48,
+ 237, 2, 128, 191, 108, 149, 155, 204,
+ 74, 134, 195, 115, 98, 36, 94, 125,
+ 154, 105, 0, 133, 50, 109, 141, 28,
+ 34, 220, 64, 15, 70, 218, 46, 237,
+ 153, 22, 201, 224, 149, 162, 54, 91,
+ 112, 208, 27, 77, 152, 214, 219, 167,
+ 36, 158, 156, 58, 50, 161, 46, 247,
+ 177, 168, 142, 6, 236, 199, 247, 229,
+ 231, 104, 39, 148, 42, 197, 146, 221,
+ 99, 38, 154, 252, 33, 127, 253, 152,
+ 1, 2, 136, 186, 39, 181, 210, 244,
+ 209, 17, 32, 103, 66, 112, 93, 247,
+ 13, 215, 183, 76, 239, 38, 130, 243,
+ 195, 223, 44, 197, 156, 120, 32, 68,
+ 226, 126, 184, 235, 141, 188, 179, 100,
+ 13, 156, 163, 143, 86, 78, 51, 27,
+ 131, 171, 63, 105, 47, 194, 159, 2,
+ 41, 196, 193, 227, 99, 96, 249, 251,
+ 253, 134, 65, 105, 31, 241, 229, 183,
+ 200, 233, 80, 146, 3, 96, 88, 101,
+ 60, 244, 64, 48, 86, 217, 204, 144,
+ 111, 156, 97, 253, 118, 150, 218, 189,
+ 60, 244, 224, 109, 42, 221, 66, 79,
+ 236, 143, 31, 118, 196, 248, 19, 150,
+ 65, 128, 234, 25, 219, 122, 125, 167,
+ 108, 45, 17, 116, 213, 206, 202, 199,
+ 78, 143, 248, 23, 9, 239, 166, 110,
+ 88, 168, 59, 63, 159, 248, 93, 154,
+ 142, 207, 0, 87, 48, 252, 140, 251,
+ 152, 249, 247, 109, 4, 223, 156, 216,
+ 205, 174, 28, 70, 36, 102, 182, 162,
+ 50, 81, 199, 140, 132, 151, 46, 111,
+ 239, 217, 243, 206, 73, 199, 110, 218,
+ 8, 25, 141, 99, 50, 252, 196, 18,
+ 161, 154, 178, 188, 171, 81, 192, 24,
+ 193, 253, 60, 220, 212, 50, 204, 91,
+ 43, 43, 130, 178, 174, 59, 55, 207,
+ 200, 192, 46, 50, 17, 174, 135, 85,
+ 4, 32, 103, 139, 241, 167, 73, 124,
+ 205, 149, 34, 167, 62, 109, 220, 204,
+ 166, 153, 104, 178, 121, 232, 194, 203,
+ 228, 114, 213, 7, 4, 200, 218, 124,
+ 23, 202, 134, 49, 131, 67, 92, 30,
+ 27, 88, 52, 9, 59, 7, 99, 142,
+ 186, 60, 239, 158, 217, 16, 224, 168,
+ 105, 151, 202, 220, 138, 18, 104, 108,
+ 140, 243, 126, 112, 23, 97, 221, 171,
+ 65, 99, 10, 73, 182, 147, 95, 5,
+ 159, 8, 186, 51, 28, 223, 170, 142,
+ 1, 215, 223, 227, 171, 134, 3, 26,
+ 229, 107, 157, 32, 100, 193, 223, 251,
+ 83, 136, 145, 204, 212, 55, 197, 128,
+ 188, 172, 75, 36, 53, 21, 190, 39,
+ 191, 137, 101, 240, 3, 107, 215, 100,
+ 87, 214, 71, 94, 192, 158, 73, 139,
+ 238, 249, 66, 249, 140, 235, 241, 144,
+ 153, 83, 135, 163, 130, 44, 187, 189,
+ 148, 115, 87, 3, 137, 141, 167, 141,
+ 248, 149, 182, 26, 219, 187, 182, 9,
+ 145, 35, 239, 195, 250, 192, 64, 253,
+ 170, 245, 26, 80, 102, 37, 77, 12,
+ 150, 251, 236, 239, 90, 50, 150, 238,
+ 197, 12, 107, 43, 202, 19, 158, 141,
+ 134, 201, 194, 79, 58, 44, 189, 86,
+ 169, 49, 212, 87, 131, 63, 252, 145,
+ 5, 92, 96, 233, 119, 31, 172, 164,
+ 58, 240, 11, 230, 161, 88, 97, 243,
+ 22, 6, 201, 196, 133, 198, 196, 110,
+ 100, 126, 207, 53, 90, 167, 179, 73,
+ 69, 49, 33, 123, 173, 68, 50, 247,
+ 4, 111, 155, 101, 121, 24, 165, 44,
+ 246, 185, 8, 67, 111, 44, 131, 44,
+ 93, 50, 137, 13, 76, 73, 218, 223,
+ 60, 156, 134, 253, 28, 201, 109, 168,
+ 152, 163, 138, 44, 132, 230, 217, 240,
+ 246, 192, 133, 10, 209, 149, 4, 104,
+ 231, 182, 235, 69, 237, 161, 235, 48,
+ 98, 131, 255, 173, 241, 36, 27, 32,
+ 143, 42, 144, 9, 33, 199, 244, 234,
+ 163, 171, 238, 94, 138, 13, 58, 152,
+ 202, 84, 97, 174, 247, 210, 177, 238,
+ 139, 18, 15, 44, 246, 99, 12, 164,
+ 72, 211, 255, 131, 105, 67, 51, 42,
+ 235, 112, 123, 76, 226, 230, 79, 54,
+ 236, 216, 30, 11, 172, 152, 200, 43,
+ 175, 174, 92, 77, 114, 141, 174, 61,
+ 104, 248, 2, 36, 235, 224, 202, 110,
+ 26, 9, 103, 242, 0, 58, 211, 158,
+ 242, 84, 2, 249, 203, 125, 108, 247,
+ 9, 25, 70, 60, 160, 172, 81, 154,
+ 109, 108, 240, 90, 157, 209, 252, 231,
+ 88, 211, 32, 3, 233, 57, 111, 92,
+ 52, 82, 94, 10, 162, 107, 151, 70,
+ 245, 81, 159, 17, 159, 77, 139, 244,
+ 236, 239, 19, 255, 223, 170, 25, 51,
+ 60, 163, 150, 150, 209, 164, 67, 53,
+ 138, 140, 133, 81, 207, 59, 51, 60,
+ 86, 157, 217, 122, 38, 120, 18, 128,
+ 237, 221, 55, 213, 167, 163, 139, 227,
+ 183, 215, 218, 196, 253, 109, 201, 253,
+ 80, 174, 185, 92, 200, 95, 166, 155,
+ 237, 141, 159, 63, 141, 24, 12, 249,
+ 232, 252, 251, 219, 134, 159, 211, 15,
+ 179, 73, 223, 177, 85, 152, 206, 88,
+ 229, 107, 188, 139, 199, 250, 55, 141,
+ 42, 4, 126, 165, 29, 48, 176, 157,
+ 123, 179, 136, 48, 212, 95, 67, 250,
+ 210, 173, 113, 111, 220, 166, 164, 244,
+ 163, 92, 185, 129, 224, 135, 34, 16,
+ 158, 61, 124, 10, 34, 47, 41, 18,
+ 14, 10, 229, 108, 11, 222, 238, 161,
+ 235, 203, 124, 210, 107, 57, 146, 120,
+ 227, 159, 43, 242, 236, 35, 177, 219,
+ 223, 93, 2, 32, 80, 1, 158, 26,
+ 205, 86, 134, 91, 186, 254, 248, 202,
+ 120, 234, 89, 54, 221, 129, 118, 25,
+ 118, 47, 177, 145, 25, 59, 76, 234,
+ 40, 165, 175, 210, 2, 43, 62, 76,
+ 87, 61, 169, 181, 147, 130, 36, 15,
+ 219, 87, 42, 149, 207, 98, 218, 189,
+ 92, 136, 122, 103, 138, 59, 23, 246,
+ 84, 87, 120, 200, 202, 105, 131, 80,
+ 167, 45, 136, 67, 65, 58, 5, 125,
+ 103, 193, 247, 212, 86, 204, 230, 92,
+ 140, 61, 207, 232, 36, 113, 92, 132,
+ 42, 217, 172, 174, 217, 24, 101, 188,
+ 249, 163, 88, 236, 111, 147, 163, 126,
+ 214, 0, 149, 101, 199, 161, 94, 187,
+ 67, 190, 37, 176, 235, 3, 250, 78,
+ 166, 30, 231, 177, 26, 158, 239, 150,
+ 196, 77, 144, 210, 13, 18, 143, 247,
+ 184, 176, 133, 219, 168, 142, 235, 119,
+ 181, 132, 109, 146, 3, 95, 228, 15,
+ 232, 148, 67, 29, 53, 154, 86, 80,
+ 244, 76, 57, 168, 60, 223, 94, 53,
+ 54, 204, 49, 248, 153, 248, 179, 247,
+ 182, 219, 139, 119, 122, 116, 195, 105,
+ 136, 111, 33, 60, 218, 201, 96, 36,
+ 113, 2, 213, 226, 244, 132, 123, 51,
+ 227, 105, 68, 236, 122, 102, 221, 146,
+ 23, 133, 23, 27, 123, 96, 111, 88,
+ 237, 48, 77, 131, 29, 116, 196, 185,
+ 6, 63, 232, 37, 4, 99, 152, 207,
+ 155, 204, 196, 94, 86, 10, 1, 183,
+ 147, 31, 150, 17, 134, 74, 180, 60,
+ 172, 205, 10, 228, 174, 14, 50, 164,
+ 166, 123, 94, 82, 214, 82, 134, 106,
+ 211, 23, 4, 127, 229, 194, 85, 109,
+ 243, 11, 38, 162, 2, 114, 202, 183,
+ 231, 53, 184, 213, 74, 14, 199, 206,
+ 13, 246, 27, 32, 131, 28, 235, 135,
+ 83, 23, 118, 204, 214, 216, 144, 35,
+ 66, 217, 235, 114, 188, 113, 174, 90,
+ 40, 50, 23, 197, 212, 7, 171, 82,
+ 206, 44, 126, 85, 167, 45, 152, 107,
+ 130, 135, 6, 235, 174, 4, 114, 101,
+ 112, 151, 57, 60, 174, 120, 48, 24,
+ 77, 6, 220, 38, 53, 253, 203, 217,
+ 207, 235, 11, 143, 172, 152, 31, 114,
+ 138, 0, 205, 163, 124, 12, 47, 114,
+ 75, 55, 169, 102, 216, 134, 225, 9,
+ 60, 83, 25, 238, 245, 161, 243, 193,
+ 237, 108, 193, 105, 151, 47, 154, 29,
+ 164, 171, 150, 69, 73, 187, 33, 145,
+ 40, 98, 159, 77, 198, 247, 15, 93,
+ 99, 64, 102, 156, 153, 101, 62, 14,
+ 249, 5, 149, 66, 218, 250, 109, 248,
+ 248, 198, 105, 229, 242, 33, 147, 223,
+ 23, 193, 39, 255, 134, 103, 112, 173,
+ 1, 27, 9, 255, 160, 147, 85, 66,
+ 174, 112, 217, 113, 160, 59, 89, 253,
+ 169, 64, 133, 207, 139, 172, 61, 102,
+ 201, 104, 181, 124, 115, 130, 223, 67,
+ 131, 234, 134, 32, 133, 196, 211, 204,
+ 210, 103, 169, 132, 127, 236, 228, 221,
+ 163, 12, 242, 228, 6, 154, 122, 145,
+ 82, 122, 121, 0, 103, 216, 133, 134,
+ 162, 171, 171, 75, 223, 52, 118, 37,
+ 149, 111, 224, 129, 188, 21, 19, 188,
+ 252, 130, 81, 220, 137, 198, 45, 246,
+ 94, 20, 144, 3, 134, 102, 170, 45,
+ 24, 159, 191, 69, 10, 221, 170, 124,
+ 228, 142, 19, 146, 126, 98, 63, 226,
+ 239, 226, 199, 205, 103, 226, 115, 197,
+ 63, 185, 185, 32, 248, 126, 5, 167,
+ 83, 254, 73, 40, 93, 212, 249, 143,
+ 254, 223, 96, 29, 51, 70, 3, 0,
+ 130, 212, 177, 58, 1, 46, 36, 131,
+ 151, 39, 43, 177, 24, 194, 240, 8,
+ 167, 103, 173, 184, 149, 64, 188, 161,
+ 48, 67, 214, 84, 183, 247, 218, 202,
+ 173, 116, 66, 170, 140, 255, 197, 4,
+ 190, 120, 153, 146, 16, 21, 189, 16,
+ 14, 88, 129, 222, 178, 172, 59, 58,
+ 26, 122, 152, 203, 18, 21, 22, 152,
+ 109, 30, 89, 90, 136, 173, 48, 199,
+ 238, 26, 204, 228, 166, 150, 159, 71,
+ 175, 92, 21, 171, 235, 168, 73, 122,
+ 190, 148, 232, 160, 152, 114, 61, 234,
+ 94, 160, 74, 214, 213, 155, 159, 94,
+ 214, 111, 2, 18, 40, 230, 246, 5,
+ 93, 222, 188, 111, 27, 87, 145, 171,
+ 38, 191, 138, 156, 178, 200, 97, 206,
+ 237, 70, 160, 40, 214, 6, 205, 188,
+ 214, 162, 134, 45, 195, 99, 170, 89,
+ 182, 203, 118, 98, 10, 84, 206, 140,
+ 32, 9, 170, 66, 181, 242, 220, 58,
+ 219, 37, 252, 210, 109, 13, 107, 66,
+ 178, 180, 199, 240, 214, 204, 209, 47,
+ 13, 202, 58, 85, 173, 63, 234, 17,
+ 208, 91, 248, 171, 115, 213, 164, 145,
+ 216, 120, 161, 119, 125, 75, 7, 221,
+ 128, 7, 52, 248, 91, 5, 95, 21,
+ 225, 88, 186, 196, 24, 231, 116, 148,
+ 158, 72, 139, 64, 50, 14, 73, 36,
+ 74, 70, 24, 134, 147, 255, 65, 244,
+ 168, 112, 96, 54, 3, 213, 4, 17,
+ 220, 22, 108, 25, 88, 67, 85, 38,
+ 129, 122, 37, 153, 110, 18, 164, 124,
+ 245, 150, 14, 140, 215, 222, 188, 60,
+ 67, 119, 112, 203, 209, 48, 70, 40,
+ 128, 58, 255, 24, 255, 115, 8, 167,
+ 240, 123, 188, 238, 253, 71, 108, 182,
+ 253, 22, 156, 47, 46, 112, 100, 13,
+ 125, 222, 20, 24, 237, 241, 3, 223,
+ 246, 98, 124, 212, 24, 109, 148, 22,
+ 144, 181, 79, 189, 208, 116, 241, 230,
+ 125, 140, 24, 240, 206, 139, 199, 11,
+ 131, 243, 191, 145, 194, 8, 48, 177,
+ 235, 234, 2, 2, 118, 126, 37, 21,
+ 145, 77, 60, 58, 129, 238, 164, 162,
+ 184, 84, 132, 179, 36, 137, 150, 20,
+ 242, 7, 31, 12, 253, 0, 224, 215,
+ 57, 182, 139, 163, 17, 165, 187, 76,
+ 2, 81, 14, 223, 84, 69, 44, 170,
+ 54, 79, 63, 14, 153, 97, 109, 240,
+ 228, 163, 52, 247, 255, 48, 225, 205,
+ 184, 186, 189, 51, 177, 215, 237, 127,
+ 204, 9, 67, 197, 179, 88, 250, 178,
+ 7, 140, 64, 100, 237, 132, 152, 139,
+ 147, 178, 190, 188, 189, 158, 117, 175,
+ 101, 240, 148, 166, 75, 7, 84, 86,
+ 167, 181, 149, 233, 46, 91, 5, 60,
+ 140, 203, 218, 116, 214, 67, 52, 24,
+ 188, 241, 232, 232, 24, 250, 199, 128,
+ 58, 248, 43, 221, 181, 163, 34, 238,
+ 248, 59, 1, 180, 12, 6, 185, 192,
+ 77, 141, 241, 223, 100, 253, 136, 27,
+ 206, 141, 73, 7, 165, 27, 202, 47,
+ 32, 180, 90, 166, 174, 2, 89, 0,
+ 182, 75, 52, 99, 190, 196, 0, 140,
+ 88, 50, 167, 125, 193, 245, 14, 202,
+ 188, 165, 141, 166, 161, 105, 233, 36,
+ 28, 72, 37, 219, 126, 160, 143, 135,
+ 195, 196, 121, 133, 140, 69, 6, 83,
+ 224, 210, 178, 22, 19, 155, 183, 133,
+ 19, 92, 100, 10, 37, 239, 31, 63,
+ 244, 79, 246, 165, 168, 1, 1, 183,
+ 2, 55, 154, 88, 28, 29, 169, 1,
+ 52, 219, 89, 26, 15, 30, 232, 165,
+ 74, 216, 126, 31, 137, 114, 150, 179,
+ 251, 33, 252, 122, 27, 171, 51, 246,
+ 187, 52, 186, 70, 140, 146, 229, 198,
+ 152, 74, 97, 116, 16, 200, 78, 97,
+ 189, 34, 44, 81, 64, 96, 160, 149,
+ 229, 219, 129, 41, 43, 44, 228, 231,
+ 30, 185, 17, 46, 75, 245, 247, 44,
+ 8, 97, 123, 139, 169, 146, 55, 130,
+ 90, 217, 249, 130, 244, 139, 62, 57,
+ 90, 87, 210, 237, 153, 204, 195, 126,
+ 179, 109, 180, 64, 210, 184, 126, 23,
+ 98, 195, 55, 72, 16, 94, 191, 125,
+ 160, 204, 29, 94, 191, 95, 244, 217,
+ 181, 55, 97, 140, 185, 157, 133, 163,
+ 93, 110, 157, 232, 222, 213, 1, 9,
+ 107, 230, 114, 28, 175, 231, 105, 196,
+ 157, 150, 25, 13, 153, 215, 16, 107,
+ 194, 148, 130, 27, 232, 171, 41, 221,
+ 74, 255, 63, 18, 202, 73, 96, 194,
+ 134, 190, 6, 23, 118, 54, 179, 83,
+ 32, 61, 156, 91, 187, 175, 137, 63,
+ 119, 216, 100, 29, 187, 64, 228, 65,
+ 176, 77, 54, 20, 234, 235, 245, 96,
+ 71, 186, 214, 134, 109, 214, 155, 56,
+ 207, 232, 246, 143, 102, 119, 226, 165,
+ 58, 189, 217, 193, 108, 150, 115, 190,
+ 189, 253, 15, 218, 35, 132, 71, 205,
+ 140, 147, 170, 32, 86, 10, 94, 127,
+ 188, 89, 181, 112, 32, 170, 234, 97,
+ 57, 158, 188, 119, 184, 156, 222, 143,
+ 220, 19, 39, 18, 253, 243, 83, 155,
+ 85, 44, 178, 31, 246, 145, 202, 153,
+ 130, 120, 7, 110, 230, 201, 110, 169,
+ 102, 64, 1, 110, 4, 120, 55, 244,
+ 242, 2, 220, 0, 132, 204, 153, 38,
+ 185, 99, 132, 219, 230, 69, 196, 129,
+ 219, 144, 0, 33, 203, 181, 22, 80,
+ 238, 170, 34, 218, 119, 86, 229, 193,
+ 212, 252, 14, 12, 0, 84, 239, 69,
+ 113, 36, 68, 59, 204, 150, 48, 178,
+ 42, 50, 161, 135, 80, 190, 104, 207,
+ 15, 16, 127, 132, 252, 51, 40, 26,
+ 29, 250, 250, 127, 75, 229, 11, 196,
+ 40, 173, 137, 111, 181, 121, 251, 214,
+ 102, 103, 136, 83, 9, 31, 112, 95,
+ 9, 44, 6, 125, 212, 185, 122, 79,
+ 76, 91, 104, 104, 188, 171, 241, 99,
+ 135, 204, 7, 211, 106, 155, 77, 120,
+ 171, 76, 211, 35, 226, 74, 26, 41,
+ 58, 185, 61, 58, 109, 149, 176, 206,
+ 200, 195, 67, 143, 116, 128, 68, 109,
+ 26, 163, 19, 201, 66, 62, 20, 123,
+ 226, 107, 191, 200, 232, 88, 183, 193,
+ 237, 244, 114, 70, 255, 122, 202, 22,
+ 113, 217, 66, 254, 169, 154, 253, 133,
+ 81, 88, 44, 151, 50, 128, 249, 164,
+ 240, 196, 232, 202, 21, 47, 88, 147,
+ 76, 138, 196, 49, 199, 120, 71, 15,
+ 211, 22, 165, 26, 154, 223, 76, 103,
+ 11, 31, 232, 43, 105, 125, 249, 220,
+ 71, 6, 206, 183, 15, 199, 137, 118,
+ 106, 220, 34, 34, 156, 102, 124, 238,
+ 200, 10, 9, 178, 77, 75, 209, 34,
+ 123, 168, 64, 115, 244, 237, 146, 130,
+ 71, 47, 249, 15, 62, 151, 43, 119,
+ 2, 198, 248, 192, 57, 128, 144, 99,
+ 122, 32, 59, 213, 180, 1, 105, 116,
+ 147, 123, 166, 16, 142, 135, 99, 171,
+ 177, 128, 55, 71, 15, 152, 14, 121,
+ 86, 121, 155, 55, 158, 26, 9, 210,
+ 221, 230, 153, 231, 50, 4, 39, 162,
+ 75, 139, 255, 243, 224, 114, 245, 61,
+ 108, 102, 117, 180, 76, 119, 239, 241,
+ 184, 177, 113, 171, 44, 188, 32, 155,
+ 187, 247, 204, 129, 131, 236, 96, 244,
+ 112, 22, 38, 181, 60, 159, 74, 252,
+ 125, 180, 252, 11, 163, 178, 44, 130,
+ 252, 151, 207, 109, 136, 146, 100, 65,
+ 40, 193, 168, 219, 223, 6, 169, 245,
+ 129, 128, 116, 84, 199, 189, 250, 103,
+ 205, 67, 248, 68, 188, 171, 157, 85,
+ 7, 121, 36, 80, 13, 45, 200, 132,
+ 124, 72, 202, 78, 58, 155, 143, 255,
+ 22, 61, 242, 47, 206, 25, 22, 147,
+ 72, 68, 79, 243, 166, 210, 85, 81,
+ 233, 185, 38, 174, 64, 165, 231, 15,
+ 208, 121, 85, 52, 59, 228, 218, 91,
+ 219, 79, 164, 108, 42, 37, 140, 90,
+ 158, 150, 219, 152, 67, 224, 54, 61,
+ 182, 219, 43, 56, 102, 47, 180, 48,
+ 121, 68, 146, 204, 104, 247, 247, 14,
+ 75, 62, 109, 60, 86, 109, 0, 72,
+ 141, 220, 208, 118, 73, 159, 240, 218,
+ 147, 186, 104, 169, 78, 54, 69, 22,
+ 143, 229, 25, 84, 57, 19, 111, 75,
+ 154, 63, 172, 214, 252, 137, 228, 130,
+ 25, 245, 141, 209, 178, 232, 38, 221,
+ 184, 228, 29, 131, 179, 103, 152, 18,
+ 86, 232, 181, 29, 21, 12, 26, 102,
+ 165, 19, 79, 166, 19, 20, 92, 233,
+ 198, 151, 13, 87, 246, 231, 193, 85,
+ 15, 120, 33, 112, 167, 236, 3, 147,
+ 120, 145, 230, 32, 52, 163, 238, 137,
+ 201, 117, 76, 73, 210, 183, 57, 83,
+ 73, 214, 168, 90, 67, 105, 70, 254,
+ 227, 0, 132, 55, 159, 56, 74, 160,
+ 137, 62, 91, 112, 125, 152, 255, 164,
+ 183, 7, 173, 193, 213, 50, 27, 226,
+ 121, 135, 223, 213, 189, 126, 212, 227,
+ 92, 126, 239, 150, 131, 134, 25, 145,
+ 35, 10, 42, 95, 2, 241, 123, 69,
+ 186, 7, 80, 35, 218, 20, 104, 177,
+ 136, 48, 139, 206, 55, 126, 125, 96,
+ 96, 228, 28, 187, 243, 62, 222, 103,
+ 166, 1, 114, 240, 136, 135, 43, 227,
+ 235, 153, 90, 47, 98, 126, 96, 218,
+ 98, 65, 23, 212, 83, 39, 11, 103,
+ 229, 213, 107, 238, 116, 142, 31, 66,
+ 76, 119, 214, 217, 203, 70, 139, 70,
+ 78, 159, 195, 157, 178, 27, 204, 85,
+ 134, 17, 223, 23, 149, 18, 114, 211,
+ 184, 212, 143, 131, 193, 160, 7, 174,
+ 176, 34, 18, 154, 34, 78, 49, 28,
+ 181, 16, 64, 162, 32, 128, 91, 189,
+ 255, 22, 234, 61, 100, 112, 216, 190,
+ 147, 254, 237, 98, 240, 15, 82, 159,
+ 22, 237, 198, 146, 216, 100, 171, 250,
+ 153, 92, 250, 173, 200, 149, 234, 112,
+ 130, 97, 120, 14, 32, 147, 102, 30,
+ 243, 130, 6, 200, 104, 112, 30, 206,
+ 241, 3, 158, 193, 15, 64, 93, 19,
+ 35, 99, 5, 37, 166, 1, 191, 190,
+ 212, 190, 252, 97, 209, 169, 103, 250,
+ 249, 230, 73, 57, 73, 155, 59, 81,
+ 62, 5, 151, 112, 213, 129, 123, 20,
+ 113, 108, 25, 226, 119, 97, 210, 85,
+ 182, 47, 62, 94, 242, 89, 120, 107,
+ 238, 244, 189, 37, 149, 179, 130, 115,
+ 119, 22, 215, 230, 38, 132, 151, 186,
+ 29, 35, 72, 238, 240, 175, 109, 66,
+ 1, 253, 94, 48, 217, 65, 60, 53,
+ 28, 102, 159, 233, 132, 191, 17, 80,
+ 85, 237, 93, 51, 180, 47, 68, 181,
+ 34, 60, 30, 149, 247, 202, 31, 214,
+ 6, 68, 162, 149, 238, 102, 210, 192,
+ 181, 114, 152, 45, 225, 99, 215, 78,
+ 100, 59, 33, 72, 204, 100, 30, 60,
+ 95, 167, 150, 134, 54, 164, 230, 232,
+ 229, 68, 116, 78, 144, 204, 2, 31,
+ 133, 37, 14, 147, 83, 100, 181, 10,
+ 248, 85, 136, 61, 108, 176, 102, 137,
+ 197, 227, 120, 111, 58, 89, 47, 53,
+ 121, 28, 177, 160, 7, 217, 154, 79,
+ 194, 90, 136, 105, 205, 164, 242, 87,
+ 146, 180, 252, 201, 45, 76, 136, 231,
+ 143, 37, 172, 227, 135, 110, 86, 60,
+ 128, 245, 68, 212, 161, 164, 195, 73,
+ 111, 125, 16, 100, 200, 125, 136, 128,
+ 214, 95, 156, 8, 185, 32, 169, 110,
+ 82, 203, 58, 117, 206, 253, 51, 172,
+ 201, 123, 27, 34, 252, 150, 230, 169,
+ 3, 140, 246, 196, 104, 91, 179, 69,
+ 249, 246, 191, 236, 56, 193, 168, 56,
+ 94, 11, 238, 118, 228, 59, 119, 248,
+ 238, 51, 8, 169, 78, 17, 91, 202,
+ 72, 89, 189, 133, 3, 140, 12, 227,
+ 66, 223, 232, 161, 194, 108, 218, 45,
+ 248, 51, 168, 118, 116, 167, 84, 29,
+ 152, 180, 214, 210, 104, 79, 248, 252,
+ 136, 127, 67, 172, 7, 186, 0, 250,
+ 240, 175, 156, 213, 150, 63, 119, 213,
+ 224, 207, 69, 42, 101, 221, 214, 197,
+ 248, 0, 170, 248, 10, 102, 48, 120,
+ 209, 143, 20, 24, 164, 177, 148, 215,
+ 182, 158, 64, 2, 110, 73, 118, 111,
+ 162, 74, 193, 53, 221, 49, 79, 232,
+ 156, 115, 69, 174, 254, 246, 242, 123,
+ 250, 61, 233, 241, 172, 172, 167, 151,
+ 70, 227, 184, 78, 141, 5, 219, 188,
+ 139, 208, 251, 97, 62, 21, 218, 210,
+ 211, 126, 118, 129, 231, 23, 144, 98,
+ 241, 6, 31, 195, 117, 10, 225, 151,
+ 54, 118, 120, 231, 48, 167, 22, 184,
+ 3, 196, 250, 216, 10, 90, 66, 223,
+ 82, 152, 71, 69, 59, 46, 169, 163,
+ 225, 202, 188, 104, 21, 189, 84, 155,
+ 126, 55, 134, 20, 25, 244, 176, 60,
+ 13, 8, 105, 168, 189, 151, 106, 62,
+ 188, 50, 179, 155, 179, 67, 166, 152,
+ 159, 191, 130, 248, 2, 228, 123, 177,
+ 40, 160, 135, 184, 96, 118, 47, 51,
+ 248, 243, 203, 213, 47, 114, 81, 164,
+ 60, 132, 201, 5, 52, 221, 129, 99,
+ 46, 234, 83, 105, 38, 122, 22, 148,
+ 204, 82, 102, 127, 116, 37, 97, 110,
+ 118, 224, 136, 69, 221, 71, 133, 65,
+ 116, 40, 195, 118, 186, 97, 250, 153,
+ 88, 219, 212, 214, 186, 54, 232, 16,
+ 177, 57, 242, 82, 201, 249, 44, 37,
+ 24, 228, 186, 234, 92, 174, 83, 143,
+ 20, 222, 227, 24, 245, 119, 218, 8,
+ 243, 70, 176, 214, 81, 103, 252, 200,
+ 26, 129, 1, 117, 154, 252, 106, 225,
+ 193, 73, 143, 108, 179, 57, 123, 240,
+ 24, 220, 82, 13, 110, 105, 2, 91,
+ 55, 11, 226, 157, 212, 188, 205, 126,
+ 184, 170, 252, 198, 191, 236, 17, 42,
+ 14, 200, 179, 16, 190, 17, 161, 182,
+ 148, 120, 144, 134, 253, 216, 225, 213,
+ 28, 204, 163, 245, 92, 89, 34, 61,
+ 190, 191, 53, 208, 204, 55, 24, 218,
+ 36, 179, 32, 211, 13, 137, 121, 146,
+ 110, 193, 207, 62, 167, 170, 5, 61,
+ 73, 44, 201, 158, 91, 40, 167, 95,
+ 10, 7, 205, 140, 120, 138, 180, 195,
+ 139, 63, 79, 14, 31, 193, 119, 11,
+ 132, 20, 154, 152, 113, 83, 40, 68,
+ 16, 180, 169, 6, 95, 130, 191, 126,
+ 61, 115, 67, 16, 71, 96, 59, 95,
+ 19, 51, 7, 21, 158, 24, 170, 25,
+ 219, 170, 232, 144, 58, 64, 125, 198,
+ 242, 188, 90, 181, 222, 133, 229, 240,
+ 247, 196, 81, 202, 84, 8, 203, 87,
+ 150, 230, 244, 20, 213, 77, 89, 221,
+ 242, 140, 37, 150, 234, 18, 86, 103,
+ 28, 197, 204, 44, 174, 109, 235, 41,
+ 156, 224, 240, 55, 152, 211, 51, 70,
+ 121, 129, 150, 52, 76, 247, 16, 235,
+ 150, 127, 15, 74, 138, 8, 207, 194,
+ 126, 217, 143, 109, 243, 217, 201, 193,
+ 133, 215, 161, 245, 254, 202, 33, 184,
+ 159, 147, 167, 125, 203, 36, 2, 244,
+ 129, 166, 61, 39, 57, 144, 248, 20,
+ 218, 166, 210, 128, 238, 218, 3, 160,
+ 128, 112, 168, 64, 20, 71, 141, 7,
+ 136, 30, 82, 159, 150, 167, 147, 41,
+ 169, 185, 3, 142, 150, 101, 39, 165,
+ 127, 14, 124, 112, 73, 19, 212, 90,
+ 49, 210, 199, 198, 144, 178, 107, 10,
+ 157, 69, 194, 142, 178, 181, 169, 43,
+ 209, 15, 54, 112, 1, 249, 13, 232,
+ 142, 96, 225, 207, 169, 173, 77, 206,
+ 62, 231, 39, 60, 131, 16, 24, 160,
+ 190, 17, 177, 71, 238, 129, 171, 85,
+ 14, 18, 160, 54, 155, 195, 105, 232,
+ 247, 115, 227, 45, 64, 21, 111, 160,
+ 114, 58, 1, 145, 67, 175, 185, 87,
+ 156, 95, 237, 160, 86, 255, 42, 252,
+ 11, 66, 179, 180, 173, 187, 163, 50,
+ 146, 115, 67, 236, 154, 231, 182, 245,
+ 220, 4, 64, 195, 212, 236, 141, 76,
+ 93, 15, 86, 69, 199, 115, 200, 215,
+ 233, 138, 192, 92, 31, 137, 113, 105,
+ 220, 192, 238, 47, 68, 180, 84, 199,
+ 2, 3, 149, 217, 136, 65, 153, 54,
+ 150, 131, 36, 122, 122, 165, 162, 174,
+ 240, 164, 88, 6, 194, 102, 152, 43,
+ 158, 225, 206, 104, 80, 7, 252, 216,
+ 221, 29, 225, 182, 162, 47, 124, 217,
+ 232, 63, 133, 76, 192, 136, 96, 74,
+ 212, 149, 242, 18, 155, 13, 118, 82,
+ 19, 2, 49, 117, 41, 126, 70, 72,
+ 76, 225, 186, 66, 132, 30, 84, 234,
+ 110, 146, 13, 136, 45, 207, 126, 111,
+ 19, 108, 114, 53, 155, 52, 95, 254,
+ 224, 174, 23, 104, 111, 108, 68, 33,
+ 63, 33, 215, 121, 169, 37, 255, 232,
+ 40, 173, 250, 186, 67, 164, 238, 195,
+ 88, 74, 93, 248, 5, 123, 206, 226,
+ 228, 21, 139, 181, 52, 122, 194, 14,
+ 240, 170, 237, 113, 143, 228, 206, 60,
+ 207, 221, 101, 147, 99, 225, 80, 99,
+ 207, 66, 119, 19, 72, 167, 165, 133,
+ 52, 76, 181, 36, 145, 213, 247, 55,
+ 88, 47, 169, 83, 121, 121, 98, 138,
+ 56, 50, 237, 49, 213, 196, 135, 223,
+ 42, 135, 128, 133, 1, 207, 178, 150,
+ 172, 55, 237, 33, 155, 94, 109, 93,
+ 7, 245, 102, 246, 218, 169, 230, 181,
+ 147, 249, 140, 239, 209, 33, 133, 85,
+ 151, 15, 35, 107, 19, 184, 62, 114,
+ 191, 116, 153, 42, 0, 248, 48, 136,
+ 184, 98, 182, 47, 169, 11, 149, 206,
+ 0, 238, 31, 245, 185, 64, 32, 75,
+ 210, 83, 216, 218, 170, 92, 242, 158,
+ 214, 195, 229, 128, 222, 75, 169, 177,
+ 166, 13, 3, 222, 135, 109, 35, 183,
+ 176, 61, 45, 254, 32, 165, 251, 147,
+ 162, 198, 50, 69, 253, 60, 175, 110,
+ 226, 124, 166, 167, 159, 207, 88, 17,
+ 115, 42, 89, 3, 14, 164, 114, 115,
+ 97, 129, 118, 47, 112, 145, 220, 175,
+ 2, 219, 181, 95, 187, 174, 77, 35,
+ 231, 204, 76, 43, 119, 32, 209, 120,
+ 133, 137, 103, 239, 93, 129, 56, 233,
+ 38, 83, 82, 114, 24, 19, 167, 73,
+ 16, 66, 135, 133, 193, 112, 222, 193,
+ 62, 229, 140, 44, 252, 84, 102, 218,
+ 4, 94, 97, 111, 19, 133, 249, 90,
+ 219, 81, 129, 242, 131, 96, 15, 17,
+ 236, 161, 1, 188, 106, 183, 219, 195,
+ 143, 220, 7, 127, 159, 113, 233, 110,
+ 248, 95, 79, 172, 45, 102, 79, 118,
+ 201, 28, 143, 167, 187, 98, 172, 188,
+ 255, 134, 11, 204, 61, 28, 222, 28,
+ 1, 142, 186, 182, 11, 114, 76, 80,
+ 174, 15, 127, 146, 24, 17, 108, 71,
+ 153, 27, 13, 145, 241, 1, 18, 255,
+ 161, 162, 94, 201, 129, 93, 32, 175,
+ 139, 147, 18, 178, 36, 13, 124, 116,
+ 212, 35, 208, 254, 100, 180, 42, 244,
+ 16, 159, 71, 3, 102, 18, 207, 206,
+ 85, 97, 45, 107, 135, 101, 130, 131,
+ 18, 204, 131, 142, 0, 77, 157, 76,
+ 91, 218, 109, 134, 151, 3, 75, 228,
+ 255, 13, 159, 144, 146, 164, 164, 69,
+ 231, 70, 16, 145, 238, 14, 190, 74,
+ 222, 241, 163, 200, 213, 82, 198, 154,
+ 190, 142, 140, 241, 165, 208, 196, 213,
+ 117, 188, 192, 38, 57, 8, 215, 45,
+ 142, 188, 39, 175, 20, 151, 27, 45,
+ 249, 124, 11, 12, 89, 247, 67, 159,
+ 121, 231, 109, 5, 9, 84, 57, 57,
+ 70, 229, 118, 8, 173, 81, 151, 126,
+ 197, 213, 103, 86, 101, 35, 110, 76,
+ 61, 225, 169, 127, 209, 152, 51, 241,
+ 128, 13, 254, 164, 116, 57, 14, 131,
+ 64, 0, 39, 96, 105, 64, 109, 251,
+ 183, 223, 142, 163, 58, 85, 130, 124,
+ 249, 5, 18, 107, 99, 167, 70, 192,
+ 167, 21, 26, 36, 120, 177, 234, 49,
+ 23, 142, 151, 68, 150, 45, 172, 113,
+ 71, 174, 4, 105, 141, 251, 71, 133,
+ 103, 17, 144, 97, 250, 45, 30, 159,
+ 172, 171, 80, 196, 253, 12, 143, 208,
+ 209, 248, 88, 193, 2, 112, 108, 36,
+ 3, 145, 53, 111, 196, 71, 196, 189,
+ 194, 212, 64, 164, 75, 146, 82, 250,
+ 16, 43, 79, 199, 121, 100, 150, 173,
+ 60, 211, 24, 175, 221, 137, 251, 67,
+ 241, 246, 96, 237, 233, 48, 182, 29,
+ 46, 191, 33, 27, 72, 103, 6, 179,
+ 95, 175, 115, 113, 125, 13, 221, 174,
+ 167, 255, 193, 196, 52, 161, 197, 200,
+ 90, 143, 255, 196, 11, 207, 141, 80,
+ 36, 101, 9, 85, 231, 58, 53, 69,
+ 112, 191, 135, 0, 101, 251, 169, 229,
+ 185, 209, 129, 94, 231, 227, 38, 24,
+ 15, 111, 93, 70, 119, 45, 75, 122,
+ 57, 90, 117, 190, 37, 44, 223, 62,
+ 238, 98, 211, 81, 94, 60, 235, 146,
+ 146, 84, 24, 77, 238, 179, 124, 215,
+ 102, 102, 42, 53, 5, 147, 227, 8,
+ 110, 120, 205, 181, 239, 37, 106, 219,
+ 155, 34, 35, 136, 132, 45, 19, 204,
+ 158, 31, 125, 101, 73, 111, 136, 151,
+ 7, 100, 170, 33, 79, 155, 21, 78,
+ 169, 31, 221, 2, 46, 14, 77, 59,
+ 157, 113, 194, 33, 94, 74, 221, 111,
+ 196, 221, 43, 25, 205, 74, 33, 136,
+ 238, 24, 78, 84, 231, 203, 211, 66,
+ 186, 135, 61, 45, 82, 189, 152, 51,
+ 86, 121, 2, 134, 179, 199, 147, 49,
+ 81, 206, 51, 125, 236, 117, 13, 20,
+ 120, 35, 69, 149, 48, 70, 148, 62,
+ 93, 58, 61, 108, 122, 200, 4, 162,
+ 19, 214, 248, 86, 160, 126, 237, 178,
+ 143, 186, 212, 162, 236, 14, 151, 134,
+ 158, 237, 66, 42, 245, 201, 11, 197,
+ 77, 139, 184, 11, 200, 97, 149, 236,
+ 101, 103, 238, 162, 105, 252, 46, 127,
+ 78, 130, 255, 236, 97, 111, 131, 252,
+ 32, 102, 251, 44, 114, 7, 69, 163,
+ 222, 27, 135, 2, 203, 207, 113, 132,
+ 91, 83, 170, 75, 201, 183, 105, 249,
+ 180, 137, 44, 24, 39, 190, 68, 227,
+ 209, 20, 62, 51, 253, 9, 207, 29,
+ 168, 97, 108, 53, 151, 45, 25, 127,
+ 230, 213, 119, 224, 221, 12, 140, 218,
+ 93, 92, 73, 171, 26, 158, 154, 187,
+ 33, 29, 73, 187, 194, 8, 171, 137,
+ 165, 45, 47, 250, 202, 59, 191, 27,
+ 110, 25, 101, 46, 230, 80, 74, 254,
+ 136, 180, 205, 244, 179, 248, 220, 174,
+ 194, 0, 52, 50, 59, 10, 39, 208,
+ 49, 158, 211, 106, 152, 177, 48, 23,
+ 236, 100, 68, 34, 46, 186, 149, 242,
+ 79, 153, 68, 95, 253, 152, 83, 116,
+ 145, 219, 150, 89, 97, 13, 150, 59,
+ 105, 153, 147, 94, 153, 89, 116, 227,
+ 252, 97, 144, 118, 198, 16, 15, 152,
+ 76, 26, 15, 195, 187, 152, 70, 9,
+ 10, 62, 113, 172, 183, 223, 175, 225,
+ 127, 82, 189, 85, 7, 55, 78, 59,
+ 159, 228, 6, 52, 239, 132, 118, 198,
+ 95, 163, 3, 0, 152, 236, 97, 243,
+ 206, 101, 190, 32, 45, 196, 255, 105,
+ 2, 150, 244, 141, 230, 90, 62, 58,
+ 156, 45, 163, 106, 123, 139, 35, 112,
+ 138, 153, 92, 24, 177, 248, 1, 11,
+ 74, 187, 104, 31, 255, 174, 144, 15,
+ 97, 31, 117, 124, 179, 2, 62, 221,
+ 194, 200, 253, 236, 112, 231, 174, 13,
+ 177, 180, 181, 77, 58, 155, 142, 92,
+ 193, 127, 160, 205, 145, 145, 250, 252,
+ 146, 134, 20, 250, 85, 147, 206, 107,
+ 152, 60, 166, 34, 173, 208, 65, 203,
+ 101, 194, 219, 140, 132, 134, 146, 220,
+ 152, 1, 32, 32, 207, 95, 110, 208,
+ 239, 101, 225, 149, 151, 213, 179, 118,
+ 62, 60, 40, 153, 129, 47, 61, 239,
+ 163, 88, 166, 224, 123, 10, 102, 40,
+ 168, 72, 21, 166, 56, 50, 47, 194,
+ 73, 93, 88, 174, 66, 16, 124, 21,
+ 81, 248, 26, 199, 152, 218, 166, 11,
+ 206, 169, 54, 186, 65, 211, 176, 73,
+ 74, 107, 139, 90, 185, 40, 248, 232,
+ 77, 47, 196, 91, 49, 229, 91, 154,
+ 214, 255, 153, 26, 74, 135, 118, 26,
+ 115, 26, 250, 118, 129, 231, 16, 184,
+ 0, 22, 189, 245, 40, 87, 25, 98,
+ 192, 24, 198, 8, 25, 150, 171, 252,
+ 244, 15, 214, 111, 73, 239, 251, 201,
+ 115, 169, 100, 165, 121, 42, 115, 189,
+ 40, 179, 14, 200, 240, 233, 209, 31,
+ 78, 18, 110, 160, 134, 226, 125, 83,
+ 83, 236, 7, 81, 216, 78, 105, 220,
+ 246, 241, 103, 233, 208, 225, 153, 154,
+ 176, 109, 99, 139, 227, 253, 96, 32,
+ 56, 255, 8, 34, 184, 99, 96, 84,
+ 99, 58, 170, 244, 227, 223, 169, 28,
+ 198, 43, 208, 74, 116, 232, 165, 206,
+ 130, 144, 88, 73, 50, 4, 36, 115,
+ 133, 244, 149, 27, 253, 122, 206, 34,
+ 14, 21, 102, 63, 142, 247, 211, 201,
+ 186, 34, 11, 220, 189, 87, 241, 161,
+ 15, 115, 255, 226, 224, 64, 96, 153,
+ 153, 161, 195, 124, 224, 64, 149, 249,
+ 52, 222, 210, 182, 150, 63, 92, 34,
+ 77, 30, 105, 221, 197, 107, 57, 187,
+ 76, 165, 238, 33, 38, 74, 189, 67,
+ 56, 205, 232, 230, 97, 48, 82, 97,
+ 119, 222, 29, 171, 162, 118, 64, 250,
+ 29, 41, 6, 196, 27, 12, 174, 190,
+ 49, 48, 19, 243, 51, 148, 46, 199,
+ 105, 45, 169, 137, 202, 95, 88, 141,
+ 107, 62, 245, 139, 202, 38, 73, 150,
+ 181, 30, 252, 194, 46, 103, 35, 111,
+ 21, 3, 37, 75, 149, 83, 150, 206,
+ 155, 132, 107, 204, 253, 79, 177, 40,
+ 6, 36, 207, 114, 233, 41, 36, 65,
+ 107, 113, 53, 80, 93, 12, 202, 251,
+ 44, 63, 50, 102, 250, 40, 240, 89,
+ 134, 47, 185, 131, 226, 59, 200, 52,
+ 115, 104, 243, 190, 229, 46, 197, 123,
+ 153, 150, 89, 135, 238, 18, 130, 151,
+ 154, 192, 11, 161, 244, 139, 89, 245,
+ 122, 229, 178, 176, 255, 176, 217, 223,
+ 3, 211, 70, 47, 89, 125, 191, 42,
+ 155, 209, 34, 128, 140, 86, 82, 126,
+ 190, 240, 86, 81, 122, 106, 195, 73,
+ 121, 50, 181, 152, 212, 156, 209, 68,
+ 173, 160, 95, 68, 115, 57, 180, 78,
+ 228, 62, 197, 180, 198, 72, 223, 122,
+ 58, 70, 231, 220, 103, 193, 182, 49,
+ 22, 201, 121, 121, 42, 3, 227, 231,
+ 187, 2, 50, 139, 8, 199, 242, 142,
+ 95, 130, 2, 143, 230, 57, 184, 118,
+ 103, 190, 15, 137, 243, 183, 0, 121,
+ 171, 97, 250, 206, 107, 60, 129, 46,
+ 207, 46, 115, 230, 31, 211, 33, 6,
+ 68, 10, 190, 133, 205, 173, 40, 99,
+ 170, 146, 110, 213, 150, 77, 126, 149,
+ 94, 216, 82, 124, 128, 100, 75, 7,
+ 9, 59, 199, 207, 151, 137, 24, 120,
+ 250, 253, 140, 115, 172, 100, 218, 65,
+ 255, 15, 153, 140, 67, 68, 189, 105,
+ 203, 197, 147, 254, 59, 188, 235, 186,
+ 232, 92, 66, 97, 53, 87, 94, 163,
+ 173, 108, 241, 191, 109, 150, 249, 164,
+ 54, 164, 122, 16, 94, 220, 114, 209,
+ 169, 252, 121, 249, 94, 170, 177, 187,
+ 246, 190, 141, 37, 175, 199, 63, 58,
+ 55, 196, 55, 227, 72, 34, 100, 100,
+ 115, 12, 153, 221, 34, 223, 73, 21,
+ 218, 110, 109, 169, 102, 81, 11, 244,
+ 80, 147, 245, 42, 130, 224, 132, 49,
+ 158, 144, 79, 189, 83, 77, 241, 39,
+ 204, 70, 87, 181, 146, 4, 213, 127,
+ 123, 244, 238, 77, 247, 169, 100, 91,
+ 25, 167, 204, 123, 67, 130, 188, 244,
+ 184, 239, 211, 27, 62, 163, 7, 123,
+ 136, 34, 0, 34, 2, 76, 97, 60,
+ 170, 24, 193, 39, 120, 132, 121, 202,
+ 93, 83, 125, 0, 225, 101, 151, 53,
+ 197, 21, 211, 38, 116, 101, 141, 89,
+ 159, 246, 172, 62, 67, 24, 152, 20,
+ 9, 248, 69, 60, 229, 73, 165, 190,
+ 101, 50, 173, 241, 115, 48, 36, 220,
+ 204, 160, 188, 251, 158, 166, 34, 171,
+ 205, 206, 240, 242, 62, 160, 220, 134,
+ 159, 96, 135, 255, 132, 253, 200, 37,
+ 121, 247, 247, 216, 61, 213, 10, 208,
+ 230, 185, 224, 84, 186, 71, 161, 64,
+ 55, 227, 34, 101, 126, 22, 43, 52,
+ 44, 113, 174, 147, 221, 130, 65, 167,
+ 217, 134, 119, 235, 27, 64, 29, 234,
+ 138, 70, 65, 224, 135, 169, 84, 34,
+ 240, 225, 212, 19, 179, 143, 22, 181,
+ 21, 157, 156, 33, 30, 231, 13, 134,
+ 125, 116, 77, 138, 95, 106, 59, 33,
+ 219, 187, 16, 203, 18, 179, 244, 43,
+ 15, 50, 151, 22, 45, 88, 140, 184,
+ 42, 216, 107, 73, 204, 13, 180, 141,
+ 20, 140, 120, 148, 212, 242, 220, 102,
+ 173, 239, 207, 87, 0, 85, 120, 105,
+ 74, 30, 49, 229, 116, 139, 65, 87,
+ 244, 145, 178, 209, 184, 197, 75, 201,
+ 61, 138, 21, 117, 224, 28, 61, 25,
+ 213, 230, 177, 195, 119, 108, 152, 167,
+ 218, 113, 135, 181, 13, 153, 82, 124,
+ 85, 192, 10, 214, 228, 153, 39, 60,
+ 201, 65, 213, 170, 156, 120, 223, 140,
+ 124, 76, 163, 164, 249, 114, 219, 37,
+ 68, 118, 91, 208, 91, 157, 244, 232,
+ 122, 44, 254, 182, 124, 200, 145, 207,
+ 90, 111, 229, 198, 226, 32, 57, 15,
+ 245, 166, 106, 226, 78, 230, 142, 104,
+ 218, 98, 23, 37, 190, 17, 142, 227,
+ 164, 174, 133, 106, 4, 43, 104, 49,
+ 114, 72, 243, 144, 9, 232, 117, 241,
+ 61, 224, 133, 126, 241, 204, 242, 55,
+ 173, 8, 217, 53, 210, 198, 175, 41,
+ 86, 84, 11, 136, 80, 226, 177, 11,
+ 123, 97, 39, 9, 41, 99, 114, 103,
+ 13, 120, 90, 168, 143, 30, 135, 97,
+ 196, 219, 0, 191, 209, 95, 66, 230,
+ 149, 27, 133, 137, 181, 29, 78, 193,
+ 10, 254, 142, 152, 128, 246, 231, 37,
+ 6, 139, 10, 251, 199, 186, 241, 159,
+ 168, 129, 182, 136, 79, 254, 40, 126,
+ 210, 222, 102, 182, 153, 74, 86, 210,
+ 51, 90, 100, 141, 240, 98, 202, 216,
+ 80, 170, 82, 226, 0, 135, 233, 173,
+ 137, 138, 74, 27, 122, 189, 163, 57,
+ 84, 217, 99, 24, 54, 132, 70, 81,
+ 79, 222, 118, 247, 237, 213, 251, 1,
+ 141, 151, 147, 91, 21, 7, 166, 78,
+ 207, 133, 14, 93, 92, 132, 2, 213,
+ 180, 26, 209, 106, 181, 11, 222, 17,
+ 108, 208, 93, 78, 177, 124, 84, 164,
+ 78, 161, 132, 132, 12, 245, 163, 44,
+ 182, 1, 28, 151, 84, 248, 49, 133,
+ 95, 195, 219, 18, 151, 221, 46, 126,
+ 92, 211, 202, 184, 141, 137, 138, 24,
+ 175, 66, 158, 179, 186, 97, 175, 127,
+ 5, 19, 113, 205, 81, 84, 41, 221,
+ 248, 201, 52, 233, 245, 211, 228, 81,
+ 33, 127, 205, 127, 251, 79, 244, 67,
+ 228, 104, 237, 249, 239, 146, 191, 118,
+ 119, 147, 42, 126, 119, 168, 46, 142,
+ 81, 45, 63, 214, 180, 226, 97, 189,
+ 144, 91, 19, 161, 42, 181, 205, 125,
+ 192, 94, 18, 205, 46, 222, 93, 99,
+ 118, 231, 180, 6, 90, 132, 98, 90,
+ 36, 88, 66, 55, 11, 240, 65, 98,
+ 225, 175, 47, 43, 122, 111, 178, 151,
+ 255, 237, 231, 214, 105, 40, 159, 22,
+ 169, 212, 83, 202, 115, 161, 47, 128,
+ 173, 237, 195, 120, 91, 188, 122, 11,
+ 102, 121, 27, 69, 251, 200, 69, 6,
+ 100, 118, 67, 114, 80, 174, 17, 136,
+ 112, 36, 43, 133, 9, 108, 198, 235,
+ 68, 134, 190, 201, 186, 251, 93, 63,
+ 239, 30, 73, 196, 52, 230, 125, 125,
+ 107, 82, 41, 146, 187, 90, 112, 26,
+ 239, 67, 13, 128, 34, 81, 210, 128,
+ 110, 50, 170, 5, 193, 59, 70, 173,
+ 39, 66, 136, 131, 75, 145, 151, 252,
+ 115, 182, 41, 121, 40, 57, 194, 50,
+ 87, 130, 8, 18, 126, 69, 48, 117,
+ 252, 186, 132, 62, 58, 151, 215, 198,
+ 229, 47, 244, 40, 14, 140, 9, 116,
+ 199, 240, 131, 62, 153, 10, 36, 20,
+ 87, 101, 230, 8, 90, 45, 173, 27,
+ 77, 248, 253, 190, 250, 65, 238, 21,
+ 87, 223, 98, 174, 64, 215, 212, 71,
+ 254, 39, 161, 202, 3, 198, 248, 79,
+ 210, 218, 236, 106, 175, 224, 85, 82,
+ 12, 145, 208, 10, 162, 121, 64, 37,
+ 84, 72, 112, 127, 11, 21, 138, 81,
+ 65, 196, 3, 156, 166, 203, 223, 55,
+ 156, 130, 139, 229, 18, 192, 220, 42,
+ 34, 31, 222, 216, 26, 8, 30, 118,
+ 85, 184, 103, 167, 127, 84, 155, 154,
+ 193, 99, 45, 49, 247, 239, 63, 17,
+ 235, 216, 66, 242, 211, 41, 123, 136,
+ 26, 234, 245, 152, 17, 81, 119, 203,
+ 20, 133, 5, 16, 38, 176, 1, 67,
+ 8, 11, 167, 78, 25, 249, 48, 205,
+ 79, 218, 192, 210, 147, 111, 154, 188,
+ 220, 186, 147, 174, 182, 212, 74, 160,
+ 89, 193, 105, 232, 60, 216, 114, 52,
+ 152, 198, 247, 239, 223, 30, 48, 28,
+ 244, 54, 41, 253, 38, 162, 42, 69,
+ 48, 37, 189, 207, 32, 151, 99, 120,
+ 253, 2, 19, 58, 234, 236, 48, 56,
+ 67, 235, 58, 83, 77, 125, 74, 154,
+ 116, 53, 7, 155, 10, 165, 97, 62,
+ 248, 140, 58, 241, 198, 17, 178, 11,
+ 205, 54, 31, 92, 52, 167, 220, 116,
+ 59, 50, 33, 1, 31, 80, 108, 96,
+ 151, 193, 190, 228, 135, 177, 247, 39,
+ 77, 10, 218, 251, 147, 246, 111, 108,
+ 111, 131, 189, 167, 148, 196, 252, 64,
+ 44, 102, 186, 7, 132, 207, 105, 222,
+ 19, 27, 182, 193, 102, 200, 6, 255,
+ 140, 199, 184, 127, 144, 66, 78, 27,
+ 82, 113, 205, 2, 169, 134, 251, 54,
+ 105, 139, 140, 172, 252, 104, 200, 96,
+ 33, 223, 196, 75, 253, 244, 27, 104,
+ 115, 77, 73, 220, 211, 66, 174, 30,
+ 161, 95, 7, 155, 96, 92, 157, 201,
+ 48, 234, 241, 118, 70, 175, 142, 162,
+ 190, 116, 54, 157, 101, 108, 107, 247,
+ 190, 119, 246, 135, 202, 24, 52, 134,
+ 248, 197, 199, 113, 247, 243, 41, 147,
+ 30, 170, 86, 82, 187, 131, 227, 5,
+ 228, 168, 243, 241, 229, 1, 106, 222,
+ 43, 117, 81, 36, 102, 21, 52, 213,
+ 52, 59, 215, 55, 148, 49, 251, 43,
+ 22, 7, 126, 196, 116, 3, 165, 99,
+ 216, 15, 172, 18, 126, 234, 226, 160,
+ 24, 15, 150, 96, 121, 174, 52, 44,
+ 242, 185, 43, 35, 22, 64, 211, 241,
+ 156, 243, 70, 1, 133, 105, 110, 82,
+ 251, 238, 224, 197, 199, 49, 15, 59,
+ 176, 2, 38, 141, 162, 214, 172, 225,
+ 29, 244, 44, 192, 242, 237, 25, 47,
+ 55, 182, 122, 238, 241, 151, 251, 211,
+ 227, 144, 162, 33, 11, 237, 142, 167,
+ 182, 77, 173, 39, 213, 10, 54, 41,
+ 227, 14, 50, 72, 137, 93, 79, 235,
+ 222, 37, 38, 171, 21, 131, 214, 209,
+ 192, 160, 102, 45, 95, 110, 170, 91,
+ 93, 131, 16, 179, 138, 55, 24, 53,
+ 42, 86, 22, 9, 246, 16, 64, 120,
+ 46, 168, 151, 137, 32, 27, 239, 210,
+ 98, 5, 38, 50, 31, 174, 85, 11,
+ 89, 6, 46, 3, 13, 68, 109, 80,
+ 95, 145, 218, 100, 193, 16, 252, 219,
+ 0, 38, 210, 231, 107, 66, 19, 212,
+ 116, 219, 9, 104, 215, 130, 221, 58,
+ 189, 206, 130, 13, 68, 93, 147, 189,
+ 20, 43, 52, 43, 59, 124, 244, 35,
+ 203, 99, 236, 12, 40, 23, 234, 76,
+ 81, 120, 170, 202, 120, 206, 218, 51,
+ 58, 104, 107, 121, 190, 43, 124, 220,
+ 110, 72, 173, 110, 127, 123, 86, 86,
+ 125, 79, 55, 163, 229, 249, 205, 66,
+ 29, 38, 143, 103, 233, 198, 0, 190,
+ 141, 16, 29, 98, 191, 82, 16, 36,
+ 80, 132, 175, 235, 104, 93, 128, 76,
+ 175, 155, 168, 208, 232, 210, 31, 113,
+ 233, 148, 94, 215, 166, 128, 180, 238,
+ 86, 194, 60, 250, 38, 162, 127, 237,
+ 54, 227, 82, 209, 77, 163, 250, 120,
+ 200, 0, 163, 136, 129, 79, 145, 174,
+ 213, 101, 204, 182, 125, 125, 60, 202,
+ 218, 248, 90, 26, 108, 125, 161, 242,
+ 118, 38, 18, 122, 215, 88, 164, 83,
+ 239, 151, 104, 80, 35, 66, 179, 157,
+ 49, 144, 104, 14, 143, 67, 49, 136,
+ 75, 136, 130, 168, 75, 203, 184, 239,
+ 210, 36, 246, 67, 231, 226, 90, 35,
+ 35, 198, 79, 209, 32, 178, 96, 54,
+ 156, 105, 31, 156, 26, 87, 33, 252,
+ 245, 79, 105, 214, 83, 245, 231, 94,
+ 132, 151, 17, 233, 66, 230, 58, 41,
+ 193, 41, 122, 158, 224, 148, 49, 99,
+ 244, 92, 107, 250, 61, 111, 248, 68,
+ 204, 78, 247, 67, 14, 199, 182, 136,
+ 173, 164, 232, 207, 178, 13, 48, 83,
+ 26, 106, 59, 92, 14, 111, 166, 66,
+ 172, 203, 104, 131, 218, 252, 248, 238,
+ 61, 167, 125, 209, 198, 174, 12, 145,
+ 40, 58, 36, 102, 76, 134, 176, 113,
+ 155, 22, 180, 149, 42, 92, 191, 179,
+ 16, 123, 117, 179, 34, 27, 95, 43,
+ 122, 114, 182, 196, 140, 66, 203, 121,
+ 29, 5, 213, 136, 149, 197, 24, 51,
+ 157, 216, 53, 68, 179, 90, 156, 72,
+ 20, 125, 0, 218, 215, 207, 190, 251,
+ 163, 33, 242, 185, 104, 116, 6, 46,
+ 104, 140, 243, 63, 198, 118, 232, 132,
+ 154, 79, 229, 15, 107, 42, 222, 239,
+ 106, 224, 147, 182, 209, 48, 92, 214,
+ 73, 255, 196, 80, 147, 94, 216, 246,
+ 252, 210, 90, 239, 180, 205, 0, 157,
+ 118, 172, 240, 164, 254, 155, 228, 249,
+ 118, 118, 81, 40, 248, 182, 178, 85,
+ 118, 105, 35, 139, 0, 6, 52, 157,
+ 42, 29, 92, 35, 154, 130, 7, 161,
+ 241, 214, 229, 80, 123, 89, 72, 179,
+ 147, 38, 221, 174, 222, 58, 17, 90,
+ 89, 30, 110, 1, 96, 57, 47, 43,
+ 254, 88, 71, 252, 201, 202, 104, 223,
+ 139, 124, 32, 31, 186, 158, 151, 13,
+ 132, 213, 254, 246, 172, 94, 180, 43,
+ 148, 184, 67, 67, 73, 126, 27, 69,
+ 98, 191, 226, 125, 0, 7, 168, 154,
+ 112, 86, 166, 33, 123, 196, 120, 11,
+ 50, 15, 190, 157, 215, 233, 68, 158,
+ 188, 42, 44, 141, 198, 245, 33, 32,
+ 120, 191, 188, 134, 80, 185, 152, 36,
+ 160, 193, 224, 154, 57, 209, 223, 99,
+ 57, 55, 45, 218, 57, 238, 25, 174,
+ 102, 169, 236, 54, 180, 208, 21, 120,
+ 56, 27, 152, 152, 159, 72, 226, 83,
+ 169, 79, 113, 237, 177, 42, 53, 104,
+ 120, 54, 211, 171, 148, 217, 119, 51,
+ 94, 139, 24, 223, 213, 247, 23, 143,
+ 79, 11, 145, 226, 156, 52, 89, 249,
+ 187, 155, 54, 111, 64, 32, 131, 189,
+ 244, 34, 253, 54, 36, 62, 236, 82,
+ 251, 232, 31, 211, 163, 185, 50, 106,
+ 133, 29, 181, 85, 157, 127, 211, 124,
+ 203, 61, 42, 220, 6, 60, 164, 28,
+ 82, 38, 209, 102, 63, 182, 234, 73,
+ 213, 238, 205, 162, 153, 176, 64, 143,
+ 155, 45, 16, 172, 224, 57, 51, 238,
+ 137, 192, 47, 112, 144, 20, 209, 197,
+ 232, 229, 28, 64, 126, 106, 189, 184,
+ 161, 192, 147, 55, 241, 35, 141, 19,
+ 48, 230, 59, 216, 88, 43, 167, 115,
+ 176, 219, 183, 190, 250, 158, 187, 14,
+ 52, 5, 107, 170, 97, 76, 150, 107,
+ 89, 39, 201, 99, 19, 84, 227, 126,
+ 172, 188, 104, 73, 130, 182, 164, 46,
+ 238, 30, 143, 32, 52, 6, 204, 180,
+ 154, 182, 247, 118, 224, 158, 86, 247,
+ 183, 75, 131, 117, 152, 38, 57, 106,
+ 80, 139, 100, 189, 232, 144, 4, 181,
+ 144, 72, 6, 1, 160, 91, 105, 157,
+ 163, 14, 185, 27, 103, 254, 105, 195,
+ 234, 180, 23, 43, 127, 99, 226, 142,
+ 75, 179, 252, 127, 53, 217, 8, 247,
+ 22, 165, 198, 251, 1, 205, 130, 28,
+ 211, 202, 64, 33, 191, 21, 13, 197,
+ 17, 149, 10, 163, 201, 3, 109, 190,
+ 74, 174, 107, 84, 229, 233, 158, 47,
+ 120, 127, 128, 32, 124, 229, 131, 39,
+ 54, 239, 11, 115, 113, 219, 158, 137,
+ 62, 85, 129, 1, 101, 71, 214, 33,
+ 212, 209, 80, 133, 95, 104, 95, 117,
+ 27, 226, 221, 222, 172, 47, 76, 31,
+ 233, 41, 74, 9, 31, 45, 242, 4,
+ 153, 163, 70, 16, 20, 130, 64, 139,
+ 57, 165, 250, 224, 201, 104, 152, 16,
+ 144, 16, 49, 173, 147, 23, 62, 117,
+ 100, 112, 227, 85, 48, 207, 88, 151,
+ 236, 110, 111, 212, 28, 242, 20, 232,
+ 186, 10, 143, 239, 87, 183, 45, 73,
+ 43, 8, 231, 148, 195, 15, 46, 24,
+ 65, 140, 150, 181, 227, 214, 218, 115,
+ 23, 94, 111, 131, 6, 70, 210, 12,
+ 178, 172, 140, 86, 191, 88, 104, 249,
+ 9, 58, 232, 123, 147, 210, 71, 172,
+ 28, 0, 85, 133, 85, 173, 68, 49,
+ 160, 16, 229, 1, 244, 8, 241, 171,
+ 181, 69, 53, 141, 68, 113, 187, 230,
+ 239, 214, 106, 46, 62, 109, 133, 198,
+ 83, 233, 159, 130, 88, 50, 166, 190,
+ 29, 140, 16, 22, 93, 47, 59, 237,
+ 154, 39, 126, 61, 149, 254, 247, 1,
+ 60, 36, 160, 51, 6, 77, 249, 22,
+ 22, 107, 241, 70, 244, 57, 106, 11,
+ 27, 0, 1, 246, 254, 240, 155, 81,
+ 151, 205, 90, 158, 16, 203, 178, 161,
+ 119, 226, 17, 79, 188, 66, 8, 91,
+ 69, 228, 102, 190, 241, 152, 87, 116,
+ 0, 16, 39, 132, 179, 239, 220, 119,
+ 158, 28, 90, 239, 238, 229, 230, 35,
+ 71, 232, 28, 34, 111, 105, 127, 149,
+ 0, 242, 56, 44, 101, 208, 219, 246,
+ 247, 249, 239, 238, 222, 122, 204, 99,
+ 49, 139, 42, 59, 7, 185, 90, 210,
+ 181, 198, 22, 211, 21, 30, 122, 191,
+ 163, 9, 200, 185, 82, 169, 29, 30,
+ 47, 86, 218, 142, 125, 90, 209, 112,
+ 140, 230, 214, 196, 170, 145, 180, 252,
+ 228, 0, 34, 146, 251, 122, 15, 16,
+ 2, 59, 103, 205, 157, 120, 111, 102,
+ 95, 79, 61, 28, 150, 98, 198, 247,
+ 131, 174, 233, 241, 170, 5, 215, 141,
+ 83, 106, 61, 83, 113, 235, 171, 78,
+ 87, 32, 217, 44, 213, 243, 17, 64,
+ 150, 113, 255, 124, 214, 168, 24, 165,
+ 140, 98, 39, 210, 99, 24, 21, 249,
+ 250, 29, 175, 171, 37, 53, 70, 73,
+ 132, 235, 184, 85, 206, 62, 165, 4,
+ 84, 145, 173, 68, 166, 109, 101, 232,
+ 150, 128, 113, 28, 33, 249, 134, 218,
+ 69, 130, 214, 71, 51, 222, 45, 132,
+ 165, 126, 171, 129, 116, 134, 199, 94,
+ 207, 206, 75, 34, 203, 227, 137, 21,
+ 120, 160, 114, 214, 239, 4, 254, 248,
+ 21, 197, 112, 150, 204, 18, 91, 223,
+ 203, 131, 217, 168, 230, 140, 144, 229,
+ 118, 36, 104, 14, 124, 225, 202, 97,
+ 225, 83, 111, 144, 138, 17, 235, 49,
+ 179, 138, 210, 5, 228, 17, 150, 59,
+ 186, 101, 230, 91, 225, 169, 7, 214,
+ 165, 240, 19, 222, 194, 75, 97, 217,
+ 121, 235, 194, 177, 181, 180, 172, 194,
+ 136, 249, 143, 91, 110, 201, 169, 116,
+ 248, 210, 122, 97, 237, 126, 99, 218,
+ 254, 102, 117, 242, 211, 157, 254, 224,
+ 51, 163, 52, 190, 207, 187, 236, 160,
+ 42, 252, 2, 231, 249, 143, 203, 133,
+ 235, 210, 46, 16, 185, 192, 150, 59,
+ 44, 64, 31, 225, 45, 142, 104, 225,
+ 205, 144, 65, 247, 171, 88, 26, 163,
+ 156, 43, 135, 246, 191, 105, 221, 214,
+ 168, 35, 133, 114, 241, 85, 47, 46,
+ 149, 11, 253, 208, 110, 109, 78, 130,
+ 37, 89, 24, 231, 163, 144, 48, 91,
+ 88, 91, 66, 59, 203, 150, 28, 8,
+ 218, 8, 24, 209, 146, 40, 100, 145,
+ 210, 241, 211, 0, 143, 247, 217, 166,
+ 55, 120, 112, 28, 116, 143, 50, 207,
+ 251, 131, 121, 57, 162, 128, 86, 255,
+ 34, 167, 26, 12, 97, 145, 191, 84,
+ 95, 93, 46, 157, 10, 89, 219, 1,
+ 90, 114, 90, 254, 142, 191, 26, 115,
+ 206, 17, 77, 24, 175, 204, 212, 175,
+ 184, 209, 163, 53, 94, 194, 84, 38,
+ 23, 235, 235, 123, 115, 76, 243, 42,
+ 163, 19, 48, 164, 52, 103, 54, 50,
+ 181, 46, 103, 9, 138, 224, 224, 2,
+ 170, 196, 208, 49, 195, 130, 215, 55,
+ 148, 195, 96, 107, 196, 160, 161, 252,
+ 111, 202, 200, 87, 22, 49, 164, 115,
+ 133, 210, 235, 155, 103, 59, 235, 163,
+ 116, 23, 77, 171, 109, 194, 232, 0,
+ 235, 215, 83, 198, 18, 5, 48, 211,
+ 231, 23, 188, 240, 88, 142, 193, 118,
+ 164, 12, 21, 160, 129, 97, 99, 13,
+ 210, 162, 212, 151, 26, 242, 42, 191,
+ 130, 226, 77, 18, 179, 84, 81, 192,
+ 138, 83, 170, 193, 242, 151, 11, 145,
+ 99, 79, 234, 82, 142, 121, 29, 145,
+ 169, 247, 162, 16, 210, 187, 187, 167,
+ 126, 210, 152, 170, 176, 225, 180, 155,
+ 178, 110, 95, 183, 70, 7, 125, 34,
+ 46, 68, 228, 101, 198, 42, 56, 10,
+ 173, 129, 25, 52, 38, 80, 15, 146,
+ 116, 194, 213, 136, 220, 45, 238, 121,
+ 204, 119, 57, 44, 196, 207, 96, 196,
+ 20, 255, 81, 223, 89, 118, 8, 178,
+ 169, 75, 92, 46, 233, 165, 76, 203,
+ 157, 53, 224, 145, 114, 38, 194, 117,
+ 228, 67, 251, 66, 73, 199, 234, 24,
+ 93, 65, 167, 109, 151, 207, 218, 135,
+ 8, 34, 86, 125, 206, 222, 112, 228,
+ 167, 124, 4, 225, 15, 253, 119, 68,
+ 187, 244, 33, 229, 180, 21, 218, 238,
+ 237, 62, 30, 120, 239, 247, 170, 84,
+ 160, 252, 42, 20, 185, 5, 209, 110,
+ 163, 132, 21, 135, 174, 113, 230, 202,
+ 14, 10, 76, 150, 94, 72, 97, 190,
+ 255, 166, 20, 172, 124, 86, 221, 230,
+ 8, 95, 221, 171, 137, 249, 222, 134,
+ 2, 7, 233, 248, 246, 109, 177, 109,
+ 98, 131, 104, 29, 50, 12, 251, 232,
+ 39, 69, 190, 173, 165, 80, 164, 68,
+ 64, 107, 128, 57, 63, 16, 127, 35,
+ 167, 189, 68, 243, 100, 75, 22, 36,
+ 47, 124, 18, 113, 185, 26, 216, 216,
+ 127, 147, 64, 188, 18, 240, 214, 223,
+ 62, 27, 199, 80, 74, 41, 175, 178,
+ 186, 163, 156, 146, 0, 178, 32, 130,
+ 6, 110, 139, 190, 203, 198, 174, 214,
+ 27, 218, 135, 45, 125, 33, 102, 166,
+ 18, 147, 204, 12, 29, 157, 192, 103,
+ 36, 105, 93, 193, 12, 34, 71, 119,
+ 243, 5, 118, 48, 75, 36, 252, 124,
+ 16, 80, 12, 31, 15, 229, 196, 3,
+ 31, 230, 55, 130, 172, 91, 14, 200,
+ 108, 8, 155, 155, 78, 110, 241, 247,
+ 101, 241, 176, 124, 66, 241, 199, 227,
+ 190, 69, 114, 240, 17, 119, 30, 49,
+ 196, 145, 158, 187, 88, 25, 129, 166,
+ 15, 108, 46, 58, 93, 165, 28, 15,
+ 21, 139, 188, 7, 43, 40, 164, 180,
+ 4, 17, 48, 64, 37, 234, 238, 14,
+ 244, 44, 175, 91, 183, 197, 142, 250,
+ 2, 158, 58, 136, 246, 232, 223, 69,
+ 54, 231, 99, 166, 151, 95, 67, 1,
+ 71, 186, 170, 188, 52, 82, 132, 72,
+ 218, 120, 52, 141, 166, 39, 205, 221,
+ 74, 120, 179, 16, 181, 210, 225, 246,
+ 130, 62, 70, 113, 154, 62, 243, 248,
+ 10, 59, 123, 161, 139, 122, 136, 125,
+ 170, 89, 180, 107, 49, 191, 186, 188,
+ 91, 149, 29, 20, 252, 219, 32, 87,
+ 63, 162, 73, 225, 64, 132, 133, 205,
+ 135, 49, 237, 33, 116, 249, 66, 28,
+ 148, 201, 86, 252, 36, 241, 207, 25,
+ 145, 68, 85, 11, 221, 191, 181, 55,
+ 118, 189, 47, 201, 8, 251, 244, 254,
+ 57, 180, 85, 225, 91, 228, 97, 11,
+ 101, 25, 133, 183, 118, 48, 237, 72,
+ 222, 251, 16, 13, 233, 10, 98, 161,
+ 68, 141, 110, 175, 52, 186, 135, 14,
+ 64, 46, 80, 197, 190, 0, 28, 177,
+ 122, 208, 205, 241, 227, 179, 204, 93,
+ 162, 248, 4, 225, 160, 86, 142, 5,
+ 194, 241, 186, 194, 190, 178, 176, 234,
+ 158, 244, 214, 50, 22, 119, 131, 232,
+ 2, 136, 63, 182, 231, 213, 30, 252,
+ 248, 8, 21, 254, 9, 107, 12, 80,
+ 222, 77, 253, 49, 235, 114, 129, 193,
+ 239, 63, 5, 195, 195, 223, 145, 11,
+ 220, 169, 155, 127, 50, 254, 92, 255,
+ 248, 252, 222, 127, 213, 100, 105, 43,
+ 28, 215, 154, 88, 11, 188, 166, 69,
+ 57, 15, 65, 87, 207, 83, 60, 63,
+ 199, 7, 190, 165, 122, 153, 149, 141,
+ 149, 171, 170, 179, 30, 43, 124, 90,
+ 168, 165, 214, 193, 52, 181, 118, 102,
+ 166, 171, 110, 49, 17, 162, 174, 138,
+ 52, 207, 78, 129, 128, 220, 220, 212,
+ 208, 175, 46, 4, 104, 210, 253, 26,
+ 242, 140, 229, 240, 172, 83, 152, 209,
+ 225, 34, 122, 74, 157, 218, 25, 225,
+ 233, 167, 77, 200, 97, 246, 132, 26,
+ 197, 112, 36, 66, 110, 234, 69, 238,
+ 147, 106, 44, 96, 22, 140, 243, 153,
+ 69, 180, 230, 247, 154, 72, 211, 7,
+ 214, 37, 167, 39, 4, 224, 181, 134,
+ 53, 100, 104, 209, 163, 160, 187, 173,
+ 58, 31, 16, 189, 16, 168, 122, 91,
+ 126, 248, 67, 225, 187, 213, 182, 160,
+ 71, 149, 94, 191, 182, 58, 84, 26,
+ 139, 175, 242, 96, 75, 144, 126, 18,
+ 124, 169, 9, 32, 173, 160, 58, 127,
+ 52, 26, 18, 172, 245, 201, 208, 167,
+ 205, 116, 156, 160, 128, 53, 187, 240,
+ 85, 189, 142, 49, 210, 142, 60, 118,
+ 150, 166, 99, 116, 28, 151, 242, 112,
+ 105, 173, 142, 74, 31, 214, 118, 190,
+ 84, 178, 113, 40, 99, 184, 211, 94,
+ 13, 255, 96, 171, 60, 187, 205, 74,
+ 243, 253, 29, 202, 107, 165, 37, 90,
+ 116, 134, 51, 41, 242, 195, 107, 56,
+ 173, 73, 233, 106, 159, 91, 76, 161,
+ 95, 237, 31, 242, 128, 188, 51, 201,
+ 111, 211, 71, 100, 251, 237, 94, 200,
+ 117, 4, 78, 110, 69, 187, 122, 206,
+ 128, 242, 27, 126, 54, 9, 104, 117,
+ 117, 214, 129, 190, 121, 71, 146, 133,
+ 131, 161, 108, 216, 126, 164, 254, 114,
+ 249, 44, 85, 72, 11, 119, 175, 93,
+ 166, 144, 250, 154, 245, 66, 228, 67,
+ 48, 80, 66, 195, 128, 179, 124, 236,
+ 191, 7, 107, 103, 85, 180, 124, 242,
+ 247, 70, 180, 249, 181, 47, 254, 126,
+ 113, 140, 10, 65, 75, 179, 41, 159,
+ 117, 247, 181, 47, 118, 9, 142, 18,
+ 180, 32, 248, 118, 27, 25, 139, 133,
+ 177, 7, 80, 92, 211, 130, 223, 134,
+ 22, 17, 171, 161, 228, 200, 11, 60,
+ 140, 207, 147, 19, 199, 68, 48, 240,
+ 248, 100, 203, 32, 212, 81, 68, 59,
+ 129, 54, 48, 230, 22, 20, 147, 4,
+ 145, 155, 221, 40, 220, 5, 164, 26,
+ 18, 200, 247, 110, 119, 6, 25, 205,
+ 238, 231, 94, 121, 146, 30, 163, 85,
+ 92, 172, 9, 220, 95, 63, 197, 220,
+ 238, 153, 59, 32, 232, 243, 48, 188,
+ 140, 31, 51, 251, 63, 111, 96, 88,
+ 188, 135, 168, 125, 207, 19, 79, 209,
+ 7, 56, 30, 52, 73, 220, 224, 113,
+ 13, 234, 19, 239, 245, 154, 180, 199,
+ 143, 134, 245, 109, 116, 141, 90, 73,
+ 48, 142, 7, 154, 184, 92, 177, 13,
+ 186, 196, 160, 255, 63, 4, 225, 207,
+ 105, 165, 197, 173, 161, 209, 142, 27,
+ 59, 111, 106, 169, 24, 121, 209, 141,
+ 21, 190, 59, 10, 30, 109, 62, 70,
+ 126, 157, 210, 27, 247, 216, 74, 87,
+ 66, 86, 69, 59, 213, 138, 81, 224,
+ 103, 92, 202, 62, 203, 38, 111, 159,
+ 46, 53, 208, 137, 229, 150, 164, 95,
+ 35, 196, 196, 3, 8, 234, 185, 35,
+ 200, 141, 59, 220, 174, 61, 88, 147,
+ 2, 108, 21, 46, 167, 121, 6, 28,
+ 218, 22, 33, 63, 172, 234, 48, 175,
+ 77, 31, 58, 50, 10, 85, 172, 239,
+ 69, 139, 198, 155, 37, 118, 86, 190,
+ 26, 228, 34, 238, 20, 131, 34, 80,
+ 134, 87, 224, 197, 92, 1, 97, 132,
+ 73, 13, 16, 25, 3, 188, 224, 168,
+ 54, 113, 78, 252, 57, 145, 37, 40,
+ 148, 170, 216, 128, 249, 0, 29, 248,
+ 14, 47, 110, 27, 5, 54, 230, 51,
+ 83, 142, 192, 203, 32, 205, 189, 2,
+ 142, 84, 240, 22, 140, 227, 161, 188,
+ 161, 195, 178, 198, 73, 108, 189, 68,
+ 155, 123, 65, 158, 159, 0, 133, 207,
+ 220, 237, 6, 9, 198, 166, 79, 133,
+ 247, 69, 66, 123, 13, 51, 91, 240,
+ 154, 115, 244, 237, 238, 11, 4, 18,
+ 66, 177, 204, 209, 8, 238, 34, 118,
+ 4, 197, 145, 178, 128, 61, 64, 206,
+ 34, 19, 41, 182, 153, 59, 247, 152,
+ 92, 14, 213, 30, 139, 72, 140, 40,
+ 164, 230, 132, 36, 37, 171, 122, 86,
+ 68, 75, 84, 27, 194, 18, 151, 143,
+ 212, 23, 147, 161, 212, 47, 32, 186,
+ 46, 34, 16, 254, 10, 14, 33, 99,
+ 21, 225, 179, 187, 170, 205, 67, 72,
+ 14, 160, 82, 211, 16, 80, 30, 65,
+ 85, 126, 52, 206, 9, 1, 154, 247,
+ 6, 219, 250, 133, 206, 91, 131, 39,
+ 13, 146, 182, 220, 135, 1, 88, 157,
+ 232, 60, 88, 26, 44, 196, 83, 40,
+ 64, 211, 116, 72, 120, 152, 83, 129,
+ 164, 180, 179, 189, 204, 238, 82, 103,
+ 72, 251, 183, 97, 47, 115, 187, 202,
+ 106, 189, 144, 161, 241, 16, 82, 167,
+ 38, 90, 40, 50, 51, 205, 197, 203,
+ 166, 160, 37, 243, 78, 210, 250, 8,
+ 154, 81, 45, 180, 182, 15, 172, 148,
+ 209, 41, 68, 113, 54, 138, 178, 243,
+ 198, 58, 131, 251, 148, 232, 105, 13,
+ 194, 117, 50, 255, 237, 63, 166, 239,
+ 234, 162, 3, 51, 166, 98, 44, 151,
+ 85, 229, 135, 120, 137, 219, 131, 169,
+ 3, 44, 94, 146, 96, 37, 240, 151,
+ 55, 93, 81, 160, 114, 109, 117, 15,
+ 97, 142, 67, 250, 9, 181, 73, 26,
+ 68, 136, 250, 48, 186, 109, 96, 38,
+ 96, 228, 223, 116, 92, 198, 212, 151,
+ 12, 63, 62, 43, 107, 18, 1, 236,
+ 142, 145, 197, 107, 205, 250, 146, 231,
+ 205, 84, 205, 86, 50, 181, 95, 99,
+ 143, 238, 129, 225, 7, 248, 143, 199,
+ 36, 118, 22, 137, 246, 107, 123, 220,
+ 107, 174, 169, 178, 104, 177, 204, 17,
+ 153, 147, 196, 126, 236, 76, 115, 212,
+ 184, 152, 12, 105, 48, 5, 156, 168,
+ 231, 38, 82, 189, 207, 209, 189, 75,
+ 221, 162, 13, 219, 214, 104, 80, 29,
+ 114, 63, 150, 200, 126, 221, 64, 208,
+ 190, 64, 33, 40, 33, 176, 119, 156,
+ 19, 41, 179, 169, 21, 144, 109, 216,
+ 135, 49, 227, 75, 253, 202, 219, 117,
+ 9, 205, 76, 56, 133, 248, 204, 132,
+ 29, 42, 147, 196, 201, 102, 14, 246,
+ 28, 111, 44, 252, 205, 138, 214, 179,
+ 85, 99, 63, 21, 126, 206, 236, 94,
+ 157, 51, 252, 122, 88, 153, 105, 40,
+ 104, 138, 179, 212, 133, 253, 153, 172,
+ 214, 137, 51, 72, 217, 71, 32, 168,
+ 217, 189, 8, 6, 208, 172, 33, 42,
+ 247, 68, 124, 1, 249, 198, 75, 104,
+ 146, 38, 235, 181, 27, 42, 33, 62,
+ 173, 218, 214, 164, 47, 5, 184, 14,
+ 113, 176, 198, 68, 19, 255, 93, 251,
+ 47, 43, 166, 254, 151, 1, 42, 147,
+ 29, 208, 165, 42, 39, 193, 110, 69,
+ 206, 2, 75, 37, 108, 141, 53, 15,
+ 204, 213, 220, 172, 89, 122, 164, 156,
+ 224, 93, 94, 88, 31, 106, 211, 102,
+ 141, 120, 46, 73, 116, 149, 211, 128,
+ 91, 50, 214, 6, 12, 197, 211, 68,
+ 245, 188, 0, 20, 19, 113, 108, 155,
+ 198, 109, 107, 3, 5, 47, 195, 224,
+ 177, 87, 129, 169, 107, 217, 30, 237,
+ 240, 59, 96, 205, 90, 144, 159, 108,
+ 66, 30, 203, 36, 158, 67, 223, 192,
+ 30, 124, 213, 244, 95, 51, 153, 39,
+ 160, 206, 24, 140, 34, 245, 118, 209,
+ 3, 218, 225, 237, 178, 133, 202, 191,
+ 124, 124, 145, 164, 22, 130, 30, 229,
+ 82, 190, 194, 199, 247, 186, 155, 76,
+ 164, 37, 207, 58, 20, 51, 32, 17,
+ 76, 173, 123, 213, 102, 6, 114, 180,
+ 211, 158, 194, 96, 163, 131, 68, 98,
+ 223, 181, 170, 10, 61, 215, 254, 159,
+ 109, 133, 18, 52, 41, 160, 114, 117,
+ 80, 49, 30, 208, 86, 32, 224, 92,
+ 217, 106, 15, 37, 167, 198, 171, 253,
+ 187, 126, 69, 61, 248, 147, 224, 132,
+ 170, 122, 180, 201, 252, 29, 46, 122,
+ 40, 163, 121, 223, 229, 88, 13, 224,
+ 126, 65, 161, 69, 201, 14, 112, 80,
+ 5, 175, 186, 247, 206, 205, 108, 218,
+ 95, 114, 166, 208, 113, 227, 88, 168,
+ 218, 248, 201, 31, 63, 32, 124, 86,
+ 192, 207, 245, 157, 99, 14, 11, 199,
+ 69, 139, 201, 193, 85, 54, 187, 102,
+ 224, 148, 93, 90, 119, 165, 32, 72,
+ 235, 100, 68, 42, 130, 144, 112, 239,
+ 48, 210, 24, 225, 240, 96, 177, 183,
+ 103, 33, 24, 231, 181, 33, 251, 91,
+ 206, 116, 69, 182, 153, 242, 155, 117,
+ 109, 54, 86, 150, 182, 51, 137, 74,
+ 26, 15, 172, 15, 29, 41, 241, 55,
+ 195, 141, 78, 164, 219, 150, 252, 220,
+ 113, 207, 41, 161, 71, 103, 176, 155,
+ 0, 68, 111, 241, 130, 243, 226, 19,
+ 230, 254, 224, 208, 49, 226, 153, 1,
+ 34, 58, 34, 215, 249, 244, 80, 30,
+ 147, 216, 143, 40, 27, 182, 43, 153,
+ 208, 39, 189, 115, 167, 48, 122, 149,
+ 164, 81, 96, 126, 168, 154, 209, 149,
+ 34, 113, 21, 241, 135, 132, 97, 211,
+ 162, 204, 110, 181, 28, 204, 104, 105,
+ 174, 29, 15, 145, 132, 103, 123, 97,
+ 95, 63, 16, 65, 36, 189, 191, 225,
+ 28, 62, 22, 15, 4, 84, 115, 7,
+ 223, 111, 152, 179, 106, 150, 47, 0,
+ 39, 228, 88, 255, 48, 171, 64, 229,
+ 54, 150, 21, 189, 87, 41, 191, 225,
+ 82, 104, 90, 225, 102, 199, 154, 61,
+ 10, 120, 45, 74, 23, 127, 233, 151,
+ 180, 195, 85, 217, 65, 188, 29, 125,
+ 189, 205, 15, 51, 241, 176, 145, 173,
+ 236, 2, 18, 22, 107, 222, 229, 197,
+ 52, 205, 128, 234, 129, 176, 177, 216,
+ 189, 22, 22, 70, 242, 50, 24, 78,
+ 229, 250, 184, 16, 57, 249, 218, 45,
+ 150, 240, 210, 56, 0, 155, 217, 227,
+ 92, 138, 213, 236, 108, 85, 237, 162,
+ 102, 187, 149, 214, 146, 176, 46, 235,
+ 185, 200, 251, 237, 157, 47, 220, 201,
+ 204, 222, 244, 95, 62, 36, 233, 30,
+ 236, 108, 87, 216, 137, 59, 20, 209,
+ 232, 254, 69, 55, 106, 130, 208, 182,
+ 176, 105, 121, 179, 172, 135, 180, 75,
+ 59, 13, 70, 70, 226, 187, 159, 252,
+ 134, 91, 72, 181, 10, 248, 154, 0,
+ 187, 81, 39, 186, 107, 153, 132, 62,
+ 7, 3, 240, 141, 188, 153, 99, 47,
+ 13, 2, 98, 160, 196, 174, 205, 185,
+ 38, 126, 87, 224, 27, 47, 1, 234,
+ 232, 46, 101, 208, 82, 35, 218, 138,
+ 244, 109, 32, 205, 84, 9, 84, 143,
+ 157, 227, 42, 13, 200, 104, 100, 235,
+ 71, 143, 68, 79, 72, 226, 227, 159,
+ 240, 23, 210, 61, 214, 91, 153, 160,
+ 164, 148, 34, 223, 120, 220, 11, 25,
+ 28, 126, 31, 228, 146, 96, 26, 64,
+ 191, 22, 246, 18, 66, 68, 46, 23,
+ 69, 171, 124, 207, 243, 205, 87, 75,
+ 185, 218, 167, 252, 5, 90, 234, 135,
+ 107, 150, 163, 108, 212, 57, 36, 108,
+ 252, 64, 144, 217, 188, 159, 62, 47,
+ 71, 25, 86, 45, 136, 34, 195, 103,
+ 251, 30, 253, 117, 82, 93, 119, 148,
+ 18, 49, 22, 169, 9, 36, 100, 35,
+ 58, 49, 67, 134, 203, 249, 17, 87,
+ 3, 127, 78, 65, 14, 102, 178, 107,
+ 70, 238, 234, 240, 75, 53, 188, 40,
+ 190, 98, 207, 164, 221, 2, 110, 106,
+ 171, 60, 22, 210, 113, 176, 223, 38,
+ 63, 150, 195, 76, 110, 50, 154, 150,
+ 180, 177, 39, 121, 215, 79, 227, 246,
+ 40, 62, 231, 241, 21, 122, 158, 216,
+ 9, 76, 211, 158, 152, 169, 1, 4,
+ 131, 210, 19, 34, 136, 59, 167, 237,
+ 219, 198, 183, 2, 55, 244, 29, 220,
+ 62, 13, 178, 143, 146, 1, 108, 23,
+ 84, 106, 60, 174, 94, 62, 100, 164,
+ 58, 254, 74, 185, 236, 134, 28, 208,
+ 130, 169, 35, 250, 74, 45, 35, 75,
+ 138, 113, 98, 120, 242, 144, 104, 113,
+ 190, 146, 48, 201, 114, 116, 120, 252,
+ 206, 226, 4, 141, 200, 111, 93, 57,
+ 255, 182, 185, 241, 229, 2, 223, 29,
+ 43, 222, 109, 0, 1, 109, 133, 218,
+ 69, 130, 48, 143, 205, 49, 213, 16,
+ 14, 89, 18, 254, 133, 161, 114, 244,
+ 158, 193, 188, 6, 52, 87, 163, 45,
+ 159, 2, 122, 109, 253, 102, 216, 151,
+ 41, 89, 34, 149, 9, 130, 126, 76,
+ 46, 51, 192, 136, 248, 85, 142, 142,
+ 69, 254, 239, 213, 216, 183, 213, 1,
+ 223, 77, 77, 79, 189, 66, 29, 98,
+ 228, 21, 164, 113, 163, 121, 137, 152,
+ 241, 4, 3, 136, 42, 156, 145, 47,
+ 241, 173, 180, 232, 64, 227, 17, 177,
+ 180, 47, 156, 154, 0, 217, 112, 153,
+ 243, 22, 171, 181, 55, 182, 2, 49,
+ 100, 37, 173, 166, 252, 138, 25, 94,
+ 93, 77, 34, 251, 178, 136, 137, 105,
+ 182, 4, 84, 17, 84, 113, 212, 185,
+ 206, 114, 228, 135, 1, 138, 35, 20,
+ 25, 28, 165, 207, 108, 253, 45, 30,
+ 204, 128, 104, 168, 140, 158, 79, 4,
+ 51, 207, 105, 106, 67, 179, 77, 64,
+ 86, 2, 184, 240, 166, 169, 219, 63,
+ 101, 19, 185, 181, 64, 89, 184, 21,
+ 98, 133, 128, 51, 187, 69, 175, 101,
+ 106, 190, 208, 36, 150, 106, 35, 241,
+ 100, 72, 208, 209, 92, 127, 148, 173,
+ 202, 111, 62, 170, 168, 213, 244, 192,
+ 65, 170, 83, 223, 126, 206, 210, 5,
+ 213, 62, 169, 237, 161, 238, 46, 133,
+ 135, 64, 48, 215, 128, 91, 155, 0,
+ 19, 205, 131, 195, 29, 213, 235, 78,
+ 211, 84, 135, 67, 137, 56, 158, 9,
+ 200, 152, 188, 83, 190, 225, 211, 56,
+ 129, 81, 35, 128, 255, 148, 65, 11,
+ 122, 185, 99, 11, 225, 213, 150, 215,
+ 129, 213, 180, 51, 1, 212, 217, 174,
+ 237, 151, 132, 37, 20, 66, 199, 79,
+ 144, 192, 151, 24, 116, 15, 16, 36,
+ 242, 117, 56, 86, 43, 22, 100, 56,
+ 140, 20, 88, 226, 27, 185, 195, 139,
+ 35, 224, 51, 241, 211, 167, 223, 96,
+ 178, 214, 86, 86, 234, 44, 55, 178,
+ 108, 207, 219, 189, 146, 41, 0, 130,
+ 87, 12, 63, 65, 21, 239, 158, 140,
+ 35, 168, 205, 225, 36, 236, 60, 204,
+ 141, 36, 61, 177, 193, 209, 246, 232,
+ 93, 150, 236, 24, 46, 147, 204, 89,
+ 109, 198, 168, 196, 125, 64, 204, 239,
+ 207, 3, 244, 199, 110, 78, 174, 97,
+ 55, 142, 228, 206, 250, 50, 229, 81,
+ 33, 252, 186, 76, 118, 118, 249, 81,
+ 93, 157, 223, 244, 228, 130, 14, 50,
+ 218, 168, 138, 174, 155, 215, 164, 49,
+ 86, 147, 69, 6, 216, 207, 183, 21,
+ 172, 152, 176, 223, 115, 63, 152, 6,
+ 205, 118, 58, 184, 249, 197, 180, 132,
+ 135, 123, 67, 178, 0, 175, 17, 72,
+ 215, 187, 137, 132, 183, 156, 237, 15,
+ 12, 198, 19, 137, 255, 249, 74, 168,
+ 70, 37, 26, 254, 129, 143, 193, 156,
+ 68, 206, 125, 24, 240, 149, 198, 29,
+ 177, 246, 253, 214, 165, 93, 114, 30,
+ 183, 104, 71, 186, 250, 147, 154, 103,
+ 221, 23, 208, 201, 142, 67, 199, 78,
+ 202, 13, 192, 192, 112, 129, 202, 161,
+ 92, 230, 106, 34, 190, 172, 187, 199,
+ 141, 160, 41, 41, 34, 109, 21, 92,
+ 129, 155, 154, 27, 171, 109, 9, 77,
+ 28, 153, 177, 162, 55, 254, 27, 204,
+ 195, 193, 151, 60, 153, 12, 43, 226,
+ 74, 146, 77, 71, 218, 117, 220, 185,
+ 209, 161, 107, 249, 60, 3, 82, 28,
+ 42, 234, 171, 27, 156, 103, 8, 101,
+ 76, 182, 217, 151, 67, 254, 198, 83,
+ 243, 29, 70, 105, 215, 237, 73, 202,
+ 102, 0, 28, 199, 53, 62, 140, 168,
+ 65, 243, 149, 205, 203, 231, 180, 119,
+ 56, 208, 12, 166, 178, 221, 192, 10,
+ 156, 234, 49, 12, 129, 94, 23, 233,
+ 139, 246, 240, 44, 48, 130, 159, 201,
+ 179, 94, 122, 23, 126, 135, 236, 56,
+ 239, 200, 95, 163, 162, 104, 187, 175,
+ 205, 20, 125, 85, 66, 140, 86, 189,
+ 190, 218, 162, 216, 22, 163, 75, 140,
+ 128, 21, 227, 174, 149, 73, 193, 250,
+ 202, 215, 125, 48, 14, 206, 217, 118,
+ 96, 146, 158, 32, 126, 150, 128, 12,
+ 2, 243, 32, 80, 211, 114, 60, 240,
+ 79, 201, 224, 94, 229, 210, 10, 250,
+ 194, 34, 198, 104, 209, 141, 60, 10,
+ 30, 156, 241, 52, 192, 23, 212, 147,
+ 110, 16, 233, 255, 162, 238, 122, 250,
+ 16, 244, 162, 56, 130, 68, 63, 10,
+ 226, 95, 144, 158, 109, 70, 188, 29,
+ 175, 78, 110, 237, 132, 4, 16, 19,
+ 6, 38, 119, 75, 189, 250, 234, 57,
+ 3, 227, 66, 40, 250, 5, 255, 194,
+ 228, 171, 19, 228, 113, 174, 184, 215,
+ 115, 100, 152, 88, 112, 68, 215, 70,
+ 86, 63, 63, 226, 208, 75, 70, 87,
+ 75, 238, 38, 169, 238, 45, 55, 25,
+ 121, 10, 168, 22, 92, 25, 54, 230,
+ 52, 163, 145, 21, 25, 42, 62, 69,
+ 108, 227, 46, 236, 230, 209, 11, 14,
+ 242, 52, 92, 86, 91, 91, 29, 2,
+ 173, 193, 166, 24, 199, 127, 87, 202,
+ 46, 199, 32, 144, 213, 173, 243, 74,
+ 138, 201, 172, 124, 200, 14, 101, 177,
+ 159, 198, 111, 94, 139, 195, 221, 87,
+ 97, 10, 32, 125, 151, 205, 180, 232,
+ 140, 29, 50, 76, 118, 181, 250, 102,
+ 74, 120, 101, 76, 30, 41, 55, 42,
+ 94, 187, 17, 109, 200, 230, 232, 150,
+ 87, 253, 21, 220, 92, 179, 125, 172,
+ 115, 148, 36, 249, 166, 153, 227, 110,
+ 55, 228, 97, 41, 55, 157, 78, 238,
+ 180, 36, 130, 14, 209, 175, 6, 104,
+ 115, 148, 17, 168, 118, 42, 19, 159,
+ 189, 239, 60, 179, 104, 98, 201, 19,
+ 140, 241, 62, 92, 133, 189, 231, 70,
+ 1, 18, 128, 73, 47, 24, 174, 5,
+ 3, 24, 245, 82, 5, 131, 48, 164,
+ 56, 93, 86, 253, 151, 123, 233, 33,
+ 5, 102, 143, 199, 101, 180, 162, 86,
+ 123, 253, 11, 221, 140, 147, 252, 111,
+ 3, 21, 190, 52, 95, 114, 18, 208,
+ 192, 252, 175, 24, 123, 68, 87, 228,
+ 213, 19, 112, 245, 179, 154, 225, 226,
+ 245, 117, 191, 239, 7, 182, 188, 191,
+ 216, 206, 32, 38, 170, 218, 126, 183,
+ 20, 107, 104, 0, 123, 100, 134, 139,
+ 242, 130, 74, 175, 100, 6, 93, 217,
+ 214, 226, 192, 77, 224, 221, 76, 80,
+ 102, 36, 88, 184, 43, 62, 14, 206,
+ 203, 123, 147, 14, 83, 170, 142, 100,
+ 120, 232, 222, 145, 44, 13, 240, 229,
+ 90, 26, 9, 17, 199, 131, 67, 27,
+ 233, 10, 48, 218, 180, 51, 234, 255,
+ 106, 211, 211, 78, 179, 58, 197, 184,
+ 58, 133, 52, 153, 159, 253, 214, 173,
+ 144, 80, 157, 126, 91, 168, 248, 94,
+ 131, 219, 148, 191, 253, 12, 218, 166,
+ 33, 180, 195, 22, 193, 80, 180, 45,
+ 22, 244, 134, 179, 193, 177, 150, 241,
+ 11, 21, 38, 237, 113, 180, 208, 186,
+ 196, 244, 206, 131, 182, 161, 160, 11,
+ 222, 177, 0, 180, 238, 180, 108, 167,
+ 44, 97, 250, 154, 152, 111, 28, 173,
+ 253, 154, 25, 116, 28, 21, 116, 247,
+ 211, 103, 38, 36, 48, 11, 177, 210,
+ 135, 75, 97, 34, 115, 39, 85, 107,
+ 95, 230, 153, 90, 11, 162, 147, 159,
+ 180, 219, 200, 58, 239, 191, 121, 61,
+ 50, 1, 132, 59, 221, 126, 137, 104,
+ 25, 26, 206, 189, 113, 222, 134, 178,
+ 20, 14, 169, 65, 176, 205, 122, 119,
+ 18, 43, 160, 188, 210, 70, 61, 16,
+ 120, 159, 195, 244, 0, 177, 132, 12,
+ 87, 184, 219, 78, 118, 203, 54, 150,
+ 124, 21, 112, 124, 30, 178, 82, 7,
+ 226, 171, 229, 213, 148, 14, 76, 126,
+ 127, 4, 63, 29, 155, 37, 141, 167,
+ 193, 144, 78, 192, 158, 36, 215, 235,
+ 250, 163, 229, 149, 99, 221, 85, 104,
+ 148, 52, 241, 195, 10, 71, 88, 209,
+ 112, 52, 41, 41, 219, 95, 107, 195,
+ 124, 88, 167, 29, 233, 32, 182, 50,
+ 72, 185, 53, 84, 7, 89, 96, 66,
+ 238, 211, 168, 61, 76, 153, 24, 152,
+ 156, 220, 249, 149, 186, 71, 239, 177,
+ 65, 144, 80, 239, 19, 235, 215, 210,
+ 117, 91, 241, 84, 50, 135, 240, 132,
+ 184, 170, 110, 120, 192, 24, 234, 90,
+ 143, 184, 226, 189, 28, 136, 75, 200,
+ 32, 199, 229, 206, 238, 165, 216, 33,
+ 218, 16, 100, 107, 197, 38, 105, 87,
+ 43, 211, 17, 94, 247, 15, 167, 67,
+ 32, 26, 175, 105, 177, 161, 82, 148,
+ 36, 116, 99, 119, 99, 58, 12, 130,
+ 222, 207, 35, 85, 221, 205, 81, 10,
+ 181, 35, 155, 91, 116, 95, 185, 73,
+ 1, 227, 160, 189, 70, 146, 90, 123,
+ 66, 39, 246, 229, 138, 99, 132, 94,
+ 110, 211, 63, 4, 43, 148, 235, 22,
+ 234, 252, 90, 81, 97, 8, 76, 108,
+ 135, 54, 160, 82, 243, 69, 218, 254,
+ 115, 215, 78, 178, 236, 249, 124, 90,
+ 41, 77, 163, 128, 77, 159, 170, 95,
+ 131, 30, 122, 239, 78, 8, 81, 83,
+ 55, 216, 150, 220, 110, 201, 68, 135,
+ 175, 165, 139, 22, 121, 253, 92, 203,
+ 159, 222, 227, 14, 162, 142, 165, 144,
+ 140, 230, 56, 154, 162, 239, 92, 227,
+ 25, 186, 12, 0, 70, 32, 31, 146,
+ 105, 184, 107, 87, 81, 206, 40, 82,
+ 160, 67, 195, 17, 177, 91, 187, 62,
+ 92, 215, 198, 21, 29, 111, 194, 250,
+ 210, 104, 69, 180, 125, 194, 73, 248,
+ 158, 41, 63, 184, 182, 19, 223, 126,
+ 92, 64, 78, 241, 128, 37, 181, 66,
+ 41, 97, 252, 158, 142, 234, 205, 231,
+ 162, 175, 175, 246, 22, 53, 200, 50,
+ 234, 85, 173, 255, 205, 246, 73, 233,
+ 44, 240, 1, 178, 14, 201, 7, 100,
+ 59, 2, 24, 53, 164, 103, 97, 52,
+ 156, 226, 150, 19, 214, 31, 24, 182,
+ 223, 31, 216, 143, 162, 130, 0, 93,
+ 157, 236, 222, 94, 132, 57, 124, 165,
+ 7, 3, 162, 48, 26, 232, 208, 114,
+ 33, 209, 199, 221, 19, 219, 14, 249,
+ 78, 252, 252, 202, 193, 10, 244, 32,
+ 16, 18, 196, 211, 156, 163, 7, 67,
+ 70, 94, 148, 57, 160, 2, 54, 211,
+ 181, 76, 95, 54, 85, 110, 36, 4,
+ 36, 252, 139, 46, 176, 177, 15, 173,
+ 153, 120, 214, 91, 149, 17, 182, 189,
+ 192, 98, 146, 173, 150, 102, 216, 250,
+ 203, 147, 113, 132, 96, 110, 103, 182,
+ 179, 176, 122, 59, 70, 58, 91, 108,
+ 126, 67, 22, 179, 86, 94, 162, 232,
+ 71, 219, 20, 181, 183, 238, 194, 120,
+ 196, 36, 90, 176, 30, 66, 71, 107,
+ 103, 243, 34, 210, 132, 148, 65, 219,
+ 83, 42, 133, 27, 44, 226, 160, 96,
+ 195, 86, 3, 153, 255, 216, 211, 159,
+ 50, 163, 40, 137, 247, 95, 22, 201,
+ 121, 244, 48, 119, 178, 13, 122, 249,
+ 61, 84, 7, 94, 189, 95, 72, 143,
+ 107, 127, 52, 236, 218, 157, 21, 218,
+ 254, 88, 8, 39, 105, 176, 28, 131,
+ 119, 153, 108, 241, 133, 198, 161, 245,
+ 31, 165, 192, 237, 208, 112, 209, 148,
+ 234, 238, 136, 136, 97, 52, 211, 6,
+ 170, 210, 92, 84, 179, 201, 147, 13,
+ 1, 50, 169, 91, 105, 228, 221, 27,
+ 111, 119, 214, 147, 243, 59, 203, 54,
+ 181, 234, 214, 177, 78, 100, 62, 60,
+ 149, 158, 197, 47, 224, 252, 128, 248,
+ 145, 253, 239, 116, 58, 220, 209, 241,
+ 150, 87, 68, 20, 133, 86, 234, 213,
+ 196, 76, 212, 53, 105, 61, 68, 238,
+ 193, 29, 113, 37, 239, 130, 144, 145,
+ 196, 109, 201, 51, 23, 245, 17, 129,
+ 248, 206, 97, 84, 144, 91, 146, 71,
+ 50, 8, 185, 8, 108, 170, 231, 125,
+ 28, 225, 17, 241, 238, 110, 102, 248,
+ 246, 229, 89, 148, 112, 65, 51, 201,
+ 33, 102, 123, 0, 86, 65, 23, 219,
+ 39, 252, 49, 155, 217, 29, 12, 205,
+ 235, 93, 130, 114, 244, 133, 23, 219,
+ 73, 18, 70, 94, 83, 101, 230, 222,
+ 173, 15, 100, 244, 80, 227, 42, 93,
+ 101, 31, 39, 148, 63, 39, 164, 192,
+ 162, 179, 164, 146, 1, 104, 96, 86,
+ 59, 149, 41, 153, 219, 14, 216, 249,
+ 96, 219, 219, 50, 116, 139, 102, 142,
+ 138, 188, 87, 48, 78, 90, 40, 19,
+ 113, 244, 102, 91, 224, 247, 210, 27,
+ 46, 117, 211, 39, 140, 114, 81, 254,
+ 14, 114, 103, 184, 155, 198, 35, 136,
+ 168, 208, 100, 163, 203, 111, 48, 210,
+ 133, 42, 189, 190, 38, 135, 221, 25,
+ 174, 215, 112, 76, 90, 50, 44, 141,
+ 104, 68, 119, 235, 118, 221, 107, 246,
+ 178, 10, 59, 137, 228, 12, 32, 145,
+ 134, 236, 71, 40, 31, 242, 14, 60,
+ 178, 133, 172, 56, 171, 252, 251, 9,
+ 124, 227, 155, 54, 252, 31, 168, 80,
+ 32, 133, 41, 244, 99, 148, 102, 236,
+ 22, 212, 147, 186, 65, 31, 56, 230,
+ 190, 47, 123, 213, 8, 53, 194, 43,
+ 111, 230, 210, 72, 38, 145, 136, 59,
+ 69, 129, 10, 239, 251, 28, 174, 52,
+ 32, 104, 144, 175, 161, 175, 236, 158,
+ 36, 208, 9, 181, 178, 173, 183, 51,
+ 22, 178, 232, 228, 4, 172, 253, 29,
+ 162, 204, 192, 36, 184, 31, 11, 34,
+ 246, 137, 67, 132, 164, 220, 195, 129,
+ 176, 43, 1, 9, 63, 1, 44, 156,
+ 131, 85, 157, 195, 85, 222, 25, 95,
+ 224, 235, 218, 214, 243, 161, 213, 246,
+ 94, 239, 159, 65, 241, 222, 125, 161,
+ 114, 124, 49, 227, 145, 73, 125, 147,
+ 70, 46, 19, 23, 196, 193, 223, 130,
+ 78, 14, 51, 235, 10, 22, 56, 47,
+ 184, 252, 129, 37, 2, 197, 71, 247,
+ 35, 37, 47, 110, 111, 156, 57, 188,
+ 17, 175, 115, 201, 167, 193, 32, 1,
+ 236, 199, 158, 145, 51, 8, 255, 94,
+ 77, 237, 46, 31, 253, 122, 27, 142,
+ 10, 60, 32, 177, 251, 120, 12, 82,
+ 129, 148, 172, 113, 50, 17, 148, 226,
+ 241, 36, 15, 26, 48, 105, 152, 81,
+ 78, 208, 245, 248, 189, 4, 252, 31,
+ 68, 115, 226, 82, 238, 40, 228, 245,
+ 165, 24, 225, 137, 74, 107, 108, 89,
+ 33, 191, 80, 131, 140, 140, 234, 56,
+ 37, 84, 115, 112, 235, 6, 148, 159,
+ 219, 251, 173, 168, 33, 45, 128, 1,
+ 150, 66, 180, 230, 248, 141, 111, 96,
+ 132, 148, 175, 224, 73, 226, 52, 130,
+ 82, 72, 64, 254, 2, 255, 30, 99,
+ 215, 186, 12, 251, 35, 7, 253, 163,
+ 187, 157, 39, 114, 222, 75, 164, 197,
+ 133, 213, 89, 230, 115, 94, 150, 188,
+ 17, 132, 245, 224, 231, 124, 27, 246,
+ 242, 159, 71, 104, 150, 22, 24, 174,
+ 241, 165, 140, 133, 18, 129, 226, 103,
+ 251, 171, 139, 213, 183, 235, 110, 193,
+ 10, 74, 73, 76, 75, 106, 206, 165,
+ 96, 108, 103, 139, 147, 144, 52, 239,
+ 141, 181, 39, 6, 81, 245, 187, 64,
+ 22, 112, 86, 201, 39, 190, 123, 140,
+ 17, 6, 231, 206, 74, 102, 93, 79,
+ 238, 54, 159, 53, 76, 100, 18, 3,
+ 169, 53, 187, 205, 79, 49, 152, 148,
+ 63, 203, 160, 87, 67, 178, 115, 125,
+ 200, 18, 94, 169, 19, 225, 135, 231,
+ 84, 188, 71, 218, 107, 159, 143, 29,
+ 210, 250, 0, 81, 71, 3, 67, 90,
+ 202, 33, 235, 19, 210, 77, 218, 236,
+ 243, 218, 169, 244, 90, 183, 7, 245,
+ 43, 202, 0, 76, 176, 195, 199, 112,
+ 166, 97, 46, 126, 175, 72, 221, 28,
+ 232, 136, 224, 35, 213, 73, 199, 144,
+ 162, 0, 169, 189, 158, 38, 13, 98,
+ 30, 101, 64, 171, 75, 218, 247, 202,
+ 196, 196, 22, 94, 97, 164, 254, 201,
+ 234, 213, 232, 186, 8, 227, 207, 195,
+ 157, 71, 59, 150, 78, 85, 74, 118,
+ 65, 65, 141, 62, 1, 200, 57, 223,
+ 64, 111, 237, 157, 230, 195, 224, 200,
+ 80, 48, 84, 41, 115, 58, 202, 108,
+ 109, 22, 211, 114, 152, 166, 8, 38,
+ 140, 204, 120, 195, 157, 149, 95, 36,
+ 233, 255, 93, 190, 99, 98, 43, 22,
+ 236, 213, 144, 152, 124, 76, 15, 173,
+ 244, 47, 197, 20, 105, 180, 42, 107,
+ 173, 59, 121, 123, 68, 125, 92, 157,
+ 13, 251, 152, 127, 66, 34, 235, 59,
+ 108, 192, 234, 94, 152, 99, 208, 61,
+ 84, 39, 154, 51, 217, 226, 8, 149,
+ 97, 217, 157, 58, 208, 47, 84, 61,
+ 61, 155, 90, 189, 32, 76, 99, 79,
+ 36, 180, 77, 202, 22, 38, 211, 200,
+ 247, 189, 209, 59, 239, 25, 133, 51,
+ 110, 232, 100, 168, 37, 130, 32, 45,
+ 40, 193, 64, 131, 165, 144, 204, 57,
+ 250, 228, 67, 219, 62, 14, 76, 160,
+ 200, 98, 149, 111, 81, 90, 240, 81,
+ 43, 200, 3, 211, 3, 87, 149, 210,
+ 110, 200, 134, 166, 243, 86, 166, 202,
+ 127, 205, 152, 175, 213, 169, 113, 105,
+ 39, 249, 52, 35, 61, 195, 246, 101,
+ 78, 178, 90, 128, 2, 34, 80, 120,
+ 58, 123, 254, 164, 53, 1, 58, 52,
+ 25, 92, 56, 119, 134, 210, 115, 59,
+ 158, 52, 163, 245, 80, 64, 146, 189,
+ 134, 137, 92, 96, 184, 77, 32, 142,
+ 86, 220, 131, 119, 205, 116, 63, 190,
+ 140, 36, 211, 169, 82, 196, 46, 85,
+ 78, 131, 166, 228, 168, 158, 4, 82,
+ 4, 95, 223, 226, 4, 84, 205, 7,
+ 131, 129, 37, 90, 92, 151, 204, 229,
+ 66, 123, 242, 121, 76, 191, 250, 152,
+ 204, 112, 101, 181, 246, 136, 69, 203,
+ 85, 178, 18, 203, 24, 57, 199, 29,
+ 250, 126, 245, 195, 55, 118, 53, 194,
+ 230, 185, 99, 181, 122, 168, 253, 76,
+ 207, 118, 91, 3, 162, 166, 248, 253,
+ 92, 60, 30, 34, 119, 68, 76, 207,
+ 81, 119, 209, 46, 197, 145, 119, 186,
+ 53, 40, 161, 237, 172, 167, 63, 11,
+ 123, 225, 151, 141, 21, 91, 39, 124,
+ 47, 65, 13, 37, 94, 38, 68, 62,
+ 189, 179, 119, 175, 38, 91, 29, 4,
+ 190, 33, 215, 81, 249, 247, 67, 19,
+ 137, 228, 231, 138, 48, 41, 38, 131,
+ 191, 222, 0, 120, 189, 9, 217, 43,
+ 162, 116, 162, 103, 249, 113, 43, 97,
+ 138, 44, 26, 199, 110, 173, 185, 53,
+ 23, 174, 60, 82, 174, 213, 82, 129,
+ 195, 209, 246, 85, 123, 191, 254, 187,
+ 111, 230, 149, 187, 23, 53, 57, 248,
+ 25, 240, 65, 59, 50, 117, 137, 18,
+ 247, 223, 105, 154, 195, 234, 109, 45,
+ 11, 12, 133, 66, 76, 37, 80, 243,
+ 103, 9, 113, 107, 220, 8, 105, 244,
+ 32, 58, 1, 111, 29, 215, 13, 36,
+ 211, 16, 98, 17, 230, 57, 187, 127,
+ 80, 71, 156, 24, 215, 214, 146, 1,
+ 232, 125, 57, 81, 134, 192, 184, 209,
+ 194, 4, 63, 113, 231, 112, 131, 123,
+ 90, 196, 94, 34, 12, 122, 168, 180,
+ 193, 70, 137, 213, 251, 76, 63, 166,
+ 176, 34, 141, 105, 114, 220, 208, 240,
+ 42, 44, 155, 185, 145, 158, 195, 150,
+ 167, 10, 27, 1, 59, 247, 119, 199,
+ 15, 172, 196, 156, 114, 5, 6, 238,
+ 108, 166, 247, 125, 62, 246, 200, 138,
+ 142, 206, 63, 39, 151, 27, 150, 241,
+ 182, 21, 55, 68, 191, 103, 28, 221,
+ 36, 173, 131, 127, 203, 11, 177, 98,
+ 132, 18, 123, 238, 202, 154, 139, 181,
+ 226, 126, 55, 200, 103, 42, 193, 104,
+ 114, 141, 143, 203, 194, 57, 1, 16,
+ 188, 129, 29, 144, 149, 156, 138, 247,
+ 157, 149, 19, 81, 72, 16, 155, 42,
+ 248, 56, 95, 246, 18, 168, 153, 79,
+ 101, 156, 224, 159, 7, 35, 1, 38,
+ 212, 87, 214, 162, 173, 95, 193, 70,
+ 88, 212, 194, 141, 39, 178, 104, 75,
+ 201, 1, 202, 49, 92, 29, 134, 249,
+ 135, 23, 226, 165, 223, 224, 241, 174,
+ 47, 77, 221, 114, 15, 154, 145, 47,
+ 196, 215, 41, 113, 129, 29, 71, 64,
+ 120, 215, 206, 224, 137, 34, 114, 215,
+ 116, 85, 245, 252, 32, 34, 72, 28,
+ 116, 75, 237, 155, 250, 188, 2, 91,
+ 47, 242, 127, 167, 90, 195, 14, 216,
+ 217, 163, 212, 48, 78, 212, 206, 85,
+ 108, 79, 244, 211, 180, 166, 84, 132,
+ 209, 175, 34, 49, 203, 93, 140, 81,
+ 40, 82, 195, 68, 98, 170, 234, 99,
+ 58, 9, 234, 115, 150, 9, 225, 85,
+ 170, 159, 156, 189, 223, 40, 69, 185,
+ 5, 242, 142, 136, 69, 71, 163, 211,
+ 197, 69, 237, 71, 11, 26, 242, 203,
+ 110, 66, 115, 193, 150, 100, 185, 38,
+ 117, 105, 61, 242, 152, 237, 114, 68,
+ 243, 21, 70, 18, 111, 252, 77, 118,
+ 200, 139, 208, 50, 220, 199, 42, 101,
+ 110, 89, 204, 99, 108, 77, 163, 78,
+ 238, 138, 72, 39, 80, 149, 79, 84,
+ 71, 213, 94, 163, 235, 142, 97, 39,
+ 109, 90, 162, 173, 199, 185, 133, 243,
+ 54, 170, 107, 2, 103, 33, 71, 188,
+ 38, 100, 86, 239, 221, 79, 147, 135,
+ 156, 227, 245, 101, 97, 174, 36, 237,
+ 120, 72, 123, 88, 31, 74, 175, 30,
+ 120, 68, 168, 20, 98, 5, 83, 65,
+ 204, 20, 60, 140, 34, 113, 198, 13,
+ 227, 65, 229, 208, 95, 193, 233, 86,
+ 177, 83, 1, 200, 130, 7, 251, 49,
+ 219, 71, 73, 177, 210, 25, 214, 252,
+ 97, 184, 167, 133, 212, 104, 239, 140,
+ 111, 101, 203, 44, 219, 0, 237, 101,
+ 174, 42, 130, 162, 237, 156, 187, 51,
+ 120, 32, 53, 152, 158, 242, 52, 0,
+ 21, 82, 223, 1, 115, 57, 71, 43,
+ 109, 82, 35, 130, 67, 44, 131, 52,
+ 135, 136, 81, 212, 220, 215, 9, 228,
+ 44, 118, 39, 249, 18, 232, 229, 71,
+ 255, 167, 44, 1, 106, 89, 230, 86,
+ 188, 135, 179, 143, 143, 124, 226, 144,
+ 186, 61, 224, 205, 106, 37, 89, 210,
+ 242, 40, 192, 95, 81, 133, 134, 155,
+ 238, 205, 207, 66, 124, 195, 238, 92,
+ 174, 209, 84, 152, 197, 72, 124, 4,
+ 141, 223, 179, 144, 103, 112, 85, 129,
+ 247, 30, 23, 42, 19, 249, 64, 63,
+ 231, 19, 21, 127, 217, 191, 21, 209,
+ 89, 12, 156, 43, 167, 137, 26, 213,
+ 19, 243, 193, 43, 81, 170, 124, 111,
+ 152, 89, 184, 9, 142, 20, 176, 158,
+ 108, 59, 126, 250, 190, 173, 9, 183,
+ 137, 221, 117, 58, 131, 0, 5, 146,
+ 114, 38, 182, 29, 142, 227, 101, 92,
+ 123, 147, 189, 208, 202, 10, 74, 49,
+ 68, 89, 217, 178, 114, 136, 90, 179,
+ 192, 92, 135, 47, 185, 212, 170, 189,
+ 177, 114, 157, 238, 153, 21, 132, 29,
+ 118, 46, 55, 198, 219, 139, 42, 150,
+ 210, 80, 74, 8, 181, 190, 118, 255,
+ 221, 82, 141, 16, 17, 22, 169, 27,
+ 65, 247, 21, 164, 136, 237, 74, 197,
+ 89, 22, 231, 177, 188, 6, 55, 124,
+ 214, 175, 98, 213, 93, 184, 107, 44,
+ 136, 16, 63, 249, 205, 119, 53, 230,
+ 88, 246, 229, 126, 148, 25, 54, 172,
+ 218, 18, 216, 179, 63, 105, 0, 210,
+ 34, 109, 117, 43, 234, 96, 96, 61,
+ 144, 29, 46, 64, 86, 255, 27, 92,
+ 84, 105, 14, 150, 131, 205, 147, 236,
+ 3, 235, 157, 89, 96, 151, 20, 234,
+ 154, 253, 210, 48, 232, 84, 128, 8,
+ 25, 89, 82, 32, 152, 205, 179, 12,
+ 3, 232, 103, 251, 20, 74, 247, 209,
+ 227, 188, 111, 175, 24, 24, 235, 13,
+ 123, 240, 28, 6, 103, 199, 4, 149,
+ 179, 226, 34, 121, 120, 147, 240, 68,
+ 174, 188, 82, 214, 164, 55, 36, 40,
+ 20, 177, 11, 107, 3, 24, 2, 157,
+ 155, 109, 158, 134, 218, 90, 99, 124,
+ 213, 40, 72, 224, 173, 97, 110, 113,
+ 89, 193, 188, 209, 27, 19, 228, 200,
+ 133, 245, 164, 188, 213, 192, 206, 73,
+ 58, 87, 93, 197, 140, 145, 38, 218,
+ 188, 222, 87, 208, 100, 84, 153, 71,
+ 4, 87, 45, 209, 9, 46, 86, 107,
+ 28, 40, 148, 152, 176, 179, 80, 235,
+ 89, 247, 126, 88, 179, 23, 148, 106,
+ 146, 218, 187, 105, 202, 56, 170, 4,
+ 197, 129, 82, 110, 129, 102, 47, 180,
+ 169, 77, 10, 223, 160, 111, 185, 244,
+ 75, 169, 110, 251, 141, 180, 142, 75,
+ 41, 129, 82, 183, 12, 165, 237, 242,
+ 73, 118, 72, 81, 127, 214, 66, 95,
+ 135, 27, 179, 100, 23, 103, 83, 173,
+ 164, 34, 123, 47, 71, 219, 69, 216,
+ 178, 110, 215, 162, 219, 134, 138, 79,
+ 208, 35, 146, 19, 122, 169, 93, 7,
+ 84, 95, 62, 223, 79, 8, 253, 73,
+ 243, 98, 93, 235, 159, 46, 121, 163,
+ 37, 119, 47, 59, 225, 206, 192, 9,
+ 128, 200, 26, 154, 112, 179, 18, 153,
+ 181, 105, 205, 229, 76, 160, 77, 242,
+ 21, 144, 192, 8, 227, 41, 1, 180,
+ 34, 250, 157, 121, 255, 137, 216, 169,
+ 205, 95, 115, 237, 151, 245, 252, 81,
+ 176, 239, 207, 30, 39, 36, 110, 97,
+ 195, 33, 12, 171, 217, 83, 246, 27,
+ 147, 194, 253, 223, 173, 110, 120, 248,
+ 193, 219, 117, 230, 153, 171, 69, 251,
+ 101, 51, 24, 101, 5, 83, 69, 90,
+ 235, 172, 180, 151, 193, 194, 118, 153,
+ 148, 50, 171, 170, 52, 13, 183, 132,
+ 228, 87, 69, 220, 210, 206, 32, 208,
+ 192, 143, 173, 212, 249, 103, 201, 140,
+ 173, 185, 101, 63, 146, 137, 164, 55,
+ 250, 248, 215, 132, 243, 107, 100, 37,
+ 0, 118, 92, 246, 162, 231, 227, 72,
+ 123, 148, 249, 255, 82, 152, 242, 221,
+ 137, 61, 213, 150, 89, 207, 105, 254,
+ 48, 219, 134, 186, 200, 127, 4, 233,
+ 64, 134, 99, 53, 3, 36, 244, 180,
+ 67, 241, 197, 191, 39, 240, 124, 42,
+ 228, 74, 137, 28, 166, 74, 130, 124,
+ 117, 76, 209, 196, 48, 148, 186, 186,
+ 49, 141, 132, 38, 13, 241, 57, 181,
+ 74, 67, 67, 150, 46, 32, 254, 136,
+ 198, 156, 51, 140, 92, 197, 195, 243,
+ 207, 85, 16, 216, 88, 92, 69, 134,
+ 13, 112, 165, 169, 205, 194, 118, 186,
+ 171, 113, 49, 88, 72, 197, 239, 212,
+ 30, 168, 197, 107, 181, 56, 181, 42,
+ 118, 72, 12, 61, 209, 139, 70, 119,
+ 5, 137, 176, 190, 175, 233, 159, 233,
+ 44, 112, 6, 52, 85, 84, 221, 163,
+ 64, 115, 255, 91, 33, 229, 217, 168,
+ 254, 14, 231, 63, 156, 226, 105, 118,
+ 231, 140, 54, 4, 198, 61, 247, 163,
+ 21, 70, 158, 231, 172, 156, 112, 143,
+ 55, 252, 103, 29, 86, 11, 54, 173,
+ 245, 2, 63, 17, 156, 227, 91, 97,
+ 235, 155, 89, 8, 242, 145, 122, 167,
+ 23, 29, 82, 167, 252, 217, 124, 189,
+ 48, 47, 139, 173, 146, 107, 19, 18,
+ 32, 7, 71, 228, 198, 48, 166, 142,
+ 27, 81, 85, 27, 88, 80, 244, 9,
+ 79, 238, 214, 131, 31, 144, 31, 86,
+ 83, 187, 216, 46, 58, 112, 30, 19,
+ 21, 85, 102, 3, 231, 66, 164, 143,
+ 42, 131, 140, 127, 16, 138, 49, 73,
+ 103, 185, 97, 93, 55, 180, 113, 161,
+ 209, 93, 10, 156, 7, 27, 45, 78,
+ 86, 158, 130, 73, 121, 32, 174, 201,
+ 27, 112, 140, 229, 53, 42, 51, 131,
+ 113, 71, 202, 234, 123, 154, 241, 69,
+ 0, 216, 7, 66, 179, 209, 228, 250,
+ 80, 183, 187, 162, 229, 137, 24, 67,
+ 199, 84, 211, 227, 110, 160, 233, 81,
+ 10, 108, 202, 1, 182, 39, 200, 154,
+ 247, 1, 157, 165, 193, 239, 62, 148,
+ 50, 181, 254, 119, 152, 70, 16, 43,
+ 156, 40, 13, 67, 109, 161, 36, 149,
+ 221, 168, 146, 14, 169, 154, 224, 224,
+ 185, 192, 3, 182, 135, 108, 102, 183,
+ 110, 41, 203, 177, 58, 83, 150, 93,
+ 177, 132, 104, 214, 118, 96, 177, 188,
+ 41, 244, 246, 172, 211, 156, 54, 45,
+ 47, 205, 114, 52, 36, 98, 247, 42,
+ 223, 221, 85, 237, 52, 68, 112, 12,
+ 53, 66, 134, 244, 149, 185, 79, 44,
+ 212, 103, 117, 31, 185, 154, 122, 51,
+ 244, 247, 174, 53, 161, 8, 191, 45,
+ 87, 35, 212, 15, 99, 249, 87, 9,
+ 142, 246, 205, 68, 165, 87, 19, 61,
+ 49, 39, 211, 166, 66, 121, 166, 213,
+ 162, 21, 74, 110, 208, 200, 242, 209,
+ 175, 4, 242, 39, 108, 220, 233, 30,
+ 97, 231, 219, 113, 42, 121, 166, 123,
+ 227, 89, 120, 50, 204, 70, 121, 110,
+ 101, 20, 73, 235, 244, 179, 225, 57,
+ 92, 48, 64, 163, 157, 245, 254, 141,
+ 132, 81, 150, 59, 146, 166, 227, 21,
+ 60, 15, 182, 249, 114, 25, 239, 145,
+ 167, 241, 96, 49, 249, 235, 189, 108,
+ 113, 100, 139, 247, 211, 188, 219, 60,
+ 35, 255, 112, 155, 21, 187, 55, 26,
+ 115, 235, 29, 233, 48, 170, 24, 126,
+ 146, 220, 199, 187, 111, 81, 138, 230,
+ 23, 88, 252, 153, 143, 142, 27, 159,
+ 241, 136, 196, 87, 253, 225, 246, 51,
+ 67, 250, 243, 102, 127, 110, 0, 168,
+ 154, 250, 43, 37, 17, 207, 60, 173,
+ 17, 156, 148, 104, 36, 0, 60, 95,
+ 95, 208, 107, 128, 60, 115, 142, 1,
+ 237, 10, 244, 36, 206, 231, 101, 247,
+ 211, 155, 87, 198, 24, 162, 137, 161,
+ 249, 245, 143, 31, 173, 200, 104, 90,
+ 226, 166, 254, 252, 221, 212, 8, 75,
+ 69, 57, 159, 30, 141, 141, 53, 207,
+ 202, 246, 28, 45, 252, 56, 230, 248,
+ 149, 41, 145, 182, 182, 242, 82, 178,
+ 130, 237, 110, 170, 30, 172, 174, 155,
+ 165, 154, 191, 142, 117, 218, 210, 165,
+ 65, 152, 95, 120, 27, 164, 70, 64,
+ 54, 197, 229, 146, 91, 195, 30, 0,
+ 167, 165, 161, 127, 84, 92, 168, 238,
+ 40, 199, 230, 116, 1, 55, 7, 210,
+ 200, 228, 18, 15, 72, 46, 39, 188,
+ 229, 119, 45, 228, 215, 41, 219, 94,
+ 75, 185, 100, 131, 47, 221, 121, 31,
+ 185, 120, 7, 124, 86, 40, 206, 15,
+ 168, 8, 128, 155, 64, 134, 198, 252,
+ 194, 167, 58, 149, 89, 119, 119, 31,
+ 196, 102, 230, 59, 152, 64, 47, 87,
+ 31, 6, 122, 124, 180, 187, 142, 86,
+ 59, 78, 93, 165, 212, 251, 184, 157,
+ 21, 67, 39, 254, 40, 4, 98, 174,
+ 104, 205, 80, 128, 94, 215, 246, 176,
+ 41, 48, 172, 2, 43, 250, 9, 178,
+ 187, 59, 215, 23, 158, 101, 97, 36,
+ 204, 6, 155, 244, 107, 227, 2, 199,
+ 46, 21, 80, 232, 41, 88, 176, 208,
+ 214, 80, 205, 129, 61, 203, 34, 94,
+ 172, 10, 176, 132, 128, 56, 214, 235,
+ 46, 86, 85, 125, 130, 228, 147, 251,
+ 200, 25, 153, 247, 207, 197, 118, 159,
+ 208, 124, 127, 170, 164, 174, 97, 28,
+ 88, 47, 71, 229, 74, 172, 208, 157,
+ 163, 62, 51, 159, 130, 133, 77, 123,
+ 144, 224, 201, 242, 75, 251, 204, 162,
+ 243, 192, 66, 127, 75, 109, 204, 120,
+ 130, 50, 183, 56, 112, 71, 51, 98,
+ 184, 13, 139, 14, 242, 134, 129, 74,
+ 99, 252, 244, 195, 137, 0, 159, 111,
+ 236, 107, 22, 187, 106, 203, 232, 64,
+ 112, 183, 157, 232, 148, 101, 2, 166,
+ 229, 24, 183, 58, 192, 13, 136, 25,
+ 250, 195, 182, 1, 253, 201, 108, 95,
+ 32, 99, 226, 46, 156, 104, 224, 99,
+ 150, 78, 134, 247, 62, 113, 212, 141,
+ 155, 38, 52, 39, 174, 47, 122, 221,
+ 218, 207, 147, 29, 29, 188, 44, 24,
+ 132, 155, 86, 192, 140, 117, 182, 38,
+ 222, 123, 100, 248, 94, 97, 7, 236,
+ 5, 188, 247, 183, 197, 77, 103, 97,
+ 37, 219, 220, 218, 163, 15, 111, 144,
+ 243, 214, 4, 160, 9, 234, 77, 228,
+ 50, 184, 175, 238, 96, 52, 193, 92,
+ 131, 184, 223, 141, 189, 56, 21, 240,
+ 192, 83, 112, 141, 74, 119, 143, 20,
+ 175, 5, 198, 83, 200, 126, 165, 131,
+ 255, 99, 92, 186, 27, 35, 15, 20,
+ 209, 201, 129, 70, 148, 251, 93, 131,
+ 94, 59, 22, 185, 201, 57, 201, 188,
+ 147, 152, 57, 66, 44, 122, 94, 145,
+ 73, 249, 231, 71, 123, 61, 153, 29,
+ 213, 181, 67, 0, 56, 78, 63, 255,
+ 82, 195, 80, 155, 18, 162, 182, 102,
+ 108, 50, 134, 78, 205, 114, 246, 245,
+ 89, 181, 112, 140, 175, 191, 212, 165,
+ 110, 240, 54, 202, 198, 35, 166, 5,
+ 65, 87, 17, 218, 19, 221, 154, 45,
+ 197, 254, 65, 109, 232, 70, 215, 33,
+ 26, 2, 73, 197, 2, 156, 185, 142,
+ 67, 134, 135, 192, 14, 78, 77, 160,
+ 99, 180, 79, 98, 4, 187, 33, 141,
+ 192, 70, 149, 98, 213, 203, 193, 27,
+ 208, 65, 205, 125, 60, 16, 182, 37,
+ 21, 75, 22, 220, 0, 166, 172, 238,
+ 70, 87, 50, 70, 35, 190, 235, 177,
+ 176, 241, 95, 71, 142, 102, 135, 162,
+ 164, 238, 179, 181, 81, 10, 152, 220,
+ 98, 234, 170, 185, 7, 84, 244, 88,
+ 12, 91, 190, 194, 126, 159, 45, 238,
+ 52, 202, 45, 2, 206, 144, 171, 124,
+ 189, 139, 8, 69, 86, 13, 50, 72,
+ 148, 170, 135, 135, 46, 218, 201, 15,
+ 102, 153, 223, 3, 193, 173, 94, 15,
+ 0, 95, 167, 53, 155, 34, 197, 106,
+ 88, 11, 192, 18, 28, 181, 145, 244,
+ 222, 137, 66, 73, 158, 147, 235, 247,
+ 83, 17, 212, 82, 241, 31, 13, 66,
+ 12, 57, 60, 10, 155, 70, 195, 128,
+ 12, 21, 90, 177, 190, 241, 57, 206,
+ 121, 0, 135, 181, 144, 89, 104, 207,
+ 104, 72, 75, 13, 187, 26, 41, 42,
+ 138, 49, 102, 1, 36, 234, 84, 172,
+ 183, 120, 138, 167, 92, 238, 226, 193,
+ 74, 141, 214, 117, 8, 243, 234, 62,
+ 79, 35, 117, 103, 135, 148, 215, 227,
+ 28, 89, 99, 254, 69, 8, 137, 149,
+ 170, 5, 182, 117, 102, 160, 111, 232,
+ 232, 112, 37, 182, 15, 120, 72, 177,
+ 249, 69, 83, 14, 40, 81, 123, 6,
+ 55, 157, 159, 196, 174, 2, 174, 102,
+ 222, 105, 16, 108, 91, 62, 255, 74,
+ 215, 174, 35, 43, 30, 9, 72, 151,
+ 187, 49, 153, 32, 181, 140, 112, 141,
+ 230, 73, 72, 142, 150, 31, 180, 95,
+ 100, 26, 144, 246, 151, 6, 239, 215,
+ 71, 109, 35, 51, 172, 244, 165, 159,
+ 229, 56, 70, 111, 193, 60, 67, 122,
+ 23, 183, 123, 41, 43, 218, 65, 32,
+ 137, 153, 6, 97, 159, 159, 233, 193,
+ 111, 147, 190, 221, 230, 47, 198, 130,
+ 180, 77, 110, 35, 176, 32, 173, 148,
+ 221, 38, 180, 75, 107, 32, 127, 227,
+ 254, 142, 133, 29, 35, 19, 234, 50,
+ 160, 196, 248, 164, 153, 63, 222, 196,
+ 252, 67, 178, 115, 176, 243, 110, 134,
+ 61, 184, 226, 14, 233, 42, 74, 212,
+ 110, 116, 214, 118, 22, 0, 193, 49,
+ 196, 130, 96, 71, 118, 61, 191, 115,
+ 192, 47, 83, 3, 36, 209, 101, 67,
+ 106, 31, 106, 214, 246, 117, 89, 87,
+ 230, 108, 137, 173, 192, 171, 222, 126,
+ 66, 58, 223, 120, 184, 151, 91, 88,
+ 155, 78, 194, 114, 102, 212, 90, 152,
+ 81, 51, 65, 42, 85, 159, 116, 226,
+ 86, 45, 164, 186, 186, 124, 173, 114,
+ 245, 85, 156, 18, 79, 15, 130, 67,
+ 114, 197, 201, 237, 191, 37, 105, 211,
+ 243, 94, 52, 42, 159, 249, 81, 56,
+ 164, 46, 220, 157, 72, 39, 165, 232,
+ 35, 3, 123, 52, 203, 38, 126, 26,
+ 104, 42, 157, 4, 217, 51, 204, 29,
+ 80, 146, 188, 17, 177, 37, 8, 95,
+ 140, 49, 235, 166, 34, 208, 67, 56,
+ 141, 42, 61, 141, 156, 31, 99, 213,
+ 155, 100, 82, 17, 55, 160, 116, 104,
+ 198, 250, 37, 197, 190, 15, 71, 236,
+ 27, 247, 149, 222, 5, 171, 147, 183,
+ 186, 54, 106, 53, 92, 219, 245, 94,
+ 137, 39, 43, 5, 56, 5, 34, 114,
+ 4, 193, 211, 133, 171, 179, 18, 158,
+ 207, 187, 97, 132, 85, 152, 209, 94,
+ 137, 199, 84, 241, 16, 115, 73, 229,
+ 74, 156, 174, 229, 134, 250, 98, 41,
+ 36, 73, 14, 205, 221, 36, 17, 44,
+ 36, 185, 151, 156, 71, 219, 146, 76,
+ 130, 236, 34, 126, 90, 79, 174, 56,
+ 96, 140, 145, 202, 207, 241, 99, 104,
+ 41, 252, 129, 44, 224, 242, 145, 97,
+ 28, 126, 3, 88, 241, 194, 33, 170,
+ 113, 198, 183, 199, 59, 132, 105, 179,
+ 80, 254, 228, 106, 101, 200, 241, 21,
+ 95, 109, 59, 24, 61, 78, 123, 159,
+ 89, 240, 140, 212, 175, 65, 142, 16,
+ 253, 31, 158, 248, 72, 247, 48, 144,
+ 28, 173, 119, 70, 55, 155, 3, 44,
+ 41, 171, 216, 184, 170, 59, 157, 185,
+ 56, 59, 148, 133, 71, 104, 19, 133,
+ 76, 3, 203, 6, 139, 245, 169, 249,
+ 248, 220, 71, 173, 117, 103, 125, 220,
+ 74, 133, 158, 219, 42, 165, 69, 158,
+ 142, 27, 239, 159, 225, 111, 128, 126,
+ 158, 61, 53, 126, 118, 166, 54, 83,
+ 0, 119, 190, 245, 144, 148, 193, 234,
+ 150, 110, 38, 209, 13, 170, 100, 156,
+ 215, 107, 241, 56, 161, 181, 59, 135,
+ 138, 86, 92, 232, 221, 134, 128, 120,
+ 85, 156, 74, 191, 39, 164, 129, 204,
+ 82, 240, 203, 246, 155, 225, 127, 13,
+ 41, 25, 184, 154, 10, 138, 9, 167,
+ 229, 27, 153, 16, 182, 237, 64, 64,
+ 184, 118, 108, 253, 145, 82, 61, 211,
+ 66, 104, 58, 71, 242, 86, 242, 202,
+ 54, 40, 97, 2, 184, 243, 123, 5,
+ 91, 184, 160, 126, 5, 133, 253, 83,
+ 240, 58, 249, 33, 198, 71, 20, 102,
+ 86, 34, 24, 180, 149, 20, 34, 76,
+ 101, 30, 184, 194, 77, 87, 255, 228,
+ 255, 152, 169, 95, 77, 141, 206, 135,
+ 253, 106, 104, 249, 76, 138, 94, 160,
+ 9, 67, 139, 125, 211, 198, 145, 199,
+ 239, 80, 83, 12, 0, 123, 128, 220,
+ 149, 54, 181, 186, 63, 61, 144, 128,
+ 187, 181, 214, 156, 228, 248, 94, 181,
+ 215, 240, 165, 58, 79, 114, 190, 36,
+ 66, 251, 190, 11, 98, 97, 69, 69,
+ 221, 134, 230, 51, 193, 143, 22, 20,
+ 127, 231, 225, 46, 184, 22, 182, 191,
+ 3, 142, 11, 223, 165, 54, 254, 238,
+ 63, 147, 159, 159, 26, 155, 120, 14,
+ 68, 249, 180, 243, 49, 194, 67, 254,
+ 179, 137, 38, 10, 2, 97, 22, 238,
+ 223, 132, 191, 14, 129, 64, 100, 167,
+ 162, 96, 108, 207, 49, 119, 188, 154,
+ 32, 7, 59, 252, 140, 163, 183, 55,
+ 30, 0, 46, 230, 253, 180, 116, 119,
+ 6, 17, 240, 150, 204, 203, 185, 249,
+ 140, 44, 204, 231, 131, 251, 10, 79,
+ 72, 252, 240, 34, 228, 39, 37, 216,
+ 97, 135, 146, 148, 246, 12, 251, 218,
+ 94, 29, 44, 174, 238, 83, 250, 157,
+ 253, 105, 57, 106, 225, 157, 55, 88,
+ 95, 155, 151, 35, 198, 126, 182, 213,
+ 213, 3, 234, 232, 156, 17, 137, 143,
+ 161, 146, 40, 245, 192, 122, 115, 0,
+ 44, 249, 224, 99, 95, 105, 184, 1,
+ 254, 238, 16, 245, 28, 65, 25, 123,
+ 3, 149, 42, 32, 44, 39, 2, 96,
+ 126, 171, 89, 72, 155, 150, 51, 49,
+ 154, 212, 62, 31, 189, 244, 77, 173,
+ 72, 223, 3, 202, 73, 255, 212, 170,
+ 173, 152, 128, 29, 46, 183, 71, 232,
+ 122, 163, 152, 88, 211, 70, 71, 116,
+ 109, 77, 177, 16, 121, 49, 50, 49,
+ 31, 48, 38, 66, 131, 157, 25, 28,
+ 177, 220, 252, 41, 81, 83, 180, 50,
+ 222, 56, 128, 28, 179, 230, 24, 179,
+ 135, 197, 228, 162, 150, 227, 145, 217,
+ 184, 188, 135, 208, 208, 165, 79, 252,
+ 148, 21, 50, 97, 24, 96, 73, 195,
+ 102, 254, 87, 42, 113, 185, 45, 155,
+ 233, 154, 170, 35, 85, 136, 185, 217,
+ 10, 48, 114, 246, 147, 172, 201, 123,
+ 87, 84, 125, 206, 34, 214, 8, 231,
+ 31, 160, 189, 112, 87, 111, 34, 169,
+ 110, 83, 245, 140, 112, 1, 218, 147,
+ 80, 215, 168, 120, 29, 109, 105, 254,
+ 20, 70, 167, 192, 33, 106, 45, 148,
+ 147, 235, 22, 135, 65, 110, 10, 243,
+ 141, 56, 92, 177, 57, 243, 204, 214,
+ 6, 121, 111, 3, 176, 121, 245, 76,
+ 160, 30, 236, 15, 229, 238, 213, 244,
+ 148, 81, 194, 25, 137, 171, 85, 195,
+ 23, 13, 154, 10, 12, 230, 122, 202,
+ 162, 74, 195, 225, 78, 183, 182, 203,
+ 17, 185, 122, 155, 5, 51, 200, 92,
+ 71, 93, 229, 38, 149, 160, 147, 33,
+ 89, 181, 103, 161, 148, 97, 55, 62,
+ 184, 39, 43, 219, 85, 74, 151, 56,
+ 86, 67, 82, 56, 38, 251, 240, 133,
+ 215, 153, 179, 60, 231, 60, 0, 24,
+ 37, 191, 202, 214, 189, 55, 2, 165,
+ 240, 179, 148, 226, 154, 81, 28, 45,
+ 231, 97, 253, 2, 54, 254, 90, 162,
+ 255, 229, 11, 161, 65, 213, 246, 80,
+ 5, 109, 14, 163, 4, 60, 123, 51,
+ 91, 134, 98, 183, 2, 154, 211, 42,
+ 109, 192, 248, 31, 26, 11, 144, 103,
+ 0, 179, 239, 215, 20, 20, 44, 82,
+ 18, 220, 179, 112, 168, 171, 80, 64,
+ 244, 136, 106, 5, 86, 114, 160, 135,
+ 233, 230, 233, 31, 30, 120, 26, 26,
+ 255, 11, 173, 238, 195, 186, 10, 16,
+ 126, 140, 47, 52, 112, 235, 30, 121,
+ 0, 98, 26, 29, 183, 138, 181, 35,
+ 227, 220, 251, 22, 33, 177, 25, 26,
+ 205, 189, 149, 169, 189, 234, 61, 79,
+ 44, 223, 79, 248, 163, 244, 53, 41,
+ 177, 28, 33, 119, 234, 138, 18, 252,
+ 227, 204, 236, 10, 130, 157, 183, 183,
+ 194, 111, 94, 34, 221, 231, 248, 118,
+ 3, 51, 103, 215, 195, 226, 92, 92,
+ 191, 217, 246, 174, 57, 238, 17, 245,
+ 209, 205, 228, 5, 183, 209, 235, 185,
+ 118, 12, 181, 115, 94, 155, 235, 23,
+ 246, 70, 62, 226, 214, 12, 53, 231,
+ 3, 37, 157, 135, 18, 36, 33, 4,
+ 208, 189, 199, 74, 231, 159, 86, 25,
+ 137, 232, 10, 231, 207, 199, 62, 65,
+ 116, 219, 179, 119, 89, 181, 18, 209,
+ 170, 161, 79, 137, 119, 136, 126, 80,
+ 29, 2, 8, 192, 145, 124, 53, 172,
+ 184, 110, 225, 63, 219, 198, 221, 212,
+ 26, 89, 59, 18, 30, 84, 59, 63,
+ 100, 1, 137, 155, 192, 225, 229, 182,
+ 115, 58, 133, 108, 12, 99, 125, 6,
+ 238, 249, 225, 176, 120, 182, 248, 108,
+ 72, 252, 115, 204, 130, 148, 102, 17,
+ 178, 2, 139, 3, 140, 10, 90, 120,
+ 122, 130, 66, 211, 80, 134, 50, 235,
+ 89, 59, 122, 86, 28, 250, 206, 233,
+ 67, 127, 145, 176, 4, 64, 127, 228,
+ 229, 111, 10, 202, 172, 146, 72, 188,
+ 247, 124, 233, 246, 89, 214, 221, 204,
+ 198, 167, 88, 208, 135, 128, 237, 53,
+ 50, 165, 114, 244, 137, 240, 1, 180,
+ 182, 66, 69, 210, 220, 55, 175, 41,
+ 172, 239, 195, 19, 153, 204, 183, 17,
+ 76, 199, 29, 58, 52, 3, 237, 48,
+ 175, 65, 242, 247, 55, 183, 155, 128,
+ 240, 250, 197, 114, 4, 77, 9, 1,
+ 126, 104, 94, 184, 142, 108, 57, 255,
+ 166, 254, 207, 87, 215, 196, 250, 44,
+ 209, 67, 56, 194, 178, 179, 104, 30,
+ 97, 167, 121, 86, 141, 60, 102, 19,
+ 2, 197, 217, 115, 63, 247, 8, 84,
+ 28, 58, 116, 169, 173, 154, 203, 122,
+ 188, 174, 166, 221, 148, 47, 176, 160,
+ 155, 97, 211, 215, 36, 46, 48, 174,
+ 22, 117, 45, 188, 40, 97, 96, 7,
+ 6, 213, 44, 3, 200, 194, 238, 191,
+ 3, 60, 254, 176, 100, 204, 235, 76,
+ 244, 110, 196, 82, 143, 245, 9, 12,
+ 210, 171, 30, 93, 84, 93, 178, 206,
+ 8, 125, 39, 212, 111, 58, 181, 114,
+ 33, 199, 165, 58, 105, 26, 187, 87,
+ 184, 139, 99, 136, 182, 230, 149, 172,
+ 33, 78, 10, 51, 149, 246, 253, 3,
+ 217, 5, 9, 210, 148, 130, 66, 70,
+ 130, 128, 49, 149, 97, 77, 153, 142,
+ 252, 193, 19, 162, 152, 161, 173, 127,
+ 43, 73, 167, 252, 89, 11, 218, 227,
+ 97, 136, 93, 205, 8, 190, 48, 82,
+ 26, 191, 249, 99, 126, 58, 145, 73,
+ 213, 56, 192, 119, 94, 244, 160, 193,
+ 15, 26, 78, 227, 217, 215, 218, 180,
+ 186, 195, 150, 42, 173, 240, 54, 185,
+ 57, 107, 0, 98, 175, 73, 216, 212,
+ 149, 168, 75, 227, 132, 50, 178, 221,
+ 39, 207, 203, 37, 49, 11, 239, 80,
+ 217, 55, 4, 13, 203, 252, 79, 105,
+ 41, 35, 134, 5, 63, 209, 26, 240,
+ 41, 234, 97, 192, 180, 84, 21, 37,
+ 64, 142, 113, 75, 34, 253, 177, 107,
+ 47, 197, 240, 157, 141, 196, 125, 183,
+ 34, 35, 133, 53, 127, 87, 44, 193,
+ 106, 181, 153, 29, 80, 2, 224, 8,
+ 216, 164, 201, 251, 6, 246, 70, 32,
+ 87, 92, 105, 53, 50, 129, 234, 20,
+ 55, 190, 195, 3, 212, 239, 223, 9,
+ 243, 84, 21, 201, 29, 51, 89, 154,
+ 40, 154, 229, 8, 5, 182, 33, 80,
+ 22, 6, 163, 49, 246, 115, 43, 78,
+ 113, 247, 45, 172, 4, 48, 242, 93,
+ 19, 172, 202, 26, 29, 254, 7, 223,
+ 131, 76, 71, 78, 69, 139, 172, 3,
+ 96, 202, 0, 50, 179, 158, 178, 234,
+ 168, 108, 111, 68, 51, 19, 28, 15,
+ 100, 121, 67, 97, 148, 238, 136, 177,
+ 76, 50, 58, 63, 245, 23, 104, 126,
+ 132, 40, 90, 80, 196, 239, 62, 175,
+ 167, 212, 129, 133, 181, 168, 5, 24,
+ 197, 143, 170, 199, 198, 205, 172, 47,
+ 124, 196, 18, 88, 228, 144, 148, 244,
+ 191, 191, 241, 165, 68, 247, 225, 138,
+ 246, 102, 170, 222, 241, 14, 30, 130,
+ 252, 64, 161, 54, 36, 173, 95, 172,
+ 222, 25, 88, 78, 102, 206, 76, 209,
+ 249, 83, 164, 104, 88, 150, 70, 238,
+ 194, 67, 201, 127, 39, 45, 70, 11,
+ 155, 69, 13, 211, 161, 77, 125, 249,
+ 189, 208, 40, 12, 156, 49, 38, 229,
+ 164, 150, 59, 127, 118, 88, 226, 216,
+ 62, 233, 199, 185, 200, 230, 105, 102,
+ 166, 71, 125, 162, 80, 176, 92, 58,
+ 83, 172, 251, 97, 47, 123, 77, 70,
+ 154, 63, 167, 0, 151, 222, 204, 142,
+ 210, 156, 27, 67, 112, 182, 194, 93,
+ 162, 176, 132, 37, 115, 240, 233, 167,
+ 119, 160, 172, 73, 122, 160, 133, 42,
+ 192, 251, 123, 241, 73, 44, 4, 67,
+ 44, 244, 174, 118, 92, 198, 44, 210,
+ 26, 152, 58, 139, 59, 151, 210, 38,
+ 210, 205, 46, 94, 218, 39, 110, 9,
+ 72, 240, 240, 136, 102, 51, 194, 148,
+ 49, 76, 143, 0, 182, 121, 214, 121,
+ 41, 174, 211, 70, 54, 32, 199, 63,
+ 223, 139, 212, 79, 239, 117, 159, 96,
+ 91, 215, 200, 18, 62, 67, 134, 179,
+ 167, 85, 203, 40, 239, 27, 238, 9,
+ 161, 220, 103, 162, 57, 11, 50, 4,
+ 210, 1, 95, 57, 96, 206, 215, 32,
+ 16, 1, 137, 240, 35, 229, 122, 171,
+ 247, 135, 135, 62, 183, 142, 7, 49,
+ 223, 179, 250, 48, 81, 24, 87, 54,
+ 194, 151, 230, 214, 76, 236, 76, 168,
+ 127, 72, 90, 153, 220, 99, 22, 190,
+ 19, 223, 8, 247, 19, 2, 11, 173,
+ 137, 240, 146, 204, 216, 10, 15, 225,
+ 227, 66, 124, 220, 171, 131, 163, 180,
+ 181, 62, 46, 81, 54, 177, 92, 83,
+ 219, 98, 161, 88, 230, 238, 32, 0,
+ 179, 173, 222, 47, 72, 160, 215, 153,
+ 49, 24, 239, 59, 39, 116, 28, 155,
+ 227, 62, 215, 180, 24, 46, 237, 0,
+ 224, 233, 224, 244, 246, 2, 175, 56,
+ 41, 188, 136, 97, 107, 123, 93, 64,
+ 130, 254, 219, 135, 11, 175, 99, 24,
+ 86, 133, 215, 14, 191, 27, 111, 74,
+ 173, 78, 166, 141, 123, 156, 156, 80,
+ 253, 220, 12, 84, 244, 204, 102, 151,
+ 176, 159, 218, 2, 118, 146, 45, 17,
+ 79, 39, 219, 244, 35, 16, 17, 241,
+ 218, 187, 175, 166, 168, 88, 145, 186,
+ 118, 255, 96, 204, 71, 164, 229, 103,
+ 102, 66, 201, 213, 132, 231, 255, 86,
+ 220, 179, 193, 128, 156, 11, 85, 2,
+ 80, 247, 133, 1, 157, 57, 137, 135,
+ 99, 111, 196, 185, 133, 235, 131, 51,
+ 210, 173, 175, 38, 184, 230, 247, 70,
+ 110, 74, 62, 97, 113, 130, 116, 78,
+ 10, 186, 96, 9, 98, 243, 174, 37,
+ 36, 133, 82, 154, 63, 36, 140, 243,
+ 53, 255, 212, 88, 64, 64, 151, 115,
+ 38, 232, 104, 4, 16, 101, 104, 185,
+ 177, 54, 55, 212, 14, 152, 31, 131,
+ 242, 183, 112, 245, 225, 100, 151, 106,
+ 23, 199, 237, 165, 140, 131, 202, 56,
+ 130, 192, 34, 147, 22, 138, 217, 227,
+ 158, 255, 8, 107, 94, 12, 50, 86,
+ 220, 47, 201, 9, 45, 186, 173, 226,
+ 226, 182, 15, 80, 144, 39, 155, 193,
+ 169, 18, 23, 40, 141, 246, 176, 97,
+ 151, 207, 163, 177, 73, 105, 236, 223,
+ 150, 6, 252, 221, 65, 217, 67, 91,
+ 34, 15, 181, 65, 196, 143, 199, 74,
+ 11, 45, 192, 214, 96, 58, 29, 188,
+ 187, 195, 47, 141, 154, 204, 35, 0,
+ 47, 249, 3, 48, 234, 152, 122, 92,
+ 19, 35, 115, 4, 44, 199, 136, 50,
+ 69, 93, 133, 19, 10, 186, 27, 179,
+ 130, 38, 216, 34, 139, 120, 87, 238,
+ 245, 241, 207, 17, 234, 46, 138, 172,
+ 188, 113, 178, 118, 6, 205, 24, 35,
+ 80, 17, 231, 72, 130, 160, 93, 24,
+ 220, 11, 152, 51, 255, 35, 35, 83,
+ 76, 79, 128, 107, 3, 126, 219, 238,
+ 18, 134, 138, 183, 126, 7, 58, 127,
+ 221, 99, 119, 129, 60, 88, 11, 142,
+ 180, 140, 174, 58, 178, 10, 248, 238,
+ 223, 174, 192, 170, 217, 99, 16, 204,
+ 61, 239, 102, 108, 58, 82, 118, 198,
+ 215, 191, 8, 139, 44, 137, 161, 125,
+ 136, 33, 84, 84, 119, 154, 237, 58,
+ 138, 11, 118, 122, 248, 211, 194, 213,
+ 91, 230, 157, 27, 34, 92, 220, 186,
+ 30, 149, 23, 83, 172, 184, 70, 251,
+ 135, 54, 113, 36, 46, 39, 21, 245,
+ 164, 100, 14, 232, 76, 92, 41, 102,
+ 86, 188, 41, 100, 183, 45, 243, 203,
+ 138, 146, 29, 74, 211, 116, 242, 122,
+ 156, 240, 69, 188, 87, 68, 127, 10,
+ 21, 140, 6, 255, 210, 149, 107, 198,
+ 173, 75, 102, 137, 230, 195, 126, 156,
+ 49, 73, 157, 73, 1, 72, 67, 203,
+ 2, 115, 152, 198, 238, 4, 249, 157,
+ 1, 16, 249, 69, 162, 203, 49, 135,
+ 68, 110, 210, 137, 182, 170, 117, 255,
+ 146, 176, 250, 206, 66, 52, 175, 76,
+ 61, 130, 62, 150, 218, 90, 100, 121,
+ 5, 12, 11, 222, 115, 222, 165, 82,
+ 157, 4, 142, 117, 57, 183, 83, 133,
+ 207, 108, 182, 183, 255, 67, 14, 16,
+ 132, 28, 227, 209, 213, 207, 108, 110,
+ 126, 119, 189, 95, 42, 91, 227, 40,
+ 150, 104, 241, 168, 82, 199, 199, 90,
+ 10, 5, 211, 22, 75, 251, 71, 132,
+ 7, 70, 220, 183, 17, 118, 239, 245,
+ 1, 13, 235, 94, 61, 227, 54, 211,
+ 216, 103, 221, 22, 205, 33, 167, 118,
+ 226, 152, 80, 80, 147, 162, 178, 55,
+ 83, 55, 8, 222, 174, 26, 136, 7,
+ 127, 60, 155, 197, 33, 5, 45, 195,
+ 44, 29, 198, 24, 224, 167, 1, 12,
+ 18, 230, 253, 72, 68, 139, 16, 24,
+ 94, 58, 242, 4, 122, 106, 96, 97,
+ 111, 90, 185, 246, 217, 15, 227, 188,
+ 36, 1, 23, 229, 6, 173, 36, 6,
+ 159, 240, 64, 212, 118, 41, 96, 180,
+ 235, 244, 211, 129, 156, 37, 45, 172,
+ 232, 132, 74, 107, 113, 158, 97, 142,
+ 171, 113, 138, 106, 18, 20, 33, 51,
+ 26, 23, 95, 163, 47, 64, 88, 183,
+ 241, 228, 232, 98, 204, 44, 142, 253,
+ 88, 17, 8, 226, 242, 214, 146, 183,
+ 184, 208, 181, 188, 106, 142, 149, 53,
+ 37, 101, 58, 176, 218, 59, 240, 220,
+ 208, 164, 38, 195, 232, 22, 194, 171,
+ 48, 122, 230, 87, 245, 87, 229, 145,
+ 3, 142, 248, 10, 30, 64, 115, 142,
+ 165, 5, 169, 217, 25, 113, 41, 27,
+ 255, 231, 74, 22, 67, 210, 208, 40,
+ 57, 65, 35, 21, 235, 126, 53, 238,
+ 190, 115, 47, 153, 40, 189, 242, 23,
+ 125, 184, 104, 67, 126, 110, 74, 27,
+ 192, 231, 170, 147, 169, 108, 23, 71,
+ 194, 168, 255, 245, 77, 50, 196, 200,
+ 86, 78, 89, 120, 184, 44, 186, 96,
+ 101, 14, 231, 1, 115, 156, 183, 182,
+ 158, 232, 255, 66, 20, 229, 13, 70,
+ 136, 171, 193, 173, 43, 97, 79, 14,
+ 129, 177, 75, 115, 48, 34, 58, 184,
+ 112, 217, 28, 155, 10, 85, 113, 50,
+ 25, 195, 86, 0, 108, 131, 203, 141,
+ 54, 53, 43, 120, 171, 112, 56, 142,
+ 221, 55, 175, 104, 149, 80, 176, 21,
+ 36, 12, 13, 128, 29, 212, 139, 41,
+ 17, 17, 83, 104, 77, 91, 161, 41,
+ 213, 151, 68, 111, 209, 33, 47, 176,
+ 98, 173, 32, 81, 116, 175, 103, 215,
+ 177, 205, 105, 116, 201, 59, 109, 134,
+ 74, 161, 161, 13, 145, 93, 235, 33,
+ 86, 130, 250, 166, 22, 78, 220, 186,
+ 241, 161, 10, 159, 239, 159, 181, 217,
+ 229, 243, 116, 145, 101, 240, 26, 44,
+ 61, 145, 249, 71, 162, 68, 110, 67,
+ 219, 31, 143, 96, 129, 177, 97, 196,
+ 113, 146, 227, 88, 7, 110, 70, 247,
+ 197, 46, 162, 108, 168, 21, 156, 230,
+ 135, 40, 54, 199, 36, 15, 49, 135,
+ 10, 4, 171, 193, 15, 236, 166, 152,
+ 57, 68, 227, 211, 114, 40, 1, 231,
+ 219, 79, 224, 69, 54, 80, 125, 186,
+ 75, 69, 141, 48, 116, 227, 39, 2,
+ 33, 176, 17, 147, 68, 166, 106, 219,
+ 110, 82, 170, 177, 31, 101, 93, 34,
+ 81, 243, 96, 8, 30, 186, 160, 40,
+ 81, 135, 78, 115, 131, 180, 60, 70,
+ 75, 246, 184, 199, 180, 91, 243, 45,
+ 113, 85, 40, 155, 195, 197, 173, 136,
+ 215, 183, 253, 52, 133, 2, 188, 8,
+ 78, 219, 11, 128, 99, 138, 140, 173,
+ 94, 112, 3, 71, 237, 88, 52, 162,
+ 244, 158, 80, 111, 213, 51, 85, 166,
+ 154, 250, 3, 33, 220, 125, 165, 246,
+ 126, 205, 64, 196, 120, 181, 251, 71,
+ 62, 246, 190, 114, 205, 193, 238, 96,
+ 181, 221, 121, 60, 2, 175, 56, 15,
+ 199, 197, 249, 127, 129, 62, 70, 148,
+ 112, 123, 252, 95, 233, 118, 36, 131,
+ 243, 246, 61, 43, 131, 183, 90, 78,
+ 237, 61, 173, 131, 182, 11, 178, 76,
+ 71, 75, 109, 73, 198, 108, 99, 225,
+ 174, 239, 179, 44, 225, 221, 37, 99,
+ 90, 24, 138, 88, 25, 8, 104, 30,
+ 251, 116, 177, 180, 100, 156, 172, 115,
+ 57, 51, 178, 51, 113, 184, 77, 189,
+ 57, 53, 149, 126, 245, 25, 156, 144,
+ 134, 196, 239, 115, 43, 133, 212, 194,
+ 255, 173, 48, 230, 242, 164, 241, 56,
+ 131, 241, 58, 1, 110, 209, 179, 98,
+ 81, 5, 50, 19, 241, 22, 122, 212,
+ 236, 119, 207, 233, 241, 90, 120, 116,
+ 233, 155, 79, 179, 79, 252, 111, 169,
+ 220, 142, 193, 51, 236, 58, 248, 49,
+ 103, 252, 123, 113, 139, 39, 184, 62,
+ 2, 242, 102, 145, 23, 236, 174, 173,
+ 90, 139, 113, 100, 8, 249, 50, 182,
+ 167, 225, 227, 81, 34, 214, 56, 138,
+ 143, 194, 214, 199, 222, 88, 45, 26,
+ 145, 97, 74, 60, 151, 16, 132, 110,
+ 9, 89, 12, 92, 88, 200, 113, 78,
+ 220, 158, 210, 190, 249, 241, 35, 138,
+ 135, 3, 116, 255, 39, 223, 29, 32,
+ 19, 121, 11, 35, 15, 189, 107, 198,
+ 81, 195, 39, 47, 41, 91, 18, 185,
+ 155, 126, 207, 242, 200, 1, 139, 27,
+ 221, 179, 123, 90, 178, 224, 250, 139,
+ 236, 55, 116, 11, 27, 160, 14, 24,
+ 113, 126, 218, 51, 252, 110, 188, 153,
+ 55, 9, 200, 193, 178, 214, 96, 232,
+ 235, 96, 95, 135, 102, 132, 165, 184,
+ 50, 62, 97, 113, 47, 154, 96, 178,
+ 117, 156, 204, 245, 81, 99, 28, 183,
+ 54, 5, 247, 192, 193, 77, 104, 69,
+ 249, 116, 207, 129, 98, 92, 232, 213,
+ 12, 128, 140, 167, 72, 86, 111, 224,
+ 94, 57, 109, 105, 215, 147, 45, 100,
+ 110, 55, 248, 171, 129, 226, 202, 182,
+ 22, 118, 253, 99, 232, 141, 70, 120,
+ 182, 24, 138, 185, 84, 180, 103, 220,
+ 121, 69, 58, 140, 239, 12, 195, 249,
+ 255, 247, 184, 121, 198, 47, 116, 110,
+ 227, 178, 52, 150, 243, 219, 176, 189,
+ 62, 202, 114, 187, 17, 129, 97, 192,
+ 249, 102, 207, 167, 59, 104, 204, 59,
+ 114, 107, 23, 152, 123, 70, 253, 19,
+ 137, 134, 234, 210, 96, 166, 30, 213,
+ 238, 120, 50, 134, 59, 162, 126, 247,
+ 61, 119, 3, 243, 255, 195, 189, 188,
+ 180, 108, 230, 172, 219, 80, 191, 162,
+ 85, 137, 32, 19, 239, 160, 93, 156,
+ 103, 218, 149, 167, 40, 137, 73, 67,
+ 170, 122, 33, 92, 196, 145, 205, 64,
+ 171, 194, 91, 215, 29, 26, 46, 184,
+ 63, 41, 252, 92, 3, 33, 247, 230,
+ 94, 144, 23, 82, 244, 115, 107, 168,
+ 32, 35, 23, 22, 218, 151, 83, 8,
+ 116, 90, 7, 227, 52, 243, 150, 235,
+ 117, 149, 169, 152, 57, 150, 51, 154,
+ 116, 9, 176, 216, 98, 172, 239, 154,
+ 20, 53, 146, 87, 233, 182, 246, 162,
+ 101, 192, 152, 182, 208, 255, 183, 246,
+ 32, 29, 122, 125, 159, 150, 124, 219,
+ 108, 131, 213, 202, 61, 168, 81, 113,
+ 149, 172, 195, 157, 52, 136, 144, 5,
+ 95, 103, 74, 126, 113, 8, 243, 104,
+ 254, 167, 64, 121, 16, 67, 221, 82,
+ 91, 12, 229, 71, 244, 227, 125, 146,
+ 199, 89, 177, 154, 80, 71, 233, 78,
+ 15, 168, 94, 47, 46, 230, 221, 254,
+ 27, 149, 18, 178, 72, 197, 161, 13,
+ 145, 103, 49, 111, 24, 105, 218, 111,
+ 28, 223, 124, 177, 57, 202, 207, 47,
+ 150, 224, 95, 208, 216, 204, 53, 51,
+ 218, 27, 148, 164, 232, 197, 23, 115,
+ 127, 100, 172, 160, 132, 2, 148, 92,
+ 182, 103, 1, 82, 153, 131, 210, 226,
+ 138, 232, 23, 70, 44, 10, 8, 35,
+ 185, 204, 126, 199, 140, 45, 59, 205,
+ 52, 102, 214, 238, 87, 50, 162, 190,
+ 158, 27, 204, 6, 209, 161, 208, 103,
+ 71, 166, 119, 80, 29, 82, 133, 96,
+ 123, 16, 181, 157, 99, 122, 238, 109,
+ 210, 127, 32, 164, 167, 60, 152, 79,
+ 182, 184, 10, 164, 39, 250, 220, 102,
+ 79, 103, 173, 218, 228, 237, 16, 202,
+ 150, 21, 220, 105, 151, 211, 160, 213,
+ 59, 17, 0, 88, 138, 45, 236, 138,
+ 166, 115, 122, 75, 236, 189, 36, 108,
+ 19, 138, 219, 249, 75, 209, 50, 174,
+ 190, 116, 17, 116, 239, 221, 75, 30,
+ 157, 189, 98, 9, 70, 223, 46, 228,
+ 156, 167, 75, 115, 109, 74, 177, 0,
+ 104, 22, 240, 213, 194, 211, 157, 52,
+ 73, 38, 143, 39, 250, 154, 111, 171,
+ 189, 189, 22, 161, 206, 186, 69, 235,
+ 95, 217, 36, 17, 206, 243, 95, 114,
+ 253, 217, 210, 30, 239, 33, 208, 142,
+ 3, 20, 137, 120, 86, 161, 191, 93,
+ 26, 125, 135, 205, 172, 218, 191, 92,
+ 3, 79, 194, 48, 122, 43, 44, 148,
+ 170, 155, 113, 51, 7, 164, 217, 35,
+ 73, 217, 0, 250, 148, 4, 175, 109,
+ 43, 65, 226, 177, 107, 177, 157, 252,
+ 213, 250, 11, 218, 205, 44, 159, 156,
+ 117, 71, 101, 85, 119, 71, 214, 217,
+ 238, 119, 240, 71, 232, 168, 6, 33,
+ 158, 37, 243, 160, 123, 58, 150, 154,
+ 233, 171, 219, 86, 130, 174, 67, 238,
+ 137, 250, 46, 53, 218, 179, 214, 32,
+ 249, 249, 244, 136, 141, 61, 170, 213,
+ 23, 249, 170, 22, 200, 101, 97, 55,
+ 50, 61, 24, 230, 19, 178, 78, 196,
+ 12, 113, 199, 62, 134, 92, 54, 36,
+ 156, 140, 211, 188, 101, 108, 141, 43,
+ 81, 69, 229, 96, 155, 50, 204, 182,
+ 98, 61, 148, 22, 197, 8, 247, 128,
+ 123, 170, 223, 186, 109, 68, 100, 93,
+ 87, 75, 212, 97, 158, 73, 31, 54,
+ 48, 219, 242, 186, 32, 130, 185, 236,
+ 41, 66, 40, 59, 238, 60, 1, 13,
+ 127, 70, 133, 11, 103, 157, 193, 94,
+ 234, 190, 123, 225, 77, 218, 6, 88,
+ 157, 131, 228, 127, 177, 126, 52, 150,
+ 212, 104, 126, 68, 76, 67, 196, 64,
+ 234, 202, 132, 242, 54, 154, 248, 79,
+ 154, 110, 208, 111, 184, 216, 14, 63,
+ 27, 14, 200, 233, 107, 37, 17, 59,
+ 125, 166, 226, 208, 13, 15, 28, 155,
+ 225, 102, 113, 217, 118, 56, 150, 129,
+ 64, 188, 157, 235, 197, 204, 37, 195,
+ 70, 42, 170, 91, 217, 13, 163, 119,
+ 224, 95, 163, 240, 51, 248, 56, 35,
+ 237, 114, 100, 154, 53, 45, 124, 23,
+ 133, 86, 197, 125, 85, 100, 164, 191,
+ 206, 150, 127, 235, 16, 33, 93, 219,
+ 129, 100, 53, 67, 82, 110, 10, 235,
+ 82, 196, 157, 20, 77, 228, 101, 166,
+ 98, 0, 235, 177, 126, 163, 102, 173,
+ 216, 130, 221, 183, 196, 104, 224, 192,
+ 32, 195, 179, 231, 223, 24, 59, 41,
+ 155, 255, 154, 207, 252, 120, 143, 21,
+ 107, 49, 175, 4, 105, 14, 206, 156,
+ 51, 178, 158, 174, 208, 46, 9, 139,
+ 239, 37, 104, 186, 41, 51, 31, 113,
+ 54, 211, 231, 53, 25, 127, 37, 136,
+ 136, 116, 37, 163, 71, 173, 91, 51,
+ 181, 147, 74, 15, 119, 88, 25, 57,
+ 253, 176, 152, 119, 143, 203, 244, 144,
+ 144, 42, 249, 246, 111, 255, 20, 128,
+ 178, 97, 102, 207, 221, 172, 72, 123,
+ 46, 204, 123, 76, 122, 131, 14, 254,
+ 35, 140, 71, 112, 164, 195, 53, 107,
+ 63, 39, 92, 118, 245, 27, 164, 45,
+ 161, 199, 106, 177, 95, 186, 238, 163,
+ 55, 129, 144, 8, 96, 122, 179, 177,
+ 97, 249, 113, 1, 205, 193, 82, 226,
+ 12, 6, 253, 108, 107, 128, 1, 179,
+ 20, 122, 74, 40, 212, 29, 152, 198,
+ 147, 14, 90, 213, 88, 103, 101, 137,
+ 21, 93, 206, 114, 54, 108, 216, 23,
+ 63, 155, 18, 7, 35, 199, 244, 150,
+ 93, 200, 121, 217, 147, 129, 37, 92,
+ 222, 110, 119, 216, 82, 6, 183, 25,
+ 19, 132, 134, 83, 21, 103, 73, 86,
+ 93, 90, 199, 51, 179, 181, 105, 126,
+ 248, 67, 108, 64, 93, 246, 188, 80,
+ 94, 185, 142, 231, 78, 180, 62, 84,
+ 177, 127, 242, 41, 149, 110, 134, 197,
+ 97, 115, 123, 158, 102, 91, 241, 78,
+ 22, 144, 105, 253, 127, 164, 1, 223,
+ 77, 197, 157, 240, 247, 174, 200, 219,
+ 96, 231, 58, 79, 183, 1, 87, 180,
+ 15, 214, 9, 189, 115, 220, 91, 83,
+ 151, 3, 68, 162, 152, 85, 165, 4,
+ 189, 76, 51, 130, 55, 117, 202, 123,
+ 251, 238, 23, 173, 27, 161, 102, 200,
+ 59, 182, 85, 187, 22, 8, 86, 109,
+ 253, 103, 100, 227, 136, 137, 104, 182,
+ 123, 25, 9, 0, 175, 119, 83, 179,
+ 155, 213, 37, 221, 222, 53, 234, 250,
+ 208, 218, 152, 12, 233, 68, 152, 47,
+ 51, 119, 25, 177, 6, 172, 176, 110,
+ 186, 238, 113, 168, 30, 232, 100, 95,
+ 77, 101, 18, 45, 207, 54, 254, 58,
+ 241, 70, 2, 25, 33, 120, 229, 227,
+ 74, 175, 146, 27, 164, 12, 194, 62,
+ 87, 96, 97, 16, 136, 219, 143, 42,
+ 255, 37, 2, 224, 22, 1, 251, 204,
+ 167, 63, 76, 53, 122, 18, 66, 117,
+ 236, 6, 183, 190, 106, 27, 137, 68,
+ 51, 164, 77, 107, 84, 184, 24, 101,
+ 202, 221, 11, 218, 16, 15, 73, 59,
+ 130, 132, 158, 191, 55, 29, 0, 75,
+ 250, 141, 168, 76, 89, 28, 90, 177,
+ 18, 115, 131, 11, 231, 118, 160, 160,
+ 198, 200, 169, 192, 193, 188, 136, 48,
+ 112, 188, 242, 108, 126, 192, 54, 35,
+ 41, 225, 160, 11, 38, 176, 244, 39,
+ 204, 25, 132, 216, 145, 169, 15, 218,
+ 183, 194, 157, 174, 189, 7, 67, 197,
+ 73, 231, 167, 223, 252, 253, 72, 66,
+ 208, 120, 197, 30, 59, 149, 71, 89,
+ 204, 80, 92, 67, 185, 90, 251, 193,
+ 138, 51, 244, 181, 114, 251, 43, 155,
+ 87, 73, 181, 52, 245, 43, 79, 120,
+ 90, 250, 5, 43, 220, 208, 248, 196,
+ 221, 98, 59, 204, 118, 133, 95, 22,
+ 217, 118, 36, 226, 233, 44, 242, 59,
+ 35, 203, 170, 166, 163, 236, 46, 254,
+ 119, 60, 91, 150, 44, 115, 204, 153,
+ 233, 69, 137, 67, 157, 153, 90, 228,
+ 24, 12, 194, 52, 47, 90, 245, 77,
+ 150, 76, 128, 118, 162, 241, 105, 196,
+ 190, 195, 239, 203, 156, 149, 89, 55,
+ 154, 214, 163, 25, 158, 253, 20, 237,
+ 99, 136, 106, 84, 129, 115, 175, 210,
+ 158, 72, 239, 147, 127, 174, 172, 36,
+ 96, 188, 83, 127, 242, 191, 88, 66,
+ 135, 17, 84, 242, 139, 230, 202, 227,
+ 240, 178, 230, 21, 111, 101, 178, 73,
+ 149, 22, 140, 46, 31, 137, 77, 12,
+ 207, 191, 139, 39, 189, 22, 78, 233,
+ 191, 98, 123, 25, 23, 43, 24, 124,
+ 4, 110, 194, 67, 182, 101, 56, 215,
+ 31, 15, 162, 34, 208, 125, 161, 2,
+ 191, 18, 145, 132, 68, 156, 222, 102,
+ 120, 204, 191, 75, 49, 252, 223, 207,
+ 129, 104, 125, 237, 82, 5, 78, 227,
+ 249, 134, 181, 212, 94, 172, 184, 136,
+ 71, 211, 251, 184, 206, 29, 6, 198,
+ 40, 164, 190, 213, 1, 26, 150, 154,
+ 9, 203, 15, 198, 44, 101, 60, 92,
+ 107, 14, 48, 0, 126, 32, 34, 225,
+ 244, 134, 10, 79, 235, 202, 49, 169,
+ 118, 53, 128, 178, 174, 142, 94, 224,
+ 72, 197, 179, 5, 10, 88, 60, 54,
+ 188, 113, 70, 165, 81, 10, 146, 218,
+ 173, 168, 96, 47, 76, 83, 25, 66,
+ 231, 165, 123, 125, 151, 45, 200, 209,
+ 157, 173, 115, 159, 4, 65, 157, 8,
+ 22, 71, 72, 198, 230, 9, 235, 223,
+ 101, 112, 191, 171, 118, 167, 81, 199,
+ 253, 126, 48, 223, 109, 204, 172, 244,
+ 186, 109, 115, 126, 215, 19, 73, 6,
+ 120, 190, 99, 181, 191, 81, 44, 217,
+ 129, 226, 17, 94, 178, 204, 15, 246,
+ 155, 23, 148, 44, 89, 34, 243, 145,
+ 62, 177, 81, 86, 151, 52, 60, 83,
+ 154, 226, 169, 144, 153, 133, 100, 202,
+ 58, 250, 165, 27, 194, 20, 219, 216,
+ 87, 135, 103, 213, 161, 78, 66, 253,
+ 107, 222, 93, 52, 72, 146, 152, 17,
+ 207, 51, 233, 168, 250, 38, 0, 129,
+ 100, 117, 212, 134, 82, 98, 88, 244,
+ 11, 160, 204, 38, 72, 60, 206, 12,
+ 190, 15, 102, 253, 49, 110, 194, 93,
+ 64, 233, 122, 19, 153, 253, 200, 2,
+ 252, 162, 189, 128, 148, 112, 73, 160,
+ 40, 143, 100, 6, 84, 151, 149, 0,
+ 223, 60, 113, 185, 75, 228, 245, 197,
+ 248, 226, 138, 133, 172, 172, 46, 146,
+ 7, 220, 98, 181, 23, 112, 100, 112,
+ 16, 221, 3, 76, 137, 87, 100, 34,
+ 50, 152, 149, 199, 54, 248, 86, 150,
+ 128, 250, 14, 167, 164, 109, 111, 108,
+ 14, 204, 76, 224, 80, 154, 58, 98,
+ 242, 87, 93, 178, 73, 222, 223, 190,
+ 251, 108, 37, 113, 85, 74, 16, 9,
+ 235, 118, 251, 167, 84, 130, 20, 28,
+ 248, 91, 17, 41, 153, 253, 109, 126,
+ 91, 95, 172, 53, 140, 241, 19, 69,
+ 222, 116, 60, 114, 107, 193, 87, 215,
+ 210, 224, 135, 44, 153, 9, 117, 132,
+ 80, 156, 125, 206, 104, 162, 5, 247,
+ 79, 172, 95, 169, 136, 103, 38, 33,
+ 141, 178, 36, 121, 196, 212, 221, 200,
+ 62, 58, 226, 54, 185, 205, 233, 226,
+ 61, 78, 119, 17, 14, 124, 250, 85,
+ 181, 97, 150, 35, 20, 40, 110, 76,
+ 193, 253, 111, 219, 156, 244, 204, 158,
+ 127, 6, 51, 204, 213, 75, 207, 31,
+ 188, 57, 8, 112, 19, 24, 16, 95,
+ 12, 107, 21, 157, 4, 42, 75, 217,
+ 140, 176, 41, 238, 194, 159, 104, 167,
+ 226, 197, 252, 181, 130, 108, 79, 141,
+ 219, 83, 101, 115, 239, 234, 63, 245,
+ 86, 237, 17, 38, 78, 188, 9, 202,
+ 200, 56, 19, 176, 165, 114, 17, 144,
+ 150, 201, 150, 108, 183, 134, 166, 98,
+ 156, 164, 20, 39, 64, 80, 176, 189,
+ 40, 62, 219, 223, 10, 86, 47, 188,
+ 108, 150, 132, 70, 230, 79, 247, 218,
+ 159, 155, 80, 211, 64, 143, 28, 248,
+ 76, 177, 37, 20, 254, 62, 52, 138,
+ 120, 137, 176, 254, 187, 197, 144, 88,
+ 144, 164, 84, 250, 108, 125, 13, 164,
+ 110, 5, 113, 40, 175, 85, 183, 84,
+ 248, 12, 52, 116, 197, 118, 51, 92,
+ 154, 117, 85, 95, 181, 229, 161, 14,
+ 164, 41, 112, 87, 167, 158, 120, 23,
+ 179, 3, 214, 22, 166, 194, 187, 7,
+ 184, 221, 242, 241, 48, 100, 239, 103,
+ 241, 161, 160, 91, 33, 177, 10, 154,
+ 63, 148, 142, 250, 120, 133, 42, 153,
+ 158, 15, 56, 231, 60, 244, 72, 64,
+ 77, 129, 246, 188, 51, 102, 195, 93,
+ 211, 40, 136, 62, 35, 197, 212, 120,
+ 162, 18, 105, 17, 175, 40, 64, 243,
+ 246, 205, 228, 138, 77, 8, 16, 200,
+ 166, 153, 138, 187, 31, 14, 117, 103,
+ 8, 168, 4, 37, 215, 225, 124, 187,
+ 79, 222, 216, 80, 214, 1, 154, 57,
+ 72, 128, 103, 164, 152, 224, 32, 110,
+ 239, 230, 163, 214, 60, 255, 93, 48,
+ 89, 225, 31, 67, 9, 221, 86, 248,
+ 10, 116, 133, 53, 93, 158, 145, 136,
+ 86, 58, 197, 19, 28, 44, 245, 156,
+ 53, 192, 123, 154, 168, 30, 133, 142,
+ 54, 59, 97, 56, 26, 151, 83, 162,
+ 128, 89, 170, 128, 130, 28, 86, 158,
+ 31, 135, 43, 195, 164, 197, 51, 35,
+ 9, 173, 131, 192, 192, 29, 78, 167,
+ 137, 169, 236, 246, 211, 41, 33, 44,
+ 161, 39, 93, 187, 89, 234, 115, 201,
+ 3, 201, 221, 249, 37, 26, 182, 236,
+ 172, 39, 194, 107, 137, 15, 157, 211,
+ 15, 112, 169, 196, 91, 174, 81, 210,
+ 44, 214, 87, 217, 246, 76, 235, 11,
+ 146, 190, 130, 38, 235, 31, 66, 76,
+ 249, 125, 61, 254, 27, 106, 18, 155,
+ 68, 49, 39, 251, 36, 70, 115, 20,
+ 60, 153, 85, 174, 153, 12, 213, 217,
+ 162, 127, 121, 158, 185, 112, 92, 9,
+ 49, 243, 94, 232, 247, 148, 104, 120,
+ 233, 146, 87, 178, 97, 179, 134, 178,
+ 136, 224, 185, 176, 253, 232, 243, 134,
+ 68, 198, 237, 217, 248, 59, 135, 129,
+ 255, 61, 59, 87, 193, 211, 111, 180,
+ 230, 14, 9, 45, 116, 231, 252, 56,
+ 210, 39, 214, 111, 123, 80, 41, 204,
+ 76, 197, 100, 30, 142, 235, 244, 37,
+ 25, 120, 96, 88, 237, 85, 206, 183,
+ 74, 161, 84, 182, 105, 239, 161, 42,
+ 10, 196, 117, 114, 91, 79, 214, 26,
+ 225, 206, 167, 160, 219, 99, 228, 227,
+ 32, 92, 179, 116, 72, 184, 109, 83,
+ 97, 106, 152, 12, 243, 240, 41, 251,
+ 35, 249, 105, 228, 53, 94, 43, 119,
+ 61, 162, 192, 78, 58, 46, 84, 110,
+#endif
+};
+
+int
+main()
+{
+ long size = sizeof (random_data) / sizeof (random_data[0]);
+ printf ("%d\n", random_data [size - 1]);
+}
diff --git a/gdb/testsuite/gdb.base/remote.exp b/gdb/testsuite/gdb.base/remote.exp
new file mode 100644
index 00000000000..e2967c60b58
--- /dev/null
+++ b/gdb/testsuite/gdb.base/remote.exp
@@ -0,0 +1,195 @@
+# Copyright 1999, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+
+# test only on a remote target board
+if {! [is_remote target]} {
+ return
+}
+
+set testfile "remote"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+gdb_start
+
+set result [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}]
+if {$result != "" } then {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+#
+# Part ONE: Check the down load commands
+#
+
+gdb_test "show download-write-size" \
+ "The write size used when downloading a program is 512." \
+ "download limit default"
+
+gdb_test "set download-write-size" "Argument required.*"
+
+gdb_test "set download-write-size 0" ""
+gdb_test "show download-write-size" \
+ "The write size used when downloading a program is unlimited." \
+ "set download limit - unlimited"
+
+gdb_test "show remote memory-write-packet-size" \
+ "The memory-write-packet-size is 0. Packets are limited to \[0-9\]+ bytes." \
+ "write-packet default"
+
+gdb_test "set remote memory-write-packet-size" \
+ "Argument required .integer, `fixed' or `limited'.\." \
+ "set write-packet - NULL"
+
+gdb_test "set remote memory-write-packet-size 16" ""
+gdb_test "show remote memory-write-packet-size" \
+ "The memory-write-packet-size is 16. Packets are limited to 16 bytes." \
+ "set write-packet - small"
+
+gdb_test "set remote memory-write-packet-size 1" ""
+gdb_test "show remote memory-write-packet-size" \
+ "The memory-write-packet-size is 1. Packets are limited to 16 bytes." \
+ "set write-packet - very-small"
+
+#
+# Part TWO: Check the download behavour
+#
+
+proc gdb_load_timed {executable downloadsize class writesize} {
+ global test gdb_prompt
+ set test "timed download `[file tail $executable]' - $downloadsize, $class, $writesize"
+
+ if {$writesize != ""} then {
+ gdb_test "set remote memory-write-packet-size $writesize" \
+ "" "$test - set packet size"
+ }
+
+ if {$downloadsize != ""} then {
+ gdb_test "set download-write-size $downloadsize" \
+ "" "$test - set download size"
+ }
+
+ if {$downloadsize != ""} then {
+ send_gdb "set remote memory-write-packet-size $class\n"
+ gdb_expect 5 {
+ -re ".*Change the packet size.*$" {
+ send_gdb "y\n"
+ gdb_expect 5 {
+ -re ".*$gdb_prompt $" {
+ pass "$test - set write size class"
+ }
+ timeout {
+ fail "$test - set write size class"
+ return
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" { }
+ timeout {
+ fail "$test - set write size class"
+ return
+ }
+ }
+ }
+
+ set load_begin_time [clock clicks]
+ set result [gdb_load $executable]
+ set load_end_time [clock clicks]
+ if {$result < 0} then { fail "$test - loading executable"; return }
+ verbose "$test - time [expr ($load_end_time - $load_begin_time) / 1000] ms"
+ pass $test
+}
+
+gdb_load_timed $binfile {} "" {}
+
+# Typically about 400-1 bytes can be downloaded
+gdb_load_timed $binfile 0 "limit" 398
+gdb_load_timed $binfile 0 "limit" 400
+
+# Absolute max is 16384
+gdb_load_timed $binfile 0 "fixed" 0
+gdb_load_timed $binfile 0 "fixed" 16385
+
+# fall back to the default
+gdb_load_timed $binfile 0 "limit" 0
+
+# Get size of data uploaded
+
+#
+# Query GDB for the size of various types
+#
+
+proc get_sizeof { type default } {
+ global gdb_prompt
+ send_gdb "print/d sizeof (${type})\n"
+ gdb_expect {
+ -re "\\$\[0-9\]* = (\[0-9\]*).*$gdb_prompt $" {
+ set size $expect_out(1,string)
+ pass "get sizeof ${type} ($size)"
+ }
+ timeout {
+ set size ${default}
+ fail "get sizeof ${type} (timeout)"
+ }
+ }
+ return ${size}
+}
+
+# Get the size of random_data table (defaults to 48K).
+set sizeof_random_data [get_sizeof "random_data" 48*1024]
+
+#
+# Part THREE: Check the upload behavour
+#
+if ![runto_main] then {
+ fail "Cannot run to main"
+}
+
+# Carefully check memory around each of the most common packet edge
+# conditions
+
+gdb_test "x/8ub random_data" \
+ "<random_data>:\[ \t\]+60\[ \t\]+74\[ \t\]+216\[ \t\]+38\[ \t\]+149\[ \t\]+49\[ \t\]+207\[ \t\]+44"
+
+gdb_test "x/8ub random_data + 400 - 4" \
+ "<random_data\\+396>:\[ \t\]+185\[ \t\]+255\[ \t\]+50\[ \t\]+140\[ \t\]+237\[ \t\]+172\[ \t\]+143\[ \t\]+93"
+
+if {$sizeof_random_data > 16380 } then {
+ gdb_test "x/8ub random_data + 16384 - 4" \
+ "<random_data\\+16380>:\[ \t\]+178\[ \t\]+180\[ \t\]+135\[ \t\]+93\[ \t\]+70\[ \t\]+62\[ \t\]+205\[ \t\]+76"
+}
+
+# Read a chunk just larger than the packet size (reduce the packet
+# size to make life easier)
+gdb_test "set remote memory-read-packet-size 16" \
+ ""
+gdb_test "show remote memory-read-packet-size" \
+ "The memory-read-packet-size is 16. Packets are limited to 16 bytes."
+gdb_test "x/17ub random_data" \
+ "<random_data>:\[ \t\]+60\[ \t\]+74\[ \t\]+216\[ \t\]+38\[ \t\]+149\[ \t\]+49\[ \t\]+207\[ \t\]+44.*<random_data\\+8>:\[ \t\]+124\[ \t\]+38\[ \t\]+93\[ \t\]+125\[ \t\]+232\[ \t\]+67\[ \t\]+228\[ \t\]+56.*<random_data\\+16>:\[ \t\]+161"
+
+gdb_exit
diff --git a/gdb/testsuite/gdb.base/reread.exp b/gdb/testsuite/gdb.base/reread.exp
new file mode 100644
index 00000000000..5e17e11df7b
--- /dev/null
+++ b/gdb/testsuite/gdb.base/reread.exp
@@ -0,0 +1,189 @@
+# Copyright 1998, 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set prototypes 1
+
+# build the first test case
+
+set testfile1 "reread1"
+set srcfile1 ${testfile1}.c
+# Cygwin needs $EXEEXT.
+set binfile1 ${objdir}/${subdir}/${testfile1}$EXEEXT
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile1}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# build the second test case
+
+set testfile2 "reread2"
+set srcfile2 ${testfile2}.c
+set binfile2 ${objdir}/${subdir}/${testfile2}$EXEEXT
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Start with a fresh gdb.
+
+set testfile "reread"
+set binfile ${objdir}/${subdir}/${testfile}$EXEEXT
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+set prms_id 13484
+set bug_id 0
+
+# Load the first executable.
+
+gdb_test "shell mv ${binfile1} ${binfile}" "" ""
+gdb_load ${binfile}
+
+# Set a breakpoint at foo
+
+gdb_test "break foo" \
+ "Breakpoint.*at.* file .*$srcfile1, line 14.*" \
+ "breakpoint foo in first file"
+
+
+# Run, should see "Breakpoint 1, foo () at hello1.c:14"
+
+gdb_run_cmd
+
+gdb_expect {
+ -re ".*Breakpoint.* foo .* at .*$srcfile1:14.*$gdb_prompt $" {
+ pass "run to foo()";
+ }
+ -re ".*$gdb_prompt $" {
+ fail "run to foo()";
+ gdb_suppress_tests;
+ }
+ timeout { fail "run to foo() (timeout)" ; gdb_suppress_tests }
+}
+
+# Restore first executable to its original name, and move
+# second executable into its place. Ensure that the new
+# executable is at least a second newer than the old.
+
+gdb_test "shell mv ${binfile} ${binfile1}" "" ""
+gdb_test "shell mv ${binfile2} ${binfile}" "" ""
+gdb_test "shell sleep 1" "" ""
+gdb_test "shell touch ${binfile}" "" ""
+
+# Run a second time; GDB should detect that the executable has changed
+# and reset the breakpoints correctly.
+# Should see "Breakpoint 1, foo () at reread2.c:9"
+
+set prms_id 0
+
+if [is_remote target] {
+ unsupported "run to foo() second time ";
+} else {
+ gdb_run_cmd
+ gdb_expect {
+ # -re ".*re-reading symbols.*Breakpoint.* foo .* at .*$srcfile2:9.*$gdb_prompt $" {}
+ -re ".*Breakpoint.* foo .* at .*:9.*$gdb_prompt $" {
+ pass "run to foo() second time ";
+ }
+ -re ".*$gdb_prompt $" {
+ fail "run to foo() second time";
+ gdb_suppress_tests;
+ }
+ timeout {
+ fail "run to foo() second time (timeout)" ;
+ gdb_suppress_tests
+ }
+ }
+}
+
+
+### Second pass: verify that GDB checks the executable file's
+### timestamp when the program is *restarted*, not just when it exits.
+
+if [is_remote target] {
+ unsupported "second pass: GDB should check for changes before running"
+} else {
+
+ # Put the older executable back in place.
+ gdb_test "shell mv ${binfile} ${binfile2}" "" ""
+ gdb_test "shell mv ${binfile1} ${binfile}" "" ""
+
+ # Restart GDB entirely.
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+
+ # Set a breakpoint on foo and run to it.
+ gdb_test "break foo" \
+ "Breakpoint.*at.* file .*$srcfile1, line 14.*" \
+ "second pass: breakpoint foo in first file"
+ gdb_run_cmd
+ gdb_expect {
+ -re ".*Breakpoint.* foo .* at .*$srcfile1:14.*$gdb_prompt $" {
+ pass "second pass: run to foo()";
+ }
+ -re ".*$gdb_prompt $" {
+ fail "second pass: run to foo()";
+ gdb_suppress_tests;
+ }
+ timeout {
+ fail "second pass: run to foo() (timeout)"
+ gdb_suppress_tests
+ }
+ }
+
+ # This time, let the program run to completion. If GDB checks the
+ # executable file's timestamp now, it won't notice any change.
+ gdb_test "continue" ".*Program exited.*" \
+ "second pass: continue to completion"
+
+ # Now move the newer executable into place, and re-run. GDB
+ # should still notice that the executable file has changed,
+ # and still re-set the breakpoint appropriately.
+ gdb_test "shell mv ${binfile} ${binfile1}" "" ""
+ gdb_test "shell mv ${binfile2} ${binfile}" "" ""
+ gdb_run_cmd
+ gdb_expect {
+ -re ".*Breakpoint.* foo .* at .*:9.*$gdb_prompt $" {
+ pass "second pass: run to foo() second time ";
+ }
+ -re ".*$gdb_prompt $" {
+ fail "second pass: run to foo() second time";
+ gdb_suppress_tests;
+ }
+ timeout {
+ fail "second pass: run to foo() second time (timeout)" ;
+ gdb_suppress_tests
+ }
+ }
+}
+
+# End of tests.
+
+gdb_stop_suppressing_tests
+
+return 0
diff --git a/gdb/testsuite/gdb.base/reread1.c b/gdb/testsuite/gdb.base/reread1.c
new file mode 100644
index 00000000000..ae9801047d4
--- /dev/null
+++ b/gdb/testsuite/gdb.base/reread1.c
@@ -0,0 +1,26 @@
+/* pr 13484 */
+
+#include <stdio.h>
+
+int x;
+
+void bar()
+{
+ x--;
+}
+
+void foo()
+{
+ x++;
+}
+
+int main()
+{
+#ifdef usestubs
+ set_debug_traps ();
+ breakpoint ();
+#endif
+ foo();
+ bar();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/reread2.c b/gdb/testsuite/gdb.base/reread2.c
new file mode 100644
index 00000000000..fd9f7b7ad64
--- /dev/null
+++ b/gdb/testsuite/gdb.base/reread2.c
@@ -0,0 +1,21 @@
+/* pr 13484 */
+
+#include <stdio.h>
+
+int x;
+
+void foo()
+{
+ x++;
+ printf("This is foo\n");
+}
+
+int main()
+{
+#ifdef usestubs
+ set_debug_traps ();
+ breakpoint ();
+#endif
+ foo();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/restore.c b/gdb/testsuite/gdb.base/restore.c
new file mode 100644
index 00000000000..e05d68c2145
--- /dev/null
+++ b/gdb/testsuite/gdb.base/restore.c
@@ -0,0 +1,260 @@
+/* Test GDB's ability to restore saved registers from stack frames
+ when using the `return' command.
+ Jim Blandy <jimb@cygnus.com> --- December 1998 */
+
+#include <stdio.h>
+
+/* This is the Emacs Lisp expression I used to generate the functions
+ in this file. If people modify the functions manually, instead of
+ changing this expression and re-running it, then evaluating this
+ expression could wipe out their work, so you probably shouldn't
+ re-run it. But I leave it here for reference.
+
+ (defun callee (n) (format "callee%d" n))
+ (defun caller (n) (format "caller%d" n))
+ (defun local (n) (format "l%d" n))
+ (defun local-sum (n)
+ (if (zerop n) (insert "0")
+ (let ((j 1))
+ (while (<= j n)
+ (insert (local j))
+ (if (< j n) (insert "+"))
+ (setq j (1+ j))))))
+ (defun local-chain (n previous first-end)
+ (let ((j 1))
+ (while (<= j n)
+ (insert " register int " (local j)
+ " = increment (" previous ");")
+ (if first-end
+ (progn
+ (insert " /" "* " first-end " *" "/")
+ (setq first-end nil)))
+ (insert "\n")
+ (setq previous (local j))
+ (setq j (1+ j))))
+ previous)
+
+ (save-excursion
+ (let ((limit 5))
+ (goto-char (point-max))
+ (search-backward "generated code starts here")
+ (forward-line 1)
+ (let ((start (point)))
+ (search-forward "generated code ends here")
+ (forward-line 0)
+ (delete-region start (point)))
+
+ ;; Generate callee functions.
+ (let ((i 0))
+ (while (<= i limit)
+ (insert (format "/%s Returns n * %d + %d %s/\n"
+ "*" i (/ (+ i (* i i)) 2) "*"))
+ (insert "int\n")
+ (insert (callee i) " (int n)\n")
+ (insert "{\n")
+ (local-chain i "n" (callee i))
+ (insert " return ")
+ (local-sum i)
+ (insert ";\n")
+ (insert "}\n\n")
+ (setq i (1+ i))))
+
+ ;; Generate caller functions.
+ (let ((i 1))
+ (while (<= i limit)
+ (insert "int\n")
+ (insert (caller i) " (void)\n")
+ (insert "{\n")
+ (let ((last (local-chain i "0x7eeb" (caller i))))
+ (insert " register int n;\n")
+ (let ((j 0))
+ (while (<= j limit)
+ (insert " n = " (callee j) " ("
+ (if (> j 0) "n + " "")
+ last ");\n")
+ (setq j (1+ j)))))
+ (insert " return n+")
+ (local-sum i)
+ (insert ";\n")
+ (insert "}\n\n")
+ (setq i (1+ i))))
+
+ ;; Generate driver function.
+ (insert "void\n")
+ (insert "driver (void)\n")
+ (insert "{\n")
+ (let ((i 1))
+ (while (<= i limit)
+ (insert " printf (\"" (caller i) " () => %d\\n\", "
+ (caller i) " ());\n")
+ (setq i (1+ i))))
+ (insert "}\n\n")))
+
+ */
+
+int
+increment (int n)
+{
+ return n + 1;
+}
+
+/* generated code starts here */
+/* Returns n * 0 + 0 */
+int
+callee0 (int n)
+{
+ return 0;
+}
+
+/* Returns n * 1 + 1 */
+int
+callee1 (int n)
+{
+ register int l1 = increment (n); /* callee1 */
+ return l1;
+}
+
+/* Returns n * 2 + 3 */
+int
+callee2 (int n)
+{
+ register int l1 = increment (n); /* callee2 */
+ register int l2 = increment (l1);
+ return l1+l2;
+}
+
+/* Returns n * 3 + 6 */
+int
+callee3 (int n)
+{
+ register int l1 = increment (n); /* callee3 */
+ register int l2 = increment (l1);
+ register int l3 = increment (l2);
+ return l1+l2+l3;
+}
+
+/* Returns n * 4 + 10 */
+int
+callee4 (int n)
+{
+ register int l1 = increment (n); /* callee4 */
+ register int l2 = increment (l1);
+ register int l3 = increment (l2);
+ register int l4 = increment (l3);
+ return l1+l2+l3+l4;
+}
+
+/* Returns n * 5 + 15 */
+int
+callee5 (int n)
+{
+ register int l1 = increment (n); /* callee5 */
+ register int l2 = increment (l1);
+ register int l3 = increment (l2);
+ register int l4 = increment (l3);
+ register int l5 = increment (l4);
+ return l1+l2+l3+l4+l5;
+}
+
+int
+caller1 (void)
+{
+ register int l1 = increment (0x7eeb); /* caller1 */
+ register int n;
+ n = callee0 (l1);
+ n = callee1 (n + l1);
+ n = callee2 (n + l1);
+ n = callee3 (n + l1);
+ n = callee4 (n + l1);
+ n = callee5 (n + l1);
+ return n+l1;
+}
+
+int
+caller2 (void)
+{
+ register int l1 = increment (0x7eeb); /* caller2 */
+ register int l2 = increment (l1);
+ register int n;
+ n = callee0 (l2);
+ n = callee1 (n + l2);
+ n = callee2 (n + l2);
+ n = callee3 (n + l2);
+ n = callee4 (n + l2);
+ n = callee5 (n + l2);
+ return n+l1+l2;
+}
+
+int
+caller3 (void)
+{
+ register int l1 = increment (0x7eeb); /* caller3 */
+ register int l2 = increment (l1);
+ register int l3 = increment (l2);
+ register int n;
+ n = callee0 (l3);
+ n = callee1 (n + l3);
+ n = callee2 (n + l3);
+ n = callee3 (n + l3);
+ n = callee4 (n + l3);
+ n = callee5 (n + l3);
+ return n+l1+l2+l3;
+}
+
+int
+caller4 (void)
+{
+ register int l1 = increment (0x7eeb); /* caller4 */
+ register int l2 = increment (l1);
+ register int l3 = increment (l2);
+ register int l4 = increment (l3);
+ register int n;
+ n = callee0 (l4);
+ n = callee1 (n + l4);
+ n = callee2 (n + l4);
+ n = callee3 (n + l4);
+ n = callee4 (n + l4);
+ n = callee5 (n + l4);
+ return n+l1+l2+l3+l4;
+}
+
+int
+caller5 (void)
+{
+ register int l1 = increment (0x7eeb); /* caller5 */
+ register int l2 = increment (l1);
+ register int l3 = increment (l2);
+ register int l4 = increment (l3);
+ register int l5 = increment (l4);
+ register int n;
+ n = callee0 (l5);
+ n = callee1 (n + l5);
+ n = callee2 (n + l5);
+ n = callee3 (n + l5);
+ n = callee4 (n + l5);
+ n = callee5 (n + l5);
+ return n+l1+l2+l3+l4+l5;
+}
+
+void
+driver (void)
+{
+ printf ("caller1 () => %d\n", caller1 ());
+ printf ("caller2 () => %d\n", caller2 ());
+ printf ("caller3 () => %d\n", caller3 ());
+ printf ("caller4 () => %d\n", caller4 ());
+ printf ("caller5 () => %d\n", caller5 ());
+}
+
+/* generated code ends here */
+
+int main ()
+{
+ register int local;
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ driver ();
+ printf("exiting\n");
+}
diff --git a/gdb/testsuite/gdb.base/restore.exp b/gdb/testsuite/gdb.base/restore.exp
new file mode 100644
index 00000000000..4c7a33a37c9
--- /dev/null
+++ b/gdb/testsuite/gdb.base/restore.exp
@@ -0,0 +1,113 @@
+# Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test GDB's ability to restore saved registers from stack frames
+# when using the `return' command.
+#
+# This file was written by Jim Blandy <jimb@cygnus.com>, with
+# fragments borrowed from return.exp.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "restore"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc restore_tests { } {
+ global gdb_prompt
+
+ if { ! [ runto driver ] } then { return 0 }
+
+ set limit 5
+
+ # For each caller function,
+ # call each of the callee functions,
+ # force a return from the callee, and
+ # make sure that the local variables still have the right values.
+ for {set c 1} {$c <= $limit} {incr c} {
+
+ # Set a breakpoint at the next caller function.
+ gdb_test "tbreak caller$c" "Breakpoint.*\[0-9\]*\\." "tbreak caller$c"
+
+ # Continue to the next caller function.
+ gdb_test "continue" ".*/\\* caller$c \\*/" "run to caller$c"
+
+ # Do each callee function.
+ for {set e 1} {$e <= $limit} {incr e} {
+
+ gdb_test "tbreak callee$e" "Breakpoint.*\[0-9\]*\\." \
+ "tbreak callee$e"
+
+ gdb_test "continue" ".*/\\* callee$e \\*/" "run to callee$e"
+
+ # Do a forced return from the callee.
+ send_gdb "return 0\n"
+ gdb_expect {
+ -re "Make .* return now.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "$gdb_prompt $" { }
+ }
+
+ # Check that the values of the local variables are what
+ # they should be.
+ for {set var 1} {$var <= $c} {incr var} {
+ set expected [expr 0x7eeb + $var]
+ gdb_test "print l$var" " = $expected" \
+ "caller$c called callee$e; variable l$var restored to $expected"
+ }
+ }
+ }
+
+ if ![gdb_skip_stdio_test "run to completion"] {
+ send_gdb "continue\n"
+
+ gdb_expect {
+ -re "exiting" {
+ pass "run to completion"
+ }
+ timeout {
+ fail "(timeout) run to completion"
+ }
+ }
+ } else {
+ gdb_test "continue" "" ""
+ }
+}
+
+
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set timeout 30
+restore_tests
diff --git a/gdb/testsuite/gdb.base/return.c b/gdb/testsuite/gdb.base/return.c
new file mode 100644
index 00000000000..d11a4b57e09
--- /dev/null
+++ b/gdb/testsuite/gdb.base/return.c
@@ -0,0 +1,36 @@
+#include <stdio.h>
+/* Test "return" command. */
+
+void func1 ()
+{
+ printf("in func1\n");
+}
+
+int
+func2 ()
+{
+ return -5;
+}
+
+double
+func3 ()
+{
+ return -5.0;
+}
+
+int tmp2;
+double tmp3;
+
+int main ()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ func1 ();
+ printf("in main after func1\n");
+ tmp2 = func2 ();
+ tmp3 = func3 ();
+ printf("exiting\n");
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/return.exp b/gdb/testsuite/gdb.base/return.exp
new file mode 100644
index 00000000000..e7a536bdac6
--- /dev/null
+++ b/gdb/testsuite/gdb.base/return.exp
@@ -0,0 +1,129 @@
+# Copyright (C) 1992, 1997, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Jeff Law. (law@cs.utah.edu)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "return"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc return_tests { } {
+ global gdb_prompt
+
+
+ if { ! [ runto func1 ] } then { return 0 }
+ send_gdb "return\n"
+ gdb_expect {
+ -re "Make .* return now.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "func1 ..;.*$gdb_prompt $" {
+ send_gdb "step\n"
+ exp_continue
+ }
+ -re ".*in main after func1.*$gdb_prompt $" { pass "simple return" }
+ -re "$gdb_prompt $" { fail "simple return" }
+ timeout { fail "(timeout) simple return" }
+ }
+
+ # Set breakpoints in other interesting functions.
+ gdb_test "break func2" "" "break func2"
+ gdb_test "break func3" "" "break func3"
+
+ gdb_test "continue" "return -5;" "continue to return of -5"
+ send_gdb "return 5\n"
+ gdb_expect {
+ -re "Make .* return now.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re ".*tmp2 = func2.*$gdb_prompt $" { }
+ -re "$gdb_prompt $" { fail "did not return (integer test)" }
+ timeout { fail "(timeout) did not return (integer test)" }
+ }
+ gdb_test "next" "tmp3 = func3.*" "next over call to func2"
+
+ gdb_test "p tmp2" ".* = 5" "correct value returned (integer test)"
+
+ gdb_test "continue" "return -5.0;" "continue to return of -5.0"
+
+ # Return of a double does not work for 68hc11 (need struct return
+ # in memory).
+ setup_xfail "m6811-*-*"
+ send_gdb "return 5.0\n"
+ gdb_expect {
+ -re "Make .* return now.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re ".*tmp3 = func3.*$gdb_prompt $" { }
+ -re "$gdb_prompt $" { fail "did not return (double test)" }
+ timeout { fail "(timeout) did not return (double test)" }
+ }
+
+ setup_xfail "m6811-*-*"
+ gdb_test "next" "printf.*" "next over call to func3"
+
+ # This test is going to fail on all i*86 systems using an i*87.
+ # When returning a floating point value from a function, all known
+ # compilers do this via a `fldl' instruction, which pushes the floating
+ # value on the i387 stack. This causes two problems:
+ # a) Most i*86 targets do not store (or cannot store, see comment in
+ # in i386v-nat.c:i386_register_u_addr) the floating point registers
+ # to the target.
+ # b) gdb would have to figure out if the `fldl' instruction (or variants
+ # of it) has already been executed. If not, it would have to simulate
+ # a push instruction, as it is not enough to write the register,
+ # the floating point `stack pointer' has to be updated too.
+ # Do not expect this to get fixed anytime soon.
+
+ # This test also fails for sparc Solaris 2.3 & 2.4, but passes under 2.5
+ # At the time the `next' is issued, the floating point unit for the
+ # process is not yet initialized, and the storing of the floating
+ # point value to the floating point return register is ignored.
+ # Xfail it for current versions that are known to fail. Presumably
+ # if some future version does initialize the floating point unit at
+ # process start, making this test pass, it will be for a version that
+ # is not xfailed.
+
+ setup_xfail "i*86-*-*" "sparc-*-solaris2.3*" "sparc-*-solaris2.4*" "m6811-*-*"
+ gdb_test "p tmp3" ".* = 5.*" "correct value returned double test (known problem with i*86 and sparc solaris"
+}
+
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set timeout 30
+return_tests
diff --git a/gdb/testsuite/gdb.base/return2.c b/gdb/testsuite/gdb.base/return2.c
new file mode 100644
index 00000000000..58d85eca113
--- /dev/null
+++ b/gdb/testsuite/gdb.base/return2.c
@@ -0,0 +1,110 @@
+/* Test gdb's "return" command. */
+
+int void_test = 0;
+int main_test = 0;
+
+char char_returnval = '1';
+short short_returnval = 1;
+int int_returnval = 1;
+long long_returnval = 1;
+long long long_long_returnval = 1;
+float float_returnval = 1;
+double double_returnval = 1;
+
+union {
+ char char_testval;
+ short short_testval;
+ int int_testval;
+ long long_testval;
+ long long long_long_testval;
+ float float_testval;
+ double double_testval;
+ char ffff[80];
+} testval;
+
+void void_func ()
+{
+ void_test = 1;
+}
+
+char char_func ()
+{
+ return char_returnval;
+}
+
+short short_func ()
+{
+ return short_returnval;
+}
+
+int int_func ()
+{
+ return int_returnval;
+}
+
+long long_func ()
+{
+ return long_returnval;
+}
+
+long long long_long_func ()
+{
+ return long_long_returnval;
+}
+
+float float_func ()
+{
+ return float_returnval;
+}
+
+double double_func ()
+{
+ return double_returnval;
+}
+
+int main (int argc, char **argv)
+{
+ char char_resultval;
+ short short_resultval;
+ int int_resultval;
+ long long_resultval;
+ long long long_long_resultval;
+ float float_resultval;
+ double double_resultval;
+ int i;
+
+ /* A "test load" that will insure that the function really returns
+ a ${type} (as opposed to just a truncated or part of a ${type}). */
+ for (i = 0; i < sizeof (testval.ffff); i++)
+ testval.ffff[i] = 0xff;
+
+ void_func (); /* call to void_func */
+ char_resultval = char_func (); /* void_checkpoint */
+ short_resultval = short_func (); /* char_checkpoint */
+ int_resultval = int_func (); /* short_checkpoint */
+ long_resultval = long_func (); /* int_checkpoint */
+ long_long_resultval = long_long_func (); /* long_checkpoint */
+
+ /* On machines using IEEE floating point, the test pattern of all
+ 1-bits established above turns out to be a floating-point NaN
+ ("Not a Number"). According to the IEEE rules, NaN's aren't even
+ equal to themselves. This can lead to stupid conversations with
+ GDB like:
+
+ (gdb) p testval.float_testval == testval.float_testval
+ $7 = 0
+ (gdb)
+
+ This is the correct answer, but it's not the sort of thing
+ return2.exp wants to see. So to make things work the way they
+ ought, we'll set aside the `union' cleverness and initialize the
+ test values explicitly here. These values have interesting bits
+ throughout the value, so we'll still detect truncated values. */
+
+ testval.float_testval = 2.7182818284590452354;/* long_long_checkpoint */
+ float_resultval = float_func ();
+ testval.double_testval = 3.14159265358979323846; /* float_checkpoint */
+ double_resultval = double_func ();
+ main_test = 1; /* double_checkpoint */
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/return2.exp b/gdb/testsuite/gdb.base/return2.exp
new file mode 100644
index 00000000000..d10faf001fb
--- /dev/null
+++ b/gdb/testsuite/gdb.base/return2.exp
@@ -0,0 +1,129 @@
+# Copyright 2000, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@redhat.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "return2"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc return_1 { type } {
+ global gdb_prompt
+
+ gdb_test "break ${type}_func" "Breakpoint \[0123456789\].*" \
+ "set break on ${type}_func"
+ gdb_test "continue" "Breakpoint.* ${type}_func.*" \
+ "continue to ${type}_func"
+ send_gdb "return testval.${type}_testval\n"
+ gdb_expect {
+ -re "Make ${type}_func return now.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re ".*${type}_resultval *= ${type}_func.*$gdb_prompt $" {
+ send_gdb "step\n"
+ exp_continue
+ }
+ -re ".*${type}_checkpoint.*$gdb_prompt $" {
+ pass "return from ${type}_func"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "return from ${type}_func"
+ }
+ timeout {
+ fail "return from ${type}_func (timeout)"
+ }
+ }
+ gdb_test "print ${type}_resultval == testval.${type}_testval" ".* = 1" \
+ "${type} value returned successfully"
+ gdb_test "print ${type}_resultval != ${type}_returnval" ".* = 1" \
+ "validate result value not equal to program return value"
+}
+
+proc return_void { } {
+ global gdb_prompt
+
+ gdb_test "break void_func" "Breakpoint \[0123456789\].*" \
+ "set break on void_func"
+ gdb_test "continue" "Breakpoint.* void_func.*" \
+ "continue to void_func"
+ send_gdb "return \n"
+ gdb_expect {
+ -re "Make void_func return now.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re ".*void_func.*call to void_func.*$gdb_prompt $" {
+ send_gdb "step\n"
+ exp_continue
+ }
+ -re ".*void_checkpoint.*$gdb_prompt $" {
+ pass "return from void_func"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "return from void_func"
+ }
+ timeout {
+ fail "return from void_func (timeout)"
+ }
+ }
+ gdb_test "print void_test == 0" ".* = 1" \
+ "void function returned successfully"
+}
+
+proc return2_tests { } {
+ global gdb_prompt
+
+ if { ! [ runto main ] } then {
+ gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
+ }
+
+ return_void
+ return_1 "char"
+ return_1 "short"
+ return_1 "int"
+ return_1 "long"
+ if { ! [istarget "m6811-*-*"] } then {
+ return_1 "long_long"
+ }
+ return_1 "float"
+ if { ! [istarget "m6811-*-*"] } then {
+ return_1 "double"
+ }
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set timeout 30
+return2_tests
diff --git a/gdb/testsuite/gdb.base/run.c b/gdb/testsuite/gdb.base/run.c
new file mode 100644
index 00000000000..25b8a4a4aa4
--- /dev/null
+++ b/gdb/testsuite/gdb.base/run.c
@@ -0,0 +1,82 @@
+/*
+ * This simple classical example of recursion is useful for
+ * testing stack backtraces and such.
+ */
+
+#ifdef vxworks
+
+# include <stdio.h>
+
+/* VxWorks does not supply atoi. */
+static int
+atoi (z)
+ char *z;
+{
+ int i = 0;
+
+ while (*z >= '0' && *z <= '9')
+ i = i * 10 + (*z++ - '0');
+ return i;
+}
+
+/* I don't know of any way to pass an array to VxWorks. This function
+ can be called directly from gdb. */
+
+vxmain (arg)
+char *arg;
+{
+ char *argv[2];
+
+ argv[0] = "";
+ argv[1] = arg;
+ main (2, argv, (char **) 0);
+}
+
+#else /* ! vxworks */
+# include <stdio.h>
+# include <stdlib.h>
+#endif /* ! vxworks */
+
+#ifdef PROTOTYPES
+int factorial (int);
+
+int
+main (int argc, char **argv, char **envp)
+#else
+int
+main (argc, argv, envp)
+int argc;
+char *argv[], **envp;
+#endif
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+#ifdef FAKEARGV
+ printf ("%d\n", factorial (1));
+#else
+ if (argc != 2) {
+ printf ("usage: factorial <number>\n");
+ return 1;
+ } else {
+ printf ("%d\n", factorial (atoi (argv[1])));
+ }
+#endif
+ return 0;
+}
+
+#ifdef PROTOTYPES
+int factorial (int value)
+#else
+int factorial (value) int value;
+#endif
+{
+ int local_var;
+
+ if (value > 1) {
+ value *= factorial (value - 1);
+ }
+ local_var = value;
+ return (value);
+}
diff --git a/gdb/testsuite/gdb.base/scope.exp b/gdb/testsuite/gdb.base/scope.exp
new file mode 100644
index 00000000000..db2c7ea9f91
--- /dev/null
+++ b/gdb/testsuite/gdb.base/scope.exp
@@ -0,0 +1,608 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002 Free
+# Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "scope"
+set binfile ${objdir}/${subdir}/${testfile}
+
+
+if { [gdb_compile "${srcdir}/${subdir}/scope0.c" "${binfile}0.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/scope1.c" "${binfile}1.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${binfile}0.o ${binfile}1.o" ${binfile} executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+# Test locating various things when stopped just inside main, after
+# running init0(). To prevent cascading of errors, we report the
+# first one and quit. If all pass, then we print the pass results.
+
+proc test_at_main {} {
+ global gdb_prompt
+ global decimal
+ global det_file
+ global srcdir
+ global subdir
+ global gcc_compiled
+ global hp_cc_compiler
+
+ # 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 init0 call.
+ if [gdb_test "next" "$decimal.*foo \\(\\);" "next over init0() in main" "$decimal.*init0 \\(\\);" "next"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope0.c::filelocal, which is 1
+
+ if [gdb_test "print filelocal" "\\\$$decimal = 1" "print filelocal" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if [gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at main" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope0.c::filelocal_bss, which is 101
+
+ if [gdb_test "print filelocal_bss" "\\\$$decimal = 101" "print filelocal_bss" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if [gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_main" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope0.c::filelocal_ro, which is 201
+
+ # No clue why the powerpc fails this test.
+ setup_xfail "powerpc-*-*"
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print filelocal_ro" "\\\$$decimal = 201" "print filelocal_ro in test_at_main" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
+ if [gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::filelocal, which is 2
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if {$hp_cc_compiler} then { setup_xfail "hppa2.0w-*-*" 11747CLLbs}
+ if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::filelocal_bss, which is 102
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if {$hp_cc_compiler} then { setup_xfail "hppa2.0w-*-*" 11747CLLbs}
+ if [gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::filelocal_ro, which is 202
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if {$hp_cc_compiler} then { setup_xfail "hppa2.0w-*-*" 11747CLLbs}
+ if [gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::foo::funclocal, which is 3
+
+ if [gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::foo::funclocal_ro, which is 203
+
+ if [gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::bar::funclocal, which is 4
+
+ if [gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"] {
+ gdb_suppress_tests ;
+ }
+ gdb_stop_suppressing_tests;
+
+}
+
+proc test_at_foo {} {
+ global gdb_prompt
+ global decimal
+ global det_file
+ global srcdir
+ global subdir
+ global gcc_compiled
+
+ if [gdb_test "next" ".*bar \\(\\);" "" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope0.c::filelocal, which is 1
+
+ if [gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at foo" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope0.c::filelocal_bss, which is 101
+
+ if [gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_foo" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope0.c::filelocal_ro, which is 201
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
+ if [gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"] {
+ gdb_suppress_tests ;
+ }
+
+
+ gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at foo"
+
+ # Print scope1.c::filelocal, which is 2
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] {
+ gdb_suppress_tests ;
+ }
+
+
+ gdb_test "print filelocal_bss" "\\\$$decimal = 102" \
+ "print filelocal_bss at foo"
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"
+
+
+ gdb_test "print filelocal_ro" "\\\$$decimal = 202" \
+ "print filelocal_ro at foo"
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"
+
+
+ # Print scope1.c::foo::funclocal, which is 3
+
+ gdb_test "print funclocal" "\\\$$decimal = 3" "print funclocal at foo"
+
+ gdb_test "print foo::funclocal" "\\\$$decimal = 3" \
+ "print foo::funclocal at foo"
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"
+
+
+ # Print scope1.c::foo::funclocal_bss, which is 103
+
+ gdb_test "print funclocal_bss" "\\\$$decimal = 103" \
+ "print funclocal_bss at foo"
+
+ gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" \
+ "print foo::funclocal_bss at foo"
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_bss"
+
+
+ # Print scope1.c::foo::funclocal_ro, which is 203
+
+ gdb_test "print funclocal_ro" "\\\$$decimal = 203" \
+ "print funclocal_ro at foo"
+
+ gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" \
+ "print foo::funclocal_ro at foo"
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"
+
+
+ # Print scope1.c::bar::funclocal, which is 4
+
+ gdb_test "print bar::funclocal" "\\\$$decimal = 4" \
+ "print bar::funclocal at foo"
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at foo" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"
+ gdb_stop_suppressing_tests;
+
+}
+
+proc test_at_bar {} {
+ global gdb_prompt
+ global decimal
+ global det_file
+ global srcdir
+ global subdir
+ global gcc_compiled
+
+ if [gdb_test "next" ".*" "" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope0.c::filelocal, which is 1
+
+ if [gdb_test "print 'scope0.c'::filelocal" "\\\$$decimal = 1" "print 'scope0.c'::filelocal at bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope0.c::filelocal_bss, which is 101
+
+ if [gdb_test "print 'scope0.c'::filelocal_bss" "\\\$$decimal = 101" "print 'scope0.c'::filelocal_bss in test_at_bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_bss"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope0.c::filelocal_ro, which is 201
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ setup_xfail "powerpc-*-*"
+ if [gdb_test "print 'scope0.c'::filelocal_ro" "\\\$$decimal = 201" "print 'scope0.c'::filelocal_ro at bar" "No symbol \"scope0.c\" in current context.*" "print '$srcdir/$subdir/scope0.c'::filelocal_ro"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::filelocal, which is 2
+
+ if [gdb_test "print filelocal" "\\\$$decimal = 2" "print filelocal at bar" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print 'scope1.c'::filelocal" "\\\$$decimal = 2" "print 'scope1.c'::filelocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::filelocal_bss, which is 102
+
+ if [gdb_test "print filelocal_bss" "\\\$$decimal = 102" "print filelocal_bss at bar" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print 'scope1.c'::filelocal_bss" "\\\$$decimal = 102" "print 'scope1.c'::filelocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_bss"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::filelocal_ro, which is 202
+
+ if [gdb_test "print filelocal_ro" "\\\$$decimal = 202" "print filelocal_ro in test_at_bar" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print 'scope1.c'::filelocal_ro" "\\\$$decimal = 202" "print 'scope1.c'::filelocal_ro at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::filelocal_ro"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::foo::funclocal, which is 3
+
+ if [gdb_test "print foo::funclocal" "\\\$$decimal = 3" "print foo::funclocal at bar" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print 'scope1.c'::foo::funclocal" "\\\$$decimal = 3" "print 'scope1.c'::foo::funclocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::foo::funclocal_bss, which is 103
+
+ if [gdb_test "print foo::funclocal_bss" "\\\$$decimal = 103" "print foo::funclocal_bss at bar" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print 'scope1.c'::foo::funclocal_bss" "\\\$$decimal = 103" "print 'scope1.c'::foo::funclocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_bss"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::foo::funclocal_ro, which is 203
+
+ if [gdb_test "print foo::funclocal_ro" "\\\$$decimal = 203" "print foo::funclocal_ro at bar" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print 'scope1.c'::foo::funclocal_ro" "\\\$$decimal = 203" "print 'scope1.c'::foo::funclocal_ro at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::foo::funclocal_ro"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::bar::funclocal, which is 4
+
+ if [gdb_test "print funclocal" "\\\$$decimal = 4" "print funclocal at bar" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if [gdb_test "print bar::funclocal" "\\\$$decimal = 4" "print bar::funclocal at bar" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print 'scope1.c'::bar::funclocal" "\\\$$decimal = 4" "print 'scope1.c'::bar::funclocal at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal"] {
+ gdb_suppress_tests ;
+ }
+
+
+ # Print scope1.c::bar::funclocal_bss, which is 104
+
+ if [gdb_test "print funclocal_bss" "\\\$$decimal = 104" "print funclocal_bss at bar" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if [gdb_test "print bar::funclocal_bss" "\\\$$decimal = 104" "print bar::funclocal_bss at bar" ] {
+ gdb_suppress_tests ;
+ }
+
+
+ if {$gcc_compiled} then { setup_xfail "rs6000-*-*" }
+ if [gdb_test "print 'scope1.c'::bar::funclocal_bss" "\\\$$decimal = 104" "print 'scope1.c'::bar::funclocal_bss at bar" "No symbol \"scope1.c\" in current context.*" "print '$srcdir/$subdir/scope1.c'::bar::funclocal_bss"] {
+ gdb_suppress_tests ;
+ }
+ gdb_stop_suppressing_tests;
+
+}
+
+# This test has little to do with local scopes, but it is in scope.exp anyway.
+# That's life.
+
+proc test_at_autovars {} {
+ global gdb_prompt
+ global decimal
+ global hex
+ global srcfile
+
+ # Test symbol table lookup with 100 local (auto) variables.
+
+ gdb_breakpoint marker1
+
+ if [gdb_test "cont" "Break.* marker1 \\(\\) at .*:$decimal.*" "continue to marker1"] {
+ gdb_suppress_tests;
+ }
+
+ if [gdb_test "up" ".*autovars.*" "up from marker1 in scope.exp" ] {
+ gdb_suppress_tests ;
+ }
+
+ set count 0
+ while {$count < 100} {
+ if [gdb_test "print i$count" ".* = $count" "" ] {
+ gdb_suppress_tests ;
+ }
+
+ set count [expr $count+1]
+ }
+ clear_xfail "*-*-*"
+ pass "$count auto variables correctly initialized"
+
+ # Test that block variable sorting is not screwing us.
+ gdb_test "frame" "#.*autovars \\(bcd=5, abc=6\\).*" "args in correct order"
+}
+
+proc test_at_localscopes {} {
+ global gdb_prompt
+ global decimal
+ global hex
+ global srcfile
+
+ gdb_breakpoint marker2
+ gdb_breakpoint marker3
+ gdb_breakpoint marker4
+
+ if [gdb_test "cont" "Break.* marker2 \\(\\) at .*:$decimal.*" "continue to marker2"] {
+ gdb_suppress_tests;
+ }
+ if [gdb_test "up" ".*localscopes.*" "up from marker2 in scopes.exp" ] {
+ gdb_suppress_tests ;
+ }
+
+ # Should be at first (outermost) scope. Check values.
+
+ gdb_test "print localval" " = 10" "print localval, outer scope"
+ gdb_test "print localval1" " = 11" "print localval1, outer scope"
+ gdb_test "print localval2" "No symbol \"localval2\" in current context." \
+ "print localval2, outer scope"
+ gdb_test "print localval3" "No symbol \"localval3\" in current context." \
+ "print localval3, outer scope"
+
+ if [gdb_test "cont" "Break.* marker3 \\(\\) at .*:$decimal.*" \
+ "continue to marker3 in scope.exp"] then { gdb_suppress_tests }
+ if [gdb_test "up" ".*localscopes.*" "up from marker3 in scope.exp"] {
+ gdb_suppress_tests
+ }
+
+ # Should be at next (first nested) scope. Check values.
+
+ gdb_test "print localval" " = 20" \
+ "print localval, first nested scope"
+ gdb_test "print localval1" " = 11" "print localval1, first nested scope"
+ gdb_test "print localval2" " = 12" "print localval2, first nested scope"
+ gdb_test "print localval3" "No symbol \"localval3\" in current context." \
+ "print localval3, first nested scope"
+
+ # This test will only fail if the file was compiled by gcc, but
+ # there's no way to check that.
+ if [gdb_test "cont" "Break.* marker4.*at .*:$decimal.*" \
+ "continue to marker4 in scope.exp"] then { gdb_suppress_tests }
+ if [gdb_test "up" ".*localscopes.*" "up from marker4 in scope.exp"] {
+ gdb_suppress_tests
+ }
+
+ gdb_test "print localval" " = 30" "print localval, innermost scope"
+ gdb_test "print localval1" " = 11" "print localval1, innermost scope"
+ gdb_test "print localval2" " = 12" "print localval2, innermost scope"
+ gdb_test "print localval3" " = 13" "print localval3, innermost scope"
+ gdb_stop_suppressing_tests;
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if [istarget "*-*-vxworks*"] {
+ set timeout 120
+ verbose "Timeout is now $timeout seconds" 2
+}
+
+# Test that variables in various segments print out correctly before
+# the program is run.
+
+# AIX--sections get mapped to the same address so we can't get the right one.
+setup_xfail "rs6000-*-*"
+setup_xfail "powerpc-*-*"
+
+gdb_test "print 'scope0.c'::filelocal_ro" "= 201"
+
+# gdb currently cannot access bss memory on some targets if the inferior
+# is not running.
+#
+# For PA boards using monitor/remote-pa.c, the bss test is going to
+# randomly fail. We've already put remote-pa on the target stack,
+# so we actually read memory from the board. Problem is crt0.o
+# is responsible for clearing bss and that hasnt' happened yet.
+#
+# This is a problem for all non-native targets. -- manson
+if [is_remote target] {
+ unsupported "print 'scope0.c'::filelocal_bss before run"
+} else {
+ gdb_test "print 'scope0.c'::filelocal_bss" "= 0" \
+ "print 'scope0.c'::filelocal_bss before run"
+}
+
+gdb_test "print 'scope0.c'::filelocal" "= 1" \
+ "print 'scope0.c'::filelocal before run"
+
+if [runto_main] then { test_at_main }
+if [istarget "mips-idt-*"] then {
+ # Restart because IDT/SIM runs out of file descriptors.
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+}
+if [runto foo] then { test_at_foo }
+if [istarget "mips-idt-*"] then {
+ # Restart because IDT/SIM runs out of file descriptors.
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+}
+if [runto bar] then { test_at_bar }
+if [istarget "mips-idt-*"] then {
+ # Restart because IDT/SIM runs out of file descriptors.
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+}
+if [runto localscopes] then { test_at_localscopes }
+if [istarget "mips-idt-*"] then {
+ # Restart because IDT/SIM runs out of file descriptors.
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+}
+if [runto autovars] then { test_at_autovars }
+
+if [istarget "*-*-vxworks*"] {
+ set timeout 120
+ verbose "Timeout is now $timeout seconds" 2
+}
diff --git a/gdb/testsuite/gdb.base/scope0.c b/gdb/testsuite/gdb.base/scope0.c
new file mode 100644
index 00000000000..ad994fc0b21
--- /dev/null
+++ b/gdb/testsuite/gdb.base/scope0.c
@@ -0,0 +1,208 @@
+static int filelocal = 1; /* In Data section */
+static int filelocal_bss; /* In BSS section */
+#ifndef __STDC__
+#define const /**/
+#endif
+static const int filelocal_ro = 201; /* In Read-Only Data section */
+
+extern void init1();
+extern void foo();
+
+int autovars (int bcd, int abc);
+int localscopes (int x);
+int useit (int val);
+void init0();
+void marker1 ();
+void marker2 ();
+void marker3 ();
+void marker4 ();
+
+int main ()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ init0 ();
+ foo ();
+ autovars (5, 6);
+ localscopes (0);
+}
+
+/* On some systems, such as AIX, unreferenced variables are deleted
+ from the executable. */
+void usestatics ()
+{
+ useit (filelocal);
+ useit (filelocal_bss);
+ useit (filelocal_ro);
+}
+
+void init0 ()
+{
+ filelocal_bss = 101;
+ init1 ();
+}
+
+/* This is to derail optimizer in localscopes.
+ Return 1 + 2 + . . . + N. */
+#ifdef PROTOTYPES
+int
+sum_upto (int n)
+#else
+int
+sum_upto (n)
+ int n;
+#endif
+{
+ int i;
+ int retval = 0;
+
+ for (i = 1; i <= n; ++i)
+ retval += i;
+ return retval;
+}
+
+#ifdef PROTOTYPES
+int
+useit (int val)
+#else
+int
+useit (val)
+#endif
+{
+ static int usedval;
+
+ usedval = val;
+ return val + sum_upto (0);
+}
+
+#ifdef PROTOTYPES
+int
+autovars (int bcd, int abc)
+#else
+int
+autovars (bcd, abc)
+ int bcd;
+ int abc;
+#endif
+{
+ int i0 = useit (0), i1 = useit (1), i2 = useit (2);
+ int i3 = useit (3), i4 = useit (4), i5 = useit (5);
+ int i6 = useit (6), i7 = useit (7), i8 = useit (8);
+ int i9 = useit (9), i10 = useit (10), i11 = useit (11);
+ int i12 = useit (12), i13 = useit (13), i14 = useit (14);
+ int i15 = useit (15), i16 = useit (16), i17 = useit (17);
+ int i18 = useit (18), i19 = useit (19), i20 = useit (20);
+ int i21 = useit (21), i22 = useit (22), i23 = useit (23);
+ int i24 = useit (24), i25 = useit (25), i26 = useit (26);
+ int i27 = useit (27), i28 = useit (28), i29 = useit (29);
+ int i30 = useit (30), i31 = useit (31), i32 = useit (32);
+ int i33 = useit (33), i34 = useit (34), i35 = useit (35);
+ int i36 = useit (36), i37 = useit (37), i38 = useit (38);
+ int i39 = useit (39), i40 = useit (40), i41 = useit (41);
+ int i42 = useit (42), i43 = useit (43), i44 = useit (44);
+ int i45 = useit (45), i46 = useit (46), i47 = useit (47);
+ int i48 = useit (48), i49 = useit (49), i50 = useit (50);
+ int i51 = useit (51), i52 = useit (52), i53 = useit (53);
+ int i54 = useit (54), i55 = useit (55), i56 = useit (56);
+ int i57 = useit (57), i58 = useit (58), i59 = useit (59);
+ int i60 = useit (60), i61 = useit (61), i62 = useit (62);
+ int i63 = useit (63), i64 = useit (64), i65 = useit (65);
+ int i66 = useit (66), i67 = useit (67), i68 = useit (68);
+ int i69 = useit (69), i70 = useit (70), i71 = useit (71);
+ int i72 = useit (72), i73 = useit (73), i74 = useit (74);
+ int i75 = useit (75), i76 = useit (76), i77 = useit (77);
+ int i78 = useit (78), i79 = useit (79), i80 = useit (80);
+ int i81 = useit (81), i82 = useit (82), i83 = useit (83);
+ int i84 = useit (84), i85 = useit (85), i86 = useit (86);
+ int i87 = useit (87), i88 = useit (88), i89 = useit (89);
+ int i90 = useit (90), i91 = useit (91), i92 = useit (92);
+ int i93 = useit (93), i94 = useit (94), i95 = useit (95);
+ int i96 = useit (96), i97 = useit (97), i98 = useit (98);
+ int i99 = useit (99);
+
+ /* Use all 100 of the local variables to derail agressive optimizers. */
+
+ useit ( i0); useit ( i1); useit ( i2); useit ( i3); useit ( i4);
+ useit ( i5); useit ( i6); useit ( i7); useit ( i8); useit ( i9);
+ useit (i10); useit (i11); useit (i12); useit (i13); useit (i14);
+ useit (i15); useit (i16); useit (i17); useit (i18); useit (i19);
+ useit (i20); useit (i21); useit (i22); useit (i23); useit (i24);
+ useit (i25); useit (i26); useit (i27); useit (i28); useit (i29);
+ useit (i30); useit (i31); useit (i32); useit (i33); useit (i34);
+ useit (i35); useit (i36); useit (i37); useit (i38); useit (i39);
+ useit (i40); useit (i41); useit (i42); useit (i43); useit (i44);
+ useit (i45); useit (i46); useit (i47); useit (i48); useit (i49);
+ useit (i50); useit (i51); useit (i52); useit (i53); useit (i54);
+ useit (i55); useit (i56); useit (i57); useit (i58); useit (i59);
+ useit (i60); useit (i61); useit (i62); useit (i63); useit (i64);
+ useit (i65); useit (i66); useit (i67); useit (i68); useit (i69);
+ useit (i70); useit (i71); useit (i72); useit (i73); useit (i74);
+ useit (i75); useit (i76); useit (i77); useit (i78); useit (i79);
+ useit (i80); useit (i81); useit (i82); useit (i83); useit (i84);
+ useit (i85); useit (i86); useit (i87); useit (i88); useit (i89);
+ useit (i90); useit (i91); useit (i92); useit (i93); useit (i94);
+ useit (i95); useit (i96); useit (i97); useit (i98); useit (i99);
+
+ useit (abc); useit (bcd);
+
+ marker1 ();
+ return i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10
+ + i11 + i12 + i13 + i14 + i15 + i16 + i17 + i18 + i19 + i20
+ + i21 + i22 + i23 + i24 + i25 + i26 + i27 + i28 + i29 + i30
+ + i31 + i32 + i33 + i34 + i35 + i36 + i37 + i38 + i39 + i40
+ + i41 + i42 + i43 + i44 + i45 + i46 + i47 + i48 + i49 + i50
+ + i51 + i52 + i53 + i54 + i55 + i56 + i57 + i58 + i59 + i60
+ + i61 + i62 + i63 + i64 + i65 + i66 + i67 + i68 + i69 + i70
+ + i71 + i72 + i73 + i74 + i75 + i76 + i77 + i78 + i79 + i80
+ + i81 + i82 + i83 + i84 + i85 + i86 + i87 + i88 + i89 + i90
+ + i91 + i92 + i93 + i94 + i95 + i96 + i97 + i98 + i99 + abc + bcd;
+}
+
+#ifdef PROTOTYPES
+int
+localscopes (int x)
+#else
+int
+localscopes (x)
+ int x;
+#endif
+{
+ int localval;
+ int retval;
+ int i;
+
+ localval = 0;
+ useit (localval);
+
+ {
+ int localval = x + 4 + sum_upto (3); /* 10 */
+ int localval1 = x + 5 + sum_upto (3); /* 11 */
+
+ useit (localval);
+ useit (localval1);
+ marker2 ();
+ {
+ int localval = localval1 + 3 + sum_upto (3); /* 20 */
+ int localval2 = localval1 + sum_upto (1); /* 12 */
+ useit (localval);
+ useit (localval2);
+ marker3 ();
+ {
+ int localval = localval2 + 3 + sum_upto (5); /* 30 */
+ int localval3 = localval2 + sum_upto (1); /* 13 */
+ useit (localval);
+ useit (localval3);
+ marker4 ();
+ retval = x + localval1 + localval2 + localval3;
+ }
+ }
+ }
+ return retval;
+}
+
+void marker1 () {}
+void marker2 () {}
+void marker3 () {}
+void marker4 () {}
diff --git a/gdb/testsuite/gdb.base/scope1.c b/gdb/testsuite/gdb.base/scope1.c
new file mode 100644
index 00000000000..8c325224993
--- /dev/null
+++ b/gdb/testsuite/gdb.base/scope1.c
@@ -0,0 +1,54 @@
+static int filelocal = 2; /* In Data section */
+static int filelocal_bss; /* In BSS section */
+#ifndef __STDC__
+#define const /**/
+#endif
+static const int filelocal_ro = 202; /* In Read-Only Data section */
+
+void foo ()
+{
+
+ void bar ();
+
+ static int funclocal = 3; /* In Data section */
+ static int funclocal_bss; /* In BSS section */
+ static const int funclocal_ro = 203; /* RO Data */
+ static const int funclocal_ro_bss; /* RO Data */
+
+ funclocal_bss = 103;
+ bar ();
+}
+
+void bar ()
+{
+ static int funclocal = 4; /* In data section */
+ static int funclocal_bss; /* In BSS section */
+ funclocal_bss = 104;
+}
+
+void init1 ()
+{
+ filelocal_bss = 102;
+}
+
+/* On some systems, such as AIX, unreferenced variables are deleted
+ from the executable. */
+void usestatics1 ()
+{
+ void useit1 (int val);
+
+ useit1 (filelocal);
+ useit1 (filelocal_bss);
+ useit1 (filelocal_ro);
+}
+
+#ifdef PROTOTYPES
+void useit1 (int val)
+#else
+void useit1 (val) int val;
+#endif
+{
+ static int usedval;
+
+ usedval = val;
+}
diff --git a/gdb/testsuite/gdb.base/sect-cmd.exp b/gdb/testsuite/gdb.base/sect-cmd.exp
new file mode 100644
index 00000000000..10c0e74959a
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sect-cmd.exp
@@ -0,0 +1,125 @@
+# Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+global usestubs
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+# This test exists solely to exercise the "section" command for
+# code-coverage on HP-UX. (So far as I can tell, the "section"
+# command isn't needed on HP-UX, but probably is for embedded
+# apps.)
+#
+if ![istarget "hppa*-*-hpux*"] then {
+ return
+}
+
+set testfile "break"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then { fail "section command tests suppressed" }
+
+# Get the $CODE$ section's starting address.
+#
+# (Note that this works for PA32 programs, which use the SOM file
+# format. PA64 uses ELF, and when support for that is added, it's
+# not clear that there'll be a section named "$CODE$" in such
+# programs.)
+#
+
+set address1 ""
+set address2 ""
+send_gdb "info files\n"
+gdb_expect {
+ -re ".*(0x\[0-9a-fA-F\]*) - (0x\[0-9a-fA-F\]*) is .(CODE|text).*$gdb_prompt $"\
+ {pass "info files"
+ set address1 $expect_out(1,string)
+ set address2 $expect_out(2,string)}
+ -re "$gdb_prompt $"\
+ {fail "info files"}
+ timeout {fail "(timeout) info files"}
+}
+
+# Reset the section to that same starting address, which should be
+# harmless (i.e., we just want to exercise the section command).
+#
+if [istarget "hppa2.0w-*-*"] then {
+ send_gdb "section \.text $address1\n"
+ gdb_expect {
+ -re ".*$address1 \- $address2 is .text.*$gdb_prompt $"\
+ {pass "set section command"}
+ -re "$gdb_prompt $"\
+ {fail "set section command"}
+ timeout {fail "(timeout) set section command"}
+ }
+} else {
+ send_gdb "section \$CODE\$ $address1\n"
+ gdb_expect {
+ -re ".*$address1 \- $address2 is .CODE..*$gdb_prompt $"\
+ {pass "set section command"}
+ -re "$gdb_prompt $"\
+ {fail "set section command"}
+ timeout {fail "(timeout) set section command"}
+ }
+}
+
+# Verify that GDB responds gracefully to a non-existent section name.
+#
+send_gdb "section FOOBARBAZ 0x1234\n"
+gdb_expect {
+ -re "Section FOOBARBAZ not found\r\n$gdb_prompt $"\
+ {pass "non-existent section disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "non-existent section disallowed"}
+ timeout {fail "(timeout) non-existent section disallowed"}
+}
+
+# We "happen to know" that GDB uses a fixed size character buffer to
+# parse the section name into, and the buffer is declared to be 100
+# characters in length. Verify that GDB gracefully handles section
+# names longer than that. (The section is also non-existent.)
+#
+send_gdb "section A234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123 0x1234\n"
+gdb_expect {
+ -re "Section A23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 not found\r\n$gdb_prompt $"\
+ {pass "non-existent too-long section disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "non-existent too-long section disallowed"}
+ timeout {fail "(timeout) non-existent too-long section disallowed"}
+}
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.base/selftest.exp b/gdb/testsuite/gdb.base/selftest.exp
new file mode 100644
index 00000000000..83ceb620e8e
--- /dev/null
+++ b/gdb/testsuite/gdb.base/selftest.exp
@@ -0,0 +1,446 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1997, 1999, 2000
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# are we on a target board
+if [is_remote target] {
+ return
+}
+
+if [istarget "m68k*-*-hpux*"] then {
+ # The top-level makefile passes CFLAGS= (no -g) for hp300. This probably
+ # should be fixed (it is only needed for gcc bootstrapping, not gdb),
+ # but until then.....
+ setup_xfail "*-*-*"
+ fail "cannot test self if compiled without debug info"
+ return -1
+}
+
+# Not all of the lines of code near the start of main are executed for
+# every machine. Also, optimization may reorder some of the lines.
+# So all we do is try to step or next over everything until we get
+# to a line that we know is always executed.
+
+proc do_steps_and_nexts {} {
+ global gdb_prompt
+ global srcdir
+
+ gdb_reinitialize_dir $srcdir/..
+
+ for {set count 0} {$count < 22} {incr count} {
+ send_gdb "list\n"
+ gdb_expect {
+ -re ".*context = data.*$gdb_prompt $" {
+ set description "step over context initialization"
+ set command "step"
+ }
+ -re ".*argc = context->argc.*$gdb_prompt $" {
+ set description "step over argc initialization"
+ set command "step"
+ }
+ -re ".*argv = context->argv.*$gdb_prompt $" {
+ set description "step over argv initialization"
+ set command "step"
+ }
+ -re ".*quiet = 0.*$gdb_prompt $" {
+ set description "step over quiet initialization"
+ set command "step"
+ }
+ -re ".*batch = 0.*$gdb_prompt $" {
+ set description "step over batch initialization"
+ set command "step"
+ }
+ -re ".*symarg = NULL.*$gdb_prompt $" {
+ set description "step over symarg initialization"
+ set command "step"
+ }
+ -re ".*execarg = NULL.*$gdb_prompt $" {
+ set description "step over execarg initialization"
+ set command "step"
+ }
+ -re ".*corearg = NULL.*$gdb_prompt $" {
+ set description "step over corearg initialization"
+ set command "step"
+ }
+ -re ".*cdarg = NULL.*$gdb_prompt $" {
+ set description "step over cdarg initialization"
+ set command "step"
+ }
+ -re ".*ttyarg = NULL.*$gdb_prompt $" {
+ set description "step over ttyarg initialization"
+ set command "step"
+ }
+ -re ".*time_at_startup = get_run_time.*$gdb_prompt $" {
+ set description "next over get_run_time and everything it calls"
+ set command "next"
+ }
+ -re ".*START_PROGRESS.*$gdb_prompt $" {
+ set description "next over START_PROGRESS and everything it calls"
+ set command "next"
+ }
+ -re ".*mac_init.*$gdb_prompt $" {
+ set description "next over mac_init and everything it calls"
+ set command "next"
+ }
+ -re ".*init_malloc.*$gdb_prompt $" {
+ set description "next over init_malloc and everything it calls"
+ set command "next"
+ }
+ -re ".*count . 0x3.*$gdb_prompt $" {
+ set description "next over conditional stack alignment code 1"
+ set command "next"
+ }
+ -re ".*if .i != 0.*$gdb_prompt $" {
+ set description "next over conditional stack alignment code 2"
+ set command "next"
+ }
+ -re ".*alloca .i - 4.*$gdb_prompt $" {
+ set description "next over conditional stack alignment alloca"
+ set command "next"
+ }
+ -re ".*cmdsize = 1.*$gdb_prompt $" {
+ set description "step over cmdsize initialization"
+ set command "next"
+ }
+ -re ".*cmdarg = .* xmalloc.*$gdb_prompt $" {
+ set description "next over cmdarg initialization via xmalloc"
+ set command "next"
+ }
+ -re ".*ncmd = 0.*$gdb_prompt $" {
+ set description "next over ncmd initialization"
+ set command "next"
+ }
+ -re ".*dirsize = 1.*$gdb_prompt $" {
+ set description "next over dirsize initialization"
+ set command "next"
+ }
+ -re ".*dirarg = .* xmalloc.*$gdb_prompt $" {
+ return
+ }
+ -re "\[ \t\]+\{\r\n$gdb_prompt $" {
+ setup_xfail "mips-*-irix5*"
+ fail "$description ended up at odd location"
+ }
+ -re ".*main.c.*No such file or directory.*$gdb_prompt $" {
+ setup_xfail "rs6000-*-aix3*"
+ fail "must be able to list source lines"
+ return
+ }
+ -re ".*$gdb_prompt $" {
+ fail "unknown source line after $description"
+ return
+ }
+ default {
+ fail "unknown source line near main"
+ return
+ }
+ }
+ send_gdb "$command\n"
+ gdb_expect {
+ -re ".*No such file or directory.\r\n$gdb_prompt $" {
+ fail "$description (no source available)"
+ }
+ -re ".*A file or directory .* does not exist..\r\n$gdb_prompt $" {
+ fail "$description (no source available)"
+ }
+ -re ".*$gdb_prompt $" {
+ pass "$description"
+ }
+ timeout {
+ fail "$description (timeout)"
+ }
+ }
+ }
+}
+
+proc test_with_self { executable } {
+ global gdb_prompt
+ global tool
+ global det_file
+ global decimal
+ global timeout
+
+ # load yourself into the debugger
+ # This can take a relatively long time, particularly for testing where
+ # the executable is being accessed over a network, or where gdb does not
+ # support partial symbols for a particular target and has to load the
+ # entire symbol table. Set the timeout to 10 minutes, which should be
+ # adequate for most environments (it *has* timed out with 5 min on a
+ # SPARCstation SLC under moderate load, so this isn't unreasonable).
+ # After gdb is started, set the timeout to 30 seconds for the duration
+ # of this test, and then back to the original value.
+
+ set oldtimeout $timeout
+ set timeout 600
+ verbose "Timeout is now $timeout seconds" 2
+ if {[gdb_load $executable] <0} then {
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+ return -1
+ }
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+
+ # disassemble yourself
+ gdb_test "x/10i main" \
+ "x/10i.*main.*main.$decimal.*main.$decimal.*" \
+ "Disassemble main"
+
+ # Set a breakpoint at main
+ gdb_test "break captured_main" \
+ "Breakpoint.*at.* file.*, line.*" \
+ "breakpoint in captured_main"
+
+ # We'll need this when we send a ^C to GDB. Need to do it before we
+ # run the program and gdb starts saving and restoring tty states.
+ # On Ultrix, we don't need it and it is really slow (because shell_escape
+ # doesn't use vfork).
+ if ![istarget "*-*-ultrix*"] then {
+ gdb_test "shell stty intr '^C'" "" \
+ "set interrupt character in test_with_self"
+ }
+
+ # FIXME: If we put this after the run to main, the first list
+ # command doesn't print the same line as the current line where
+ # gdb is stopped.
+ gdb_test "set listsize 1" "" "set listsize to 1"
+
+ # run yourself
+ # It may take a very long time for the inferior gdb to start (lynx),
+ # so we bump it back up for the duration of this command.
+ set timeout 600
+
+ set description "run until breakpoint at captured_main"
+ send_gdb "run -nw\n"
+ gdb_expect {
+ -re "Starting program.*Breakpoint \[0-9\]+,.*captured_main .data.* at .*main.c:.*$gdb_prompt $" {
+ pass "$description"
+ }
+ -re "Starting program.*Breakpoint \[0-9\]+,.*captured_main .data.*$gdb_prompt $" {
+ xfail "$description (line numbers scrambled?)"
+ }
+ -re "vfork: No more processes.*$gdb_prompt $" {
+ fail "$description (out of virtual memory)"
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+ return -1
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$description"
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+ return -1
+ }
+ timeout {
+ fail "$description (timeout)"
+ }
+ }
+
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+
+ # do we have a version number ?
+ send_gdb "print version\n"
+ gdb_expect {
+ -re ".\[0-9\]+ = .\[0-9.\]+.*$gdb_prompt $" {
+ pass "printed version as string"
+ }
+ -re ".\[0-9\]+ = +0x.*\[0-9.\]+.*$gdb_prompt $" {
+ pass "printed version as pointer"
+ }
+ -re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" {
+ pass "printed version with cast"
+ }
+ -re ".*$gdb_prompt $" { fail "printed version" }
+ timeout { fail "(timeout) printed version" }
+ }
+
+ do_steps_and_nexts
+
+ gdb_test "print \"foo\"" ".\[0-9\]+ = \"foo\"" "print a string"
+
+ # do_steps_and_nexts left us ready to execute an xmalloc call,
+ # so give that a try.
+ # If we don't actually enter the xmalloc call when we give a
+ # step command that seems like a genuine bug. It seems to happen
+ # on most RISC processors.
+ setup_xfail "alpha-*-*" "mips-*-*"
+ set description "step into xmalloc call"
+ send_gdb "step\n"
+ gdb_expect {
+ -re "xmalloc.*size=.*at.*utils.c.*$gdb_prompt $" {
+ pass "$description"
+ }
+ -re ".*No such file or directory.\r\n$gdb_prompt $" {
+ pass "$description (no source available)"
+ }
+ -re "A file or directory .* does not exist..\r\n$gdb_prompt $" {
+ pass "$description (no source available)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$description"
+ }
+ timeout {
+ fail "$description (timeout)"
+ }
+ }
+
+ # start the "xgdb" process
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "GNU gdb \[0-9\.\]*.*
+Copyright \[0-9\]* Free Software Foundation, Inc.*
+GDB is free software, covered by the GNU General Public License, and you are.*
+welcome to change it and/or distribute copies of it under certain conditions.*
+Type \"show copying\" to see the conditions.*
+There is absolutely no warranty for GDB. Type \"show warranty\" for details.*
+This GDB was configured as .*$gdb_prompt $"\
+ { pass "xgdb is at prompt" }
+ -re "GDB is free software and you are welcome to distribute copies of it.*
+ under certain conditions; type \"show copying\" to see the conditions..*
+There is absolutely no warranty for GDB; type \"show warranty\" for details..*
+GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$gdb_prompt $"\
+ { pass "xgdb is at prompt (obsolescent gdb)" }
+ -re ".*$gdb_prompt $" { fail "xgdb is at prompt" }
+ timeout { fail "(timeout) xgdb is at prompt" }
+ }
+
+ # set xgdb prompt so we can tell which is which
+ send_gdb "set prompt (xgdb) \n"
+ gdb_expect {
+ -re "\[(\]xgdb\[)\].*\[(\]xgdb\[)\] $" { pass "Set xgdb prompt" }
+ -re ".*$gdb_prompt $" { fail "Set xgdb prompt" }
+ default { fail "(timeout) Set xgdb prompt" }
+ }
+
+ # kill the xgdb process
+ set description "send ^C to child process"
+ send_gdb "\003"
+ gdb_expect {
+ -re "Program received signal SIGINT.*$gdb_prompt $" {
+ pass "$description"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$description"
+ }
+ timeout {
+ fail "$description (timeout)"
+ }
+ }
+
+ set description "send SIGINT signal to child process"
+ send_gdb "signal SIGINT\n"
+ gdb_expect {
+ -re "Continuing with signal SIGINT.*$gdb_prompt $" {
+ pass "$description"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$description"
+ }
+ timeout {
+ fail "$description (timeout)"
+ }
+ }
+
+ # get a stack trace
+ #
+ # This fails on some linux systems for unknown reasons. On the
+ # systems where it fails, sometimes it works fine when run manually.
+ # The testsuite failures may not be limited to just aout systems.
+ setup_xfail "i*86-pc-linuxaout-gnu"
+ set description "backtrace through signal handler"
+ send_gdb "backtrace\n"
+ gdb_expect {
+ -re "#0.*read.*in main \\(.*\\) at .*main\\.c.*$gdb_prompt $" {
+ pass "$description"
+ }
+ -re ".*$gdb_prompt $" {
+ # On the alpha, we hit the infamous problem about gdb
+ # being unable to get the frame pointer (mentioned in
+ # gdb/README). As it is intermittent, there is no way to
+ # XFAIL it which will give us an XPASS if the problem goes
+ # away.
+ setup_xfail "alpha*-*-osf*"
+ fail "$description"
+ }
+ timeout {
+ fail "$description (timeout)"
+ }
+ }
+
+
+ # Set the timeout back to the value it had when we were called.
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+
+ # Restart gdb in case next test expects it to be started already.
+ return 0
+}
+
+# Find a pathname to a file that we would execute if the shell was asked
+# to run $arg using the current PATH.
+
+proc find_gdb { arg } {
+
+ # If the arg directly specifies an existing executable file, then
+ # simply use it.
+
+ if [file executable $arg] then {
+ return $arg
+ }
+
+ set result [which $arg]
+ if [string match "/" [ string range $result 0 0 ]] then {
+ return $result
+ }
+
+ # If everything fails, just return the unqualified pathname as default
+ # and hope for best.
+
+ return $arg
+}
+
+# Run the test with self.
+# Copy the file executable file in case this OS doesn't like to edit its own
+# text space.
+
+set GDB_FULLPATH [find_gdb $GDB]
+
+# Remove any old copy lying around.
+remote_file host delete x$tool
+
+gdb_start
+set file [remote_download host $GDB_FULLPATH x$tool]
+set result [test_with_self $file];
+gdb_exit;
+catch "remote_file host delete $file";
+
+if {$result <0} then {
+ warning "Couldn't test self"
+ return -1
+}
diff --git a/gdb/testsuite/gdb.base/setshow.c b/gdb/testsuite/gdb.base/setshow.c
new file mode 100644
index 00000000000..fbaba0f5ddf
--- /dev/null
+++ b/gdb/testsuite/gdb.base/setshow.c
@@ -0,0 +1,27 @@
+/* IMPORTANT: leave this comment in the first line of this source file. */
+/* this will guarantee that line 1 contains no code. */
+
+#include <stdio.h>
+
+#ifdef PROTOTYPES
+int
+main(int argc, char **argv)
+#else
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+#endif
+{
+ int i = 1;
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+
+ if (argc <= 0 || argc > 8)
+ return -1;
+ while (i < argc)
+ printf ("%s ", argv[i++]);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp
new file mode 100644
index 00000000000..a1070fd986f
--- /dev/null
+++ b/gdb/testsuite/gdb.base/setshow.exp
@@ -0,0 +1,243 @@
+# Copyright 1992, 1994, 1996, 1997, 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "setshow"
+set srcfile ${srcdir}/${subdir}/${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile ${srcfile} ${binfile} executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Start with a fresh gdb
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# make sure $pc is sane, in case we're talking to a board.
+if { ![runto_main] } {
+ gdb_suppress_tests;
+}
+
+#
+# Test gdb set and show commands.
+# Add tests here for show and set that don't fit neatly elsewhere.
+# FIXME: many rudimentary tests for set and show commands have been
+# added below, but most do nothing more than check that a
+# variable has been set successfully, ie. they do not test
+# whether setting the variable has had the desired effect.
+#
+
+#test default annotation_level is 0
+gdb_test "show annotate" "Annotation_level is 0..*" "default annotation_level is zero"
+
+#test set annotate 2
+send_gdb "set annotate 2\n"
+gdb_expect {
+ -re ".*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" \
+ { pass "set annotate 2" }
+ -re ".*$gdb_prompt $" { fail "set annotate 2" }
+ timeout { fail "(timeout) set annotate 2" }
+ }
+
+send_gdb "show annotate\n"
+gdb_expect {
+ -re ".*\032\032post-prompt.*Annotation_level is 2..*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" \
+ { pass "show annotate (2)" }
+ -re ".*$gdb_prompt $" { fail "show annotate (2)" }
+ timeout { fail "(timeout) show annotate (2)" }
+ }
+
+#test annotation_level 2
+send_gdb "info line 1\n"
+gdb_expect {
+ -re ".*\032\032post-prompt.*Line 1 of .* is at address .* but contains no code.*:1:0:beg:0x.*\032\032pre-prompt.*$gdb_prompt .*\032\032prompt.*$" \
+ { pass "annotation_level 2" }
+ -re ".*$gdb_prompt $" { fail "annotation_level 2" }
+ timeout { fail "(timeout) annotation_level 2" }
+ }
+
+#test set annotate 1
+gdb_test "set annotate 1" ".*post-prompt.*" "set annotate 1"
+gdb_test "show annotate" "Annotation_level is 1..*" "show annotate (1)"
+#test annotation_level 1
+gdb_test "info line 1" "Line 1 of .* is at address .* but contains no code.*:1:0:beg:0x.*" "annotation_level 1"
+#test set annotate 0
+gdb_test "set annotate 0" "" "set annotate 0"
+gdb_test "show annotate" "Annotation_level is 0..*" "show annotate (0)"
+#test annotation_level 0
+gdb_test "info line 1" "Line 1 of .* is at address .* but contains no code.*" "annotation_level 0"
+#test set args
+gdb_test "set args foo bar blup baz bubble" "" "set args"
+#test show args
+gdb_test "show args" "Argument list to give program being debugged when it is started is \"foo bar blup baz bubble\"..*" "show args"
+
+# Don't test if we can't pass args or if we're using a stub.
+if { ![target_info exists use_gdb_stub] && ![target_info exists noargs] } {
+ #test passing args
+ gdb_test "cont" "Continuing.*" "continuing"
+ delete_breakpoints
+ gdb_test "run" "Starting program:.*foo bar blup baz bubble.*" "passing args"
+}
+#test set check range on
+gdb_test "set check range on" "" "set check range on"
+#test show check range on
+gdb_test "show check range" "Range checking is \"on\"\..*" "show check range (on)"
+#test set check range auto
+gdb_test "set check range auto" "" "set check range auto"
+#test show check range auto
+gdb_test "show check range" "Range checking is \"auto; currently .*" "show check range (auto)"
+#test set check type on
+gdb_test "set check type on" "" "set check type on"
+#test show check type on
+gdb_test "show check type" "Type checking is \"on\"..*" "show check type (on)"
+#test set check type auto
+gdb_test "set check type auto" "" "set check type auto"
+#test show check type
+gdb_test "show check type" "Type checking is \"auto; currently .*" "show check type (auto)"
+#test set complaints 100
+gdb_test "set complaints 100" "" "set complaints 100"
+#test show complaints 100
+gdb_test "show complaints" "Max number of complaints about incorrect symbols is 100..*" "show complaints (100)"
+#test set complaints 0
+gdb_test "set complaints 0" "" "set complaints 0"
+#test show complaints 0
+gdb_test "show complaints" "Max number of complaints about incorrect symbols is 0..*" "show complaints (0)"
+#test set confirm off
+gdb_test "set confirm off" "" "set confirm off"
+#test show confirm off
+gdb_test "show confirm" "Whether to confirm potentially dangerous operations is off..*" "show confirm (off)"
+#test set confirm on
+gdb_test "set confirm on" "" "set confirm on"
+#test show confirm on
+gdb_test "show confirm" "Whether to confirm potentially dangerous operations is on..*" "show confirm (on)"
+#test set editing off
+gdb_test "set editing off" "" "set editing off"
+#test show editing off
+gdb_test "show editing" "Editing of command lines as they are typed is off..*" "show editing (off)"
+#test set editing on
+#gdb_test "set editing on" "" "set editing on"
+#test show editing on
+#gdb_test "show editing" "Editing of command lines as they are typed is on..*" "show editing (on)"
+#test set environment FOOBARBAZ
+gdb_test "set environment FOOBARBAZ = grbxgrbxgrbx" "" "set environment FOOBARBAZ"
+#test show environment FOOBARBAZ
+gdb_test "show environment FOOBARBAZ" "FOOBARBAZ = grbxgrbxgrbx.*" "show environment FOOBARBAZ"
+#test set height 100
+gdb_test "set height 100" "" "set height 100"
+#test show height 100
+gdb_test "show height" "Number of lines gdb thinks are in a page is 100..*" "show height"
+#test set history expansion on
+gdb_test "set history expansion on" "" "set history expansion on"
+#test show history expansion on
+gdb_test "show history expansion on" "History expansion on command input is on.*" "show history expansion"
+#test set history filename foobar.baz
+gdb_test "set history filename foobar.baz" "" "set history filename foobar.baz"
+#test show history filename foobar.baz
+gdb_test "show history filename" "The filename in which to record the command history is \"foobar.baz\"..*" "show history filename (foobar.baz)"
+#test set history save on
+gdb_test "set history save on" "" "set history save on"
+#test show history save on
+gdb_test "show history save" "Saving of the history record on exit is on..*" "show history save (on)"
+#test set history size 100
+gdb_test "set history size 100" "" "set history size 100"
+#test show history size 100
+gdb_test "show history size" "The size of the command history is 100..*" "show history size (100)"
+#test set language asm
+gdb_test "set language asm" "" "set language asm"
+#test show language asm
+gdb_test "show language" "The current source language is \"asm\"..*" "show language (asm)"
+#test set language auto
+gdb_test "set language auto" "" "set language auto"
+#test show language
+gdb_test "show language" "The current source language is \"auto.*\"..*" "show language (auto)"
+#test set listsize 100
+gdb_test "set listsize 100" "" "set listsize 100"
+#test show listsize 100
+gdb_test "show listsize" "Number of source lines gdb will list by default is 100..*" "show listsize (100)"
+
+if ![board_info target exists gdb_prompt] {
+ #test set prompt (FooBarBaz)
+ set newprompt "\\(FooBarBaz\\)"
+ send_gdb "set prompt (FooBarBaz) \n"
+ gdb_expect {
+ -re "$newprompt $" { pass "set prompt (FooBarBaz) " }
+ timeout { fail "(timeout) set prompt (FooBarBaz) " }
+ }
+
+ #test show prompt (FooBarBaz)
+ send_gdb "show prompt\n"
+ gdb_expect {
+ -re "Gdb's prompt is \"$newprompt \"..* $" \
+ { pass "show prompt (FooBarBaz) " }
+ timeout { fail "(timeout) show prompt (FooBarBaz) " }
+ }
+
+ #test set prompt (gdb)
+ send_gdb "set prompt (gdb) \n"
+ gdb_expect {
+ -re "$gdb_prompt $" { pass "set prompt (gdb) " }
+ timeout { fail "(timeout) set prompt (gdb) " }
+ }
+}
+
+#test set radix 11
+gdb_test "set radix 11" "Unsupported output radix ``decimal 11''; output radix unchanged..*" "set radix 11"
+#test set radix 16
+gdb_test "set radix 16" "Input and output radices now set to decimal 16, hex 10, octal 20..*" "set radix 16"
+#test show radix 16
+gdb_test "show radix" "Input and output radices set to decimal 16, hex 10, octal 20..*" "show radix (16)"
+#test set radix 10
+gdb_test "set radix" "Input and output radices now set to decimal 10, hex a, octal 12..*" "set radix 10"
+#test show radix 10
+gdb_test "show radix" "Input and output radices set to decimal 10, hex a, octal 12..*" "show radix (10)"
+#test set width 90
+gdb_test "set width 90" "" "set width 90"
+#test show width 90
+gdb_test "show width" "Number of characters gdb thinks are in a line is 90..*" "show width (90)"
+#test set write on
+# This is only supported on targets which use exec.o.
+gdb_test "set write on" "" "set write on"
+#test show write on
+# This is only supported on targets which use exec.o.
+gdb_test "show write" "Writing into executable and core files is on..*" "show write (on)"
+#test set symbol-reloading on
+gdb_test "set symbol-reloading on" "" "set symbol-reloading on"
+#test show symbol-reloading on
+gdb_test "show symbol-reloading" "Dynamic symbol table reloading multiple times in one run is on..*" "show symbol-reloading (on)"
+#test show user
+gdb_test "show user" "" "show user"
+#test set verbose on
+gdb_test "set verbose on" "" "set verbose on"
+#test show verbose on
+gdb_test "show verbose" "Verbose printing of informational messages is on..*" "show verbose (on)"
+#test set verbose off
+gdb_test "set verbose off" "" "set verbose off"
+#test show verbose off
+gdb_test "show verbose" "Verbosity is off..*" "show verbose (off)"
diff --git a/gdb/testsuite/gdb.base/setvar.c b/gdb/testsuite/gdb.base/setvar.c
new file mode 100644
index 00000000000..969de0d5e71
--- /dev/null
+++ b/gdb/testsuite/gdb.base/setvar.c
@@ -0,0 +1,278 @@
+#include <stdlib.h>
+
+#ifdef PROTOTYPES
+int main (int argc, char **argv, char **envp)
+#else
+main (argc, argv, envp)
+ int argc;
+ char **argv;
+ char **envp;
+#endif
+{
+ extern void dummy();
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ dummy();
+ return 0;
+}
+
+/* We put main() right up front so its line number doesn't keep changing. */
+
+/*
+ * Test file with lots of different types, for testing the
+ * "whatis" command.
+ */
+
+/*
+ * First the basic C types.
+ */
+
+#if !defined (__STDC__) && !defined (_AIX)
+#define signed /**/
+#endif
+
+char v_char;
+signed char v_signed_char;
+unsigned char v_unsigned_char;
+
+short v_short;
+signed short v_signed_short;
+unsigned short v_unsigned_short;
+
+int v_int;
+signed int v_signed_int;
+unsigned int v_unsigned_int;
+
+long v_long;
+signed long v_signed_long;
+unsigned long v_unsigned_long;
+
+float v_float;
+double v_double;
+
+/*
+ * Now some derived types, which are arrays, functions-returning,
+ * pointers, structures, unions, and enumerations.
+ */
+
+/**** arrays *******/
+
+char v_char_array[2];
+signed char v_signed_char_array[2];
+unsigned char v_unsigned_char_array[2];
+
+short v_short_array[2];
+signed short v_signed_short_array[2];
+unsigned short v_unsigned_short_array[2];
+
+int v_int_array[2];
+signed int v_signed_int_array[2];
+unsigned int v_unsigned_int_array[2];
+
+long v_long_array[2];
+signed long v_signed_long_array[2];
+unsigned long v_unsigned_long_array[2];
+
+float v_float_array[2];
+double v_double_array[2];
+
+/**** pointers *******/
+
+char *v_char_pointer;
+signed char *v_signed_char_pointer;
+unsigned char *v_unsigned_char_pointer;
+
+short *v_short_pointer;
+signed short *v_signed_short_pointer;
+unsigned short *v_unsigned_short_pointer;
+
+int *v_int_pointer;
+signed int *v_signed_int_pointer;
+unsigned int *v_unsigned_int_pointer;
+
+long *v_long_pointer;
+signed long *v_signed_long_pointer;
+unsigned long *v_unsigned_long_pointer;
+
+float *v_float_pointer;
+double *v_double_pointer;
+
+/**** structs *******/
+
+struct t_struct {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_struct1;
+
+struct {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_struct2;
+
+/**** unions *******/
+
+union t_union {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_union;
+
+union {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_union2;
+
+/*** Functions returning type ********/
+
+char v_char_func () { return(0); }
+signed char v_signed_char_func () { return (0); }
+unsigned char v_unsigned_char_func () { return (0); }
+
+short v_short_func () { return (0); }
+signed short v_signed_short_func () { return (0); }
+unsigned short v_unsigned_short_func () { return (0); }
+
+int v_int_func () { return (0); }
+signed int v_signed_int_func () { return (0); }
+unsigned int v_unsigned_int_func () { return (0); }
+
+long v_long_func () { return (0); }
+signed long v_signed_long_func () { return (0); }
+unsigned long v_unsigned_long_func () { return (0); }
+
+float v_float_func () { return (0.0); }
+double v_double_func () { return (0.0); }
+
+/**** Some misc more complicated things *******/
+
+struct link {
+ struct link *next;
+#ifdef __STDC__
+ struct link *(*linkfunc) (struct link *this, int flags);
+#else
+ struct link *(*linkfunc) ();
+#endif
+ struct t_struct stuff[1][2][3];
+} *s_link;
+
+union tu_link {
+ struct link *next;
+#ifdef __STDC__
+ struct link *(*linkfunc) (struct link *this, int flags);
+#else
+ struct link *(*linkfunc) ();
+#endif
+ struct t_struct stuff[1][2][3];
+} u_link;
+
+/**** Enumerations *******/
+
+enum colors {red, green, blue} color;
+enum cars {chevy, ford, porsche} clunker;
+
+/**** Enumeration bitfields, supported by GNU C *******/
+
+#ifdef __GNUC__
+enum senum {sm1 = -1, s1 = 1};
+struct senum_field {enum senum field:2; } sef;
+enum uenum {u1 = 1, u2 = 2};
+struct uenum_field {enum uenum field:2; } uef;
+#endif
+
+void
+dummy ()
+{
+ /* setvar.exp wants to allocate memory for constants. So make sure malloc
+ gets linked into the program. */
+ malloc (1);
+
+ /* Some linkers (e.g. on AIX) remove unreferenced variables,
+ so make sure to reference them. */
+ v_char = 0;
+ v_signed_char = 1;
+ v_unsigned_char = 2;
+
+ v_short = 3;
+ v_signed_short = 4;
+ v_unsigned_short = 5;
+
+ v_int = 6;
+ v_signed_int = 7;
+ v_unsigned_int = 8;
+
+ v_long = 9;
+ v_signed_long = 10;
+ v_unsigned_long = 11;
+
+ v_float = 100.0;
+ v_double = 200.0;
+
+
+ v_char_array[0] = v_char;
+ v_signed_char_array[0] = v_signed_char;
+ v_unsigned_char_array[0] = v_unsigned_char;
+
+ v_short_array[0] = v_short;
+ v_signed_short_array[0] = v_signed_short;
+ v_unsigned_short_array[0] = v_unsigned_short;
+
+ v_int_array[0] = v_int;
+ v_signed_int_array[0] = v_signed_int;
+ v_unsigned_int_array[0] = v_unsigned_int;
+
+ v_long_array[0] = v_long;
+ v_signed_long_array[0] = v_signed_long;
+ v_unsigned_long_array[0] = v_unsigned_long;
+
+ v_float_array[0] = v_float;
+ v_double_array[0] = v_double;
+
+ v_char_pointer = &v_char;
+ v_signed_char_pointer = &v_signed_char;
+ v_unsigned_char_pointer = &v_unsigned_char;
+
+ v_short_pointer = &v_short;
+ v_signed_short_pointer = &v_signed_short;
+ v_unsigned_short_pointer = &v_unsigned_short;
+
+ v_int_pointer = &v_int;
+ v_signed_int_pointer = &v_signed_int;
+ v_unsigned_int_pointer = &v_unsigned_int;
+
+ v_long_pointer = &v_long;
+ v_signed_long_pointer = &v_signed_long;
+ v_unsigned_long_pointer = &v_unsigned_long;
+
+ v_float_pointer = &v_float;
+ v_double_pointer = &v_double;
+
+ color = red;
+ clunker = porsche;
+
+ u_link.next = s_link;
+
+ v_struct2.v_int_member = v_struct1.v_int_member;
+ v_union2.v_short_member = v_union.v_short_member;
+
+#ifdef __GNUC__
+ sef.field = s1;
+ uef.field = u1;
+#endif
+}
diff --git a/gdb/testsuite/gdb.base/setvar.exp b/gdb/testsuite/gdb.base/setvar.exp
new file mode 100644
index 00000000000..e14ed5d948e
--- /dev/null
+++ b/gdb/testsuite/gdb.base/setvar.exp
@@ -0,0 +1,434 @@
+# Copyright 1997, 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1995
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "setvar"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+#
+# set it up at a breakpoint so we canplay with the variable values
+#
+send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# Determine expected output for unsigned long variables,
+# the output varies with sizeof (unsigned long).
+
+set ulong_minus_1 4294967295
+set ulong_minus_456 4294966840
+send_gdb "print sizeof (unsigned long)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 4.*$gdb_prompt $" {}
+ -re ".\[0-9\]* = 8.*$gdb_prompt $" {
+ set ulong_minus_1 18446744073709551615
+ set ulong_minus_456 18446744073709551160
+ }
+ -re ".*$gdb_prompt $" {
+ fail "getting sizeof unsigned long"
+ }
+ default { fail "(timeout) getting sizeof unsigned long" }
+}
+
+proc test_set { args } {
+ global gdb_prompt
+
+ set length [expr [llength $args] - 1];
+ set message "[lindex $args $length]";
+ set final [expr $length - 2];
+ set count 1;
+
+ # Set up the variables.
+ for {set x 0;} {$x < $length} {incr x;} {
+ if { "[lindex $args $x]" != "" } {
+ set arg [lindex $args $x];
+ if { ($x == $final) || ([string first ".*" [lindex $args [expr $x + 1]]] >= 0) } {
+ set match [lindex $args [expr $x + 1]];
+ if { $count == 1 } {
+ set mess "$message"
+ } else {
+ set mess "$message (#$count)";
+ }
+ incr count;
+ incr x;
+ } else {
+ set mess "";
+ set match ""
+ }
+ verbose "doing $arg $match"
+ if [gdb_test "$arg" "$match" "$mess"] {
+ fail "$message -- $match";
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+#
+# test "set variable" for type "char"
+#
+# Because bare char types can be either signed or unsigned, we just test the
+# range of values that are common to both (0-127).
+#
+
+test_set "set variable v_char=0" "print v_char" ".\[0-9\]* = 0 \'.0\'" "set variable char=0"
+test_set "set variable v_char=1" "print v_char" ".\[0-9\]* = 1 \'.001\'" "set variable char=1"
+test_set "set variable v_char=27" "print v_char" ".\[0-9\]* = 27 \'.e\'" "set variable char=27 (Esc)"
+test_set "set variable v_char=32" "print v_char" ".\[0-9\]* = 32 \' \'" "set variable char=32 (SPC)"
+test_set "set variable v_char=65" "print v_char" ".\[0-9\]* = 65 \'A\'" "set variable char=65 ('A')"
+test_set "set variable v_char=97" "print v_char" ".\[0-9\]* = 97 \'a\'" "set variable char=97 ('a')"
+test_set "set variable v_char=126" "print v_char" ".\[0-9\]* = 126 \'~\'" "set variable char=126 ('~')"
+test_set "set variable v_char=127" "print v_char" ".\[0-9\]* = 127 \'.177\'" "set variable char=127 (8-bit)"
+#
+# test "set variable" for type "signed char"
+#
+test_set "set variable v_char=0" "print v_signed_char" ".\[0-9\]* = 0 \'.0\'" "set variable signed char=0"
+test_set "set variable v_signed_char=1" "print v_signed_char" ".\[0-9\]* = 1 \'.001\'" "set variable signed char=1"
+test_set "set variable v_signed_char=27" "print v_signed_char" ".\[0-9\]* = 27 \'.e\'" "set variable signed char=27 (Esc)"
+test_set "set variable v_signed_char=32" "print v_signed_char" ".\[0-9\]* = 32 \' \'" "set variable signed char=32 (SPC)"
+test_set "set variable v_signed_char=65" "print v_signed_char" ".\[0-9\]* = 65 \'A\'" "set variable signed char=65 ('A')"
+test_set "set variable v_signed_char=97" "print v_signed_char" ".\[0-9\]* = 97 \'a\'" "set variable signed char=97 ('a')"
+test_set "set variable v_signed_char=126" "print v_signed_char" ".\[0-9\]* = 126 \'~\'" "set variable signed char=126 ('~')"
+test_set "set variable v_signed_char=127" "print v_signed_char" ".\[0-9\]* = 127 \'.177\'" "set variable signed char=127 (8-bit)"
+gdb_test "set variable v_signed_char=-1" ""
+if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix4*" }
+gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \
+ "set variable signed char=-1 (-1)"
+gdb_test "set variable v_signed_char=0xFF" ""
+if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix4*" }
+gdb_test "print v_signed_char" ".\[0-9\]* = -1 \'.377\'" \
+ "set variable signed char=0xFF (0xFF)"
+#
+# test "set variable" for type "unsigned char"
+#
+test_set "set variable v_unsigned_char=0" "print v_unsigned_char" ".\[0-9\]* = 0 \'.0\'" "set variable unsigned char=0"
+test_set "set variable v_unsigned_char=1" "print v_unsigned_char" ".\[0-9\]* = 1 \'.001\'" "set variable unsigned char=1"
+test_set "set variable v_unsigned_char=27" "print v_unsigned_char" ".\[0-9\]* = 27 \'.e\'" "set variable unsigned char=27 (Esc)"
+test_set "set variable v_unsigned_char=32" "print v_unsigned_char" ".\[0-9\]* = 32 \' \'" "set variable unsigned char=32 (SPC)"
+test_set "set variable v_unsigned_char=65" "print v_unsigned_char" ".\[0-9\]* = 65 \'A\'" "set variable unsigned char=65 ('A')"
+test_set "set variable v_unsigned_char=97" "print v_unsigned_char" ".\[0-9\]* = 97 \'a\'" "set variable unsigned char=97 ('a')"
+test_set "set variable v_unsigned_char=126" "print v_unsigned_char" ".\[0-9\]* = 126 \'~\'" "set variable unsigned char=126 ('~')"
+test_set "set variable v_unsigned_char=~0" "print v_unsigned_char" ".\[0-9\]* = 255 \'.377\'" "set variable unsigned char=255 (8-bit)"
+#
+# test "set variable" for type "short"
+#
+test_set "set variable v_short=0" "print v_short" ".\[0-9\]* = 0" "set variable short=0"
+test_set "set variable v_short=1" "print v_short" ".\[0-9\]* = 1" "set variable short=1"
+test_set "set variable v_short=-1" "print v_short" ".\[0-9\]* = -1" "set variable short=-1 (minus)"
+#
+# test "set variable" for type "signed short"
+#
+test_set "set variable v_signed_short=0" "print v_signed_short" ".\[0-9\]* = 0" "set variable signed short=0"
+test_set "set variable v_signed_short=1" "print v_signed_short" ".\[0-9\]* = 1" "set variable signed short=1"
+test_set "set variable v_signed_short=-1" "print v_signed_short" ".\[0-9\]* = -1" "set variable signed short=-1 (minus)"
+#
+# test "set variable" for type "unsigned short"
+#
+test_set "set variable v_unsigned_short=0" "print v_unsigned_short" ".\[0-9\]* = 0" "set variable unsigned short=0"
+test_set "set variable v_unsigned_short=1" "print v_unsigned_short" ".\[0-9\]* = 1" "set variable unsigned short=1"
+test_set "set variable v_unsigned_short=~0" "print v_unsigned_short" ".\[0-9\]* = 65535" "set variable unsigned short=~0 (minus)"
+#
+# test "set variable" for type "int"
+#
+test_set "set variable v_int=0" "print v_int" ".\[0-9\]* = 0" "set variable int=0"
+test_set "set variable v_int=1" "print v_int" ".\[0-9\]* = 1" "set variable int=1"
+test_set "set variable v_int=-1" "print v_int" ".\[0-9\]* = -1" "set variable int=-1 (minus)"
+#
+# test "set variable" for type "signed int"
+#
+test_set "set variable v_signed_int=0" "print v_signed_int" ".\[0-9\]* = 0" "set variable signed int=0"
+test_set "set variable v_signed_int=1" "print v_signed_int" ".\[0-9\]* = 1" "set variable signed int=1"
+test_set "set variable v_signed_int=-1" "print v_signed_int" ".\[0-9\]* = -1" "set variable signed int=-1 (minus)"
+#
+# test "set variable" for type "unsigned int"
+#
+test_set "set variable v_unsigned_int=0" "print v_unsigned_int" ".\[0-9\]* = 0" "set variable unsigned int=0"
+test_set "set variable v_unsigned_int=1" "print v_unsigned_int" ".\[0-9\]* = 1" "set variable unsigned int=1"
+test_set "set variable v_unsigned_int=~0" "print v_unsigned_int" ".\[0-9\]* = (4294967295|65535)" "set variable unsigned int=~0 (minus)"
+#test_set ".\[0-9\]* = 65535" "set variable unsigned int=~0 (minus)"
+#
+# test "set variable" for type "long"
+#
+test_set "set variable v_long=0" "print v_long" ".\[0-9\]* = 0" "set variable long=0"
+test_set "set variable v_long=1" "print v_long" ".\[0-9\]* = 1" "set variable long=1"
+test_set "set variable v_long=-1" "print v_long" ".\[0-9\]* = -1" "set variable long=-1 (minus)"
+#
+# test "set variable" for type "signed long"
+#
+test_set "set variable v_signed_long=0" "print v_signed_long" ".\[0-9\]* = 0" "set variable signed long=0"
+test_set "set variable v_signed_long=1" "print v_signed_long" ".\[0-9\]* = 1" "set variable signed long=1"
+test_set "set variable v_signed_long=-1" "print v_signed_long" ".\[0-9\]* = -1" "set variable signed long=-1 (minus)"
+#
+# test "set variable" for type "unsigned long"
+#
+test_set "set variable v_unsigned_long=0" "print v_unsigned_long" ".\[0-9\]* = 0" "set variable unsigned long=0"
+test_set "set variable v_unsigned_long=1" "print v_unsigned_long" ".\[0-9\]* = 1" "set variable unsigned long=1"
+test_set "set variable v_unsigned_long=~0" "print v_unsigned_long" ".\[0-9\]* = $ulong_minus_1" "set variable unsigned long=~0 (minus)"
+#
+# test "set variable" for type "float"
+#
+test_set "set variable v_float=0.0" "print v_float" ".\[0-9\]* = 0" "set variable float=0"
+test_set "set variable v_float=1.0" "print v_float" ".\[0-9\]* = 1" "set variable float=1"
+test_set "set variable v_float=-1.0" "print v_float" ".\[0-9\]* = -1" "set variable float=-1 (minus)"
+#
+# test "set variable" for type "double"
+#
+test_set "set variable v_double=0.0" "print v_double" ".\[0-9\]* = 0" "set variable double=0"
+test_set "set variable v_double=1.0" "print v_double" ".\[0-9\]* = 1" "set variable double=1"
+test_set "set variable v_double=-1.0" "print v_double" ".*.\[0-9\]* = -1" "set variable double=-1 (minus)"
+#
+# test "set variable" for "char array[2]"
+#
+test_set "set variable v_char_array\[0\]='h'" "set variable v_char_array\[1\]='i'" "print v_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable char array=\"hi\" (string)"
+#
+# test "set variable" for "signed char array[2]"
+#
+test_set "set variable v_signed_char_array\[0\]='h'" "set variable v_signed_char_array\[1\]='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable signed char array=\"hi\" (string)"
+#
+# test "set variable" for "unsigned char array[2]"
+#
+test_set "set variable v_unsigned_char_array\[0\]='h'" "set variable v_unsigned_char_array\[1\]='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\"" "set variable unsigned char array=\"hi\" (string)"
+#
+# test "set variable" for "short array[2]"
+#
+test_set "set variable v_short_array\[0\]=123" "set variable v_short_array\[1\]=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable short array"
+#
+# test "set variable" for "signed short array[2]"
+#
+test_set "set variable v_signed_short_array\[0\]=123" "set variable v_signed_short_array\[1\]=-456" "print v_signed_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed short array"
+#
+# test "set variable" for "unsigned short array[2]"
+#
+test_set "set variable v_unsigned_short_array\[0\]=123" "set variable v_unsigned_short_array\[1\]=-456" "print v_unsigned_short_array" ".*.\[0-9\]* =.*\\{123,.*65080\\}" "set variable unsigned short array"
+#
+# test "set variable" for "int array[2]"
+#
+test_set "set variable v_int_array\[0\]=123" "set variable v_int_array\[1\]=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable int array"
+#
+# test "set variable" for "signed int array[2]"
+#
+test_set "set variable v_signed_int_array\[0\]=123" "set variable v_signed_int_array\[1\]=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed int array"
+#
+# test "set variable" for "unsigned int array[2]"
+#
+test_set "set variable v_unsigned_int_array\[0\]=123" "set variable v_unsigned_int_array\[1\]=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\\{123,.*(4294966840|65080)\\}" "set variable unsigned int array"
+#
+# test "set variable" for "long array[2]"
+#
+test_set "set variable v_long_array\[0\]=123" "set variable v_long_array\[1\]=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable long array"
+#
+# test "set variable" for "signed long array[2]"
+#
+test_set "set variable v_signed_long_array\[0\]=123" "set variable v_signed_long_array\[1\]=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable signed long array"
+#
+# test "set variable" for "unsigned long array[2]"
+#
+test_set "set variable v_unsigned_long_array\[0\]=123" "set variable v_unsigned_long_array\[1\]=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}" "set variable unsigned long array"
+#
+# test "set variable" for "float array[2]"
+#
+test_set "set variable v_float_array\[0\]=123.0" "set variable v_float_array\[1\]=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable float array"
+#
+# test "set variable" for "double array[2]"
+#
+test_set "set variable v_double_array\[0\]=123.0" "set variable v_double_array\[1\]=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "set variable double array"
+#
+# test "set variable" for type "char *"
+#
+test_set "set v_char_pointer=v_char_array" "set variable *(v_char_pointer)='h'" "set variable *(v_char_pointer+1)='i'" "print v_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable char pointer=\"hi\" (string)"
+#
+# test "set variable" for type "signed char *"
+#
+test_set "set v_signed_char_pointer=v_signed_char_array" "set variable *(v_signed_char_pointer)='h'" "set variable *(v_signed_char_pointer+1)='i'" "print v_signed_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_signed_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable signed char pointer=\"hi\" (string)"
+#
+# test "set variable" for type "unsigned char *"
+#
+test_set "set v_unsigned_char_pointer=v_unsigned_char_array" "set variable *(v_unsigned_char_pointer)='h'" "set variable *(v_unsigned_char_pointer+1)='i'" "print v_unsigned_char_array" ".*.\[0-9\]* =.*\"hi\"" "print *(v_unsigned_char_pointer+1)" ".*.\[0-9\]* = 105 \'i\'" "set variable unsigned char pointer=\"hi\" (string)"
+#
+# test "set variable" for type "short *"
+#
+test_set "set v_short_pointer=v_short_array" "set variable *(v_short_pointer)=123" "set variable *(v_short_pointer+1)=-456" "print v_short_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_short_pointer+1)" ".*.\[0-9\]* = -456" "set variable short pointer"
+#
+# test "set variable" for type "signed short *"
+#
+gdb_test "set v_signed_short_pointer=v_signed_short_array" ""
+gdb_test "set variable *(v_signed_short_pointer)=123" ""
+gdb_test "set variable *(v_signed_short_pointer+1)=-456" ""
+gdb_test "print v_signed_short_array" ".\[0-9\]* =.*\\{123,.*-456\\}" \
+ "set variable signed short pointer"
+gdb_test "print *(v_signed_short_pointer+1)" ".\[0-9\]*.*=.*-456"
+#
+# test "set variable" for type "unsigned short *"
+#
+gdb_test "set v_unsigned_short_pointer=v_unsigned_short_array" ""
+gdb_test "set variable *(v_unsigned_short_pointer)=123" ""
+gdb_test "set variable *(v_unsigned_short_pointer+1)=-456" ""
+# DTS 10060CLLbs - bad type info from cc
+if {$hp_cc_compiler} {setup_xfail hppa*-*-*11* 10060CLLbs}
+gdb_test "print v_unsigned_short_array" ".\[0-9\]* =.*\\{123,.*65080\\}" \
+ "set variable unsigned short pointer"
+# DTS 10060CLLbs - bad type info from cc
+if {$hp_cc_compiler} {setup_xfail hppa*-*-*11* 10060CLLbs}
+gdb_test "print *(v_unsigned_short_pointer+1)" ".\[0-9\]* = 65080"
+#
+# test "set variable" for type "int *"
+#
+test_set "set v_int_pointer=v_int_array" "set variable *(v_int_pointer)=123" "set variable *(v_int_pointer+1)=-456" "print v_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_int_pointer+1)" ".*.\[0-9\]* = -456" "set variable int pointer"
+#
+# test "set variable" for type "signed int *"
+#
+test_set "set v_signed_int_pointer=v_signed_int_array" "set variable *(v_signed_int_pointer)=123" "set variable *(v_signed_int_pointer+1)=-456" "print v_signed_int_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_signed_int_pointer+1)" ".*.\[0-9\]* = -456" "set variable signed int pointer"
+#
+# test "set variable" for type "unsigned int *"
+#
+test_set "set v_unsigned_int_pointer=v_unsigned_int_array" "set variable *(v_unsigned_int_pointer)=123" "set variable *(v_unsigned_int_pointer+1)=-456" "print v_unsigned_int_array" ".*.\[0-9\]* =.*\\{123,.*(4294966840|65080)\\}" "set variable unsigned int pointer"
+test_set "" "print *(v_unsigned_int_pointer+1)" ".*.\[0-9\]* = (4294966840|65080)" "print variable unsigned int pointer+1"
+#
+# test "set variable" for type "long *"
+#
+test_set "set v_long_pointer=v_long_array" "set variable *(v_long_pointer)=123" "set variable *(v_long_pointer+1)=-456" "print v_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_long_pointer+1)" ".*.\[0-9\]* = -456" "set variable long pointer"
+#
+# test "set variable" for type "signed long *"
+#
+test_set "set v_signed_long_pointer=v_signed_long_array" "set variable *(v_signed_long_pointer)=123" "set variable *(v_signed_long_pointer+1)=-456" "print v_signed_long_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_signed_long_pointer+1)" ".*.\[0-9\]* = -456" "set variable signed long pointer"
+#
+# test "set variable" for type "unsigned long *"
+#
+test_set "set v_unsigned_long_pointer=v_unsigned_long_array" "set variable *(v_unsigned_long_pointer)=123" "set variable *(v_unsigned_long_pointer+1)=-456" "print v_unsigned_long_array" ".*.\[0-9\]* =.*\\{123,.*$ulong_minus_456\\}" "print *(v_unsigned_long_pointer+1)" ".*.\[0-9\]* = $ulong_minus_456" "set variable unsigned long pointer"
+#
+# test "set variable" for type "float *"
+#
+test_set "set v_float_pointer=v_float_array" "set variable *(v_float_pointer)=123.0" "set variable *(v_float_pointer+1)=-456.0" "print v_float_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_float_pointer+1)" ".*.\[0-9\]* = -456" "set variable float pointer"
+#
+# test "set variable" for type "double *"
+#
+test_set "set v_double_pointer=v_double_array" "set variable *(v_double_pointer)=123.0" "set variable *(v_double_pointer+1)=-456.0" "print v_double_array" ".*.\[0-9\]* =.*\\{123,.*-456\\}" "print *(v_double_pointer+1)" ".*.\[0-9\]* = -456" "set variable double pointer"
+#
+# test "set variable" for struct members
+#
+test_set "set variable v_struct1.v_char_member='h'" "print v_struct1.v_char_member" ".*.\[0-9\]* = 104 \'h\'" "set variable structure char member"
+test_set "set variable v_struct1.v_short_member=1" "print v_struct1.v_short_member" ".*.\[0-9\]* = 1" "set variable structure short member"
+test_set "set variable v_struct1.v_int_member=2" "print v_struct1.v_int_member" ".*.\[0-9\]* = 2" "set variable structure int member"
+test_set "set variable v_struct1.v_long_member=3" "print v_struct1.v_long_member" ".*.\[0-9\]* = 3" "set variable structure long member"
+test_set "set variable v_struct1.v_float_member=4.0" "print v_struct1.v_float_member" ".*.\[0-9\]* = 4" "set variable structure float member"
+test_set "set variable v_struct1.v_double_member=5.0" "print v_struct1.v_double_member" ".*.\[0-9\]* = 5" "set variable structure double member"
+
+gdb_test "print v_struct1" \
+ ".*.\[0-9\]* = \{.*v_char_member = 104 \'h\',.*v_short_member = 1,\
+.*v_int_member = 2,.*\
+v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\}" \
+ "set print structure #1"
+
+# Some believe that the following should be an error. GCC extensions for
+# structure constants require the type of the structure to be specified, as in
+# v_struct1 = (struct t_struct) {32, 33, 34, 35, 36, 37}
+# The argument is that GDB should do the same if it wants to provide this
+# feature, i.e., require the cast.
+# We decided that we don't want the debugger to be as picky as a
+# compiler and make us type complex casts.
+
+# We need to up this because this can be really slow on some boards.
+# (malloc() is called as part of the test).
+set timeout 60;
+
+# Change the values
+test_set "set variable v_struct1 = {32, 33, 34, 35, 36, 37}" \
+ "print v_struct1" \
+ ".*.\[0-9\]* = \\{.*v_char_member = 32 \' \',.*v_short_member = 33,\
+.*v_int_member = 34,.*\
+v_long_member = 35,.*v_float_member = 36,.*v_double_member = 37.*\\}" \
+ "set print structure #2"
+
+# Change them back
+test_set "set variable v_struct1 = {'h', 1, 2, 3, 4.0, 5.0}" \
+ "print v_struct1" \
+ ".*.\[0-9\]* = \\{.*v_char_member = 104 \'h\',.*v_short_member = 1,\
+.*v_int_member = 2,.*\
+v_long_member = 3,.*v_float_member = 4,.*v_double_member = 5.*\\}" \
+ "set print structure #3"
+
+# Test printing of enumeration bitfields.
+# GNU C supports them, some other compilers don't.
+
+if {$gcc_compiled} then {
+ gdb_test "print sef.field=sm1" ".*.\[0-9\]* = sm1"
+ gdb_test "print sef.field" ".*.\[0-9\]* = sm1" "print sef.field (sm1)"
+ gdb_test "print sef.field=s1" ".*.\[0-9\]* = s1"
+ gdb_test "print sef.field" ".*.\[0-9\]* = s1" "print sef.field (s1)"
+ gdb_test "print uef.field=u2" ".*.\[0-9\]* = u2"
+ gdb_test "print uef.field" ".*.\[0-9\]* = u2" "print uef.field (u2)"
+ gdb_test "print uef.field=u1" ".*.\[0-9\]* = u1"
+ gdb_test "print uef.field" ".*.\[0-9\]* = u1" "print uef.field (u1)"
+
+ # Test for truncation when assigning invalid values to bitfields.
+ gdb_test "print sef.field=7" \
+ ".*warning: Value does not fit in 2 bits.*\[0-9\]* = sm1"
+ gdb_test "print uef.field=6" \
+ ".*warning: Value does not fit in 2 bits.*\[0-9\]* = u2"
+}
diff --git a/gdb/testsuite/gdb.base/shlib-call.exp b/gdb/testsuite/gdb.base/shlib-call.exp
new file mode 100644
index 00000000000..47919be4c03
--- /dev/null
+++ b/gdb/testsuite/gdb.base/shlib-call.exp
@@ -0,0 +1,296 @@
+# Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# file to test calls into shared libraries
+# the source files for this test are:
+#
+# shmain.c
+# shr1.c (shared lib)
+# shr2.c (shared lib)
+# ss.h (header for shr2.c)
+#
+# file written by Elena Zannoni: elz@ch.apollo.com
+#
+
+#debug shmain
+#prop lib shr1.sl
+#prop lib shr2.sl
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# are we on a target board?
+if ![isnative] then {
+ return 0
+}
+
+set testfile "shmain"
+set libfile "shr"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# build the first test case
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+# Build the shared libraries this test case needs.
+#
+
+if {$gcc_compiled == 0} {
+ if [istarget "hppa*-hp-hpux*"] then {
+ set additional_flags "additional_flags=+z"
+ } else {
+ # don't know what the compiler is...
+ set additional_flags ""
+ }
+} else {
+ if { ([istarget "powerpc*-*-aix*"]
+ || [istarget "rs6000*-*-aix*"]) } {
+ set additional_flags ""
+ } else {
+ set additional_flags "additional_flags=-fpic"
+ }
+}
+
+if {[gdb_compile "${srcdir}/${subdir}/${libfile}1.c" "${objdir}/${subdir}/${libfile}1.o" object [list debug $additional_flags]] != ""} {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if {[gdb_compile "${srcdir}/${subdir}/${libfile}2.c" "${objdir}/${subdir}/${libfile}2.o" object [list debug $additional_flags]] != ""} {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [istarget "hppa*-*-hpux*"] {
+ remote_exec build "ld -b ${objdir}/${subdir}/${libfile}1.o -o ${objdir}/${subdir}/${libfile}1.sl"
+ remote_exec build "ld -b ${objdir}/${subdir}/${libfile}2.o -o ${objdir}/${subdir}/${libfile}2.sl"
+} else {
+ set additional_flags "additional_flags=-shared"
+ if {[gdb_compile "${objdir}/${subdir}/${libfile}1.o" "${objdir}/${subdir}/${libfile}1.sl" executable [list debug $additional_flags]] != ""} {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+ if {[gdb_compile "${objdir}/${subdir}/${libfile}2.o" "${objdir}/${subdir}/${libfile}2.sl" executable [list debug $additional_flags]] != ""} {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+}
+
+if { ($gcc_compiled
+ && ([istarget "powerpc*-*-aix*"]
+ || [istarget "rs6000*-*-aix*"] )) } {
+ set additional_flags "additional_flags=-L${objdir}/${subdir}"
+} else {
+ set additional_flags ""
+}
+if {[gdb_compile "${objdir}/${subdir}/${testfile}.o ${objdir}/${subdir}/${libfile}1.sl ${objdir}/${subdir}/${libfile}2.sl" "${binfile}" executable [list debug $additional_flags]] != ""} {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
+
+
+if ![runto_main] then {
+ perror "C function calling tests suppressed"
+}
+
+
+#step -over
+
+ send_gdb "next\n"
+ gdb_expect {
+ -re ".*g = shr1\\(g\\).*$gdb_prompt $" {pass "next to shr1"}
+ -re ".*$gdb_prompt $" { fail "next to shr1" }
+ timeout { fail "next to shr1 (timeout)" }
+ }
+
+
+
+#print g
+
+send_gdb "print g\n"
+gdb_expect {
+ -re ".*\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print g"
+ }
+ -re ".*$gdb_prompt $" { fail "print g" }
+ timeout { fail "(timeout) print g" }
+ }
+
+
+#step -over
+ if ![gdb_skip_stdio_test "next over shr1"] {
+ send_gdb "next\n"
+ gdb_expect {
+ -re ".*address of sgs is $hex.*g = shr2\\(g\\).*$gdb_prompt $" {
+ pass "next over shr1"
+ }
+ -re ".*$gdb_prompt $" { fail "next over shr1" }
+ timeout { fail "next over shr1 (timeout)" }
+ }
+ } else {
+ gdb_test "next" "" ""
+ }
+
+
+#print g
+send_gdb "print g\n"
+gdb_expect {
+ -re ".*\[0-9\]* = 2.*$gdb_prompt $" {
+ pass "print g" }
+ -re ".*$gdb_prompt $" { fail "print g" }
+ timeout { fail "(timeout) print g" }
+ }
+
+#print shr1(1)
+ if ![gdb_skip_stdio_test "print shr1(1)"] {
+ send_gdb "print shr1(1)\n"
+ gdb_expect {
+ -re ".*address of sgs is $hex.*\[0-9\]* = 2.*$gdb_prompt $" {
+ pass "print shr1(1)"
+ }
+ -re ".*$gdb_prompt $" { fail "print shr1(1)" }
+ timeout { fail "(timeout) print shr1(1)" }
+ }
+ }
+
+#print shr1(g)
+ if ![gdb_skip_stdio_test "print shr1(g)"] {
+ send_gdb "print shr1(g)\n"
+ gdb_expect {
+ -re ".*address of sgs is $hex.*\[0-9\]* = 4.*$gdb_prompt $" {
+ pass "print shr1(g)"
+ }
+ -re ".*$gdb_prompt $" { fail "print shr1(g)" }
+ timeout { fail "(timeout) print shr1(g)" }
+ }
+ }
+
+#break shr2
+#go
+gdb_test "break shr2" \
+ "Breakpoint.*file.*shr2.c, line.*" \
+ "breakpoint function shr2"
+
+gdb_test "continue" \
+ "Continuing\\..*Breakpoint \[0-9\]+, shr2 \\(.*\\) at.*shr2\\.c:7.*7.*return 2.x;" \
+ "run until breakpoint set at a function"
+
+
+#print shr1(1)
+if ![gdb_skip_stdio_test "print shr1(1) 2nd time"] {
+ send_gdb "print shr1(1)\n"
+ gdb_expect {
+ -re ".*address of sgs is $hex.*\[0-9\]* = 2.*$gdb_prompt $" {
+ pass "print shr1(1) 2nd time"
+ }
+ -re ".*$gdb_prompt $" { fail "print shr1(1) 2nd time" }
+ timeout { fail "(timeout) print shr1(1) 2nd time" }
+ }
+}
+
+#print mainshr1(1)
+send_gdb "print mainshr1(1)\n"
+gdb_expect {
+ -re ".*\[0-9\]* = 2.*$gdb_prompt $" {
+ pass "print mainshr1(1) from shlib func"
+ }
+ -re ".*$gdb_prompt $" { fail "print mainshr1(1) from shlib func" }
+ timeout { fail "(timeout) print mainshr1(1) from shlib func" }
+ }
+
+#step -return
+ send_gdb "step\n"
+ gdb_expect {
+ -re ".*\\\}.*$gdb_prompt $" { pass "step inside shr2 (shlib func)"}
+ -re ".*$gdb_prompt $" { fail "step inside shr2 (shlib func)" }
+ timeout { fail "step inside shr2 (shlib func) (timeout)" }
+ }
+
+ send_gdb "step\n"
+ gdb_expect {
+ -re "main \\(\\) at.*g = mainshr1\\(g\\);.*$gdb_prompt $" { pass "step out of shr2 to main"}
+ -re ".*$gdb_prompt $" { fail "step out of shr2 to main" }
+ timeout { fail "step out of shr2 to main (timeout)" }
+ }
+
+#print mainshr1(1)
+send_gdb "print mainshr1(1)\n"
+gdb_expect {
+ -re ".*\[0-9\]* = 2.*$gdb_prompt $" {
+ pass "print mainshr1(1)"
+ }
+ -re ".*$gdb_prompt $" { fail "print mainshr1(1) from main" }
+ timeout { fail "(timeout) print mainshr1(1) from main" }
+ }
+
+#step
+ send_gdb "step\n"
+ gdb_expect {
+ -re ".*mainshr1 \\(g=4\\) at.*return 2.g;.*$gdb_prompt $" { pass "step into mainshr1"}
+ -re ".*$gdb_prompt $" { fail "step into mainshr1" }
+ timeout { fail "step into mainshr1 (timeout)" }
+ }
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
+
+# PR's 16495, 18213
+# test that we can re-set breakpoints in shared libraries
+gdb_test "break shr1" "Breakpoint 1.*" "set bp in shared library"
+
+# FIXME: should not send "run" explicitly. Non-portable.
+
+if ![is_remote target] {
+ gdb_test "run" "Starting program:.*Breakpoint 1,.*" \
+ "run to bp in shared library"
+
+ gdb_test "cont" ".*Program exited normally..*"
+
+ gdb_test "run" "Starting program:.*Breakpoint 1,.*" \
+ "re-run to bp in shared library (PR's 16495, 18213)"
+
+ gdb_test "cont" ".*Program exited normally..*"
+}
+
+return 0
diff --git a/gdb/testsuite/gdb.base/shmain.c b/gdb/testsuite/gdb.base/shmain.c
new file mode 100644
index 00000000000..7013db52328
--- /dev/null
+++ b/gdb/testsuite/gdb.base/shmain.c
@@ -0,0 +1,56 @@
+/* A test */
+
+#include "ss.h"
+#include <stdio.h>
+
+extern int structarg(struct s);
+extern int pstructarg(struct s*);
+extern int shr1(int);
+extern int shr2(int);
+extern float sg;
+
+int eglob;
+
+struct {
+ int a;
+ int b;
+} s;
+
+int g;
+
+#ifdef PROTOTYPES
+int local_structarg(struct s x)
+#else
+int local_structarg(x)
+struct s x;
+#endif
+{
+ return x.b;
+}
+
+#ifdef PROTOTYPES
+int mainshr1(int g)
+#else
+int mainshr1(g)
+int g;
+#endif
+{
+ return 2*g;
+}
+
+int main()
+{
+ struct s y;
+ g = 1;
+ g = shr1(g);
+ g = shr2(g);
+ g = mainshr1(g);
+ sg = 1.1;
+ printf("address of sg is 0x%x\n", &sg);
+ y.a = 3;
+ y.b = 4;
+ g = local_structarg(y);
+ g = structarg(y);
+ g = pstructarg(&y);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/shr1.c b/gdb/testsuite/gdb.base/shr1.c
new file mode 100644
index 00000000000..a0257e40233
--- /dev/null
+++ b/gdb/testsuite/gdb.base/shr1.c
@@ -0,0 +1,63 @@
+#include "ss.h"
+#include <stdio.h>
+
+typedef float f;
+
+float sg = 5.5;
+int sgi = 2;
+static int sgs = 7;
+
+#ifdef PROTOTYPES
+int shr1(int x)
+#else
+int shr1(x)
+int x;
+#endif
+{
+ f mumble;
+ int l;
+ l = 1;
+ {
+ int l;
+ l = 2;
+ }
+ mumble = 7.7;
+ sg = 6.6;
+ sgi++;
+ sgs = 8;
+ printf("address of sgs is 0x%x\n", &sgs);
+ return 2*x;
+}
+
+#ifdef PROTOTYPES
+static int shr1_local(int x)
+#else
+static int shr1_local(x)
+int x;
+#endif
+{
+ return 2*x;
+}
+
+#ifdef PROTOTYPES
+int structarg(struct s x)
+#else
+int structarg(x)
+struct s x;
+#endif
+{
+ return x.a;
+}
+
+#ifdef PROTOTYPES
+int pstructarg(struct s *x)
+#else
+int pstructarg(x)
+struct s *x;
+#endif
+{
+ return x->a;
+}
+
+
+
diff --git a/gdb/testsuite/gdb.base/shr2.c b/gdb/testsuite/gdb.base/shr2.c
new file mode 100644
index 00000000000..de34986d76d
--- /dev/null
+++ b/gdb/testsuite/gdb.base/shr2.c
@@ -0,0 +1,17 @@
+#ifdef PROTOTYPES
+int shr2(int x)
+#else
+int shr2(x) int x;
+#endif
+{
+ return 2*x;
+}
+
+#ifdef PROTOTYPES
+int shr2_local(int x)
+#else
+int shr2_local(x) int x;
+#endif
+{
+ return 2*x;
+}
diff --git a/gdb/testsuite/gdb.base/sigall.c b/gdb/testsuite/gdb.base/sigall.c
new file mode 100644
index 00000000000..30d06f367d3
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sigall.c
@@ -0,0 +1,1810 @@
+#include <signal.h>
+#include <unistd.h>
+
+#ifdef __sh__
+#define signal(a,b) /* Signals not supported on this target - make them go away */
+#endif
+
+/* Signal handlers, we set breakpoints in them to make sure that the
+ signals really get delivered. */
+
+#ifdef PROTOTYPES
+void
+handle_ABRT (int sig)
+#else
+void
+handle_ABRT (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_HUP (int sig)
+#else
+void
+handle_HUP (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_QUIT (int sig)
+#else
+void
+handle_QUIT (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_ILL (int sig)
+#else
+void
+handle_ILL (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_EMT (int sig)
+#else
+void
+handle_EMT (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_FPE (int sig)
+#else
+void
+handle_FPE (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_BUS (int sig)
+#else
+void
+handle_BUS (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_SEGV (int sig)
+#else
+void
+handle_SEGV (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_SYS (int sig)
+#else
+void
+handle_SYS (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_PIPE (int sig)
+#else
+void
+handle_PIPE (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_ALRM (int sig)
+#else
+void
+handle_ALRM (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_URG (int sig)
+#else
+void
+handle_URG (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_TSTP (int sig)
+#else
+void
+handle_TSTP (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_CONT (int sig)
+#else
+void
+handle_CONT (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_CHLD (int sig)
+#else
+void
+handle_CHLD (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_TTIN (int sig)
+#else
+void
+handle_TTIN (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_TTOU (int sig)
+#else
+void
+handle_TTOU (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_IO (int sig)
+#else
+void
+handle_IO (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_XCPU (int sig)
+#else
+void
+handle_XCPU (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_XFSZ (int sig)
+#else
+void
+handle_XFSZ (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_VTALRM (int sig)
+#else
+void
+handle_VTALRM (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_PROF (int sig)
+#else
+void
+handle_PROF (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_WINCH (int sig)
+#else
+void
+handle_WINCH (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_LOST (int sig)
+#else
+void
+handle_LOST (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_USR1 (int sig)
+#else
+void
+handle_USR1 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_USR2 (int sig)
+#else
+void
+handle_USR2 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_PWR (int sig)
+#else
+void
+handle_PWR (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_POLL (int sig)
+#else
+void
+handle_POLL (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_WIND (int sig)
+#else
+void
+handle_WIND (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_PHONE (int sig)
+#else
+void
+handle_PHONE (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_WAITING (int sig)
+#else
+void
+handle_WAITING (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_LWP (int sig)
+#else
+void
+handle_LWP (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_DANGER (int sig)
+#else
+void
+handle_DANGER (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_GRANT (int sig)
+#else
+void
+handle_GRANT (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_RETRACT (int sig)
+#else
+void
+handle_RETRACT (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_MSG (int sig)
+#else
+void
+handle_MSG (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_SOUND (int sig)
+#else
+void
+handle_SOUND (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_SAK (int sig)
+#else
+void
+handle_SAK (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_PRIO (int sig)
+#else
+void
+handle_PRIO (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_33 (int sig)
+#else
+void
+handle_33 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_34 (int sig)
+#else
+void
+handle_34 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_35 (int sig)
+#else
+void
+handle_35 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_36 (int sig)
+#else
+void
+handle_36 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_37 (int sig)
+#else
+void
+handle_37 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_38 (int sig)
+#else
+void
+handle_38 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_39 (int sig)
+#else
+void
+handle_39 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_40 (int sig)
+#else
+void
+handle_40 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_41 (int sig)
+#else
+void
+handle_41 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_42 (int sig)
+#else
+void
+handle_42 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_43 (int sig)
+#else
+void
+handle_43 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_44 (int sig)
+#else
+void
+handle_44 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_45 (int sig)
+#else
+void
+handle_45 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_46 (int sig)
+#else
+void
+handle_46 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_47 (int sig)
+#else
+void
+handle_47 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_48 (int sig)
+#else
+void
+handle_48 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_49 (int sig)
+#else
+void
+handle_49 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_50 (int sig)
+#else
+void
+handle_50 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_51 (int sig)
+#else
+void
+handle_51 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_52 (int sig)
+#else
+void
+handle_52 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_53 (int sig)
+#else
+void
+handle_53 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_54 (int sig)
+#else
+void
+handle_54 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_55 (int sig)
+#else
+void
+handle_55 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_56 (int sig)
+#else
+void
+handle_56 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_57 (int sig)
+#else
+void
+handle_57 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_58 (int sig)
+#else
+void
+handle_58 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_59 (int sig)
+#else
+void
+handle_59 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_60 (int sig)
+#else
+void
+handle_60 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_61 (int sig)
+#else
+void
+handle_61 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_62 (int sig)
+#else
+void
+handle_62 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_63 (int sig)
+#else
+void
+handle_63 (sig)
+ int sig;
+#endif
+{
+}
+
+#ifdef PROTOTYPES
+void
+handle_TERM (int sig)
+#else
+void
+handle_TERM (sig)
+ int sig;
+#endif
+{
+}
+
+/* Functions to send signals. These also serve as markers. */
+int
+gen_ABRT ()
+{
+ kill (getpid (), SIGABRT);
+ return 0;
+}
+
+int
+gen_HUP ()
+{
+#ifdef SIGHUP
+ kill (getpid (), SIGHUP);
+#else
+ handle_HUP (0);
+#endif
+return 0;
+}
+
+int
+gen_QUIT ()
+{
+#ifdef SIGQUIT
+ kill (getpid (), SIGQUIT);
+#else
+ handle_QUIT (0);
+#endif
+return 0;
+}
+
+int
+gen_ILL ()
+{
+#ifdef SIGILL
+ kill (getpid (), SIGILL);
+#else
+ handle_ILL (0);
+#endif
+return 0;
+}
+
+int
+gen_EMT ()
+{
+#ifdef SIGEMT
+ kill (getpid (), SIGEMT);
+#else
+ handle_EMT (0);
+#endif
+return 0;
+}
+
+int x;
+
+int
+gen_FPE ()
+{
+ /* The intent behind generating SIGFPE this way is to check the mapping
+ from the CPU exception itself to the signals. It would be nice to
+ do the same for SIGBUS, SIGSEGV, etc., but I suspect that even this
+ test might turn out to be insufficiently portable. */
+
+#if 0
+ /* Loses on the PA because after the signal handler executes we try to
+ re-execute the failing instruction again. Perhaps we could siglongjmp
+ out of the signal handler? */
+ /* The expect script looks for the word "kill"; don't delete it. */
+ return 5 / x; /* and we both started jumping up and down yelling kill */
+#else
+ kill (getpid (), SIGFPE);
+#endif
+return 0;
+}
+
+int
+gen_BUS ()
+{
+#ifdef SIGBUS
+ kill (getpid (), SIGBUS);
+#else
+ handle_BUS (0);
+#endif
+return 0;
+}
+
+int
+gen_SEGV ()
+{
+#ifdef SIGSEGV
+ kill (getpid (), SIGSEGV);
+#else
+ handle_SEGV (0);
+#endif
+return 0;
+}
+
+int
+gen_SYS ()
+{
+#ifdef SIGSYS
+ kill (getpid (), SIGSYS);
+#else
+ handle_SYS (0);
+#endif
+return 0;
+}
+
+int
+gen_PIPE ()
+{
+#ifdef SIGPIPE
+ kill (getpid (), SIGPIPE);
+#else
+ handle_PIPE (0);
+#endif
+return 0;
+}
+
+int
+gen_ALRM ()
+{
+#ifdef SIGALRM
+ kill (getpid (), SIGALRM);
+#else
+ handle_ALRM (0);
+#endif
+return 0;
+}
+
+int
+gen_URG ()
+{
+#ifdef SIGURG
+ kill (getpid (), SIGURG);
+#else
+ handle_URG (0);
+#endif
+return 0;
+}
+
+int
+gen_TSTP ()
+{
+#ifdef SIGTSTP
+ kill (getpid (), SIGTSTP);
+#else
+ handle_TSTP (0);
+#endif
+return 0;
+}
+
+int
+gen_CONT ()
+{
+#ifdef SIGCONT
+ kill (getpid (), SIGCONT);
+#else
+ handle_CONT (0);
+#endif
+return 0;
+}
+
+int
+gen_CHLD ()
+{
+#ifdef SIGCHLD
+ kill (getpid (), SIGCHLD);
+#else
+ handle_CHLD (0);
+#endif
+return 0;
+}
+
+int
+gen_TTIN ()
+{
+#ifdef SIGTTIN
+ kill (getpid (), SIGTTIN);
+#else
+ handle_TTIN (0);
+#endif
+return 0;
+}
+
+int
+gen_TTOU ()
+{
+#ifdef SIGTTOU
+ kill (getpid (), SIGTTOU);
+#else
+ handle_TTOU (0);
+#endif
+return 0;
+}
+
+int
+gen_IO ()
+{
+#ifdef SIGIO
+ kill (getpid (), SIGIO);
+#else
+ handle_IO (0);
+#endif
+return 0;
+}
+
+int
+gen_XCPU ()
+{
+#ifdef SIGXCPU
+ kill (getpid (), SIGXCPU);
+#else
+ handle_XCPU (0);
+#endif
+return 0;
+}
+
+int
+gen_XFSZ ()
+{
+#ifdef SIGXFSZ
+ kill (getpid (), SIGXFSZ);
+#else
+ handle_XFSZ (0);
+#endif
+return 0;
+}
+
+int
+gen_VTALRM ()
+{
+#ifdef SIGVTALRM
+ kill (getpid (), SIGVTALRM);
+#else
+ handle_VTALRM (0);
+#endif
+return 0;
+}
+
+int
+gen_PROF ()
+{
+#ifdef SIGPROF
+ kill (getpid (), SIGPROF);
+#else
+ handle_PROF (0);
+#endif
+return 0;
+}
+
+int
+gen_WINCH ()
+{
+#ifdef SIGWINCH
+ kill (getpid (), SIGWINCH);
+#else
+ handle_WINCH (0);
+#endif
+return 0;
+}
+
+int
+gen_LOST ()
+{
+#if defined(SIGLOST) && (!defined(SIGABRT) || SIGLOST != SIGABRT)
+ kill (getpid (), SIGLOST);
+#else
+ handle_LOST (0);
+#endif
+return 0;
+}
+
+int
+gen_USR1 ()
+{
+#ifdef SIGUSR1
+ kill (getpid (), SIGUSR1);
+#else
+ handle_USR1 (0);
+#endif
+return 0;
+}
+
+int
+gen_USR2 ()
+{
+#ifdef SIGUSR2
+ kill (getpid (), SIGUSR2);
+#else
+ handle_USR2 (0);
+#endif
+return 0;
+}
+
+int
+gen_PWR ()
+{
+#ifdef SIGPWR
+ kill (getpid (), SIGPWR);
+#else
+ handle_PWR (0);
+#endif
+return 0;
+}
+
+int
+gen_POLL ()
+{
+#if defined (SIGPOLL) && (!defined (SIGIO) || SIGPOLL != SIGIO)
+ kill (getpid (), SIGPOLL);
+#else
+ handle_POLL (0);
+#endif
+return 0;
+}
+
+int
+gen_WIND ()
+{
+#ifdef SIGWIND
+ kill (getpid (), SIGWIND);
+#else
+ handle_WIND (0);
+#endif
+return 0;
+}
+
+int
+gen_PHONE ()
+{
+#ifdef SIGPHONE
+ kill (getpid (), SIGPHONE);
+#else
+ handle_PHONE (0);
+#endif
+return 0;
+}
+
+int
+gen_WAITING ()
+{
+#ifdef SIGWAITING
+ kill (getpid (), SIGWAITING);
+#else
+ handle_WAITING (0);
+#endif
+return 0;
+}
+
+int
+gen_LWP ()
+{
+#ifdef SIGLWP
+ kill (getpid (), SIGLWP);
+#else
+ handle_LWP (0);
+#endif
+return 0;
+}
+
+int
+gen_DANGER ()
+{
+#ifdef SIGDANGER
+ kill (getpid (), SIGDANGER);
+#else
+ handle_DANGER (0);
+#endif
+return 0;
+}
+
+int
+gen_GRANT ()
+{
+#ifdef SIGGRANT
+ kill (getpid (), SIGGRANT);
+#else
+ handle_GRANT (0);
+#endif
+return 0;
+}
+
+int
+gen_RETRACT ()
+{
+#ifdef SIGRETRACT
+ kill (getpid (), SIGRETRACT);
+#else
+ handle_RETRACT (0);
+#endif
+return 0;
+}
+
+int
+gen_MSG ()
+{
+#ifdef SIGMSG
+ kill (getpid (), SIGMSG);
+#else
+ handle_MSG (0);
+#endif
+return 0;
+}
+
+int
+gen_SOUND ()
+{
+#ifdef SIGSOUND
+ kill (getpid (), SIGSOUND);
+#else
+ handle_SOUND (0);
+#endif
+return 0;
+}
+
+int
+gen_SAK ()
+{
+#ifdef SIGSAK
+ kill (getpid (), SIGSAK);
+#else
+ handle_SAK (0);
+#endif
+return 0;
+}
+
+int
+gen_PRIO ()
+{
+#ifdef SIGPRIO
+ kill (getpid (), SIGPRIO);
+#else
+ handle_PRIO (0);
+#endif
+return 0;
+}
+
+int
+gen_33 ()
+{
+#ifdef SIG33
+ kill (getpid (), 33);
+#else
+ handle_33 (0);
+#endif
+return 0;
+}
+
+int
+gen_34 ()
+{
+#ifdef SIG34
+ kill (getpid (), 34);
+#else
+ handle_34 (0);
+#endif
+return 0;
+}
+
+int
+gen_35 ()
+{
+#ifdef SIG35
+ kill (getpid (), 35);
+#else
+ handle_35 (0);
+#endif
+return 0;
+}
+
+int
+gen_36 ()
+{
+#ifdef SIG36
+ kill (getpid (), 36);
+#else
+ handle_36 (0);
+#endif
+return 0;
+}
+
+int
+gen_37 ()
+{
+#ifdef SIG37
+ kill (getpid (), 37);
+#else
+ handle_37 (0);
+#endif
+return 0;
+}
+
+int
+gen_38 ()
+{
+#ifdef SIG38
+ kill (getpid (), 38);
+#else
+ handle_38 (0);
+#endif
+return 0;
+}
+
+int
+gen_39 ()
+{
+#ifdef SIG39
+ kill (getpid (), 39);
+#else
+ handle_39 (0);
+#endif
+return 0;
+}
+
+int
+gen_40 ()
+{
+#ifdef SIG40
+ kill (getpid (), 40);
+#else
+ handle_40 (0);
+#endif
+return 0;
+}
+
+int
+gen_41 ()
+{
+#ifdef SIG41
+ kill (getpid (), 41);
+#else
+ handle_41 (0);
+#endif
+return 0;
+}
+
+int
+gen_42 ()
+{
+#ifdef SIG42
+ kill (getpid (), 42);
+#else
+ handle_42 (0);
+#endif
+return 0;
+}
+
+int
+gen_43 ()
+{
+#ifdef SIG43
+ kill (getpid (), 43);
+#else
+ handle_43 (0);
+#endif
+return 0;
+}
+
+int
+gen_44 ()
+{
+#ifdef SIG44
+ kill (getpid (), 44);
+#else
+ handle_44 (0);
+#endif
+return 0;
+}
+
+int
+gen_45 ()
+{
+#ifdef SIG45
+ kill (getpid (), 45);
+#else
+ handle_45 (0);
+#endif
+return 0;
+}
+
+int
+gen_46 ()
+{
+#ifdef SIG46
+ kill (getpid (), 46);
+#else
+ handle_46 (0);
+#endif
+return 0;
+}
+
+int
+gen_47 ()
+{
+#ifdef SIG47
+ kill (getpid (), 47);
+#else
+ handle_47 (0);
+#endif
+return 0;
+}
+
+int
+gen_48 ()
+{
+#ifdef SIG48
+ kill (getpid (), 48);
+#else
+ handle_48 (0);
+#endif
+return 0;
+}
+
+int
+gen_49 ()
+{
+#ifdef SIG49
+ kill (getpid (), 49);
+#else
+ handle_49 (0);
+#endif
+return 0;
+}
+
+int
+gen_50 ()
+{
+#ifdef SIG50
+ kill (getpid (), 50);
+#else
+ handle_50 (0);
+#endif
+return 0;
+}
+
+int
+gen_51 ()
+{
+#ifdef SIG51
+ kill (getpid (), 51);
+#else
+ handle_51 (0);
+#endif
+return 0;
+}
+
+int
+gen_52 ()
+{
+#ifdef SIG52
+ kill (getpid (), 52);
+#else
+ handle_52 (0);
+#endif
+return 0;
+}
+
+int
+gen_53 ()
+{
+#ifdef SIG53
+ kill (getpid (), 53);
+#else
+ handle_53 (0);
+#endif
+return 0;
+}
+
+int
+gen_54 ()
+{
+#ifdef SIG54
+ kill (getpid (), 54);
+#else
+ handle_54 (0);
+#endif
+return 0;
+}
+
+int
+gen_55 ()
+{
+#ifdef SIG55
+ kill (getpid (), 55);
+#else
+ handle_55 (0);
+#endif
+return 0;
+}
+
+int
+gen_56 ()
+{
+#ifdef SIG56
+ kill (getpid (), 56);
+#else
+ handle_56 (0);
+#endif
+return 0;
+}
+
+int
+gen_57 ()
+{
+#ifdef SIG57
+ kill (getpid (), 57);
+#else
+ handle_57 (0);
+#endif
+return 0;
+}
+
+int
+gen_58 ()
+{
+#ifdef SIG58
+ kill (getpid (), 58);
+#else
+ handle_58 (0);
+#endif
+return 0;
+}
+
+int
+gen_59 ()
+{
+#ifdef SIG59
+ kill (getpid (), 59);
+#else
+ handle_59 (0);
+#endif
+return 0;
+}
+
+int
+gen_60 ()
+{
+#ifdef SIG60
+ kill (getpid (), 60);
+#else
+ handle_60 (0);
+#endif
+return 0;
+}
+
+int
+gen_61 ()
+{
+#ifdef SIG61
+ kill (getpid (), 61);
+#else
+ handle_61 (0);
+#endif
+return 0;
+}
+
+int
+gen_62 ()
+{
+#ifdef SIG62
+ kill (getpid (), 62);
+#else
+ handle_62 (0);
+#endif
+return 0;
+}
+
+int
+gen_63 ()
+{
+#ifdef SIG63
+ kill (getpid (), 63);
+#else
+ handle_63 (0);
+#endif
+return 0;
+}
+
+int
+gen_TERM ()
+{
+ kill (getpid (), SIGTERM);
+return 0;
+}
+
+int
+main ()
+{
+#ifdef usestubs
+ set_debug_traps ();
+ breakpoint ();
+#endif
+ signal (SIGABRT, handle_ABRT);
+#ifdef SIGHUP
+ signal (SIGHUP, handle_HUP);
+#endif
+#ifdef SIGQUIT
+ signal (SIGQUIT, handle_QUIT);
+#endif
+#ifdef SIGILL
+ signal (SIGILL, handle_ILL);
+#endif
+#ifdef SIGEMT
+ signal (SIGEMT, handle_EMT);
+#endif
+#ifdef SIGFPE
+ signal (SIGFPE, handle_FPE);
+#endif
+#ifdef SIGBUS
+ signal (SIGBUS, handle_BUS);
+#endif
+#ifdef SIGSEGV
+ signal (SIGSEGV, handle_SEGV);
+#endif
+#ifdef SIGSYS
+ signal (SIGSYS, handle_SYS);
+#endif
+#ifdef SIGPIPE
+ signal (SIGPIPE, handle_PIPE);
+#endif
+#ifdef SIGALRM
+ signal (SIGALRM, handle_ALRM);
+#endif
+#ifdef SIGURG
+ signal (SIGURG, handle_URG);
+#endif
+#ifdef SIGTSTP
+ signal (SIGTSTP, handle_TSTP);
+#endif
+#ifdef SIGCONT
+ signal (SIGCONT, handle_CONT);
+#endif
+#ifdef SIGCHLD
+ signal (SIGCHLD, handle_CHLD);
+#endif
+#ifdef SIGTTIN
+ signal (SIGTTIN, handle_TTIN);
+#endif
+#ifdef SIGTTOU
+ signal (SIGTTOU, handle_TTOU);
+#endif
+#ifdef SIGIO
+ signal (SIGIO, handle_IO);
+#endif
+#ifdef SIGXCPU
+ signal (SIGXCPU, handle_XCPU);
+#endif
+#ifdef SIGXFSZ
+ signal (SIGXFSZ, handle_XFSZ);
+#endif
+#ifdef SIGVTALRM
+ signal (SIGVTALRM, handle_VTALRM);
+#endif
+#ifdef SIGPROF
+ signal (SIGPROF, handle_PROF);
+#endif
+#ifdef SIGWINCH
+ signal (SIGWINCH, handle_WINCH);
+#endif
+#if defined(SIGLOST) && (!defined(SIGABRT) || SIGLOST != SIGABRT)
+ signal (SIGLOST, handle_LOST);
+#endif
+#ifdef SIGUSR1
+ signal (SIGUSR1, handle_USR1);
+#endif
+#ifdef SIGUSR2
+ signal (SIGUSR2, handle_USR2);
+#endif
+#ifdef SIGPWR
+ signal (SIGPWR, handle_PWR);
+#endif
+#if defined (SIGPOLL) && (!defined (SIGIO) || SIGPOLL != SIGIO)
+ signal (SIGPOLL, handle_POLL);
+#endif
+#ifdef SIGWIND
+ signal (SIGWIND, handle_WIND);
+#endif
+#ifdef SIGPHONE
+ signal (SIGPHONE, handle_PHONE);
+#endif
+#ifdef SIGWAITING
+ signal (SIGWAITING, handle_WAITING);
+#endif
+#ifdef SIGLWP
+ signal (SIGLWP, handle_LWP);
+#endif
+#ifdef SIGDANGER
+ signal (SIGDANGER, handle_DANGER);
+#endif
+#ifdef SIGGRANT
+ signal (SIGGRANT, handle_GRANT);
+#endif
+#ifdef SIGRETRACT
+ signal (SIGRETRACT, handle_RETRACT);
+#endif
+#ifdef SIGMSG
+ signal (SIGMSG, handle_MSG);
+#endif
+#ifdef SIGSOUND
+ signal (SIGSOUND, handle_SOUND);
+#endif
+#ifdef SIGSAK
+ signal (SIGSAK, handle_SAK);
+#endif
+#ifdef SIGPRIO
+ signal (SIGPRIO, handle_PRIO);
+#endif
+#ifdef __Lynx__
+ /* Lynx doesn't seem to have anything in signal.h for this. */
+ signal (33, handle_33);
+ signal (34, handle_34);
+ signal (35, handle_35);
+ signal (36, handle_36);
+ signal (37, handle_37);
+ signal (38, handle_38);
+ signal (39, handle_39);
+ signal (40, handle_40);
+ signal (41, handle_41);
+ signal (42, handle_42);
+ signal (43, handle_43);
+ signal (44, handle_44);
+ signal (45, handle_45);
+ signal (46, handle_46);
+ signal (47, handle_47);
+ signal (48, handle_48);
+ signal (49, handle_49);
+ signal (50, handle_50);
+ signal (51, handle_51);
+ signal (52, handle_52);
+ signal (53, handle_53);
+ signal (54, handle_54);
+ signal (55, handle_55);
+ signal (56, handle_56);
+ signal (57, handle_57);
+ signal (58, handle_58);
+ signal (59, handle_59);
+ signal (60, handle_60);
+ signal (61, handle_61);
+ signal (62, handle_62);
+ signal (63, handle_63);
+#endif /* lynx */
+ signal (SIGTERM, handle_TERM);
+
+ x = 0;
+
+ gen_ABRT ();
+ gen_HUP ();
+ gen_QUIT ();
+ gen_ILL ();
+ gen_EMT ();
+ gen_FPE ();
+ gen_BUS ();
+ gen_SEGV ();
+ gen_SYS ();
+ gen_PIPE ();
+ gen_ALRM ();
+ gen_URG ();
+ gen_TSTP ();
+ gen_CONT ();
+ gen_CHLD ();
+ gen_TTIN ();
+ gen_TTOU ();
+ gen_IO ();
+ gen_XCPU ();
+ gen_XFSZ ();
+ gen_VTALRM ();
+ gen_PROF ();
+ gen_WINCH ();
+ gen_LOST ();
+ gen_USR1 ();
+ gen_USR2 ();
+ gen_PWR ();
+ gen_POLL ();
+ gen_WIND ();
+ gen_PHONE ();
+ gen_WAITING ();
+ gen_LWP ();
+ gen_DANGER ();
+ gen_GRANT ();
+ gen_RETRACT ();
+ gen_MSG ();
+ gen_SOUND ();
+ gen_SAK ();
+ gen_PRIO ();
+ gen_33 ();
+ gen_34 ();
+ gen_35 ();
+ gen_36 ();
+ gen_37 ();
+ gen_38 ();
+ gen_39 ();
+ gen_40 ();
+ gen_41 ();
+ gen_42 ();
+ gen_43 ();
+ gen_44 ();
+ gen_45 ();
+ gen_46 ();
+ gen_47 ();
+ gen_48 ();
+ gen_49 ();
+ gen_50 ();
+ gen_51 ();
+ gen_52 ();
+ gen_53 ();
+ gen_54 ();
+ gen_55 ();
+ gen_56 ();
+ gen_57 ();
+ gen_58 ();
+ gen_59 ();
+ gen_60 ();
+ gen_61 ();
+ gen_62 ();
+ gen_63 ();
+ gen_TERM ();
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/sigall.exp b/gdb/testsuite/gdb.base/sigall.exp
new file mode 100644
index 00000000000..f452f0c6ef7
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sigall.exp
@@ -0,0 +1,210 @@
+# Copyright 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if [target_info exists gdb,nosignals] {
+ verbose "Skipping sigall.exp because of nosignals."
+ continue
+}
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+set testfile sigall
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Make the first signal SIGABRT because it is always supported.
+set sig_supported 1
+set thissig "ABRT"
+
+proc test_one_sig {nextsig} {
+ global sig_supported
+ global gdb_prompt
+ global thissig
+
+ set this_sig_supported $sig_supported
+ gdb_test "handle SIG$thissig stop print" \
+ "SIG$thissig\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes.*"
+ gdb_test "b handle_$thissig" "Breakpoint \[0-9\]+ .*"
+ gdb_test "b gen_$nextsig" "Breakpoint \[0-9\]+ .*"
+
+ set need_another_continue 1
+ set missed_handler 0
+ if $this_sig_supported then {
+ send_gdb "continue\n"
+ if { $thissig == "IO" } {
+ setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
+ }
+ gdb_expect {
+ -re "Continuing.*Program received signal SIG$thissig.*$gdb_prompt $" {
+ pass "get signal $thissig"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "get signal $thissig"
+ set need_another_continue 0
+ }
+ default {
+ fail "get signal $thissig (eof or timeout)"
+ }
+ }
+ }
+ if [ istarget "alpha-dec-osf3*" ] then {
+ # OSF/1-3.x is unable to continue with a job control stop signal.
+ # The inferior remains stopped without an event of interest
+ # and GDB waits forever for the inferior to stop on an event
+ # of interest. Work around the kernel bug.
+ if { $thissig == "TSTP" || $thissig == "TTIN" || $thissig == "TTOU" } {
+ setup_xfail "alpha-dec-osf3*"
+ fail "cannot continue from signal $thissig"
+ set need_another_continue 0
+ }
+ }
+
+ if $need_another_continue then {
+ send_gdb "continue\n"
+ if { $thissig == "URG" } {
+ setup_xfail "i*86-pc-linuxoldld-gnu" "i*86-pc-linuxaout-gnu"
+ }
+ # Either Lynx or GDB screws up on SIGPRIO
+ if { $thissig == "PRIO" } {
+ setup_xfail "*-*-*lynx*"
+ }
+ gdb_expect {
+ -re "Breakpoint.*handle_$thissig.*$gdb_prompt $" {
+ pass "send signal $thissig"
+ }
+ -re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" {
+ fail "missed breakpoint at handle_$thissig"
+ set missed_handler 1
+ }
+ }
+ }
+
+ if { $missed_handler == "0" } then {
+ send_gdb "signal 0\n"
+ gdb_expect {
+ -re "Breakpoint.*gen_$nextsig.*kill.*$gdb_prompt $" {
+ pass "advance to $nextsig"
+ set sig_supported 1
+ }
+ -re "Breakpoint.*gen_$nextsig.*handle.*$gdb_prompt $" {
+ pass "advance to $nextsig"
+ set sig_supported 0
+ }
+ -re ".*$gdb_prompt $" { fail "advance to $nextsig" }
+ default { fail "advance to $nextsig (eof or timeout)" }
+ }
+ }
+ set thissig $nextsig
+}
+
+gdb_load $binfile
+
+runto gen_ABRT
+test_one_sig HUP
+test_one_sig QUIT
+test_one_sig ILL
+test_one_sig EMT
+test_one_sig FPE
+test_one_sig BUS
+test_one_sig SEGV
+test_one_sig SYS
+test_one_sig PIPE
+test_one_sig ALRM
+test_one_sig URG
+test_one_sig TSTP
+test_one_sig CONT
+test_one_sig CHLD
+test_one_sig TTIN
+test_one_sig TTOU
+test_one_sig IO
+test_one_sig XCPU
+test_one_sig XFSZ
+test_one_sig VTALRM
+test_one_sig PROF
+test_one_sig WINCH
+test_one_sig LOST
+test_one_sig USR1
+test_one_sig USR2
+test_one_sig PWR
+test_one_sig POLL
+test_one_sig WIND
+test_one_sig PHONE
+test_one_sig WAITING
+test_one_sig LWP
+test_one_sig DANGER
+test_one_sig GRANT
+test_one_sig RETRACT
+test_one_sig MSG
+test_one_sig SOUND
+test_one_sig SAK
+test_one_sig PRIO
+test_one_sig 33
+test_one_sig 34
+test_one_sig 35
+test_one_sig 36
+test_one_sig 37
+test_one_sig 38
+test_one_sig 39
+test_one_sig 40
+test_one_sig 41
+test_one_sig 42
+test_one_sig 43
+test_one_sig 44
+test_one_sig 45
+test_one_sig 46
+test_one_sig 47
+test_one_sig 48
+test_one_sig 49
+test_one_sig 50
+test_one_sig 51
+test_one_sig 52
+test_one_sig 53
+test_one_sig 54
+test_one_sig 55
+test_one_sig 56
+test_one_sig 57
+test_one_sig 58
+test_one_sig 59
+test_one_sig 60
+test_one_sig 61
+test_one_sig 62
+test_one_sig 63
+test_one_sig TERM
+
+# The last signal (SIGTERM) gets handled slightly differently because
+# we are not setting up for another test.
+gdb_test "handle SIGTERM stop print" \
+ "SIGTERM\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes.*"
+gdb_test "b handle_TERM" "Breakpoint \[0-9\]+ .*"
+gdb_test "continue" \
+ "Continuing.*Program received signal SIGTERM.*" \
+ "get signal TERM"
+gdb_test "continue" "Breakpoint.*handle_TERM.*" "send signal TERM"
+gdb_continue_to_end "continue to sigall exit"
+
+return 0
diff --git a/gdb/testsuite/gdb.base/signals.c b/gdb/testsuite/gdb.base/signals.c
new file mode 100644
index 00000000000..f1ebcfccb3d
--- /dev/null
+++ b/gdb/testsuite/gdb.base/signals.c
@@ -0,0 +1,59 @@
+/* Test GDB dealing with stuff like stepping into sigtramp. */
+
+#include <signal.h>
+#include <unistd.h>
+
+#ifdef __sh__
+#define signal(a,b) /* Signals not supported on this target - make them go away */
+#define alarm(a) /* Ditto for alarm() */
+#endif
+
+static int count = 0;
+
+#ifdef PROTOTYPES
+static void
+handler (int sig)
+#else
+static void
+handler (sig)
+ int sig;
+#endif
+{
+ signal (sig, handler);
+ ++count;
+}
+
+static void
+func1 ()
+{
+ ++count;
+}
+
+static void
+func2 ()
+{
+ ++count;
+}
+
+int
+main ()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+#ifdef SIGALRM
+ signal (SIGALRM, handler);
+#endif
+#ifdef SIGUSR1
+ signal (SIGUSR1, handler);
+#endif
+ alarm (1);
+ ++count; /* first */
+ alarm (1);
+ ++count; /* second */
+ func1 ();
+ alarm (1);
+ func2 ();
+ return count;
+}
diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp
new file mode 100644
index 00000000000..2bf719234bd
--- /dev/null
+++ b/gdb/testsuite/gdb.base/signals.exp
@@ -0,0 +1,639 @@
+# Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if [target_info exists gdb,nosignals] {
+ verbose "Skipping signals.exp because of nosignals."
+ continue
+}
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile signals
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+if {$hp_cc_compiler} {
+ set void 0
+} else {
+ set void void
+}
+
+proc signal_tests_1 {} {
+ global gdb_prompt
+ if [runto_main] then {
+ gdb_test "next" "signal \\(SIGUSR1.*" \
+ "next over signal (SIGALRM, handler)"
+ gdb_test "next" "alarm \\(.*" \
+ "next over signal (SIGUSR1, handler)"
+ gdb_test "next" "\\+\\+count; /\\* first \\*/" \
+ "next over alarm (1)"
+ # An alarm has been signaled, give the signal time to get delivered.
+ sleep 2
+
+ # i386 BSD currently fails the next test with a SIGTRAP.
+ setup_xfail "i*86-*-bsd*"
+ # But Dynix has a DECR_PC_AFTER_BREAK of zero, so the failure
+ # is shadowed by hitting the through_sigtramp_breakpoint.
+ clear_xfail "i*86-sequent-bsd*"
+ # Univel SVR4 i386 continues instead of stepping.
+ setup_xfail "i*86-univel-sysv4*"
+ # lynx fails with "next" acting like "continue"
+ setup_xfail "*-*-*lynx*"
+ # linux (aout versions) also fails with "next" acting like "continue"
+ # this is probably more dependant on the kernel version than on the
+ # object file format or utils. (sigh)
+ setup_xfail "i*86-pc-linuxaout-gnu" "i*86-pc-linuxoldld-gnu"
+ send_gdb "next\n"
+ gdb_expect {
+ -re "alarm .*$gdb_prompt $" { pass "next to 2nd alarm (1)" }
+ -re "Program received signal SIGTRAP.*first.*$gdb_prompt $" {
+
+ # This can happen on machines that have a trace flag
+ # in their PS register.
+ # The trace flag in the PS register will be set due to
+ # the `next' command.
+ # Before calling the signal handler, the PS register
+ # is pushed along with the context on the user stack.
+ # When the signal handler has finished, it reenters the
+ # the kernel via a sigreturn syscall, which restores the
+ # PS register along with the context.
+ # If the kernel erroneously does not clear the trace flag
+ # in the pushed context, gdb will receive a SIGTRAP from
+ # the set trace flag in the restored context after the
+ # signal handler has finished.
+
+ # I do not yet understand why the SIGTRAP does not occur
+ # after stepping the instruction at the restored PC on
+ # i386 BSDI 1.0 systems.
+
+ # Note that the vax under Ultrix also exhibits
+ # this behaviour (it is uncovered by the `continue from
+ # a break in a signal handler' test below).
+ # With this test the failure is shadowed by hitting the
+ # through_sigtramp_breakpoint upon return from the signal
+ # handler.
+
+ # SVR4 and Linux based i*86 systems exhibit this behaviour
+ # as well (it is uncovered by the `continue from a break
+ # in a signal handler' test below).
+ # As these systems use procfs, where we tell the kernel not
+ # to tell gdb about `pass' signals, and the trace flag is
+ # cleared by the kernel before entering the sigtramp
+ # routine, GDB will not notice the execution of the signal
+ # handler.
+ # Upon return from the signal handler, GDB will receive
+ # a SIGTRAP from the set trace flag in the restored context.
+ # The SIGTRAP marks the end of a (albeit long winded)
+ # single step for GDB, causing this test to pass.
+
+ fail "next to 2nd alarm (1) (probably kernel bug)"
+ gdb_test "next" "alarm.*" "next to 2nd alarm (1)"
+ }
+ -re "Program exited with code.*$gdb_prompt $" {
+
+ # This is apparently a bug in the UnixWare kernel (but
+ # has not been investigated beyond the
+ # resume/target_wait level, and has not been reported
+ # to Univel). If it steps when a signal is pending,
+ # it does a continue instead. I don't know whether
+ # there is a workaround.
+
+ # Perhaps this problem exists on other SVR4 systems;
+ # but (a) we have no reason to think so, and (b) if we
+ # put a wrong xfail here, we never get an XPASS to let
+ # us know that it was incorrect (and then if such a
+ # configuration regresses we have no way of knowing).
+ # Solaris is not a relevant data point either way
+ # because it lacks single stepping.
+
+ # fnf: I don't agree with the above philosophy. We
+ # can never be sure that any particular XFAIL is
+ # specified 100% correctly in that no systems with
+ # the bug are missed and all systems without the bug
+ # are excluded. If we include an XFAIL that isn't
+ # appropriate for a particular system, then when that
+ # system gets tested it will XPASS, and someone should
+ # investigate and fix the setup_xfail as appropriate,
+ # or more preferably, the actual bug. Each such case
+ # adds more data to narrowing down the scope of the
+ # problem and ultimately fixing it.
+
+ setup_xfail "i*86-*-sysv4*"
+ fail "'next' behaved as 'continue (known SVR4 bug)'"
+ return 0
+ }
+ -re ".*$gdb_prompt $" { fail "next to 2nd alarm (1)" }
+ timeout { fail "next to 2nd alarm (1); (timeout)" }
+ eof { fail "next to 2nd alarm (1); (eof)" }
+ }
+
+ gdb_test "break handler" "Breakpoint \[0-9\]+ .*"
+ gdb_test "next" "\\+\\+count; /\\* second \\*/" \
+ "next to 2nd ++count in signals_tests_1"
+ # An alarm has been signaled, give the signal time to get delivered.
+ sleep 2
+
+ set bash_bug 0
+ send_gdb "next\n"
+ gdb_expect {
+ -re "Breakpoint.*handler.*$gdb_prompt $" {
+ pass "next to handler in signals_tests_1"
+ }
+ -re "Program received signal SIGEMT.*$gdb_prompt $" {
+ # Bash versions before 1.13.5 cause this behaviour
+ # by blocking SIGTRAP.
+ fail "next to handler in signals_tests_1 (known problem with bash versions before 1.13.5)"
+ set bash_bug 1
+ gdb_test "signal 0" "Breakpoint.*handler.*"
+ }
+ -re ".*$gdb_prompt $" { fail "next to handler in signals_tests_1" }
+ timeout { fail "next to handler in signals_tests_1 (timeout)" }
+ eof { fail "next to handler in signals_tests_1 (eof)" }
+ }
+
+ # This doesn't test that main is frame #2, just that main is frame
+ # #2, #3, or higher. At some point this should be fixed (but
+ # it quite possibly would introduce new FAILs on some systems).
+ setup_xfail "i*86-*-bsdi2.0"
+ gdb_test "backtrace 10" "#0.*handler.*#1.*#2.*main.*" \
+ "backtrace in signals_tests_1"
+
+ gdb_test "break func1" "Breakpoint \[0-9\]+ .*"
+ gdb_test "break func2" "Breakpoint \[0-9\]+ .*"
+
+ # Vax Ultrix and i386 BSD currently fail the next test with
+ # a SIGTRAP, but with different symptoms.
+ setup_xfail "vax-*-ultrix*"
+ setup_xfail "i*86-*-bsd*"
+ setup_xfail "i*86-pc-linux-gnu*"
+ setup_xfail "i*86-*-solaris2*"
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Breakpoint.*func1.*$gdb_prompt $" { pass "continue to func1" }
+ -re "Program received signal SIGTRAP.*second.*$gdb_prompt $" {
+
+ # See explanation for `next to 2nd alarm (1)' fail above.
+ # We did step into the signal handler, hit a breakpoint
+ # in the handler and continued from the breakpoint.
+ # The set trace flag in the restored context is causing
+ # the SIGTRAP, without stepping an instruction.
+
+ fail "continue to func1 (probably kernel bug)"
+ gdb_test "continue" "Breakpoint.*func1.*" \
+ "extra continue to func1"
+ }
+ -re "Program received signal SIGTRAP.*func1 ..;.*$gdb_prompt $" {
+
+ # On the vax under Ultrix the set trace flag in the restored
+ # context is causing the SIGTRAP, but after stepping one
+ # instruction, as expected.
+
+ fail "continue to func1 (probably kernel bug)"
+ gdb_test "continue" "Breakpoint.*func1.*" \
+ "extra continue to func1"
+ }
+ -re ".*$gdb_prompt $" { fail "continue to func1" }
+ default { fail "continue to func1" }
+ }
+
+ setup_xfail "*-*-irix*"
+ send_gdb "signal SIGUSR1\n"
+ gdb_expect {
+ -re "Breakpoint.*handler.*$gdb_prompt $" { pass "signal SIGUSR1" }
+ -re "Program received signal SIGUSR1.*$gdb_prompt $" {
+ # This is what irix4 and irix5 do.
+ # It would appear to be a kernel bug.
+ fail "signal SIGUSR1"
+ gdb_test "continue" "Breakpoint.*handler.*" "pass it SIGUSR1"
+ }
+ -re ".*$gdb_prompt $" { fail "signal SIGUSR1" }
+ default { fail "signal SIGUSR1" }
+ }
+
+ # Will tend to wrongly require an extra continue.
+
+ # The problem here is that the breakpoint at func1 will be
+ # inserted, and when the system finishes with the signal
+ # handler it will try to execute there. For GDB to try to
+ # remember that it was going to step over a breakpoint when a
+ # signal happened, distinguish this case from the case where
+ # func1 is called from the signal handler, etc., seems
+ # exceedingly difficult. So don't expect this to get fixed
+ # anytime soon.
+
+ setup_xfail "*-*-*"
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Breakpoint.*func2.*$gdb_prompt $" { pass "continue to func2" }
+ -re "Breakpoint.*func1.*$gdb_prompt $" {
+ fail "continue to func2"
+ gdb_test "continue" "Breakpoint.*func2.*" \
+ "extra continue to func2"
+ }
+ -re ".*$gdb_prompt $" { fail "continue to func2" }
+ default { fail "continue to func2" }
+ }
+
+ sleep 2
+
+ # GDB yanks out the breakpoints to step over the breakpoint it
+ # stopped at, which means the breakpoint at handler is yanked.
+ # But if SOFTWARE_SINGLE_STEP_P, we won't get another chance to
+ # reinsert them (at least not with procfs, where we tell the kernel
+ # not to tell gdb about `pass' signals). So the fix would appear to
+ # be to just yank that one breakpoint when we step over it.
+
+ setup_xfail "sparc*-*-*"
+ setup_xfail "rs6000-*-*"
+ setup_xfail "powerpc-*-*"
+
+ # A faulty bash will not step the inferior into sigtramp on sun3.
+ if {$bash_bug} then {
+ setup_xfail "m68*-*-sunos4*"
+ }
+
+ setup_xfail "i*86-pc-linux-gnu*"
+ setup_xfail "i*86-*-solaris2*"
+ gdb_test "continue" "Breakpoint.*handler.*" "continue to handler"
+
+ # If the SOFTWARE_SINGLE_STEP_P failure happened, we have already
+ # exited.
+ # If we succeeded a continue will return from the handler to func2.
+ # GDB now has `forgotten' that it intended to step over the
+ # breakpoint at func2 and will stop at func2.
+ setup_xfail "*-*-*"
+ # The sun3 with a faulty bash will also be `forgetful' but it
+ # already got the spurious stop at func2 and this continue will work.
+ if {$bash_bug} then {
+ clear_xfail "m68*-*-sunos4*"
+ }
+ gdb_test "continue" "Program exited with code 010\\." \
+ "continue to exit in signals_tests_1 "
+ }
+}
+
+# On a few losing systems, ptrace (PT_CONTINUE) or ptrace (PT_STEP)
+# causes pending signals to be cleared, which causes these tests to
+# get nowhere fast. This is totally losing behavior (perhaps there
+# are cases in which is it useful but the user needs more control,
+# which they mostly have in GDB), but some people apparently think it
+# is a feature. It is documented in the ptrace manpage on Motorola
+# Delta Series sysV68 R3V7.1 and on HPUX 9.0. Even the non-HPUX PA
+# OSes (BSD and OSF/1) seem to have figured they had to copy this
+# braindamage.
+
+if {[ istarget "m68*-motorola-*" ] || [ istarget "hppa*-*-bsd*" ] ||
+ [ istarget "hppa*-*-osf*" ]} then {
+ setup_xfail "*-*-*"
+ fail "ptrace loses on signals on this target"
+ return 0
+}
+
+# lynx2.2.2 doesn't lose signals, instead it screws up the stack pointer
+# in some of these tests leading to massive problems. I've
+# reported this to lynx, hopefully it'll be fixed in lynx2.3.
+# Severe braindamage.
+if [ istarget "*-*-*lynx*" ] then {
+ setup_xfail "*-*-*"
+ fail "kernel scroggs stack pointer in signal tests on this target"
+ return 0
+}
+
+gdb_exit
+gdb_start
+
+# This will need to be updated as the exact list of signals changes,
+# but I want to test that TARGET_SIGNAL_0, TARGET_SIGNAL_DEFAULT, and
+# TARGET_SIGNAL_UNKNOWN are skipped.
+proc test_handle_all_print {} {
+ global timeout
+ # Increase timeout and expect input buffer for large output from gdb.
+ # Allow blank or TAB as whitespace characters.
+ set oldtimeout $timeout
+ set timeout [expr "$timeout + 360"]
+ verbose "Timeout is now $timeout seconds" 2
+ if { ![istarget "*-*-linux*"]
+ && ( [istarget "*-*-gnu*"]
+ || [istarget "*-*-mach*"] ) } {
+ gdb_test "handle all print" "Signal\[ \]+Stop\[ \]+Print\[ \]+Pass to program\[ \]+Description\r\nSIGHUP\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Hangup.*SIG63\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Real-time event 63.*EXC_BREAKPOINT\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Breakpoint"
+ } else {
+ gdb_test "handle all print" "Signal\[ \]+Stop\[ \]+Print\[ \]+Pass to program\[ \]+Description\r\nSIGHUP\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Hangup.*SIG63\[ \]+Yes\[ \]+Yes\[ \]+Yes\[ \]+Real-time event 63.*"
+ }
+ set timeout $oldtimeout
+ verbose "Timeout restored to $timeout seconds" 2
+}
+test_handle_all_print
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+signal_tests_1
+
+# Force a resync, so we're looking at the right prompt. On SCO we
+# were getting out of sync (I don't understand why).
+send_gdb "p 1+1\n"
+gdb_expect {
+ -re "= 2.*$gdb_prompt $" {}
+ -re ".*$gdb_prompt $" { perror "sync trouble in signals.exp" }
+ default { perror "sync trouble in signals.exp" }
+}
+
+if [runto_main] then {
+ # Since count is a static variable outside main, runto_main
+ # is no guarantee that count will be 0 at this point.
+ gdb_test "set variable count = 0" ""
+ gdb_test "break handler if 0" "Breakpoint \[0-9\]+ .*"
+ gdb_test "set \$handler_breakpoint_number = \$bpnum" ""
+
+ # Get to the point where a signal is waiting to be delivered
+ gdb_test "next" "signal \\(SIGUSR1.*" "next to signal in signals.exp"
+ gdb_test "next" "alarm \\(.*" "next to alarm #1 in signals.exp"
+ gdb_test "next" "\\+\\+count; /\\* first \\*/" \
+ "next to ++count #1 in signals.exp"
+ # Give the signal time to get delivered
+ sleep 2
+
+ # Now call a function. When GDB tries to run the stack dummy,
+ # it will hit the breakpoint at handler. Provided it doesn't
+ # lose its cool, this is not a problem, it just has to note
+ # that the breakpoint condition is false and keep going.
+
+ gdb_test "p func1 ()" "^p func1 \\(\\)\r\n.\[0-9\]* = $void" \
+ "p func1 () #1 in signals.exp"
+
+ # Make sure the count got incremented.
+
+ # Haven't investigated this xfail
+ setup_xfail "rs6000-*-*"
+ setup_xfail "powerpc-*-*"
+ gdb_test "p count" "= 2" "p count #1 in signals.exp"
+ if { [istarget "rs6000-*-*"] || [istarget "powerpc-*-*"] } { return 0 }
+
+ gdb_test "condition \$handler_breakpoint_number" "now unconditional\\."
+ gdb_test "next" "alarm \\(.*" "next to alarm #2 in signals.exp"
+ gdb_test "next" "\\+\\+count; /\\* second \\*/" \
+ "next to ++count #2 in signals.exp"
+ sleep 2
+
+ # This time we stop when GDB tries to run the stack dummy.
+ # So it is OK that we do not print the return value from the function.
+ gdb_test "p func1 ()" \
+"Breakpoint \[0-9\]*, handler.*
+The program being debugged stopped while in a function called from GDB.*" \
+ "p func1 () #2 in signals.exp"
+ # But we should be able to backtrace...
+ # On alpha-*-osf2.0 this test works when run manually but sometime fails when
+ # run under dejagnu, making it very hard to debug the problem. Weird...
+ gdb_test "bt 10" "#0.*handler.*#1.*#2.*main.*" "bt in signals.exp"
+ # ...and continue...
+ gdb_test "continue" "Continuing\\." "continue in signals.exp"
+ # ...and then count should have been incremented
+ gdb_test "p count" "= 5" "p count #2 in signals.exp"
+
+
+# Verify that "info signals" produces reasonable output.
+#
+ send_gdb "info signals\n"
+ gdb_expect {
+ -re "SIGHUP.*SIGINT.*SIGQUIT.*SIGILL.*SIGTRAP.*SIGABRT.*SIGEMT.*SIGFPE.*SIGKILL.*SIGBUS.*SIGSEGV.*SIGSYS.*SIGPIPE.*SIGALRM.*SIGTERM.*SIGURG.*SIGSTOP.*SIGTSTP.*SIGCONT.*SIGCHLD.*SIGTTIN.*SIGTTOU.*SIGIO.*SIGXCPU.*SIGXFSZ.*SIGVTALRM.*SIGPROF.*SIGWINCH.*SIGLOST.*SIGUSR1.*SIGUSR2.*SIGPWR.*SIGPOLL.*SIGWIND.*SIGPHONE.*SIGWAITING.*SIGLWP.*SIGDANGER.*SIGGRANT.*SIGRETRACT.*SIGMSG.*SIGSOUND.*SIGSAK.*SIGPRIO.*SIG33.*SIG34.*SIG35.*SIG36.*SIG37.*SIG38.*SIG39.*SIG40.*SIG41.*SIG42.*SIG43.*SIG44.*SIG45.*SIG46.*SIG47.*SIG48.*SIG49.*SIG50.*SIG51.*SIG52.*SIG53.*SIG54.*SIG55.*SIG56.*SIG57.*SIG58.*SIG59.*SIG60.*SIG61.*SIG62.*SIG63.*Use the \"handle\" command to change these tables.*$gdb_prompt $"\
+ {pass "info signals"}
+ -re "$gdb_prompt $"\
+ {fail "info signals"}
+ timeout {fail "(timeout) info signals"}
+ }
+
+# Verify that "info signal" correctly handles an argument, be it a
+# symbolic signal name, or an integer ID.
+#
+ send_gdb "info signal SIGTRAP\n"
+ gdb_expect {
+ -re ".*SIGTRAP\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*No\[ \t\]*Trace/breakpoint trap.*$gdb_prompt $"\
+ {pass "info signal SIGTRAP"}
+ -re "$gdb_prompt $"\
+ {fail "info signal SIGTRAP"}
+ timeout {fail "(timeout) info signal SIGTRAP"}
+ }
+
+ send_gdb "info signal 5\n"
+ gdb_expect {
+ -re ".*SIGTRAP\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*No\[ \t\]*Trace/breakpoint trap.*$gdb_prompt $"\
+ {pass "info signal 5"}
+ -re "$gdb_prompt $"\
+ {fail "info signal 5"}
+ timeout {fail "(timeout) info signal 5"}
+ }
+
+# Verify that "handle" with illegal arguments is gracefully, um, handled.
+#
+ send_gdb "handle\n"
+ gdb_expect {
+ -re "Argument required .signal to handle.*$gdb_prompt $"\
+ {pass "handle without arguments"}
+ -re "$gdb_prompt $"\
+ {fail "handle without arguments"}
+ timeout {fail "(timeout) handle without arguments"}
+ }
+
+ send_gdb "handle SIGFOO\n"
+ gdb_expect {
+ -re "Unrecognized or ambiguous flag word: \"SIGFOO\".*$gdb_prompt $"\
+ {pass "handle with bogus SIG"}
+ -re "$gdb_prompt $"\
+ {fail "handle with bogus SIG"}
+ timeout {fail "(timeout) handle with bogus SIG"}
+ }
+
+ send_gdb "handle SIGHUP frump\n"
+ gdb_expect {
+ -re "Unrecognized or ambiguous flag word: \"frump\".*$gdb_prompt $"\
+ {pass "handle SIG with bogus action"}
+ -re "$gdb_prompt $"\
+ {fail "handle SIG with bogus action"}
+ timeout {fail "(timeout) handle SIG with bogus action"}
+ }
+
+# Verify that "handle" can take multiple actions per SIG, and that in
+# the case of conflicting actions, that the rightmost action "wins".
+#
+ send_gdb "handle SIGHUP print noprint\n"
+ gdb_expect {
+ -re ".*SIGHUP\[ \t\]*No\[ \t\]*No\[ \t\]*Yes\[ \t\]*Hangup.*$gdb_prompt $"\
+ {pass "handle SIG with multiple conflicting actions"}
+ -re "$gdb_prompt $"\
+ {fail "handle SIG with multiple conflicting actions"}
+ timeout {fail "(timeout) handle SIG with multiple conflicting actions"}
+ }
+
+# Exercise all the various actions. (We don't care what the outcome
+# is, this is just to ensure that they all can be parsed.)
+#
+ send_gdb "handle SIGHUP print noprint stop nostop ignore noignore pass nopass\n"
+ gdb_expect {
+ -re ".*Signal.*$gdb_prompt $"\
+ {pass "handle SIG parses all legal actions"}
+ -re "$gdb_prompt $"\
+ {fail "handle SIG parses all legal actions"}
+ timeout {fail "(timeout) handle SIG parses all legal actions"}
+ }
+
+# Verify that we can "handle" multiple signals at once, interspersed
+# with actions.
+#
+ send_gdb "handle SIG63 print SIGILL\n"
+ gdb_expect {
+ -re ".*SIGILL\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Illegal instruction.*SIG63\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*Real-time event 63.*$gdb_prompt $"\
+ {pass "handle multiple SIGs"}
+ -re "$gdb_prompt $"\
+ {fail "handle multiple SIGs"}
+ timeout {fail "(timeout) handle multiple SIGs"}
+ }
+
+# Verify that "handle" can take a numeric argument for the signal ID,
+# rather than a symbolic name. (This may not be portable; works for
+# HP-UX.)
+#
+# Also note that this testpoint overrides SIGTRAP, which on HP-UX at
+# least, is used to implement single-steps and breakpoints. Don't
+# expect to run the inferior after this!
+#
+ send_gdb "handle 5 nopass\n"
+ gdb_expect {
+ -re ".*SIGTRAP is used by the debugger.*Are you sure you want to change it.*y or n.*"\
+ {send_gdb "y\n"
+ gdb_expect {
+ -re ".*SIGTRAP\[ \t\]*Yes\[ \t\]*Yes\[ \t\]*No\[ \t\]*Trace/breakpoint trap.*$gdb_prompt $"\
+ {pass "override SIGTRAP (#5)"}
+ -re "$gdb_prompt $"\
+ {fail "override SIGTRAP (#5)"}
+ timeout {fail "(timeout) override SIGTRAP (#5)"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "override SIGTRAP (#5)"}
+ timeout {fail "(timeout) override SIGTRAP (#5)"}
+ }
+
+# GDB doesn't seem to allow numeric signal IDs larger than 15. Verify
+# that restriction. ??rehrauer: Not sure if this is a feature or a
+# bug, actually. Why is the range 1-15?
+#
+ send_gdb "handle 58\n"
+ gdb_expect {
+ -re "Only signals 1-15 are valid as numeric signals.*Use \"info signals\" for a list of symbolic signals.*$gdb_prompt $"\
+ {pass "invalid signal number rejected"}
+ -re "$gdb_prompt $"\
+ {fail "invalid signal number rejected"}
+ timeout {fail "(timeout) invalid signal number rejected"}
+ }
+
+# Verify that we can accept a signal ID range (number-number).
+# ??rehrauer: This feature isn't documented on the quick-reference
+# card.
+#
+ send_gdb "handle 13-15\n"
+ gdb_expect {
+ -re ".*SIGPIPE.*SIGALRM.*SIGTERM.*$gdb_prompt $"\
+ {pass "handle multiple SIGs via integer range"}
+ -re "$gdb_prompt $"\
+ {fail "handle multiple SIGs via integer range"}
+ timeout {fail "(timeout) handle multiple SIGs via integer range"}
+
+ }
+
+# Bizarrely enough, GDB also allows you to reverse the range
+# stat, stop IDs. E.g., "3-1" and "1-3" mean the same thing.
+# Probably this isn't documented, but the code anticipates it,
+# so we'd best test it...
+#
+ send_gdb "handle 15-13\n"
+ gdb_expect {
+ -re ".*SIGPIPE.*SIGALRM.*SIGTERM.*$gdb_prompt $"\
+ {pass "handle multiple SIGs via integer range"}
+ -re "$gdb_prompt $"\
+ {fail "handle multiple SIGs via integer range"}
+ timeout {fail "(timeout) handle multiple SIGs via integer range"}
+
+ }
+
+# SIGINT is used by the debugger as well. Verify that we can change
+# our minds about changing it.
+#
+ send_gdb "handle SIGINT nopass\n"
+ gdb_expect {
+ -re ".*SIGINT is used by the debugger.*Are you sure you want to change it.*y or n.*"\
+ {send_gdb "n\n"
+# ??rehrauer: When you answer "n", the header for the signal info is
+# printed, but not the actual handler settings. Probably a bug.
+#
+ gdb_expect {
+ -re "Not confirmed, unchanged.*Signal.*$gdb_prompt $"\
+ {pass "override SIGINT"}
+ -re "$gdb_prompt $"\
+ {fail "override SIGINT"}
+ timeout {fail "(timeout) override SIGINT"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "override SIGINT"}
+ timeout {fail "(timeout) override SIGINT"}
+ }
+
+# Verify that GDB responds gracefully to the "signal" command with
+# a missing argument.
+#
+ send_gdb "signal\n"
+ gdb_expect {
+ -re "Argument required .signal number..*$gdb_prompt $"\
+ {pass "signal without arguments disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "signal without arguments disallowed"}
+ timeout {fail "(timeout) signal without arguments disallowed"}
+ }
+
+# Verify that we can successfully send a signal other than 0 to
+# the inferior. (This probably causes the inferior to run away.
+# Be prepared to rerun to main for further testing.)
+#
+ send_gdb "signal 5\n"
+ gdb_expect {
+ -re "Continuing with signal SIGTRAP.*$gdb_prompt $"\
+ {pass "sent signal 5"}
+ -re "$gdb_prompt $"\
+ {fail "sent signal 5"}
+ timeout {fail "(timeout) sent signal 5"}
+ }
+
+}
+
+return 0
diff --git a/gdb/testsuite/gdb.base/sizeof.c b/gdb/testsuite/gdb.base/sizeof.c
new file mode 100644
index 00000000000..95d379ee9ae
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sizeof.c
@@ -0,0 +1,122 @@
+#include <stdio.h>
+
+typedef char padding[16];
+
+struct {
+ padding p1;
+ char v;
+ padding p2;
+} padding_char;
+
+struct {
+ padding p1;
+ short v;
+ padding p2;
+} padding_short;
+
+struct {
+ padding p1;
+ int v;
+ padding p2;
+} padding_int;
+
+struct {
+ padding p1;
+ long v;
+ padding p2;
+} padding_long;
+
+struct {
+ padding p1;
+ long long v;
+ padding p2;
+} padding_long_long;
+
+struct {
+ padding p1;
+ float v;
+ padding p2;
+} padding_float;
+
+struct {
+ padding p1;
+ double v;
+ padding p2;
+} padding_double;
+
+struct {
+ padding p1;
+ long double v;
+ padding p2;
+} padding_long_double;
+
+static void
+fill (void *buf, long sizeof_buf)
+{
+ char *p = buf;
+ int i;
+ for (i = 0; i < sizeof_buf; i++)
+ p[i] = "The quick brown dingo jumped over the layzy dog."[i];
+}
+
+void
+fill_structs (void)
+{
+ fill (&padding_char.p1, sizeof (padding));
+ fill (&padding_char.v, sizeof (padding_char.v));
+ fill (&padding_char.p2, sizeof (padding));
+
+ fill (&padding_short.p1, sizeof (padding));
+ fill (&padding_short.v, sizeof (padding_short.v));
+ fill (&padding_short.p2, sizeof (padding));
+
+ fill (&padding_int.p1, sizeof (padding));
+ fill (&padding_int.v, sizeof (padding_int.v));
+ fill (&padding_int.p2, sizeof (padding));
+
+ fill (&padding_long.p1, sizeof (padding));
+ fill (&padding_long.v, sizeof (padding_long.v));
+ fill (&padding_long.p2, sizeof (padding));
+
+ fill (&padding_long_long.p1, sizeof (padding));
+ fill (&padding_long_long.v, sizeof (padding_long_long.v));
+ fill (&padding_long_long.p2, sizeof (padding));
+
+ fill (&padding_float.p1, sizeof (padding));
+ fill (&padding_float.v, sizeof (padding_float.v));
+ fill (&padding_float.p2, sizeof (padding));
+
+ fill (&padding_double.p1, sizeof (padding));
+ fill (&padding_double.v, sizeof (padding_double.v));
+ fill (&padding_double.p2, sizeof (padding));
+
+ fill (&padding_long_double.p1, sizeof (padding));
+ fill (&padding_long_double.v, sizeof (padding_long_double.v));
+ fill (&padding_long_double.p2, sizeof (padding));
+}
+
+int
+main ()
+{
+ fill_structs ();
+
+ printf ("sizeof (char) == %d\n", sizeof (char));
+ printf ("sizeof (short) == %d\n", sizeof (short));
+ printf ("sizeof (int) == %d\n", sizeof (int));
+ printf ("sizeof (long) == %d\n", sizeof (long));
+ printf ("sizeof (long long) == %d\n", sizeof (long long));
+
+ printf ("sizeof (void *) == %d\n", sizeof (void*));
+ printf ("sizeof (void (*)(void)) == %d\n", sizeof (void (*)(void)));
+
+ printf ("sizeof (float) == %d\n", sizeof (float));
+ printf ("sizeof (double) == %d\n", sizeof (double));
+ printf ("sizeof (long double) == %d\n", sizeof (long double));
+
+ /* Signed char? */
+ printf ("valueof ((int) (char) -1) == %d\n", (int) (char) -1);
+ printf ("valueof ((int) (signed char) -1) == %d\n", (int) (signed char) -1);
+ printf ("valueof ((int) (unsigned char) -1) == %d\n", (int) (unsigned char) -1);
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/sizeof.exp b/gdb/testsuite/gdb.base/sizeof.exp
new file mode 100644
index 00000000000..7c0390588a0
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sizeof.exp
@@ -0,0 +1,208 @@
+# Copyright 2000, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "sizeof"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+#
+# Query GDB for the size of various types
+#
+
+proc get_valueof { fmt exp default } {
+ global gdb_prompt
+ send_gdb "print${fmt} ${exp}\n"
+ gdb_expect {
+ -re "\\$\[0-9\]* = (\[-\]*\[0-9\]*).*$gdb_prompt $" {
+ set val $expect_out(1,string)
+ pass "get value of ${exp} ($val)"
+ }
+ timeout {
+ set size ${default}
+ fail "get value of ${exp} (timeout)"
+ }
+ }
+ return ${val}
+}
+
+proc get_sizeof { type default } {
+ return [get_valueof "/d" "sizeof (${type})" $default]
+}
+
+gdb_test "next"
+
+set sizeof_char [get_sizeof "char" 1]
+set sizeof_short [get_sizeof "short" 2]
+set sizeof_int [get_sizeof "int" 4]
+set sizeof_long [get_sizeof "long" 4]
+set sizeof_long_long [get_sizeof "long long" 8]
+
+set sizeof_data_ptr [get_sizeof "void *" 4]
+set sizeof_func_ptr [get_sizeof "void (*)(void)" 4]
+
+set sizeof_float [get_sizeof "float" 4]
+set sizeof_double [get_sizeof "double" 8]
+set sizeof_long_double [get_sizeof "long double" 8]
+
+#
+# Compare GDB's idea of types with the running program
+#
+
+proc check_sizeof { type size } {
+ global gdb_prompt
+
+ if [gdb_skip_stdio_test "check sizeof $type == $size"] {
+ return;
+ }
+
+ set pat [string_to_regexp "sizeof (${type}) == ${size}"]
+ send_gdb "next\n"
+ gdb_expect {
+ -re "${pat}\[\r\n\].*$gdb_prompt $" {
+ pass "check sizeof ${type} == ${size}"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "check sizeof ${type} == ${size}"
+ }
+ timeout {
+ fail "check sizeof ${type} == ${size} (timeout)"
+ }
+ }
+}
+
+check_sizeof "char" ${sizeof_char}
+check_sizeof "short" ${sizeof_short}
+check_sizeof "int" ${sizeof_int}
+check_sizeof "long" ${sizeof_long}
+check_sizeof "long long" ${sizeof_long_long}
+
+check_sizeof "void *" ${sizeof_data_ptr}
+check_sizeof "void (*)(void)" ${sizeof_func_ptr}
+
+check_sizeof "float" ${sizeof_float}
+check_sizeof "double" ${sizeof_double}
+check_sizeof "long double" ${sizeof_long_double}
+
+proc check_valueof { exp val } {
+ global gdb_prompt
+
+ if [gdb_skip_stdio_test "check valueof $exp == $val"] {
+ return;
+ }
+
+ set pat [string_to_regexp "valueof (${exp}) == ${val}"]
+ send_gdb "next\n"
+ gdb_expect {
+ -re "${pat}\[\r\n\].*$gdb_prompt $" {
+ pass "check valueof ${exp} == ${val}"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "check valueof ${exp} == ${val}"
+ }
+ timeout {
+ fail "check valueof ${exp} == ${val} (timeout)"
+ }
+ }
+}
+
+# Check that GDB and the target agree over the sign of a character.
+
+set signof_char [get_valueof "/d" "(int) (char) -1" -1]
+set signof_signed_char [get_valueof "/d" "(int) (signed char) -1" -1]
+set signof_unsigned_char [get_valueof "/d" "(int) (unsigned char) -1" -1]
+
+check_valueof "(int) (char) -1" ${signof_char}
+check_valueof "(int) (signed char) -1" ${signof_signed_char}
+check_valueof "(int) (unsigned char) -1" ${signof_unsigned_char}
+
+proc check_padding { fmt type val } {
+ global gdb_prompt
+ gdb_test "set padding_${type}.v = ${val}"
+ gdb_test "print padding_${type}.p1" "= \"The quick brown \""
+ gdb_test "print${fmt} padding_${type}.v" "= ${val}"
+ gdb_test "print padding_${type}.p2" "\"The quick brown \".*"
+}
+
+# Check that GDB is managing to store a value in a struct field
+# without corrupting the fields immediately adjacent to it.
+
+check_padding "/d" "char" 1
+check_padding "/d" "short" 2
+check_padding "/d" "int" 4
+check_padding "/d" "long" 4
+check_padding "/d" "long_long" 8
+
+# use multiples of two which can be represented exactly
+check_padding "/f" "float" 1
+check_padding "/f" "double" 2
+check_padding "/f" "long_double" 4
+
+#
+# For reference, dump out the entire architecture
+#
+# The output is very long so use a while loop to consume it
+send_gdb "maint print arch\n"
+set ok 1
+while { $ok } {
+ gdb_expect {
+ -re ".*dump" {
+ #pass "maint print arch $ok"
+ #set ok [expr $ok + 1]
+ }
+ -re "$gdb_prompt $" {
+ pass "maint print arch"
+ set ok 0
+ }
+ timeout {
+ fail "maint print arch (timeout)"
+ set ok 0
+ }
+ }
+}
diff --git a/gdb/testsuite/gdb.base/so-impl-ld.c b/gdb/testsuite/gdb.base/so-impl-ld.c
new file mode 100644
index 00000000000..9310bca1421
--- /dev/null
+++ b/gdb/testsuite/gdb.base/so-impl-ld.c
@@ -0,0 +1,23 @@
+/* This program is linked against SOM shared libraries, which the loader
+ automatically loads along with the program itself).
+ */
+
+#include <stdio.h>
+
+#if defined(__cplusplus) || defined(__STDCPP__)
+extern "C" int solib_main (int arg);
+#else
+int solib_main (int arg);
+#endif
+
+int main ()
+{
+ int result;
+
+ /* Call a shlib function. */
+ result = solib_main (100);
+
+ /* Call it again. */
+ result = solib_main (result);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/so-impl-ld.exp b/gdb/testsuite/gdb.base/so-impl-ld.exp
new file mode 100644
index 00000000000..68a1bf41c00
--- /dev/null
+++ b/gdb/testsuite/gdb.base/so-impl-ld.exp
@@ -0,0 +1,172 @@
+# Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+set prms_id 0
+set bug_id 0
+
+# are we on a target board
+if ![isnative] then {
+ return
+}
+
+# This test is presently only valid on HP-UX, since it requires
+# that we use HP-UX-specific compiler & linker options to build
+# the testcase.
+# Actually this test works on solaris, and linux too.
+
+if {! ([istarget "hppa*-*-*hpux*"]
+ || [istarget "sparc-sun-solaris*"]
+ || [istarget "*-*-linux-gnu*"]) } {
+ return
+}
+
+set libfile "solib"
+set testfile "so-impl-ld"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+# Build the shared libraries this test case needs.
+#
+#cd ${subdir}
+#remote_exec build "$CC -g +z -c ${libfile}1.c -o ${libfile}1.o"
+
+
+if {$gcc_compiled == 0} {
+ if [istarget "hppa*-hp-hpux*"] then {
+ set additional_flags "additional_flags=+z"
+ } else {
+ # don't know that the compiler is, hope for the best...
+ set additional_flags ""
+ }
+} else {
+ set additional_flags "additional_flags=-fpic"
+}
+
+if {[gdb_compile "${srcdir}/${subdir}/${libfile}1.c" "${libfile}1.o" object [list debug $additional_flags]] != ""} {
+ perror "Couldn't compile ${libfile}1.c"
+ return -1
+}
+
+if [istarget "hppa*-hp-hpux*"] then {
+ remote_exec build "ld -b ${libfile}1.o -o ${objdir}/${subdir}/${libfile}1.sl"
+} else {
+ set additional_flags "additional_flags=-shared"
+ gdb_compile "${libfile}1.o" "${objdir}/${subdir}/${libfile}1.sl" executable [list debug $additional_flags]
+}
+
+# Build the test case
+#remote_exec build "$CC -Aa -g ${srcfile} ${libfile}1.sl -o ${binfile}"
+
+
+if {$hp_cc_compiler} {
+ set additional_flags "additional_flags=-Ae"
+} else {
+ set additional_flags ""
+}
+
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile} ${objdir}/${subdir}/${libfile}1.sl" "${binfile}" executable [list debug $additional_flags]] != ""} {
+ perror "Couldn't build ${binfile}"
+ return -1
+}
+#cd ..
+
+# Start with a fresh gdb
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# This program implicitly loads SOM shared libraries.
+#
+if ![runto_main] then { fail "implicit solibs tests suppressed" }
+
+# Verify that we can step over the first shlib call.
+#
+send_gdb "next\n"
+gdb_expect {
+ -re "21\[ \t\]*result = solib_main .result.*$gdb_prompt $"\
+ {pass "step over solib call"}
+ -re "$gdb_prompt $"\
+ {fail "step over solib call"}
+ timeout {fail "(timeout) step over solib call"}
+}
+
+# Verify that we can step into the second shlib call.
+#
+send_gdb "step\n"
+gdb_expect {
+ -re "solib_main .arg=10000. at.*${libfile}1.c:17.*$gdb_prompt $"\
+ {pass "step into solib call"}
+ -re "$gdb_prompt $"\
+ {fail "step into solib call"}
+ timeout {fail "(timeout) step into solib call"}
+}
+
+# Verify that we can step within the shlib call.
+#
+send_gdb "next\n"
+gdb_expect {
+ -re "18\[ \t\]*\}.*$gdb_prompt $"\
+ {pass "step in solib call"}
+ -re "$gdb_prompt $"\
+ {fail "step in solib call"}
+ timeout {fail "(timeout) step in solib call"}
+}
+
+# Verify that we can step out of the shlib call, and back out into
+# the caller.
+#
+send_gdb "next\n"
+gdb_expect {
+ -re "0x\[0-9a-f\]*\[ \t\]*9\[ \t\]*.*$gdb_prompt $" {
+ # we haven't left the callee yet, so do another next
+ send_gdb "next\n"
+ gdb_expect {
+ -re "main .. at.*so-impl-ld.c:22.*$gdb_prompt $"\
+ {pass "step out of solib call"}
+ -re "$gdb_prompt $"\
+ {fail "step out of solib call"}
+ timeout {fail "(timeout) step out of solib call"}
+ }
+ }
+
+ -re "main .. at.*so-impl-ld.c:22.*$gdb_prompt $"\
+ {pass "step out of solib call"}
+ -re "$gdb_prompt $"\
+ {fail "step out of solib call"}
+ timeout {fail "(timeout) step out of solib call"}
+}
+
+gdb_exit
+return 0
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.base/so-indr-cl.c b/gdb/testsuite/gdb.base/so-indr-cl.c
new file mode 100644
index 00000000000..f31800d04bf
--- /dev/null
+++ b/gdb/testsuite/gdb.base/so-indr-cl.c
@@ -0,0 +1,30 @@
+/* This program is linked against SOM shared libraries, which the loader
+ automatically loads along with the program itself).
+ */
+
+#include <stdio.h>
+#ifdef PROTOTYPES
+extern "C" int solib_main (int);
+
+static int
+solib_wrapper (int (*function)(int))
+#else
+extern int solib_main (int);
+
+static int
+solib_wrapper (function)
+ int (*function)(int);
+#endif
+{
+ return (*function)(100);
+}
+
+
+int main ()
+{
+ int result;
+
+ /* This is an indirect call to solib_main. */
+ result = solib_wrapper (solib_main);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/so-indr-cl.exp b/gdb/testsuite/gdb.base/so-indr-cl.exp
new file mode 100644
index 00000000000..1232cebabe9
--- /dev/null
+++ b/gdb/testsuite/gdb.base/so-indr-cl.exp
@@ -0,0 +1,139 @@
+# Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+set prms_id 0
+set bug_id 0
+
+# are we on a target board
+if ![isnative] then {
+ return
+}
+
+# This test is presently only valid on HP-UX, since it requires
+# that we use HP-UX-specific compiler & linker options to build
+# the testcase.
+#
+if {! [istarget "hppa*-*-*hpux*"] } {
+ return
+}
+
+set libfile "solib"
+set testfile "so-indr-cl"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+# Build the shared libraries this test case needs.
+#
+#cd ${subdir}
+#remote_exec build "$CC -g +z -c ${libfile}1.c -o ${libfile}1.o"
+
+
+if {$hp_cc_compiler || $hp_aCC_compiler} {
+ set additional_flags "additional_flags=+z"
+} else {
+ set additional_flags "additional_flags=-fpic"
+}
+if {[gdb_compile "${srcdir}/${subdir}/${libfile}1.c" "${objdir}/${subdir}/${libfile}1.o" object [list debug $additional_flags]] != ""} {
+ perror "Couldn't compile ${libfile}1.c"
+ return -1
+}
+
+if [istarget "hppa*-hp-hpux*"] then {
+ remote_exec build "ld -b ${objdir}/${subdir}/${libfile}1.o -o ${objdir}/${subdir}/${libfile}1.sl"
+} else {
+ set additional_flags "additional_flags=-shared"
+ gdb_compile "${objdir}/${subdir}/${libfile}1.o" "${objdir}/${subdir}/${libfile}1.sl" executable [list debug $additional_flags]
+}
+
+# Build the test case
+#remote_exec build "$CC -Aa -g ${srcfile} ${libfile}1.sl -o ${binfile}"
+
+
+if {$hp_cc_compiler} {
+ set additional_flags "additional_flags=-Ae"
+} else {
+ set additional_flags ""
+}
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile} ${objdir}/${subdir}/${libfile}1.sl" "${binfile}" executable [list debug $additional_flags]] != ""} {
+ perror "Couldn't build ${binfile}"
+ return -1
+}
+
+#cd ..
+
+# Start with a fresh gdb
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# This program implicitly loads SOM shared libraries. We wish to test
+# whether a user can set breakpoints in a shlib before running the
+# program, where the program doesn't directly call the shlib, but
+# indirectly does via passing its address to another function.
+#
+# ??rehrauer: Currently, this doesn't work, but we do catch the case
+# and explicitly disallow it. The reason it fails appears to be that
+#
+# [1] gdb consults only the linker symbol table in this scenario, and
+# [2] For a shlib function that is only indirectly called from the
+# main a.out, there is in the linker symbol table a stub whose
+# address is negative. Possibly this is to be interpreted as
+# an index into the DLT??
+#
+send_gdb "break solib_main\n"
+gdb_expect {
+ -re "Cannot break on solib_main without a running program.*$gdb_prompt $"\
+ {pass "break on indirect solib call before running"}
+ -re "Breakpoint.*deferred.*\\(\"solib_main\" was not found.*$gdb_prompt $"\
+ {pass "break on indirect solib call before running 2"}
+ -re "$gdb_prompt $"\
+ {fail "break on indirect solib call before running"}
+ timeout {fail "(timeout) break on indirect solib call before running"}
+}
+
+# However, if we do run to the program's main, we then ought to be
+# able to set a breakpoint on the indirectly called function. (Apparently,
+# once the inferior is running, gdb consults the debug info rather than
+# the linker symbol table, and is able to find the correct address.)
+#
+if ![runto_main] then { fail "indirect solib call tests suppressed" }
+
+# Verify that we can step over the first shlib call.
+#
+send_gdb "break solib_main\n"
+gdb_expect {
+ -re ".*\[Bb\]reakpoint \[0-9\]* at 0x\[0-9a-fA-F\]*: file.*${libfile}1.c.*$gdb_prompt $"\
+ {pass "break on indirect solib call after running"}
+ -re "$gdb_prompt $"\
+ {fail "break on indirect solib call after running"}
+ timeout {fail "(timeout) break on indirect solib call after running"}
+}
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.base/solib.c b/gdb/testsuite/gdb.base/solib.c
new file mode 100644
index 00000000000..6fb9f5e11da
--- /dev/null
+++ b/gdb/testsuite/gdb.base/solib.c
@@ -0,0 +1,60 @@
+/* This program uses HP-UX-specific features to load and unload SOM
+ shared libraries that it wasn't linked against (i.e., libraries
+ that the loader doesn't automatically load along with the program
+ itself).
+ */
+
+#include <stdio.h>
+#include <dl.h>
+
+int main ()
+{
+ shl_t solib_handle;
+ int dummy;
+ int status;
+ int (*solib_main) (int);
+
+ /* Load a shlib, with immediate binding of all symbols.
+
+ Note that the pathname of the loaded shlib is assumed to be relative
+ to the testsuite directory (from whence the tested GDB is run), not
+ from dot/.
+ */
+ dummy = 1; /* Put some code between shl_ calls... */
+ solib_handle = shl_load ("gdb.base/solib1.sl", BIND_IMMEDIATE, 0);
+
+ /* Find a function within the shlib, and call it. */
+ status = shl_findsym (&solib_handle,
+ "solib_main",
+ TYPE_PROCEDURE,
+ (long *) &solib_main);
+ status = (*solib_main) (dummy);
+
+ /* Unload the shlib. */
+ status = shl_unload (solib_handle);
+
+ /* Load a different shlib, with deferred binding of all symbols. */
+ dummy = 2;
+ solib_handle = shl_load ("gdb.base/solib2.sl", BIND_DEFERRED, 0);
+
+ /* Find a function within the shlib, and call it. */
+ status = shl_findsym (&solib_handle,
+ "solib_main",
+ TYPE_PROCEDURE,
+ (long *) &solib_main);
+ status = (*solib_main) (dummy);
+
+ /* Unload the shlib. */
+ status = shl_unload (solib_handle);
+
+ /* Reload the first shlib again, with deferred symbol binding this time. */
+ dummy = 3;
+ solib_handle = shl_load ("gdb.base/solib1.sl", BIND_IMMEDIATE, 0);
+
+ /* Unload it without trying to find any symbols in it. */
+ status = shl_unload (solib_handle);
+
+ /* All done. */
+ dummy = -1;
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/solib.exp b/gdb/testsuite/gdb.base/solib.exp
new file mode 100644
index 00000000000..3ce0edb7185
--- /dev/null
+++ b/gdb/testsuite/gdb.base/solib.exp
@@ -0,0 +1,360 @@
+# Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+set prms_id 0
+set bug_id 0
+
+# are we on a target board
+if ![isnative] then {
+ return
+}
+
+# This test is presently only valid on HP-UX. It verifies GDB's
+# ability to catch loads and unloads of shared libraries.
+#
+
+#setup_xfail "*-*-*"
+#clear_xfail "hppa*-*-*hpux*"
+if {![istarget "hppa*-*-hpux*"]} {
+ return 0
+}
+
+set testfile "solib"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# build the first test case
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+# Build the shared libraries this test case needs.
+#
+#cd ${subdir}
+#remote_exec build "$CC -g +z -c ${testfile}1.c -o ${testfile}1.o"
+#remote_exec build "$CC -g +z -c ${testfile}2.c -o ${testfile}2.o"
+
+if {$gcc_compiled == 0} {
+ if [istarget "hppa*-hp-hpux*"] then {
+ set additional_flags "additional_flags=+z"
+ } else {
+ # don't know what the compiler is...
+ set additional_flags ""
+ }
+} else {
+ set additional_flags "additional_flags=-fpic"
+}
+
+if {[gdb_compile "${srcdir}/${subdir}/${testfile}1.c" "${binfile}1.o" object [list debug $additional_flags]] != ""} {
+ perror "Couldn't compile ${testfile}1.c"
+ #return -1
+}
+if {[gdb_compile "${srcdir}/${subdir}/${testfile}2.c" "${binfile}2.o" object [list debug, $additional_flags]] != ""} {
+ perror "Couldn't compile ${testfile}2.c"
+ #return -1
+}
+
+if [istarget "hppa*-*-hpux*"] {
+ remote_exec build "ld -b ${binfile}1.o -o ${binfile}1.sl"
+ remote_exec build "ld -b ${binfile}2.o -o ${binfile}2.sl"
+} else {
+ set additional_flags "additional_flags=-shared"
+ gdb_compile "${binfile}1.o" "${binfile}1.sl" executable [list debug $additional_flags]
+ gdb_compile "${binfile}2.o" "${binfile}2.sl" executable [list debug $additional_flags]
+}
+
+# Build a version where the main program is in a shared library. For
+# testing an indirect call made in a shared library.
+
+if {[gdb_compile "${srcdir}/${subdir}/${testfile}.c" "${binfile}_sl.o" object [list debug $additional_flags]] != ""} {
+ perror "Couldn't compile ${testfile}.c for ${binfile}_sl.o"
+ #return -1
+}
+
+if { [istarget "hppa*-*-hpux*"] } {
+ remote_exec build "ld -b ${binfile}_sl.o -o ${binfile}_sl.sl"
+} else {
+ set additional_flags "additional_flags=-shared"
+ gdb_compile "${binfile}_sl.o" "${binfile}_sl.sl" executable [list debug $additional_flags]
+}
+
+if { [istarget "hppa*-*-hpux*"] } {
+ set additional_flags "-Wl,-u,main"
+ if { [gdb_compile "${binfile}_sl.sl" "${binfile}_sl" executable [list debug $additional_flags]] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+} else {
+ # FIXME: need to fill this part in for non-HP build
+}
+
+#cd ..
+
+# Start with a fresh gdb
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# This program manually loads and unloads SOM shared libraries, via calls
+# to shl_load and shl_unload.
+#
+if ![runto_main] then { fail "catch load/unload tests suppressed" }
+
+# Verify that we complain if the user tells us to catch something we
+# don't understand.
+#
+send_gdb "catch a_cold\n"
+gdb_expect {
+ -re "Unknown event kind specified for catch.*$gdb_prompt $"\
+ {pass "bogus catch kind is disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "bogus catch kind is disallowed"}
+ timeout {fail "(timeout) bogus catch kind is disallowed"}
+}
+
+# Verify that we can set a generic catchpoint on shlib loads. I.e., that
+# we can catch any shlib load, without specifying the name.
+#
+send_gdb "catch load\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\]* .load <any library>.*$gdb_prompt $"\
+ {pass "set generic catch load"}
+ -re "$gdb_prompt $"\
+ {fail "set generic catch load"}
+ timeout {fail "(timeout) set generic catch load"}
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\] .loaded gdb.base/solib1.sl.*$gdb_prompt $"\
+ {pass "caught generic solib load"}
+ -re "$gdb_prompt $"\
+ {fail "caught generic solib load"}
+ timeout {fail "(timeout) caught generic solib load"}
+}
+
+# Set a breakpoint on the line following the shl_load call, and
+# continue.
+#
+# ??rehrauer: It appears that we can't just say "finish" from here;
+# GDB is getting confused by the dld's presense on the stack.
+#
+send_gdb "break 27\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]* at.*$gdb_prompt $"\
+ {pass "set break after shl_load"}
+ -re "$gdb_prompt $"\
+ {fail "set break after shl_load"}
+ timeout {fail "(timeout) set break after shl_load"}
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*, main .. at .*solib.c:27.*$gdb_prompt $"\
+ {pass "continue after generic catch load"}
+ -re "$gdb_prompt $"\
+ {fail "continue after generic catch load"}
+ timeout {fail "(timeout) continue after generic catch load"}
+}
+
+# Step over the call to shl_findsym.
+#
+# ??rehrauer: In theory, since the call to shl_load asked for
+# immediate binding of the shlib's symbols, and since the
+# shlib's symbols should have been auto-loaded, we ought to
+# be able to set a breakpoint on solib_main now. However,
+# that seems not to be the case. Dunno why for sure; perhaps
+# the breakpoint wants to be set on an import stub in the
+# main program for solib_main? There wouldn't be one, in
+# this case...
+#
+send_gdb "next\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "step over shl_findsym"}
+ timeout {fail "(timeout) step over shl_findsym"}
+}
+
+# Verify that we can catch an unload of any library.
+#
+send_gdb "catch unload\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\]* .unload <any library>.*$gdb_prompt $"\
+ {pass "set generic catch unload"}
+ -re "$gdb_prompt $"\
+ {fail "set generic catch unload"}
+ timeout {fail "(timeout) set generic catch load"}
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\] .unloaded gdb.base/solib1.sl.*$gdb_prompt $"\
+ {pass "caught generic solib unload"}
+ -re "$gdb_prompt $"\
+ {fail "caught generic solib unload"}
+ timeout {fail "(timeout) caught generic solib unload"}
+}
+
+# Verify that we can catch a load of a specific library. (Delete
+# all the other catchpoints first, so that the generic catchpoints
+# we've previously set don't trigger.)
+#
+send_gdb "delete\n"
+gdb_expect {
+ -re "Delete all breakpoints.*y or n.*"\
+ {send_gdb "y\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "delete all catchpoints"}
+ timeout {fail "(timeout) delete all catchpoints"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "delete all catchpoints"}
+ timeout {fail "(timeout) delete all catchpoints"}
+}
+
+send_gdb "catch load gdb.base/solib2.sl\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\]* .load gdb.base/solib2.sl.*$gdb_prompt $"\
+ {pass "set specific catch load"}
+ -re "$gdb_prompt $"\
+ {fail "set specific catch load"}
+ timeout {fail "(timeout) set specific catch load"}
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\] .loaded gdb.base/solib2.sl.*$gdb_prompt $"\
+ {pass "caught specific solib load"}
+ -re "$gdb_prompt $"\
+ {fail "caught specific solib load"}
+ timeout {fail "(timeout) caught specific solib load"}
+}
+
+# Verify that we can catch an unload of a specific library.
+#
+send_gdb "catch unload gdb.base/solib2.sl\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\]* .unload gdb.base/solib2.sl.*$gdb_prompt $"\
+ {pass "set specific catch unload"}
+ -re "$gdb_prompt $"\
+ {fail "set specific catch unload"}
+ timeout {fail "(timeout) set specific catch unload"}
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\] .unloaded gdb.base/solib2.sl.*$gdb_prompt $"\
+ {pass "caught specific solib unload"}
+ -re "$gdb_prompt $"\
+ {fail "caught specific solib unload"}
+ timeout {fail "(timeout) caught specific solib unload"}
+}
+
+# Verify that we can set a catchpoint on a specific library that
+# happens not to be loaded by the program. And, that this catchpoint
+# won't trigger inappropriately when other shlibs are loaded.
+#
+send_gdb "break 55\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]* at.*$gdb_prompt $"\
+ {pass "set break on shl_unload"}
+ -re "$gdb_prompt $"\
+ {fail "set break on shl_unload"}
+ timeout {fail "(timeout) set break on shl_unload"}
+}
+
+send_gdb "break 58\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]* at.*$gdb_prompt $"\
+ {pass "set break after shl_unload"}
+ -re "$gdb_prompt $"\
+ {fail "set break after shl_unload"}
+ timeout {fail "(timeout) set break after shl_unload"}
+}
+
+send_gdb "catch load foobar.sl\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\]* .load foobar.sl.*$gdb_prompt $"\
+ {pass "set specific catch load for nonloaded shlib"}
+ -re "$gdb_prompt $"\
+ {fail "set specific catch load for nonloaded shlib"}
+ timeout {fail "(timeout) set specific catch load for nonloaded shlib"}
+}
+
+send_gdb "catch unload foobar.sl\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\]* .unload foobar.sl.*$gdb_prompt $"\
+ {pass "set specific catch unload for nonloaded shlib"}
+ -re "$gdb_prompt $"\
+ {fail "set specific catch unload for nonloaded shlib"}
+ timeout {fail "(timeout) set specific catch unload for nonloaded shlib"}
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*.*$gdb_prompt $"\
+ {pass "specific catch load doesn't trigger inappropriately"}
+ -re "$gdb_prompt $"\
+ {fail "specific catch load doesn't trigger inappropriately"}
+ timeout {fail "(timeout) specific catch load doesn't trigger inappropriately"}
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*.*$gdb_prompt $"\
+ {pass "specific catch unload doesn't trigger inappropriately"}
+ -re "$gdb_prompt $"\
+ {fail "specific catch unload doesn't trigger inappropriately"}
+ timeout {fail "(timeout) specific catch unload doesn't trigger inappropriately"}
+}
+
+# ??rehrauer: There ought to be testpoints here that verify that
+# load/unload catchpoints can use conditionals, can be temporary,
+# self-disabling, etc etc.
+#
+
+gdb_exit
+
+#
+# Test stepping into an indirect call in a shared library.
+#
+
+gdb_start
+gdb_load ${binfile}_sl
+gdb_test "break main" ".*deferred. at .main..*" "break on main"
+gdb_test "run" ".*Breakpoint.*main.*solib.c.*" "hit breakpoint at main"
+gdb_test "break 45" "Breakpoint.*solib.c, line 45.*" "break on indirect call"
+gdb_test "continue" "Continuing.*solib.c:45.*" \
+ "continue to break on indirect call"
+gdb_test "step" "solib_main.*solib1.c:17.*return arg.arg.*" \
+ "step into indirect call from a shared library"
+gdb_exit
+
+return 0
diff --git a/gdb/testsuite/gdb.base/solib1.c b/gdb/testsuite/gdb.base/solib1.c
new file mode 100644
index 00000000000..2e517504505
--- /dev/null
+++ b/gdb/testsuite/gdb.base/solib1.c
@@ -0,0 +1,18 @@
+/* This program is intended to be built as an HP-UX SOM shared
+ library, for use by the solib.exp testcase. It simply returns
+ the square of its integer argument.
+ */
+#if defined(__cplusplus) || defined(__STDCPP__)
+extern "C" int
+solib_main (int arg)
+#else
+#ifdef PROTOTYPES
+int solib_main (int arg)
+#else
+int solib_main (arg)
+ int arg;
+#endif
+#endif
+{
+ return arg*arg;
+}
diff --git a/gdb/testsuite/gdb.base/solib2.c b/gdb/testsuite/gdb.base/solib2.c
new file mode 100644
index 00000000000..8c69d8b273e
--- /dev/null
+++ b/gdb/testsuite/gdb.base/solib2.c
@@ -0,0 +1,19 @@
+/* This program is intended to be built as an HP-UX SOM shared
+ library, for use by the solib.exp testcase. It simply returns
+ the cube of its integer argument.
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef PROTOTYPES
+int solib_main (int arg)
+#else
+int solib_main (arg)
+ int arg;
+#endif
+{
+ return arg*arg*arg;
+}
+#ifdef __cplusplus
+}
+#endif
diff --git a/gdb/testsuite/gdb.base/ss.h b/gdb/testsuite/gdb.base/ss.h
new file mode 100644
index 00000000000..2a4c162dcd6
--- /dev/null
+++ b/gdb/testsuite/gdb.base/ss.h
@@ -0,0 +1,4 @@
+struct s {
+ int a;
+ int b;
+};
diff --git a/gdb/testsuite/gdb.base/step-line.c b/gdb/testsuite/gdb.base/step-line.c
new file mode 100644
index 00000000000..f961120ab1c
--- /dev/null
+++ b/gdb/testsuite/gdb.base/step-line.c
@@ -0,0 +1,84 @@
+/* Test step/next in presence of #line directives.
+ Copyright 2001
+ Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+void dummy (int, int);
+int f1 (int);
+int f2 (int);
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ i = f1 (4);
+ i = f1 (i);
+ dummy (0, i);
+ return 0;
+}
+
+int
+f1 (int i)
+{
+#line 40 "step-line.c"
+ dummy (1, i);
+#line 24 "step-line.inp"
+ i = f2 (i);
+#line 44 "step-line.c"
+ dummy (2, i);
+#line 25 "step-line.inp"
+ i = f2 (i);
+#line 48 "step-line.c"
+ dummy (3, i);
+#line 26 "step-line.inp"
+ return i;
+#line 52 "step-line.c"
+}
+
+int
+f2 (int i)
+{
+#line 31 "step-line.inp"
+ int j;
+#line 60 "step-line.c"
+ dummy (4, i);
+#line 32 "step-line.inp"
+ j = i;
+#line 64 "step-line.c"
+ dummy (5, i);
+ dummy (6, j);
+#line 33 "step-line.inp"
+ j = j + 1;
+#line 69 "step-line.c"
+ dummy (7, i);
+ dummy (8, j);
+#line 34 "step-line.inp"
+ j = j - i;
+#line 74 "step-line.c"
+ dummy (9, i);
+ dummy (10, j);
+#line 35 "step-line.inp"
+ return i;
+#line 79 "step-line.c"
+}
+
+void
+dummy (int num, int i)
+{
+}
diff --git a/gdb/testsuite/gdb.base/step-line.exp b/gdb/testsuite/gdb.base/step-line.exp
new file mode 100644
index 00000000000..cac3128fcec
--- /dev/null
+++ b/gdb/testsuite/gdb.base/step-line.exp
@@ -0,0 +1,95 @@
+# Copyright 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+# use this to debug:
+#
+#log_user 1
+
+# step-line.exp -- Expect script to test stepping in files with
+# #line directives.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile step-line
+set srcfile ${srcdir}/${subdir}/${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+remote_exec build "rm -f ${binfile}"
+if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ fail "Can't run to main"
+ return 0
+}
+
+gdb_test "break f1" ".*Breakpoint 2 at .* file step-line.c.*" "break f1"
+gdb_test "continue" \
+ "Continuing.*Breakpoint 2, f1 \\(i=4\\).*dummy \\(1, i\\);" \
+ "continue to f1"
+gdb_test "next" \
+ ".*i = f2 \\(i\\);.*" \
+ "next over dummy 1"
+gdb_test "next" \
+ ".*dummy \\(2, i\\);.*" \
+ "next to dummy 2"
+gdb_test "next" \
+ ".*i = f2 \\(i\\);.*" \
+ "next over dummy 2"
+gdb_test "step" \
+ ".*f2 \\(i=4\\).*dummy \\(4, i\\);.*" \
+ "step into f2"
+gdb_test "next" \
+ ".*j = i;.*" \
+ "next over dummy 4"
+gdb_test "next" \
+ ".*dummy \\(5, i\\);.*" \
+ "next to dummy 5"
+gdb_test "next" \
+ ".*dummy \\(6, j\\);.*" \
+ "next to dummy 6"
+gdb_test "next" \
+ ".*j = SUCC \\(j\\);.*" \
+ "next over dummy 6"
+gdb_test "next" \
+ ".*dummy \\(7, i\\);.*" \
+ "next to dummy 7"
+gdb_test "next" \
+ ".*dummy \\(8, j\\);.*" \
+ "next to dummy 8"
+gdb_test "next" \
+ ".*j = j - i;.*" \
+ "next over dummy 8"
+gdb_test "next" \
+ ".*dummy \\(9, i\\);.*" \
+ "next to dummy 9"
+gdb_test "next" \
+ ".*dummy \\(10, j\\);.*" \
+ "next to dummy 10"
+gdb_test "next" \
+ ".*RETURN \\(j\\);.*" \
+ "next over dummy 10"
+return 0
diff --git a/gdb/testsuite/gdb.base/step-line.inp b/gdb/testsuite/gdb.base/step-line.inp
new file mode 100644
index 00000000000..f4060a94152
--- /dev/null
+++ b/gdb/testsuite/gdb.base/step-line.inp
@@ -0,0 +1,41 @@
+# Test step/next in presence of #line directives
+# Copyright 2001
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# We pretend that this file has been transformed by some other tool
+# into step-line.c.
+
+FUNCTION f1 (i : INTEGER);
+ BEGIN
+ i = f2 (i);
+ i = f2 (i);
+ RETURN (i);
+ END
+
+FUNCTION f2 (i : INTEGER);
+ BEGIN
+ VARIABLE j : INTEGER
+ j = i;
+ j = SUCC (j);
+ j = j - i;
+ RETURN (j);
+ END
+
+BEGIN
+ VARIABLE i : INTEGER;;
+
+END
diff --git a/gdb/testsuite/gdb.base/step-test.c b/gdb/testsuite/gdb.base/step-test.c
new file mode 100644
index 00000000000..a1e1dc408cf
--- /dev/null
+++ b/gdb/testsuite/gdb.base/step-test.c
@@ -0,0 +1,61 @@
+#include <stdlib.h>
+#include <string.h>
+
+/* Test various kinds of stepping.
+*/
+int myglob = 0;
+
+int callee() {
+ myglob++; return 0;
+}
+
+/* A structure which, we hope, will need to be passed using memcpy. */
+struct rhomboidal {
+ int rather_large[100];
+};
+
+void
+large_struct_by_value (struct rhomboidal r)
+{
+ myglob += r.rather_large[42]; /* step-test.exp: arrive here 1 */
+}
+
+int main () {
+ int w,x,y,z;
+ int a[10], b[10];
+
+ /* Test "next" and "step" */
+ w = 0;
+ x = 1;
+ y = 2;
+ z = 3;
+ w = w + 2;
+ x = x + 3;
+ y = y + 4;
+ z = z + 5;
+
+ /* Test that "next" goes over a call */
+ callee(); /* OVER */
+
+ /* Test that "step" doesn't */
+ callee(); /* INTO */
+
+ /* Test "stepi" */
+ a[5] = a[3] - a[4];
+ callee(); /* STEPI */
+
+ /* Test "nexti" */
+ callee(); /* NEXTI */
+
+ y = w + z;
+
+ {
+ struct rhomboidal r;
+ memset (r.rather_large, 0, sizeof (r.rather_large));
+ r.rather_large[42] = 10;
+ large_struct_by_value (r); /* step-test.exp: large struct by value */
+ }
+
+ exit (0);
+}
+
diff --git a/gdb/testsuite/gdb.base/step-test.exp b/gdb/testsuite/gdb.base/step-test.exp
new file mode 100644
index 00000000000..9a21136996c
--- /dev/null
+++ b/gdb/testsuite/gdb.base/step-test.exp
@@ -0,0 +1,241 @@
+# Copyright 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# use this to debug:
+#
+#log_user 1
+
+# step-test.exp -- Expect script to test stepping in gdb
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set testfile step-test
+set srcfile ${srcdir}/${subdir}/${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+remote_exec build "rm -f ${binfile}"
+if { [gdb_compile "${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ fail "Can't run to main"
+ return 0
+}
+
+# Set a breakpoint at line 45, if stepi then finish fails, we would
+# run to the end of the program, which would mess up the rest of the tests.
+
+# Vanilla step/next
+#
+gdb_test "next" ".*${decimal}.*x = 1;.*" "next 1"
+gdb_test "step" ".*${decimal}.*y = 2;.*" "step 1"
+
+# With count
+#
+gdb_test "next 2" ".*${decimal}.*w = w.*2;.*" "next 2"
+gdb_test "step 3" ".*${decimal}.*z = z.*5;.*" "step 3"
+gdb_test "next" ".*${decimal}.*callee.*OVER.*" "next 3"
+
+# Step over call
+#
+gdb_test "next" ".*${decimal}.*callee.*INTO.*" "next over"
+
+# Step into call
+#
+gdb_test "step" ".*${decimal}.*myglob.*" "step into"
+
+# Step out of call
+#
+# I wonder if this is really portable. Are there any caller-saves
+# platforms, on which `finish' will return you to some kind of pop
+# instruction, which is attributed to the line containing the function
+# call?
+
+# On PA64, we end up at a different instruction than PA32.
+# On IA-64, we also end up on callee instead of on the next line due
+# to the restoration of the global pointer (which is a caller-save).
+if { [istarget "hppa2.0w-hp-hpux*"] || [istarget "ia64-*-*"]} {
+ send_gdb "finish\n"
+ gdb_expect {
+ -re ".*${decimal}.*a.*5.*= a.*3.*$gdb_prompt $" { pass "step out 1" }
+ -re ".*${decimal}.*callee.*INTO.*$gdb_prompt $" { pass "step out 2" }
+ timeout { fail "step out" }
+ }
+} else {
+ gdb_test "finish" ".*${decimal}.*a.*5.*= a.*3.*" "step out"
+}
+
+### Testing nexti and stepi.
+###
+### test_i NAME COMMAND HERE THERE
+###
+### Send COMMAND to gdb over and over, while the output matches the
+### regexp HERE, followed by the gdb prompt. Pass if the output
+### eventually matches the regexp THERE, followed by the gdb prompt;
+### fail if we have to iterate more than a hundred times, we time out
+### talking to gdb, or we get output which is neither HERE nor THERE. :)
+###
+### Use NAME as the name of the test.
+###
+### The exact regexps used are "$HERE.*$gdb_prompt $"
+### and "$THERE.*$gdb_prompt $"
+###
+proc test_i {name command here there} {
+ global gdb_prompt
+
+ set i 0
+ while 1 {
+ send_gdb "${command}\n"
+ gdb_expect {
+ -re "$here.*$gdb_prompt $" {
+ # Okay, we're still on the same line. Just step again.
+ }
+ -re "$there.*$gdb_prompt $" {
+ # We've reached the next line. Rah.
+ pass "$name"
+ return
+ }
+ -re "$gdb_prompt $" {
+ # We got something else. Fail.
+ fail "$name"
+ return
+ }
+ timeout {
+ fail "$name (timeout)"
+ return
+ }
+ }
+
+ # Have we gone for too many steps without seeing any progress?
+ if {[incr i] >= 100} {
+ fail "$name (no progress after 100 steps)"
+ return
+ }
+ }
+}
+
+test_i "stepi to next line" "stepi" \
+ ".*${decimal}.*a.*5.* = a.*3" \
+ ".*${decimal}.*callee.*STEPI"
+test_i "stepi into function" "stepi" \
+ ".*${decimal}.*callee.*STEPI" \
+ ".*callee \\(\\) at .*step-test\\.c"
+
+# Continue to step until we reach the function's body. This makes it
+# more likely that we've actually completed the prologue, so "finish"
+# will work.
+test_i "stepi into function's first source line" "stepi" \
+ ".*${decimal}.*int callee" \
+ ".*${decimal}.*myglob.*; return 0;"
+
+# Have to be careful here, if the finish does not work,
+# then we may run to the end of the program, which
+# will cause erroneous failures in the rest of the tests
+send_gdb "finish\n"
+gdb_expect {
+ -re ".*(Program received|Program exited).*$gdb_prompt $" {
+ # Oops... We ran to the end of the program... Better reset
+ if {![runto_main]} then {
+ fail "Can't run to main"
+ return 0
+ }
+ if {![runto step-test.c:45]} {
+ fail "Can't run to line 45"
+ return 0
+ }
+ fail "stepi: finish call"
+ }
+ -re ".*${decimal}.*callee.*NEXTI.*$gdb_prompt $" {
+ pass "stepi: finish call"
+ }
+ -re ".*${decimal}.*callee.*STEPI.*$gdb_prompt $" {
+ # On PA64, we end up at a different instruction than PA32.
+ # On IA-64, we end up on callee instead of on the following line due
+ # to the restoration of the global pointer.
+ if { [istarget "hppa2.0w-hp-hpux*"] || [istarget "ia64-*-*"] } {
+ pass "stepi: finish call 2"
+ } else {
+ fail "stepi: finish call 2"
+ return
+ }
+ }
+ -re "$gdb_prompt $" {
+ # We got something else. Fail.
+ fail "stepi: finish call"
+ return
+ }
+ timeout {
+ fail "stepi: finish call (timeout)"
+ return
+ }
+}
+
+test_i "nexti over function" "nexti" \
+ ".*${decimal}.*callee.*NEXTI" \
+ ".*${decimal}.*y = w \\+ z;"
+
+# On some platforms, if we try to step into a function call that
+# passes a large structure by value, then we actually end up stepping
+# into memcpy, bcopy, or some such --- GCC emits the call to pass the
+# argument. Opinion is bitterly divided about whether this is the
+# right behavior for GDB or not, but we'll catch it here, so folks
+# won't forget about it.
+# Update 4/4/2002 - Regardless of which opinion you have, you would
+# probably have to agree that gdb is currently behaving as designed,
+# in the absence of additional code to not stop in functions used
+# internally by the compiler. Since the testsuite should be checking
+# for conformance to the design, the correct behavior is to accept the
+# cases where gdb stops in memcpy/bcopy.
+
+gdb_test \
+ "break [gdb_get_line_number "step-test.exp: large struct by value"]" \
+ ".*Breakpoint.* at .*" \
+ "set breakpoint at call to large_struct_by_value"
+gdb_test "continue" \
+ ".*Breakpoint ${decimal},.*large_struct_by_value.*" \
+ "run to pass large struct"
+send_gdb "step\n"
+gdb_expect {
+ -re ".*step-test.exp: arrive here 1.*$gdb_prompt $" {
+ pass "large struct by value"
+ }
+ -re ".*(memcpy|bcopy).*$gdb_prompt $" {
+ send_gdb "finish\n" ; gdb_expect -re "$gdb_prompt $"
+ send_gdb "step\n"
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {
+ fail "large struct by value"
+ }
+ timeout {
+ fail "large struct by value (timeout)"
+ }
+}
+
+gdb_continue_to_end "step-test.exp"
+
+return 0
diff --git a/gdb/testsuite/gdb.base/structs.c b/gdb/testsuite/gdb.base/structs.c
new file mode 100644
index 00000000000..356f0729f1e
--- /dev/null
+++ b/gdb/testsuite/gdb.base/structs.c
@@ -0,0 +1,263 @@
+/* Copyright 1996, 1999 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+struct struct1 { char a;};
+struct struct2 { char a, b;};
+struct struct3 { char a, b, c; };
+struct struct4 { char a, b, c, d; };
+struct struct5 { char a, b, c, d, e; };
+struct struct6 { char a, b, c, d, e, f; };
+struct struct7 { char a, b, c, d, e, f, g; };
+struct struct8 { char a, b, c, d, e, f, g, h; };
+struct struct9 { char a, b, c, d, e, f, g, h, i; };
+struct struct10 { char a, b, c, d, e, f, g, h, i, j; };
+struct struct11 { char a, b, c, d, e, f, g, h, i, j, k; };
+struct struct12 { char a, b, c, d, e, f, g, h, i, j, k, l; };
+struct struct16 { char a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p; };
+
+struct struct1 foo1 = {'1'}, L1;
+struct struct2 foo2 = { 'a', 'b'}, L2;
+struct struct3 foo3 = { 'A', 'B', 'C'}, L3;
+struct struct4 foo4 = {'1', '2', '3', '4'}, L4;
+struct struct5 foo5 = {'a', 'b', 'c', 'd', 'e'}, L5;
+struct struct6 foo6 = {'A', 'B', 'C', 'D', 'E', 'F'}, L6;
+struct struct7 foo7 = {'1', '2', '3', '4', '5', '6', '7'}, L7;
+struct struct8 foo8 = {'1', '2', '3', '4', '5', '6', '7', '8'}, L8;
+struct struct9 foo9 = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'}, L9;
+struct struct10 foo10 = {
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'}, L10;
+struct struct11 foo11 = {
+ '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B'}, L11;
+struct struct12 foo12 = {
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L'}, L12;
+struct struct16 foo16 = {
+ 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p'}, L16;
+
+struct struct1 fun1()
+{
+ return foo1;
+}
+struct struct2 fun2()
+{
+ return foo2;
+}
+struct struct3 fun3()
+{
+ return foo3;
+}
+struct struct4 fun4()
+{
+ return foo4;
+}
+struct struct5 fun5()
+{
+ return foo5;
+}
+struct struct6 fun6()
+{
+ return foo6;
+}
+struct struct7 fun7()
+{
+ return foo7;
+}
+struct struct8 fun8()
+{
+ return foo8;
+}
+struct struct9 fun9()
+{
+ return foo9;
+}
+struct struct10 fun10()
+{
+ return foo10;
+}
+struct struct11 fun11()
+{
+ return foo11;
+}
+struct struct12 fun12()
+{
+ return foo12;
+}
+struct struct16 fun16()
+{
+ return foo16;
+}
+
+#ifdef PROTOTYPES
+void Fun1(struct struct1 foo1)
+#else
+void Fun1(foo1)
+ struct struct1 foo1;
+#endif
+{
+ L1 = foo1;
+}
+#ifdef PROTOTYPES
+void Fun2(struct struct2 foo2)
+#else
+void Fun2(foo2)
+ struct struct2 foo2;
+#endif
+{
+ L2 = foo2;
+}
+#ifdef PROTOTYPES
+void Fun3(struct struct3 foo3)
+#else
+void Fun3(foo3)
+ struct struct3 foo3;
+#endif
+{
+ L3 = foo3;
+}
+#ifdef PROTOTYPES
+void Fun4(struct struct4 foo4)
+#else
+void Fun4(foo4)
+ struct struct4 foo4;
+#endif
+{
+ L4 = foo4;
+}
+#ifdef PROTOTYPES
+void Fun5(struct struct5 foo5)
+#else
+void Fun5(foo5)
+ struct struct5 foo5;
+#endif
+{
+ L5 = foo5;
+}
+#ifdef PROTOTYPES
+void Fun6(struct struct6 foo6)
+#else
+void Fun6(foo6)
+ struct struct6 foo6;
+#endif
+{
+ L6 = foo6;
+}
+#ifdef PROTOTYPES
+void Fun7(struct struct7 foo7)
+#else
+void Fun7(foo7)
+ struct struct7 foo7;
+#endif
+{
+ L7 = foo7;
+}
+#ifdef PROTOTYPES
+void Fun8(struct struct8 foo8)
+#else
+void Fun8(foo8)
+ struct struct8 foo8;
+#endif
+{
+ L8 = foo8;
+}
+#ifdef PROTOTYPES
+void Fun9(struct struct9 foo9)
+#else
+void Fun9(foo9)
+ struct struct9 foo9;
+#endif
+{
+ L9 = foo9;
+}
+#ifdef PROTOTYPES
+void Fun10(struct struct10 foo10)
+#else
+void Fun10(foo10)
+ struct struct10 foo10;
+#endif
+{
+ L10 = foo10;
+}
+#ifdef PROTOTYPES
+void Fun11(struct struct11 foo11)
+#else
+void Fun11(foo11)
+ struct struct11 foo11;
+#endif
+{
+ L11 = foo11;
+}
+#ifdef PROTOTYPES
+void Fun12(struct struct12 foo12)
+#else
+void Fun12(foo12)
+ struct struct12 foo12;
+#endif
+{
+ L12 = foo12;
+}
+#ifdef PROTOTYPES
+void Fun16(struct struct16 foo16)
+#else
+void Fun16(foo16)
+ struct struct16 foo16;
+#endif
+{
+ L16 = foo16;
+}
+
+int main()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+
+ /* TEST C FUNCTIONS */
+ L1 = fun1();
+ L2 = fun2();
+ L3 = fun3();
+ L4 = fun4();
+ L5 = fun5();
+ L6 = fun6();
+ L7 = fun7();
+ L8 = fun8();
+ L9 = fun9();
+ L10 = fun10();
+ L11 = fun11();
+ L12 = fun12();
+ L16 = fun16();
+
+ foo1.a = foo2.a = foo3.a = foo4.a = foo5.a = foo6.a = foo7.a = foo8.a =
+ foo9.a = foo10.a = foo11.a = foo12.a = foo16.a = '$';
+
+ Fun1(foo1);
+ Fun2(foo2);
+ Fun3(foo3);
+ Fun4(foo4);
+ Fun5(foo5);
+ Fun6(foo6);
+ Fun7(foo7);
+ Fun8(foo8);
+ Fun9(foo9);
+ Fun10(foo10);
+ Fun11(foo11);
+ Fun12(foo12);
+ Fun16(foo16);
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/structs.exp b/gdb/testsuite/gdb.base/structs.exp
new file mode 100644
index 00000000000..ed91c86e482
--- /dev/null
+++ b/gdb/testsuite/gdb.base/structs.exp
@@ -0,0 +1,167 @@
+# Copyright 1996, 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Jeff Law. (law@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set prototypes 1
+set testfile "structs"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# build the first test case
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ # built the second test case since we can't use prototypes
+ warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DNO_PROTOTYPES}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+ set prototypes 0
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+
+# Some targets can't call functions, so don't even bother with this
+# test.
+if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ continue
+}
+
+
+# Call FUNC with no arguments, and expect to see the regexp RESULT in
+# the output. If we get back the error message "Function return value
+# unknown", call that an unsupported test; on some architectures, it's
+# impossible to find structs returned by value reliably.
+proc call_struct_func { func result } {
+ global gdb_prompt
+
+ set command "p ${func}()"
+ send_gdb "${command}\n"
+ gdb_expect {
+ -re "$result\[\r\n\]+$gdb_prompt $" {
+ pass "$command"
+ }
+ -re "Function return value unknown.\[\r\n\]+$gdb_prompt $" {
+ unsupported "$command"
+ }
+ -re "$gdb_prompt $" {
+ fail "$command"
+ }
+ timeout {
+ fail "$command (timeout)"
+ }
+ }
+}
+
+# FIXME: Before calling this proc, we should probably verify that
+# we can call inferior functions and get a valid integral value
+# returned.
+# Note that it is OK to check for 0 or 1 as the returned values, because C
+# specifies that the numeric value of a relational or logical expression
+# (computed in the inferior) is 1 for true and 0 for false.
+
+proc do_function_calls {} {
+ global prototypes
+ global gcc_compiled
+ global gdb_prompt
+
+ # First, call the "fun" functions and examine the value they return.
+ call_struct_func "fun1" " = {a = 49 '1'}"
+ call_struct_func "fun2" " = {a = 97 'a', b = 98 'b'}"
+ call_struct_func "fun3" " = {a = 65 'A', b = 66 'B', c = 67 'C'}"
+ call_struct_func "fun4" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4'}"
+ call_struct_func "fun5" " = {a = 97 'a', b = 98 'b', c = 99 'c', d = 100 'd', e = 101 'e'}"
+ call_struct_func "fun6" " = {a = 65 'A', b = 66 'B', c = 67 'C', d = 68 'D', e = 69 'E', f = 70 'F'}"
+ call_struct_func "fun7" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4', e = 53 '5', f = 54 '6', g = 55 '7'}"
+ call_struct_func "fun8" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4', e = 53 '5', f = 54 '6', g = 55 '7', h = 56 '8'}"
+ call_struct_func "fun9" " = {a = 97 'a', b = 98 'b', c = 99 'c', d = 100 'd', e = 101 'e', f = 102 'f', g = 103 'g', h = 104 'h', i = 105 'i'}"
+ call_struct_func "fun10" " = {a = 65 'A', b = 66 'B', c = 67 'C', d = 68 'D', e = 69 'E', f = 70 'F', g = 71 'G', h = 72 'H', i = 73 'I', j = 74 'J'}"
+ call_struct_func "fun11" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4', e = 53 '5', f = 54 '6', g = 55 '7', h = 56 '8', i = 57 '9', j = 65 'A', k = 66 'B'}"
+ call_struct_func "fun12" " = {a = 65 'A', b = 66 'B', c = 67 'C', d = 68 'D', e = 69 'E', f = 70 'F', g = 71 'G', h = 72 'H', i = 73 'I', j = 74 'J', k = 75 'K', l = 76 'L'}"
+ call_struct_func "fun16" " = {a = 97 'a', b = 98 'b', c = 99 'c', d = 100 'd', e = 101 'e', f = 102 'f', g = 103 'g', h = 104 'h', i = 105 'i', j = 106 'j', k = 107 'k', l = 108 'l', m = 109 'm', n = 110 'n', o = 111 'o', p = 112 'p'}"
+
+ # Now call the Fun functions to set the L* variables. This
+ # tests that gdb properly passes structures to functions.
+ gdb_test "p Fun1(foo1)" " = (void|0)"
+ gdb_test "p Fun2(foo2)" " = (void|0)"
+ gdb_test "p Fun3(foo3)" " = (void|0)"
+ gdb_test "p Fun4(foo4)" " = (void|0)"
+ gdb_test "p Fun5(foo5)" " = (void|0)"
+ gdb_test "p Fun6(foo6)" " = (void|0)"
+ gdb_test "p Fun7(foo7)" " = (void|0)"
+ gdb_test "p Fun8(foo8)" " = (void|0)"
+ gdb_test "p Fun9(foo9)" " = (void|0)"
+ gdb_test "p Fun10(foo10)" " = (void|0)"
+ gdb_test "p Fun11(foo11)" " = (void|0)"
+ gdb_test "p Fun12(foo12)" " = (void|0)"
+ gdb_test "p Fun16(foo16)" " = (void|0)"
+
+ # Now print the L* variables and examine their values.
+ gdb_test "p L1" " = {a = 49 '1'}"
+ gdb_test "p L2" " = {a = 97 'a', b = 98 'b'}"
+ gdb_test "p L3" " = {a = 65 'A', b = 66 'B', c = 67 'C'}"
+ gdb_test "p L4" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4'}"
+ gdb_test "p L5" " = {a = 97 'a', b = 98 'b', c = 99 'c', d = 100 'd', e = 101 'e'}"
+ gdb_test "p L6" " = {a = 65 'A', b = 66 'B', c = 67 'C', d = 68 'D', e = 69 'E', f = 70 'F'}"
+ gdb_test "p L7" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4', e = 53 '5', f = 54 '6', g = 55 '7'}"
+ gdb_test "p L8" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4', e = 53 '5', f = 54 '6', g = 55 '7', h = 56 '8'}"
+ gdb_test "p L9" " = {a = 97 'a', b = 98 'b', c = 99 'c', d = 100 'd', e = 101 'e', f = 102 'f', g = 103 'g', h = 104 'h', i = 105 'i'}"
+ gdb_test "p L10" " = {a = 65 'A', b = 66 'B', c = 67 'C', d = 68 'D', e = 69 'E', f = 70 'F', g = 71 'G', h = 72 'H', i = 73 'I', j = 74 'J'}"
+ gdb_test "p L11" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4', e = 53 '5', f = 54 '6', g = 55 '7', h = 56 '8', i = 57 '9', j = 65 'A', k = 66 'B'}"
+ gdb_test "p L12" " = {a = 65 'A', b = 66 'B', c = 67 'C', d = 68 'D', e = 69 'E', f = 70 'F', g = 71 'G', h = 72 'H', i = 73 'I', j = 74 'J', k = 75 'K', l = 76 'L'}"
+ gdb_test "p L16" " = {a = 97 'a', b = 98 'b', c = 99 'c', d = 100 'd', e = 101 'e', f = 102 'f', g = 103 'g', h = 104 'h', i = 105 'i', j = 106 'j', k = 107 'k', l = 108 'l', m = 109 'm', n = 110 'n', o = 111 'o', p = 112 'p'}"
+}
+# Start with a fresh gdb.
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "set print sevenbit-strings" ""
+gdb_test "set print address off" ""
+gdb_test "set width 0" ""
+
+if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ return 0
+}
+
+if { ![runto_main] } then {
+ gdb_suppress_tests;
+}
+
+do_function_calls;
+
+gdb_stop_suppressing_tests;
+
+return 0
diff --git a/gdb/testsuite/gdb.base/structs2.c b/gdb/testsuite/gdb.base/structs2.c
new file mode 100644
index 00000000000..f1eeab1adc2
--- /dev/null
+++ b/gdb/testsuite/gdb.base/structs2.c
@@ -0,0 +1,38 @@
+/* pr 13536 */
+
+static void param_reg (register signed char pr_char,
+ register unsigned char pr_uchar,
+ register short pr_short,
+ register unsigned short pr_ushort);
+
+int bkpt;
+
+int
+main ()
+{
+#ifdef usestubs
+ set_debug_traps ();
+ breakpoint ();
+#endif
+
+ bkpt = 0;
+ param_reg (120, 130, 32000, 33000);
+ param_reg (130, 120, 33000, 32000);
+
+ return 0;
+}
+
+static void dummy () {}
+
+static void
+param_reg(register signed char pr_char,
+ register unsigned char pr_uchar,
+ register short pr_short,
+ register unsigned short pr_ushort)
+{
+ bkpt = 1;
+ dummy ();
+ pr_char = 1;
+ pr_uchar = pr_short = pr_ushort = 1;
+ dummy ();
+}
diff --git a/gdb/testsuite/gdb.base/structs2.exp b/gdb/testsuite/gdb.base/structs2.exp
new file mode 100644
index 00000000000..c3c4e671c5e
--- /dev/null
+++ b/gdb/testsuite/gdb.base/structs2.exp
@@ -0,0 +1,79 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set prototypes 1
+set testfile "structs2"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# build the first test case
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ # built the second test case since we can't use prototypes
+ warning "Prototypes not supported, rebuilding with -DNO_PROTOTYPES"
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DNO_PROTOTYPES}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+ set prototypes 0
+}
+
+# Start with a fresh gdb.
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "set width 0" ""
+
+if { ![runto_main] } then {
+ gdb_suppress_tests
+}
+
+# Ok, we're finally ready to actually do our tests.
+
+set prms_id 13536
+set bug_id 0
+
+gdb_test "f" \
+ ".*bkpt = 0.*" \
+ "structs2 sanity check"
+
+gdb_test "break param_reg" \
+ "Breakpoint .* at .*" \
+ "structs2 breakpoint set"
+
+gdb_test "continue" \
+ ".*pr_char=120.*pr_uchar=130.*pr_short=32000.*pr_ushort=33000.*bkpt = 1.*" \
+ "structs2 continue1"
+
+gdb_test "continue" \
+ ".*pr_char=-126.*pr_uchar=120.*pr_short=-32536.*pr_ushort=32000.*bkpt = 1.*" \
+ "structs2 continue2"
+
+# End of tests.
+
+gdb_stop_suppressing_tests
+
+return 0
diff --git a/gdb/testsuite/gdb.base/sum.c b/gdb/testsuite/gdb.base/sum.c
new file mode 100644
index 00000000000..f5a5dbf2631
--- /dev/null
+++ b/gdb/testsuite/gdb.base/sum.c
@@ -0,0 +1,15 @@
+/* This is a sample program for the HP/DDE debugger. */
+#include <stdio.h>
+
+#ifdef PROTOTYPES
+int sum(int *list, int low, int high)
+#else
+int sum(list, low, high)
+int *list, low, high;
+#endif
+ {
+ int i = 0, s = 0;
+ for (i = low; i <= high; i++)
+ s += list[i];
+ return(s);
+ }
diff --git a/gdb/testsuite/gdb.base/term.exp b/gdb/testsuite/gdb.base/term.exp
new file mode 100644
index 00000000000..1a645311297
--- /dev/null
+++ b/gdb/testsuite/gdb.base/term.exp
@@ -0,0 +1,76 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# Don't try this for remote targets.
+if [is_remote target] then {
+ continue
+}
+
+gdb_start
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "run"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+delete_breakpoints
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "set print sevenbit-strings" "" "test set print sevenbit-strings"
+gdb_test "set print address off" "" "test set print address off"
+gdb_test "set width 0" "" "test set width 0"
+gdb_test "info terminal" "No saved terminal information.*" "test info terminal"
+gdb_run_cmd 5
+gdb_expect {
+ -re ".*120.*Program exited normally.*$gdb_prompt $" {
+ gdb_test "info terminal" "No saved terminal information.*" "test info terminal #2"
+ }
+ default {
+ fail "term.exp, factorial didn't run to completion for info terminal"
+ }
+}
+
+# In mid-execution
+gdb_breakpoint main
+gdb_run_cmd 5
+gdb_expect {
+ -re ".*Breakpoint \[0-9\]+,.*main.*if .argc != 2.*$gdb_prompt $" {
+ gdb_test "info terminal" "Inferior's terminal status .currently saved by GDB.:.*" "info terminal at breakpoint"
+ }
+ -re ".*$gdb_prompt $" { fail "info terminal at breakpoint" }
+ timeout { fail "(timeout) info terminal at breakpoint" }
+}
diff --git a/gdb/testsuite/gdb.base/twice.c b/gdb/testsuite/gdb.base/twice.c
new file mode 100644
index 00000000000..09eb2ddf5a2
--- /dev/null
+++ b/gdb/testsuite/gdb.base/twice.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+int nothing ()
+
+{
+ int x = 3 ;
+ return x ;
+}
+
+
+int main ()
+
+{
+ int y ;
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ y = nothing () ;
+ printf ("hello\n") ;
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/twice.exp b/gdb/testsuite/gdb.base/twice.exp
new file mode 100644
index 00000000000..7a86701cb67
--- /dev/null
+++ b/gdb/testsuite/gdb.base/twice.exp
@@ -0,0 +1,64 @@
+# Copyright 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile twice-tmp
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+set options debug
+lappend options "additional_flags=-I."
+
+set fileid [open ${objdir}/${subdir}/${srcfile} w];
+puts $fileid "#include \"twice.c\"";
+close $fileid;
+
+remote_download host ${srcdir}/${subdir}/twice.c twice.c
+
+if { [gdb_compile "${objdir}/${subdir}/${srcfile}" "${binfile}" executable $options] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+if [runto_main] then {
+ # Test that GDB can still detect whether we have line numbers
+ # even if we're executing code in an include file.
+
+ # The bug was fixed by
+ #Tue Jun 29 11:02:58 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+ #
+ # * infrun.c (wait_for_inferior): Use find_pc_line not
+ # find_pc_symtab to check whether there is line number
+ # information.
+
+ gdb_test "step" "nothing \\(\\) at.*"
+}
+remote_exec build "rm -f twice.c"
+return 0
diff --git a/gdb/testsuite/gdb.base/varargs.c b/gdb/testsuite/gdb.base/varargs.c
new file mode 100644
index 00000000000..1122767977c
--- /dev/null
+++ b/gdb/testsuite/gdb.base/varargs.c
@@ -0,0 +1,111 @@
+/* varargs.c -
+ * (Added as part of fix for bug 15306 - "call" to varargs functions fails)
+ * This program is intended to let me try out "call" to varargs functions
+ * with varying numbers of declared args and various argument types.
+ * - RT 9/27/95
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+
+int find_max1(int, ...);
+int find_max2(int, int, ...);
+double find_max_double(int, double, ...);
+
+char ch;
+unsigned char uc;
+short s;
+unsigned short us;
+int a,b,c,d;
+int max_val;
+long long ll;
+float fa,fb,fc,fd;
+double da,db,dc,dd;
+double dmax_val;
+
+int main() {
+ c = -1;
+ uc = 1;
+ s = -2;
+ us = 2;
+ a = 1;
+ b = 60;
+ max_val = find_max1(1, 60);
+ max_val = find_max1(a, b);
+ a = 3;
+ b = 1;
+ c = 4;
+ d = 2;
+ max_val = find_max1(3, 1, 4, 2);
+ max_val = find_max2(a, b, c, d);
+ da = 3.0;
+ db = 1.0;
+ dc = 4.0;
+ dd = 2.0;
+ dmax_val = find_max_double(3, 1.0, 4.0, 2.0);
+ dmax_val = find_max_double(a, db, dc, dd);
+
+ return 0;
+}
+
+/* Integer varargs, 1 declared arg */
+
+int find_max1(int num_vals, ...) {
+ int max_val = 0;
+ int x;
+ int i;
+ va_list argp;
+ va_start(argp, num_vals);
+ printf("find_max(%d,", num_vals);
+ for (i = 0; i < num_vals; i++) {
+ x = va_arg(argp, int);
+ if (max_val < x) max_val = x;
+ if (i < num_vals - 1)
+ printf(" %d,", x);
+ else
+ printf(" %d)", x);
+ }
+ printf(" returns %d\n", max_val);
+ return max_val;
+}
+
+/* Integer varargs, 2 declared args */
+
+int find_max2(int num_vals, int first_val, ...) {
+ int max_val = 0;
+ int x;
+ int i;
+ va_list argp;
+ va_start(argp, first_val);
+ x = first_val;
+ if (max_val < x) max_val = x;
+ printf("find_max(%d, %d", num_vals, first_val);
+ for (i = 1; i < num_vals; i++) {
+ x = va_arg(argp, int);
+ if (max_val < x) max_val = x;
+ printf(", %d", x);
+ }
+ printf(") returns %d\n", max_val);
+ return max_val;
+}
+
+/* Double-float varargs, 2 declared args */
+
+double find_max_double(int num_vals, double first_val, ...) {
+ double max_val = 0;
+ double x;
+ int i;
+ va_list argp;
+ va_start(argp, first_val);
+ x = first_val;
+ if (max_val < x) max_val = x;
+ printf("find_max(%d, %f", num_vals, first_val);
+ for (i = 1; i < num_vals; i++) {
+ x = va_arg(argp, double);
+ if (max_val < x) max_val = x;
+ printf(", %f", x);
+ }
+ printf(") returns %f\n", max_val);
+ return max_val;
+}
+
diff --git a/gdb/testsuite/gdb.base/varargs.exp b/gdb/testsuite/gdb.base/varargs.exp
new file mode 100644
index 00000000000..22fa84a3c53
--- /dev/null
+++ b/gdb/testsuite/gdb.base/varargs.exp
@@ -0,0 +1,148 @@
+# Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+
+# this file tests command line calls with functions having variable
+# args list
+# corresponding source file: varargs.c
+
+#print find_max1(5,1,2,3,4,5)
+#print find_max1(1,3)
+#call find_max1(10,1,2,3,4,5,6,7,8,29,0)
+#print find_max2(3,1,2,3)
+#print find_max_double(5,1.0,17.0,2.0,3.0,4.0)
+#quit
+
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set prototypes 0
+set testfile "varargs"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+if {$hp_cc_compiler} {
+ set additional_flags "additional_flags=-Ae"
+} else {
+ set additional_flags ""
+}
+
+# build the first test case
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug ${additional_flags}}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "set print address off\n" ; gdb_expect -re "$gdb_prompt $"
+send_gdb "set width 0\n" ; gdb_expect -re "$gdb_prompt $"
+
+if [gdb_skip_stdio_test "varargs.exp"] {
+ # Nothing in this module is testable without printf.
+ return;
+}
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+if { $hp_aCC_compiler } {
+ # When compiled w/ aCC we need to disable overload resolution
+ # for command line calls.
+ # We need it for vararg calls since the aCC compiler gives us no
+ # information about the undeclared arguments, or even that there
+ # _are_ undeclared arguments. As far as gdb is concerned it only
+ # knows about the declared arguments. So we need to force the call
+ # even though the overload resolution mechanism says that the types
+ # don't match.
+ # - guo
+ gdb_test "set overload-resolution 0" ""
+}
+
+send_gdb "print find_max1(5,1,2,3,4,5)\n"
+gdb_expect {
+ -re ".*find_max\\(5, 1, 2, 3, 4, 5\\) returns 5\[ \r\n\]+.\[0-9\]+ = 5.*$gdb_prompt $" {
+ pass "print find_max1(5,1,2,3,4,5)"
+ }
+ -re ".*$gdb_prompt $" { fail "print find_max1(5,1,2,3,4,5)" }
+ timeout { fail "(timeout) print find_max1(5,1,2,3,4,5)" }
+ }
+
+
+
+
+send_gdb "print find_max1(1,3)\n"
+gdb_expect {
+ -re ".*find_max\\(1, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3.*$gdb_prompt $" {
+ pass "print find_max1(1,3)"
+ }
+ -re ".*$gdb_prompt $" { fail "print find_max1(1,3)" }
+ timeout { fail "(timeout) print find_max1(1,3)" }
+ }
+
+
+send_gdb "print find_max1(10,1,2,3,4,5,6,7,8,29,0)\n"
+gdb_expect {
+ -re ".*find_max\\(10, 1, 2, 3, 4, 5, 6, 7, 8, 29, 0\\) returns 29\[ \r\n\]+.\[0-9\]+ = 29.*$gdb_prompt $" {
+ pass "print find_max1(10,1,2,3,4,5,6,7,8,29,0)"
+ }
+ -re ".*$gdb_prompt $" { fail "print find_max1(10,1,2,3,4,5,6,7,8,29,0)" }
+ timeout { fail "(timeout) print find_max1(10,1,2,3,4,5,6,7,8,29,0)" }
+ }
+
+
+
+send_gdb "print find_max2(3,1,2,3)\n"
+gdb_expect {
+ -re ".*find_max\\(3, 1, 2, 3\\) returns 3\[ \r\n\]+.\[0-9\]+ = 3.*$gdb_prompt $" {
+ pass "print find_max2(3,1,2,3)"
+ }
+ -re ".*$gdb_prompt $" { fail "print find_max2(3,1,2,3)" }
+ timeout { fail "(timeout) print find_max2(3,1,2,3)" }
+ }
+
+
+if {![target_info exists gdb,skip_float_tests]} {
+ send_gdb "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)\n"
+ gdb_expect {
+ -re ".*find_max\\(.*\\) returns 17\\.000000\[ \r\n\]+.\[0-9\]+ = 17.*$gdb_prompt $" {
+ pass "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)"
+ }
+ -re ".*$gdb_prompt $" { fail "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" }
+ timeout { fail "(timeout) print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" }
+ }
+}
+
diff --git a/gdb/testsuite/gdb.base/vforked-prog.c b/gdb/testsuite/gdb.base/vforked-prog.c
new file mode 100644
index 00000000000..27504db528a
--- /dev/null
+++ b/gdb/testsuite/gdb.base/vforked-prog.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+#ifdef PROTOTYPES
+int main (void)
+#else
+main()
+#endif
+{
+ printf("Hello from vforked-prog...\n");
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/volatile.exp b/gdb/testsuite/gdb.base/volatile.exp
new file mode 100644
index 00000000000..efb271b6ec0
--- /dev/null
+++ b/gdb/testsuite/gdb.base/volatile.exp
@@ -0,0 +1,268 @@
+# Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Written by Satish Pai <pai@apollo.hp.com> 1997-07-07
+# In the spirit of constvars.exp: added volatile, const-volatile stuff.
+
+# This file is part of the gdb testsuite
+# Tests for:
+# volatile vars
+# pointers to volatile vars
+# const volatile vars
+# pointers to const volatile vars
+# const pointers to volatile vars
+# volatile pointers to const vars
+# const volatile pointers to const vars
+# const volatile pointers to volatile vars
+# ... etc. (you get the idea)
+# Mostly with char and unsigned char.
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+# Use the same test program constvars.c.
+
+set testfile "constvars"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+if {$hp_aCC_compiler || $hp_cc_compiler} {
+ set lang "c++"
+} else {
+ set lang ""
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [concat debug $lang]] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+remote_exec build "rm -f ${binfile}.ci"
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+source ${binfile}.ci
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+get_debug_format
+
+proc local_compiler_xfail_check { } {
+ global gcc_compiled;
+
+ if {$gcc_compiled} then {
+ if { ![test_debug_format "HP"] \
+ && ![test_debug_format "DWARF 2"] } then {
+ setup_xfail "*-*-*"
+ }
+ }
+}
+
+send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
+
+ send_gdb "cont\n"
+ gdb_expect {
+ -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
+ send_gdb "up\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "up from marker1" }
+ }
+ }
+ -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
+ fail "continue to marker1 (demangling)"
+ send_gdb "up\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "up from marker1" }
+ }
+ }
+ -re "$gdb_prompt $" { fail "continue to marker1" }
+ timeout { fail "(timeout) continue to marker1" }
+ }
+
+# As of Feb 1999, GCC does not issue info about volatility of vars, so
+# these tests are all expected to fail if GCC is the compiler. -sts
+
+local_compiler_xfail_check
+gdb_test "ptype vox" "type = volatile char.*"
+
+local_compiler_xfail_check
+gdb_test "ptype victuals" "type = volatile unsigned char.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vixen" "type = volatile short.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vitriol" "type = volatile (unsigned short|short unsigned)( int)?.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vellum" "type = volatile long.*"
+
+local_compiler_xfail_check
+gdb_test "ptype valve" "type = volatile (unsigned long|long unsigned)( int)?.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vacuity" "type = volatile float.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vertigo" "type = volatile double.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vampire" "type = volatile char \\*.*"
+
+local_compiler_xfail_check
+gdb_test "ptype viper" "type = volatile unsigned char \\*.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vigour" "type = volatile short( int)? \\*.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vapour" "type = volatile (unsigned short|short unsigned)( int)? \\*.*"
+
+local_compiler_xfail_check
+gdb_test "ptype ventricle" "type = volatile long( int)? \\*.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vigintillion" "type = volatile (unsigned long|long unsigned)( int)? \\*.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vocation" "type = volatile float \\*.*"
+
+local_compiler_xfail_check
+gdb_test "ptype veracity" "type = volatile double \\*.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vapidity" "type = volatile char \\* volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype velocity" "type = volatile unsigned char \\* volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype veneer" "type = volatile short( int)? \\* volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype video" "type = volatile (unsigned short|short unsigned)( int) \\* volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vacuum" "type = volatile long( int)? \\* volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype veniality" "type = volatile (unsigned long|long unsigned)( int)? \\* volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vitality" "type = volatile float \\* volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype voracity" "type = volatile double \\* volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype victor" "type = const volatile char.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vicar" "type = const volatile unsigned char.*"
+
+local_compiler_xfail_check
+gdb_test "ptype victory" "type = const volatile char \\*.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vicarage" "type = const volatile unsigned char \\*.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vein" "type = volatile char \\* const.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vogue" "type = volatile unsigned char \\* const.*"
+
+local_compiler_xfail_check
+gdb_test "ptype cavern" "type = const volatile char \\* const.*"
+
+local_compiler_xfail_check
+gdb_test "ptype coverlet" "type = const volatile unsigned char \\* const.*"
+
+local_compiler_xfail_check
+gdb_test "ptype caveat" "type = const char \\* volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype covenant" "type = const unsigned char \\* volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vizier" "type = const volatile char \\* volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vanadium" "type = const volatile unsigned char \\* volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vane" "type = char \\* const volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype veldt" "type = unsigned char \\* const volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype cove" "type = const char \\* const volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype cavity" "type = const unsigned char \\* const volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vagus" "type = volatile char \\* const volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vagrancy" "type = volatile unsigned char \\* const volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vagary" "type = const volatile char \\* const volatile.*"
+
+local_compiler_xfail_check
+gdb_test "ptype vendor" "type = const volatile unsigned char \\* const volatile.*"
+
+# test function parameters
+local_compiler_xfail_check
+send_gdb "ptype qux2\n"
+gdb_expect {
+ -re "type = int \\(volatile unsigned char, const volatile int, volatile short( int)?, volatile long( int)? \\*, float \\* volatile, const volatile signed char \\* const volatile\\).*$gdb_prompt $" {
+ pass "ptype qux2"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype qux2" }
+ timeout { fail "(timeout) ptype qux2" }
+ }
diff --git a/gdb/testsuite/gdb.base/watchpoint.c b/gdb/testsuite/gdb.base/watchpoint.c
new file mode 100644
index 00000000000..14ccecd5253
--- /dev/null
+++ b/gdb/testsuite/gdb.base/watchpoint.c
@@ -0,0 +1,174 @@
+#include <stdio.h>
+#include <unistd.h>
+/*
+ * Since using watchpoints can be very slow, we have to take some pains to
+ * ensure that we don't run too long with them enabled or we run the risk
+ * of having the test timeout. To help avoid this, we insert some marker
+ * functions in the execution stream so we can set breakpoints at known
+ * locations, without worrying about invalidating line numbers by changing
+ * this file. We use null bodied functions are markers since gdb does
+ * not support breakpoints at labeled text points at this time.
+ *
+ * One place we need is a marker for when we start executing our tests
+ * instructions rather than any process startup code, so we insert one
+ * right after entering main(). Another is right before we finish, before
+ * we start executing any process termination code.
+ *
+ * Another problem we have to guard against, at least for the test
+ * suite, is that we need to ensure that the line that causes the
+ * watchpoint to be hit is still the current line when gdb notices
+ * the hit. Depending upon the specific code generated by the compiler,
+ * the instruction after the one that triggers the hit may be part of
+ * the same line or part of the next line. Thus we ensure that there
+ * are always some instructions to execute on the same line after the
+ * code that should trigger the hit.
+ */
+
+int count = -1;
+int ival1 = -1;
+int ival2 = -1;
+int ival3 = -1;
+int ival4 = -1;
+int ival5 = -1;
+char buf[10];
+struct foo
+{
+ int val;
+};
+struct foo struct1, struct2, *ptr1, *ptr2;
+
+int doread = 0;
+
+void marker1 ()
+{
+}
+
+void marker2 ()
+{
+}
+
+void marker4 ()
+{
+}
+
+void marker5 ()
+{
+}
+
+void marker6 ()
+{
+}
+
+#ifdef PROTOTYPES
+void recurser (int x)
+#else
+void recurser (x) int x;
+#endif
+{
+ int local_x;
+
+ if (x > 0)
+ recurser (x-1);
+ local_x = x;
+}
+
+void
+func2 ()
+{
+ int local_a;
+ static int static_b;
+
+ ival5++;
+ local_a = ival5;
+ static_b = local_a;
+}
+
+int
+func1 ()
+{
+ /* The point of this is that we will set a breakpoint at this call.
+
+ Then, if DECR_PC_AFTER_BREAK equals the size of a function call
+ instruction (true on a sun3 if this is gcc-compiled--FIXME we
+ should use asm() to make it work for any compiler, present or
+ future), then we will end up branching to the location just after
+ the breakpoint. And we better not confuse that with hitting the
+ breakpoint. */
+ func2 ();
+ return 73;
+}
+
+int main ()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ struct1.val = 1;
+ struct2.val = 2;
+ ptr1 = &struct1;
+ ptr2 = &struct2;
+ marker1 ();
+ func1 ();
+ for (count = 0; count < 4; count++) {
+ ival1 = count;
+ ival3 = count; ival4 = count;
+ }
+ ival1 = count; /* Outside loop */
+ ival2 = count;
+ ival3 = count; ival4 = count;
+ marker2 ();
+ if (doread)
+ {
+ static char msg[] = "type stuff for buf now:";
+ write (1, msg, sizeof (msg) - 1);
+ read (0, &buf[0], 5);
+ }
+ marker4 ();
+
+ /* We have a watchpoint on ptr1->val. It should be triggered if
+ ptr1's value changes. */
+ ptr1 = ptr2;
+
+ /* This should not trigger the watchpoint. If it does, then we
+ used the wrong value chain to re-insert the watchpoints or we
+ are not evaluating the watchpoint expression correctly. */
+ struct1.val = 5;
+ marker5 ();
+
+ /* We have a watchpoint on ptr1->val. It should be triggered if
+ ptr1's value changes. */
+ ptr1 = ptr2;
+
+ /* This should not trigger the watchpoint. If it does, then we
+ used the wrong value chain to re-insert the watchpoints or we
+ are not evaluating the watchpoint expression correctly. */
+ struct1.val = 5;
+ marker5 ();
+
+ /* We're going to watch locals of func2, to see that out-of-scope
+ watchpoints are detected and properly deleted.
+ */
+ marker6 ();
+
+ /* This invocation is used for watches of a single
+ local variable. */
+ func2 ();
+
+ /* This invocation is used for watches of an expression
+ involving a local variable. */
+ func2 ();
+
+ /* This invocation is used for watches of a static
+ (non-stack-based) local variable. */
+ func2 ();
+
+ /* This invocation is used for watches of a local variable
+ when recursion happens.
+ */
+ marker6 ();
+ recurser (2);
+
+ marker6 ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/watchpoint.exp b/gdb/testsuite/gdb.base/watchpoint.exp
new file mode 100644
index 00000000000..e150d555e60
--- /dev/null
+++ b/gdb/testsuite/gdb.base/watchpoint.exp
@@ -0,0 +1,806 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "watchpoint"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+set wp_set 1
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Prepare for watchpoint tests by setting up two breakpoints and one
+# watchpoint.
+#
+# We use breakpoints at marker functions to get past all the startup code,
+# so we can get to the watchpoints in a reasonable amount of time from a
+# known starting point.
+#
+# For simplicity, so we always know how to reference specific breakpoints or
+# watchpoints by number, we expect a particular ordering and numbering of
+# each in the combined breakpoint/watchpoint table, as follows:
+#
+# Number What Where
+# 1 Breakpoint marker1()
+# 2 Breakpoint marker2()
+# 3 Watchpoint ival3
+
+proc initialize {} {
+ global gdb_prompt
+ global hex
+ global decimal
+ global srcfile
+ global wp_set
+
+ # Disable hardware watchpoints if necessary.
+ if [target_info exists gdb,no_hardware_watchpoints] {
+ gdb_test "set can-use-hw-watchpoints 0" "" ""
+ }
+
+ if [gdb_test "break marker1" "Breakpoint 1 at $hex: file .*$srcfile, line $decimal.*" "set breakpoint at marker1" ] {
+ return 0;
+ }
+
+
+ if [gdb_test "break marker2" "Breakpoint 2 at $hex: file .*$srcfile, line $decimal.*" "set breakpoint at marker2" ] {
+ return 0;
+ }
+
+
+ if [gdb_test "info break" "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*" "info break in watchpoint.exp" ] {
+ return 0;
+ }
+
+
+ # ??rehrauer: To fix DTS #CHFts23014, in which setting a watchpoint
+ # before running can cause the inferior to croak on HP-UX 11.0 for
+ # reasons yet unknown, we've disabled the ability to set watches
+ # without a running inferior. Verify the restriction.
+ #
+ send_gdb "watch ival3\n"
+ gdb_expect {
+ -re ".*\[Ww\]atchpoint 3: ival3.*$gdb_prompt $" {
+ pass "set watchpoint on ival3"
+ }
+ -re "warning: can't do that without a running program; try \"break main\", \"run\" first.*$gdb_prompt $" {
+ pass "set watchpoint on ival3"
+ set wp_set 0
+ return 1
+ }
+ timeout {
+ fail "(timeout) set watchpoint on ival3"
+ return 0
+ }
+ }
+
+ # "info watch" is the same as "info break"
+
+ if [gdb_test "info watch" "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*\r\n3\[ \]*.*watchpoint.*ival3" "watchpoint found in watchpoint/breakpoint table" ] {
+ return 0;
+ }
+
+
+ # After installing the watchpoint, we disable it until we are ready
+ # to use it. This allows the test program to run at full speed until
+ # we get to the first marker function.
+
+ if [gdb_test "disable 3" "disable 3\[\r\n\]+" "disable watchpoint" ] {
+ return 0;
+ }
+
+
+ return 1
+}
+
+#
+# Test simple watchpoint.
+#
+
+proc test_simple_watchpoint {} {
+ global gdb_prompt
+ global hex
+ global decimal
+ global wp_set
+
+ # Ensure that the watchpoint is disabled when we startup.
+
+ if { $wp_set } {
+ if [gdb_test "disable 3" "^disable 3\[\r\n\]+" "disable watchpoint in test_simple_watchpoint" ] {
+ return 0;
+ }
+ }
+
+
+ # Run until we get to the first marker function.
+
+ gdb_run_cmd
+ set timeout 600
+ gdb_expect {
+ -re "Breakpoint 1, marker1 .*$gdb_prompt $" {
+ pass "run to marker1 in test_simple_watchpoint"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "run to marker1 in test_simple_watchpoint"
+ return
+ }
+ timeout {
+ fail "run to marker1 in test_simple_watchpoint (timeout)"
+ return
+ }
+ }
+
+ if { !$wp_set } {
+ # ??rehrauer: To fix DTS #CHFts23014, in which setting a watchpoint
+ # before running can cause the inferior to croak on HP-UX 11.0
+ # for reasons yet unknown, we've disabled the ability to set
+ # watches without a running inferior. The following testpoints used
+ # to be in [initialize].
+ #
+ send_gdb "watch ival3\n"
+ gdb_expect {
+ -re ".*\[Ww\]atchpoint 3: ival3\r\n$gdb_prompt $" {
+ pass "set watchpoint on ival3"
+ }
+ -re ".*$gdb_prompt $" { fail "set watchpoint on ival3" }
+ timeout { fail "set watchpoint on ival3 (timeout)" }
+ }
+
+ set wp_set 1
+
+ # "info watch" is the same as "info break"
+
+ send_gdb "info watch\n"
+ gdb_expect {
+ -re "1\[ \]*breakpoint.*marker1.*\r\n2\[ \]*breakpoint.*marker2.*\r\n3\[ \]*.*watchpoint.*ival3\r\n$gdb_prompt $" {
+ pass "watchpoint found in watchpoint/breakpoint table"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "watchpoint found in watchpoint/breakpoint table"
+ }
+ timeout {
+ fail "watchpoint found in watchpoint/breakpoint table"
+ }
+ }
+
+ # After installing the watchpoint, we disable it until we are ready
+ # to use it. This allows the test program to run at full speed until
+ # we get to the first marker function.
+
+ send_gdb "disable 3\n"
+ gdb_expect {
+ -re "disable 3\[\r\n\]+$gdb_prompt $" { pass "disable watchpoint" }
+ -re ".*$gdb_prompt $" { fail "disable watchpoint" }
+ timeout { fail "disable watchpoint (timeout)" }
+ }
+ }
+
+ # After reaching the marker function, enable the watchpoint.
+
+ if [gdb_test "enable 3" "^enable 3\[\r\n\]+" "enable watchpoint" ] {
+ return ;
+ }
+
+
+ gdb_test "break func1" "Breakpoint.*at.*"
+ gdb_test "set \$func1_breakpoint_number = \$bpnum" ""
+
+ gdb_test "continue" "Continuing.*Breakpoint \[0-9\]*, func1.*" \
+ "continue to breakpoint at func1"
+
+ # Continue until the first change, from -1 to 0
+
+ send_gdb "cont\n"
+ gdb_expect {
+ -re "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count; ival4 = count;.*$gdb_prompt $" {
+ pass "watchpoint hit, first time"
+ }
+ -re "Continuing.*Breakpoint.*func1.*$gdb_prompt $" {
+ setup_xfail "m68*-*-*" 2597
+ fail "thought it hit breakpoint at func1 twice"
+ gdb_test "delete \$func1_breakpoint_number" ""
+ gdb_test "continue" "\
+Continuing.*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count;" \
+ "watchpoint hit, first time"
+ }
+ -re ".*$gdb_prompt $" { fail "watchpoint hit, first time" ; return }
+ timeout { fail "watchpoint hit, first time (timeout)" ; return }
+ eof { fail "watchpoint hit, first time (eof)" ; return }
+ }
+
+ # Check that the hit count is reported correctly
+ gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 1 time.*" "Watchpoint hit count is 1"
+
+ gdb_test "delete \$func1_breakpoint_number" ""
+
+ # Continue until the next change, from 0 to 1.
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = 1.*ival3 = count; ival4 = count;.*" "watchpoint hit, second time"
+
+ # Check that the hit count is reported correctly
+ gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 2 times.*" "Watchpoint hit count is 2"
+
+ # Continue until the next change, from 1 to 2.
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 1.*New value = 2.*ival3 = count; ival4 = count;.*" "watchpoint hit, third time"
+
+ # Check that the hit count is reported correctly
+ gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 3 times.*" "Watchpoint hit count is 3"
+
+ # Continue until the next change, from 2 to 3.
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 2.*New value = 3.*ival3 = count; ival4 = count;.*" "watchpoint hit, fourth time"
+
+ # Check that the hit count is reported correctly
+ gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 4 times.*" "Watchpoint hit count is 4"
+
+ # Continue until the next change, from 3 to 4.
+ # Note that this one is outside the loop.
+
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 3.*New value = 4.*ival3 = count; ival4 = count;.*" "watchpoint hit, fifth time"
+
+ # Check that the hit count is reported correctly
+ gdb_test "info break" ".*watchpoint\[ \t\]+keep\[ \t\]+y\[ \t\]+ival3\r\n\[ \t]+breakpoint already hit 5 times.*" "Watchpoint hit count is 5"
+
+ # Continue until we hit the finishing marker function.
+ # Make sure we hit no more watchpoints.
+
+ gdb_test "cont" "Continuing.*Breakpoint.*marker2 \(\).*" \
+ "continue to marker2"
+
+ # Disable the watchpoint so we run at full speed until we exit.
+
+ if [gdb_test "disable 3" "^disable 3\[\r\n\]+" "watchpoint disabled" ] {
+ return ;
+ }
+
+
+ # Run until process exits.
+
+ if [target_info exists gdb,noresults] { return }
+
+ gdb_continue_to_end "continue to exit in test_simple_watchpoint"
+}
+
+# Test disabling watchpoints.
+
+proc test_disabling_watchpoints {} {
+ global gdb_prompt
+ global binfile
+ global srcfile
+ global decimal
+ global hex
+
+ # "info watch" is the same as "info break"
+ gdb_test "info watch" "\[0-9\]+\[ \]*breakpoint.*marker1.*\r\n\[0-9\]+\[ \]*breakpoint.*marker2.*\r\n\[0-9]+\[ \]*.*watchpoint.*ival3\r\n\.*\[0-9\]+ times.*" "watchpoints found in watchpoint/breakpoint table"
+
+ # Ensure that the watchpoint is disabled when we startup.
+
+ if [gdb_test "disable 3" "^disable 3\[\r\n\]+" "disable watchpoint in test_disabling_watchpoints" ] {
+ return 0;
+ }
+
+
+ # Run until we get to the first marker function.
+
+ gdb_run_cmd
+ set timeout 600
+ gdb_expect {
+ -re "Breakpoint 1, marker1 .*$gdb_prompt $" {
+ pass "run to marker1 in test_disabling_watchpoints"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "run to marker1 in test_disabling_watchpoints"
+ return
+ }
+ timeout {
+ fail "run to marker1 in test_disabling_watchpoints (timeout)"
+ return
+ }
+ }
+
+ # After reaching the marker function, enable the watchpoint.
+
+ if [gdb_test "enable 3" "^enable 3\[\r\n\]+" "watchpoint enabled" ] {
+ return ;
+ }
+
+
+ # Continue until the first change, from -1 to 0
+ # Don't check the old value, because on VxWorks the variable value
+ # will not have been reinitialized.
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = .*New value = 0.*ival3 = count; ival4 = count;.*" "watchpoint hit in test_disabling_watchpoints, first time"
+
+ # Continue until the next change, from 0 to 1.
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = 1.*ival3 = count; ival4 = count;.*" "watchpoint hit in test_disabling_watchpoints, second time"
+
+ # Disable the watchpoint but leave breakpoints
+
+ if [gdb_test "disable 3" "^disable 3\[\r\n\]+" "disable watchpoint #2 in test_disabling_watchpoints" ] {
+ return 0;
+ }
+
+
+ # Check watchpoint list, looking for the entry that confirms the
+ # watchpoint is disabled.
+ gdb_test "info watchpoints" "\[0-9]+\[ \]*.*watchpoint\[ \]*keep\[ \]*n\[ \]*ival3\r\n.*" "watchpoint disabled in table"
+
+ # Continue until we hit the finishing marker function.
+ # Make sure we hit no more watchpoints.
+ gdb_test "cont" "Continuing.*Breakpoint.*marker2 \\(\\).*" \
+ "disabled watchpoint skipped"
+
+ if [target_info exists gdb,noresults] { return }
+
+ gdb_continue_to_end "continue to exit in test_disabling_watchpoints"
+}
+
+# Test stepping and other mundane operations with watchpoints enabled
+proc test_stepping {} {
+ global gdb_prompt
+
+ if [runto marker1] then {
+ gdb_test "watch ival2" ".*\[Ww\]atchpoint \[0-9\]*: ival2"
+
+ # Well, let's not be too mundane. It should be a *bit* of a challenge
+ gdb_test "break func2 if 0" "Breakpoint.*at.*"
+ gdb_test "p \$func2_breakpoint_number = \$bpnum" " = .*"
+
+ # The problem is that GDB confuses stepping through the call
+ # dummy with hitting the breakpoint at the end of the call dummy.
+ # Will be fixed once all architectures define
+ # CALL_DUMMY_BREAKPOINT_OFFSET.
+ setup_xfail "*-*-*"
+ # This doesn't occur if the call dummy starts with a call,
+ # because we are out of the dummy by the first time the inferior
+ # stops.
+ clear_xfail "arm*-*-*"
+ clear_xfail "xscale*-*-*"
+ clear_xfail "d10v*-*-*"
+ clear_xfail "m68*-*-*"
+ clear_xfail "i*86*-*-*"
+ clear_xfail "vax-*-*"
+ # The following architectures define CALL_DUMMY_BREAKPOINT_OFFSET.
+ clear_xfail "alpha-*-*"
+ clear_xfail "mips*-*-*"
+ clear_xfail "sparc-*-*"
+ clear_xfail "hppa*-*-*bsd*"
+ # It works with the generic inferior function calling code too.
+ clear_xfail "mn10200*-*-*"
+ clear_xfail "mn10300*-*-*"
+ # The following architectures define CALL_DUMMY_HAS_COMPLETED.
+ clear_xfail "hppa*-*-*hpux*"
+ gdb_test "p func1 ()" "= 73" \
+ "calling function with watchpoint enabled"
+
+ #
+ # "finish" brings us back to main.
+ # On some targets (e.g. alpha) gdb will stop from the finish in midline
+ # of the marker1 call. This is due to register restoring code on
+ # the alpha and might be caused by stack adjustment instructions
+ # on other targets. In this case we will step once more.
+ #
+
+ send_gdb "finish\n"
+ gdb_expect {
+ -re "Run.*exit from.*marker1.* at" {
+ pass "finish from marker1"
+ }
+ default { fail "finish from marker1 (timeout)" ; return }
+ }
+
+ gdb_expect {
+ -re "marker1 \\(\\);.*$gdb_prompt $" {
+ send_gdb "step\n"
+ exp_continue
+ }
+ -re "func1 \\(\\);.*$gdb_prompt $" {
+ pass "back at main from marker1"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "back at main from marker1"
+ }
+ default { fail "back at main from marker1 (timeout)" ; return }
+ }
+
+ gdb_test "next" "for \\(count = 0.*" "next to `for' in watchpoint.exp"
+
+ # Now test that "until" works. It's a bit tricky to test
+ # "until", because compilers don't always arrange the code
+ # exactly the same way, and we might get slightly different
+ # sequences of statements. But the following should be true
+ # (if not it is a compiler or a debugger bug): The user who
+ # does "until" at every statement of a loop should end up
+ # stepping through the loop once, and the debugger should not
+ # stop for any of the remaining iterations.
+
+ gdb_test "until" "ival1 = count.*" "until to ival1 assignment"
+ gdb_test "until" "ival3 = count.*" "until to ival3 assignment"
+ send_gdb "until\n"
+ gdb_expect {
+ -re "(for \\(count = 0|\}).*$gdb_prompt $" {
+ gdb_test "until" "ival1 = count; /. Outside loop ./" \
+ "until out of loop"
+ }
+ -re "ival1 = count; /. Outside loop ./.*$gdb_prompt $" {
+ pass "until out of loop"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "until out of loop"
+ }
+ default { fail "until out of loop (timeout)" ; return }
+ }
+
+ gdb_test "step" "ival2 = count.*" "step to ival2 assignment"
+ }
+}
+
+# Test stepping and other mundane operations with watchpoints enabled
+proc test_watchpoint_triggered_in_syscall {} {
+ global gdb_prompt
+
+ # These tests won't work without printf support.
+ if [gdb_skip_stdio_test "watchpoints triggered in syscall"] {
+ return;
+ }
+ # Run until we get to the first marker function.
+ set x 0
+ set y 0
+ set testname "Watch buffer passed to read syscall"
+ if [runto marker2] then {
+ gdb_test "watch buf\[0\]" ".*\[Ww\]atchpoint \[0-9\]*: buf\\\[0\\\]"
+ gdb_test "watch buf\[1\]" ".*\[Ww\]atchpoint \[0-9\]*: buf\\\[1\\\]"
+ gdb_test "watch buf\[2\]" ".*\[Ww\]atchpoint \[0-9\]*: buf\\\[2\\\]"
+ gdb_test "watch buf\[3\]" ".*\[Ww\]atchpoint \[0-9\]*: buf\\\[3\\\]"
+ gdb_test "watch buf\[4\]" ".*\[Ww\]atchpoint \[0-9\]*: buf\\\[4\\\]"
+ gdb_test "break marker4" ".*Breakpoint.*"
+
+ gdb_test "set doread = 1" ""
+
+ # If we send_gdb "123\n" before gdb has switched the tty, then it goes
+ # to gdb, not the inferior, and we lose. So that is why we have
+ # watchpoint.c prompt us, so we can wait for that prompt.
+ send_gdb "continue\n";
+ gdb_expect {
+ -re "Continuing\\.\r\ntype stuff for buf now:" {
+ pass "continue to read"
+ }
+ default {
+ fail "continue to read";
+ return ;
+ }
+ }
+
+ send_gdb "123\n"
+ gdb_expect {
+ -re ".*\[Ww\]atchpoint.*buf\\\[0\\\].*Old value = 0.*New value = 49\[^\n\]*\n" { set x [expr $x+1] ; exp_continue }
+ -re ".*\[Ww\]atchpoint.*buf\\\[1\\\].*Old value = 0.*New value = 50\[^\n\]*\n" { set x [expr $x+1] ; exp_continue }
+ -re ".*\[Ww\]atchpoint.*buf\\\[2\\\].*Old value = 0.*New value = 51\[^\n\]*\n" { set x [expr $x+1] ; exp_continue }
+ -re ".*\[Ww\]atchpoint.*buf\\\[3\\\].*Old value = 0.*New value = 10\[^\n\]*\n" { set x [expr $x+1] ; exp_continue }
+ -re ".*$gdb_prompt $" { pass "sent 123" }
+ timeout { fail "sent 123 (timeout)" }
+ }
+
+ # Examine the values in buf to see how many watchpoints we
+ # should have printed.
+ send_gdb "print buf\[0\]\n"
+ gdb_expect {
+ -re ".*= 49.*$gdb_prompt $" { set y [expr $y+1]; pass "print buf\[0\]"}
+ -re ".*= 0.*$gdb_prompt $" { pass "print buf\[0\]"}
+ -re ".*$gdb_prompt $" { fail "print buf\[0\]"}
+ default { fail "print buf\[0\]"}
+ }
+ send_gdb "print buf\[1\]\n"
+ gdb_expect {
+ -re ".*= 50.*$gdb_prompt $" { set y [expr $y+1]; pass "print buf\[1\]"}
+ -re ".*= 0.*$gdb_prompt $" { pass "print buf\[1\]"}
+ -re ".*$gdb_prompt $" { fail "print buf\[1\]"}
+ default { fail "print buf\[1\]"}
+ }
+ send_gdb "print buf\[2\]\n"
+ gdb_expect {
+ -re ".*= 51.*$gdb_prompt $" { set y [expr $y+1]; pass "print buf\[2\]"}
+ -re ".*= 0.*$gdb_prompt $" { pass "print buf\[2\]"}
+ -re ".*$gdb_prompt $" { fail "print buf\[2\]"}
+ default { fail "print buf\[2\]"}
+ }
+ send_gdb "print buf\[3\]\n"
+ gdb_expect {
+ -re ".*= 10.*$gdb_prompt $" { set y [expr $y+1]; pass "print buf\[3\]"}
+ -re ".*= 0.*$gdb_prompt $" { pass "print buf\[3\]"}
+ -re ".*$gdb_prompt $" { fail "print buf\[3\]" }
+ default { fail "print buf\[3\]" }
+ }
+
+ # Did we find what we were looking for? If not, flunk it.
+ if [expr $x==$y] then { pass $testname } else { fail "$testname (only triggered $x watchpoints, expected $y)"}
+
+ # Continue until we hit the finishing marker function.
+ # Make sure we hit no more watchpoints.
+ gdb_test "cont" "Continuing.*Breakpoint.*marker4 \\(\\).*" \
+ "continue to marker4"
+
+ # Disable everything so we can finish the program at full speed
+ gdb_test "disable" "" "disable in test_watchpoint_triggered_in_syscall"
+
+ if [target_info exists gdb,noresults] { return }
+
+ gdb_continue_to_end "continue to exit in test_watchpoint_triggered_in_syscall"
+ }
+}
+
+# Do a simple test of of watching through a pointer when the pointer
+# itself changes. Should add some more complicated stuff here.
+
+proc test_complex_watchpoint {} {
+ global gdb_prompt
+
+ if [runto marker4] then {
+ gdb_test "watch ptr1->val" ".*\[Ww\]atchpoint \[0-9\]*: ptr1->val"
+ gdb_test "break marker5" ".*Breakpoint.*"
+
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint.*ptr1->val.*Old value = 1.*New value = 2.*" "Test complex watchpoint"
+
+ # Continue until we hit the marker5 function.
+ # Make sure we hit no more watchpoints.
+
+ gdb_test "cont" "Continuing.*Breakpoint.*marker5 \\(\\).*" \
+ "did not trigger wrong watchpoint"
+
+ # Test watches of things declared locally in a function.
+ # In particular, test that a watch of stack-based things
+ # is deleted when the stack-based things go out of scope.
+ #
+ gdb_test "disable" "" "disable in test_complex_watchpoint"
+ gdb_test "break marker6" ".*Breakpoint.*"
+ gdb_test "cont" "Continuing.*Breakpoint.*marker6 \\(\\).*" \
+ "continue to marker6"
+ gdb_test "break func2" ".*Breakpoint.*"
+ gdb_test "cont" "Continuing.*func2.*"
+
+ # Test a watch of a single stack-based variable, whose scope
+ # is the function we're now in. This should auto-delete when
+ # execution exits the scope of the watchpoint.
+ #
+ gdb_test "watch local_a" ".*\[Ww\]atchpoint \[0-9\]*: local_a" "set local watch"
+ gdb_test "cont" "\[Ww\]atchpoint.*local_a.*" "trigger local watch"
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*" "self-delete local watch"
+
+ gdb_test "cont" "Continuing.*func2.*"
+ # We should be in "func2" again now. Test a watch of an
+ # expression which includes both a stack-based local and
+ # something whose scope is larger than this invocation
+ # of "func2". This should also auto-delete.
+ #
+ gdb_test "watch local_a + ival5" ".*\[Ww\]atchpoint \[0-9\]*: local_a . ival5" \
+ "set partially local watch"
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: local_a . ival5.*" \
+ "trigger1 partially local watch"
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: local_a . ival5.*" \
+ "trigger2 partially local watch"
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*" \
+ "self-delete partially local watch"
+
+ # We should be in "func2" again now. Test a watch of a
+ # static (non-stack-based) local. Since this has scope
+ # across any invocations of "func2", it should not auto-
+ # delete.
+ #
+ gdb_test "cont" "Continuing.*func2.*"
+ gdb_test "watch static_b" ".*\[Ww\]atchpoint \[0-9\]*: static_b" \
+ "set static local watch"
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: static_b.*" \
+ "trigger static local watch"
+ gdb_test "cont" "Continuing.*marker6 \\(\\).*" \
+ "continue after trigger static local watch"
+ gdb_test "info break" ".*watchpoint.*static_b.*" \
+ "static local watch did not self-delete"
+
+ # We should be in "recurser" now. Test a watch of a stack-
+ # based local. Symbols mentioned in a watchpoint are bound
+ # at watchpoint-creation. Thus, a watch of a stack-based
+ # local to a recursing function should be bound only to that
+ # one invocation, and should not trigger for other invocations.
+ #
+ gdb_test "tbreak recurser" ".*Breakpoint.*"
+ gdb_test "cont" "Continuing.*recurser.*"
+ gdb_test "watch local_x" ".*\[Ww\]atchpoint \[0-9\]*: local_x" \
+ "set local watch in recursive call"
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint .*: local_x.*New value = 2.*" \
+ "trigger local watch in recursive call"
+ gdb_test "cont" "Continuing.*\[Ww\]atchpoint .* deleted because the program has left the block in.*which its expression is valid.*" \
+ "self-delete local watch in recursive call"
+
+ # Disable everything so we can finish the program at full speed
+ gdb_test "disable" "" "disable in test_complex_watchpoint"
+
+ if [target_info exists gdb,noresults] { return }
+
+ gdb_continue_to_end "continue to exit in test_complex_watchpoint"
+ }
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+set prev_timeout $timeout
+set timeout 600
+verbose "Timeout now 600 sec.\n"
+
+if [initialize] then {
+
+ test_simple_watchpoint
+
+ # The IDT/sim monitor only has 8 (!) open files, of which it uses
+ # 4 (!). So we have to make sure one program exits before
+ # starting another one.
+ if [istarget "mips-idt-*"] then {
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+ initialize
+ }
+
+ test_disabling_watchpoints
+
+ # See above.
+ if [istarget "mips-idt-*"] then {
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+ initialize
+ }
+
+ if ![target_info exists gdb,cannot_call_functions] {
+ test_stepping
+
+ # See above.
+ if [istarget "mips-idt-*"] then {
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+ initialize
+ }
+ }
+
+ # Only enabled for some targets merely because it has not been tested
+ # elsewhere.
+ # On sparc-sun-sunos4.1.3, GDB was running all the way to the marker4
+ # breakpoint before stopping for the watchpoint. I don't know why.
+ if {[istarget "hppa*-*-*"]} then {
+ test_watchpoint_triggered_in_syscall
+ }
+
+ # See above.
+ if [istarget "mips-idt-*"] then {
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+ initialize
+ }
+
+ # Only enabled for some targets merely because it has not been tested
+ # elsewhere.
+ if {[istarget "hppa*-*-*"] || \
+ [istarget "sparc*-*-sunos*"] || \
+ [istarget "m32r-*-*"]} then {
+ test_complex_watchpoint
+ }
+
+ # Verify that a user can force GDB to use "slow" watchpoints.
+ # (This proves rather little on kernels that don't support
+ # fast watchpoints, but still...)
+ #
+ if ![runto_main] then { fail "watch tests suppressed" }
+
+ send_gdb "set can-use-hw-watchpoints 0\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "disable fast watches"}
+ timeout {fail "(timeout) disable fast watches"}
+ }
+ send_gdb "show can-use-hw-watchpoints\n"
+ gdb_expect {
+ -re "Debugger's willingness to use watchpoint hardware is 0.*$gdb_prompt $"\
+ {pass "show disable fast watches"}
+ -re "$gdb_prompt $"\
+ {fail "show disable fast watches"}
+ timeout {fail "(timeout) show disable fast watches"}
+ }
+ send_gdb "watch ival3 if count > 1\n"
+ gdb_expect {
+ -re "Watchpoint \[0-9\]*: ival3.*$gdb_prompt $"\
+ {pass "set slow conditional watch"}
+ -re "$gdb_prompt $"\
+ {fail "set slow conditional watch"}
+ timeout {fail "(timeout) set slow conditional watch"}
+ }
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Watchpoint \[0-9\]*: ival3.*Old value = 1.*New value = 2.*$gdb_prompt $"\
+ {pass "trigger slow conditional watch"}
+ -re "$gdb_prompt $"\
+ {fail "trigger slow conditional watch"}
+ timeout {fail "(timeout) trigger slow conditional watch"}
+ }
+
+ # We've explicitly disabled hardware watches. Verify that GDB
+ #
+ #
+ send_gdb "rwatch ival3\n"
+ gdb_expect {
+ -re "Expression cannot be implemented with read/access watchpoint..*$gdb_prompt $"\
+ {pass "rwatch disallowed when can-set-hw-watchpoints cleared"}
+ -re "$gdb_prompt $"\
+ {fail "rwatch disallowed when can-set-hw-watchpoints cleared"}
+ timeout {fail "(timeout) rwatch disallowed when can-use-hw-watchpoints cleared"}
+ }
+
+ # Read- and access watchpoints are unsupported on HP-UX. Verify
+ # that GDB gracefully responds to requests to create them.
+ #
+ if [istarget "hppa*-*-hpux*"] then {
+ send_gdb "set can-use-hw-watchpoints 1\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "enable fast watches"}
+ timeout {fail "(timeout) enable fast watches"}
+ }
+ send_gdb "rwatch ival3\n"
+ gdb_expect {
+ -re "Target does not have this type of hardware watchpoint support.*$gdb_prompt $"\
+ {pass "read watches disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "read watches disallowed"}
+ timeout {fail "(timeout) read watches disallowed"}
+ }
+
+ send_gdb "awatch ival3\n"
+ gdb_expect {
+ -re "Target does not have this type of hardware watchpoint support.*$gdb_prompt $"\
+ {pass "access watches disallowed"}
+ -re "$gdb_prompt $"\
+ {fail "access watches disallowed"}
+ timeout {fail "(timeout) access watches disallowed"}
+ }
+ }
+}
+
+# Restore old timeout
+set timeout $prev_timeout
+verbose "Timeout now $timeout sec.\n"
diff --git a/gdb/testsuite/gdb.base/whatis-exp.exp b/gdb/testsuite/gdb.base/whatis-exp.exp
new file mode 100644
index 00000000000..e36683ed198
--- /dev/null
+++ b/gdb/testsuite/gdb.base/whatis-exp.exp
@@ -0,0 +1,217 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This file is part of the gdb testsuite
+#
+# tests for whatis command on expressions.
+# used in file eval.c. This flavor of whatis
+# command performs evaluation of expressions w/o actually
+# computing the value, but just the type
+# of the result. It goes through the evaluate_subexp_standard
+# with the EVAL_AVOID_SIDE_EFFECTS flag rather than EVAL_NORMAL
+#
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "int-type"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+#
+# test expressions with "int" types
+#
+
+gdb_test "set variable x=14" "" "set variable x=14"
+gdb_test "set variable y=2" "" "set variable y=2"
+gdb_test "set variable z=2" "" "set variable z=2"
+gdb_test "set variable w=3" "" "set variable w=3"
+
+send_gdb "print x\n"
+gdb_expect {
+ -re ".*14.*$gdb_prompt $" {
+ pass "print value of x"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of x" }
+ timeout { fail "(timeout) print value of x" }
+ }
+
+
+send_gdb "print y\n"
+gdb_expect {
+ -re ".*2.*$gdb_prompt $" {
+ pass "print value of y"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of y" }
+ timeout { fail "(timeout) print value of y" }
+ }
+
+send_gdb "print z\n"
+gdb_expect {
+ -re ".*2.*$gdb_prompt $" {
+ pass "print value of z"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of z" }
+ timeout { fail "(timeout) print value of z" }
+ }
+
+send_gdb "print w\n"
+gdb_expect {
+ -re ".*3.*$gdb_prompt $" {
+ pass "print value of w"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of w" }
+ timeout { fail "(timeout) print value of w" }
+ }
+
+
+
+send_gdb "whatis x+y\n"
+gdb_expect {
+ -re ".*type = long.*$gdb_prompt $" {
+ pass "whatis value of x+y"
+ }
+ -re ".*$gdb_prompt $" { fail "whatis value of x+y" }
+ timeout { fail "(timeout) whatis value of x+y" }
+ }
+
+send_gdb "whatis x-y\n"
+gdb_expect {
+ -re ".*type = long.*$gdb_prompt $" {
+ pass "whatis value of x-y"
+ }
+ -re ".*$gdb_prompt $" { fail "whatis value of x-y" }
+ timeout { fail "(timeout) whatis value of x-y" }
+ }
+
+send_gdb "whatis x*y\n"
+gdb_expect {
+ -re ".*type = long.*$gdb_prompt $" {
+ pass "whatis value of x*y"
+ }
+ -re ".*$gdb_prompt $" { fail "whatis value of x*y" }
+ timeout { fail "(timeout) whatis value of x*y" }
+ }
+
+send_gdb "whatis x/y\n"
+gdb_expect {
+ -re ".*type = int.*$gdb_prompt $" {
+ pass "whatis value of x/y"
+ }
+ -re ".*$gdb_prompt $" { fail "whatis value of x/y" }
+ timeout { fail "(timeout) whatis value of x/y" }
+ }
+
+send_gdb "whatis x%y\n"
+gdb_expect {
+ -re ".*type = int.*$gdb_prompt $" {
+ pass "whatis value of x%y"
+ }
+ -re ".*$gdb_prompt $" { fail "whatis value of x%y" }
+ timeout { fail "(timeout) whatis value of x%y" }
+ }
+
+
+
+send_gdb "whatis x=y\n"
+gdb_expect {
+ -re ".*type = int.*$gdb_prompt $" {
+ pass "whatis value of x=y"
+ }
+ -re ".*$gdb_prompt $" { fail "whatis value of x=y" }
+ timeout { fail "(timeout) whatis value of x=y" }
+ }
+
+
+send_gdb "whatis x+=2\n"
+gdb_expect {
+ -re ".*type = int.*$gdb_prompt $" {
+ pass "whatis value of x+=2"
+ }
+ -re ".*$gdb_prompt $" { fail "whatis value of x+=2" }
+ timeout { fail "(timeout) whatis value of x+=2" }
+ }
+
+
+send_gdb "whatis ++x\n"
+gdb_expect {
+ -re ".*type = int.*$gdb_prompt $" {
+ pass "whatis value of ++x"
+ }
+ -re ".*$gdb_prompt $" { fail "whatis value of ++x" }
+ timeout { fail "(timeout) whatis value of ++x" }
+ }
+
+send_gdb "whatis --x\n"
+gdb_expect {
+ -re ".*type = int.*$gdb_prompt $" {
+ pass "whatis value of --x"
+ }
+ -re ".*$gdb_prompt $" { fail "whatis value of --x" }
+ timeout { fail "(timeout) whatis value of --x" }
+ }
+
+send_gdb "whatis x++\n"
+gdb_expect {
+ -re ".*type = int.*$gdb_prompt $" {
+ pass "whatis value of x++"
+ }
+ -re ".*$gdb_prompt $" { fail "whatis value of x++" }
+ timeout { fail "(timeout) whatis value of x++" }
+ }
+
+send_gdb "whatis x--\n"
+gdb_expect {
+ -re ".*type = int.*$gdb_prompt $" {
+ pass "whatis value of x--"
+ }
+ -re ".*$gdb_prompt $" { fail "whatis value of x--" }
+ timeout { fail "(timeout) whatis value of x--" }
+ }
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.base/whatis.c b/gdb/testsuite/gdb.base/whatis.c
new file mode 100644
index 00000000000..63d5d3dae09
--- /dev/null
+++ b/gdb/testsuite/gdb.base/whatis.c
@@ -0,0 +1,269 @@
+/*
+ * Test file with lots of different types, for testing the
+ * "whatis" command.
+ */
+
+/*
+ * First the basic C types.
+ */
+
+#if !(defined (__STDC__) || defined (_AIX))
+#define signed /**/
+#endif
+
+char v_char;
+signed char v_signed_char;
+unsigned char v_unsigned_char;
+
+short v_short;
+signed short v_signed_short;
+unsigned short v_unsigned_short;
+
+int v_int;
+signed int v_signed_int;
+unsigned int v_unsigned_int;
+
+long v_long;
+signed long v_signed_long;
+unsigned long v_unsigned_long;
+
+float v_float;
+double v_double;
+
+/*
+ * Now some derived types, which are arrays, functions-returning,
+ * pointers, structures, unions, and enumerations.
+ */
+
+/**** arrays *******/
+
+char v_char_array[2];
+signed char v_signed_char_array[2];
+unsigned char v_unsigned_char_array[2];
+
+short v_short_array[2];
+signed short v_signed_short_array[2];
+unsigned short v_unsigned_short_array[2];
+
+int v_int_array[2];
+signed int v_signed_int_array[2];
+unsigned int v_unsigned_int_array[2];
+
+long v_long_array[2];
+signed long v_signed_long_array[2];
+unsigned long v_unsigned_long_array[2];
+
+float v_float_array[2];
+double v_double_array[2];
+
+/**** pointers *******/
+
+/* Make sure they still print as pointer to foo even there is a typedef
+ for that type. Test this not just for char *, which might be
+ a special case kludge in GDB (Unix system include files like to define
+ caddr_t), but for a variety of types. */
+typedef char *char_addr;
+typedef unsigned short *ushort_addr;
+typedef signed long *slong_addr;
+
+char *v_char_pointer;
+signed char *v_signed_char_pointer;
+unsigned char *v_unsigned_char_pointer;
+
+short *v_short_pointer;
+signed short *v_signed_short_pointer;
+unsigned short *v_unsigned_short_pointer;
+
+int *v_int_pointer;
+signed int *v_signed_int_pointer;
+unsigned int *v_unsigned_int_pointer;
+
+long *v_long_pointer;
+signed long *v_signed_long_pointer;
+unsigned long *v_unsigned_long_pointer;
+
+float *v_float_pointer;
+double *v_double_pointer;
+
+/**** structs *******/
+
+struct t_struct {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_struct1;
+
+struct {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_struct2;
+
+/**** unions *******/
+
+union t_union {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_union;
+
+union {
+ char v_char_member;
+ short v_short_member;
+ int v_int_member;
+ long v_long_member;
+ float v_float_member;
+ double v_double_member;
+} v_union2;
+
+/*** Functions returning type ********/
+
+char v_char_func () { return(0); }
+signed char v_signed_char_func () { return (0); }
+unsigned char v_unsigned_char_func () { return (0); }
+
+short v_short_func () { return (0); }
+signed short v_signed_short_func () { return (0); }
+unsigned short v_unsigned_short_func () { return (0); }
+
+int v_int_func () { return (0); }
+signed int v_signed_int_func () { return (0); }
+unsigned int v_unsigned_int_func () { return (0); }
+
+long v_long_func () { return (0); }
+signed long v_signed_long_func () { return (0); }
+unsigned long v_unsigned_long_func () { return (0); }
+
+float v_float_func () { return (0.0); }
+double v_double_func () { return (0.0); }
+
+/**** Some misc more complicated things *******/
+
+struct link {
+ struct link *next;
+#ifdef __STDC__
+ struct link *(*linkfunc) (struct link *this, int flags);
+#else
+ struct link *(*linkfunc) ();
+#endif
+ struct t_struct stuff[1][2][3];
+} *s_link;
+
+union tu_link {
+ struct link *next;
+#ifdef __STDC__
+ struct link *(*linkfunc) (struct link *this, int flags);
+#else
+ struct link *(*linkfunc) ();
+#endif
+ struct t_struct stuff[1][2][3];
+} u_link;
+
+struct outer_struct {
+ int outer_int;
+ struct inner_struct {
+ int inner_int;
+ long inner_long;
+ }inner_struct_instance;
+ union inner_union {
+ int inner_union_int;
+ long inner_union_long;
+ }inner_union_instance;
+ long outer_long;
+} nested_su;
+
+/**** Enumerations *******/
+
+enum colors {red, green, blue} color;
+enum cars {chevy, ford, porsche} clunker;
+
+/***********/
+
+int main ()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ /* Some linkers (e.g. on AIX) remove unreferenced variables,
+ so make sure to reference them. */
+ v_char = 0;
+ v_signed_char = 1;
+ v_unsigned_char = 2;
+
+ v_short = 3;
+ v_signed_short = 4;
+ v_unsigned_short = 5;
+
+ v_int = 6;
+ v_signed_int = 7;
+ v_unsigned_int = 8;
+
+ v_long = 9;
+ v_signed_long = 10;
+ v_unsigned_long = 11;
+
+ v_float = 100.0;
+ v_double = 200.0;
+
+
+ v_char_array[0] = v_char;
+ v_signed_char_array[0] = v_signed_char;
+ v_unsigned_char_array[0] = v_unsigned_char;
+
+ v_short_array[0] = v_short;
+ v_signed_short_array[0] = v_signed_short;
+ v_unsigned_short_array[0] = v_unsigned_short;
+
+ v_int_array[0] = v_int;
+ v_signed_int_array[0] = v_signed_int;
+ v_unsigned_int_array[0] = v_unsigned_int;
+
+ v_long_array[0] = v_long;
+ v_signed_long_array[0] = v_signed_long;
+ v_unsigned_long_array[0] = v_unsigned_long;
+
+ v_float_array[0] = v_float;
+ v_double_array[0] = v_double;
+
+ v_char_pointer = &v_char;
+ v_signed_char_pointer = &v_signed_char;
+ v_unsigned_char_pointer = &v_unsigned_char;
+
+ v_short_pointer = &v_short;
+ v_signed_short_pointer = &v_signed_short;
+ v_unsigned_short_pointer = &v_unsigned_short;
+
+ v_int_pointer = &v_int;
+ v_signed_int_pointer = &v_signed_int;
+ v_unsigned_int_pointer = &v_unsigned_int;
+
+ v_long_pointer = &v_long;
+ v_signed_long_pointer = &v_signed_long;
+ v_unsigned_long_pointer = &v_unsigned_long;
+
+ v_float_pointer = &v_float;
+ v_double_pointer = &v_double;
+
+ color = red;
+ clunker = porsche;
+
+ u_link.next = s_link;
+
+ v_union2.v_short_member = v_union.v_short_member;
+
+ v_struct1.v_char_member = 0;
+ v_struct2.v_char_member = 0;
+
+ nested_su.outer_int = 0;
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/whatis.exp b/gdb/testsuite/gdb.base/whatis.exp
new file mode 100644
index 00000000000..79c48e4da70
--- /dev/null
+++ b/gdb/testsuite/gdb.base/whatis.exp
@@ -0,0 +1,419 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1999, 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile whatis
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+# Define a procedure to set up an xfail for all targets that put out a
+# `long' type as an `int' type.
+# Sun/Ultrix cc have this problem.
+# It was said that COFF targets can not distinguish int from long either.
+
+proc setup_xfail_on_long_vs_int {} {
+ global gcc_compiled
+
+ if {!$gcc_compiled} {
+ setup_xfail "*-sun-sunos4*" "*-*-ultrix*" "i*86-sequent-bsd*"
+ }
+}
+
+#
+# Test whatis command with basic C types
+#
+# The name printed now (as of 23 May 1993) is whatever name the compiler
+# uses in the stabs. So we need to deal with names both from gcc and
+# native compilers.
+#
+
+gdb_test "whatis v_char" \
+ "type = (unsigned char|char)" \
+ "whatis char"
+
+# If we did not use the signed keyword when compiling the file, don't
+# expect GDB to know that char is signed.
+if { $hp_cc_compiler || $hp_aCC_compiler } {
+ set signed_keyword_not_used 1
+}
+if $signed_keyword_not_used then {
+ set signed_char "char"
+} else {
+ set signed_char "signed char"
+}
+if {!$gcc_compiled} then { setup_xfail "mips-sgi-irix*" }
+gdb_test "whatis v_signed_char" \
+ "type = $signed_char" \
+ "whatis signed char"
+
+gdb_test "whatis v_unsigned_char" \
+ "type = unsigned char" \
+ "whatis unsigned char"
+
+gdb_test "whatis v_short" \
+ "type = (short|short int)" \
+ "whatis short"
+
+gdb_test "whatis v_signed_short" \
+ "type = (short|short int|signed short|signed short int)" \
+ "whatis signed short"
+
+gdb_test "whatis v_unsigned_short" \
+ "type = (unsigned short|short unsigned int)" \
+ "whatis unsigned short"
+
+gdb_test "whatis v_int" \
+ "type = int" \
+ "whatis int"
+
+gdb_test "whatis v_signed_int" \
+ "type = (signed |)int" \
+ "whatis signed int"
+
+gdb_test "whatis v_unsigned_int" \
+ "type = unsigned int" \
+ "whatis unsigned int"
+
+setup_xfail_on_long_vs_int
+# AIX xlc gets this wrong and unsigned long right. Go figure.
+if {!$gcc_compiled} then {setup_xfail "rs6000-*-aix*"}
+gdb_test "whatis v_long" \
+ "type = (long|long int)" \
+ "whatis long"
+
+setup_xfail_on_long_vs_int
+# AIX xlc gets this wrong and unsigned long right. Go figure.
+if {!$gcc_compiled} then {setup_xfail "rs6000-*-aix*"}
+gdb_test "whatis v_signed_long" \
+ "type = (signed |)(long|long int)" \
+ "whatis signed long"
+
+setup_xfail_on_long_vs_int
+gdb_test "whatis v_unsigned_long" \
+ "type = (unsigned long|long unsigned int)" \
+ "whatis unsigned long"
+
+gdb_test "whatis v_float" \
+ "type = float" \
+ "whatis float"
+
+gdb_test "whatis v_double" \
+ "type = double" \
+ "whatis double"
+
+
+# test whatis command with arrays
+#
+# We already tested whether char prints as "char", so here we accept
+# "unsigned char", "signed char", and other perversions. No need for more
+# than one xfail for the same thing.
+gdb_test "whatis v_char_array" \
+ "type = (signed |unsigned |)char \\\[2\\\]" \
+ "whatis char array"
+
+gdb_test "whatis v_signed_char_array" \
+ "type = (signed |unsigned |)char \\\[2\\\]" \
+ "whatis signed char array"
+
+gdb_test "whatis v_unsigned_char_array" \
+ "type = unsigned char \\\[2\\\]" \
+ "whatis unsigned char array"
+
+gdb_test "whatis v_short_array" \
+ "type = (short|short int) \\\[2\\\]" \
+ "whatis short array"
+
+gdb_test "whatis v_signed_short_array" \
+ "type = (signed |)(short|short int) \\\[2\\\]" \
+ "whatis signed short array"
+
+gdb_test "whatis v_unsigned_short_array" \
+ "type = (unsigned short|short unsigned int) \\\[2\\\]" \
+ "whatis unsigned short array"
+
+gdb_test "whatis v_int_array" \
+ "type = int \\\[2\\\]" \
+ "whatis int array"
+
+gdb_test "whatis v_signed_int_array" \
+ "type = (signed |)int \\\[2\\\]" \
+ "whatis signed int array"
+
+gdb_test "whatis v_unsigned_int_array" \
+ "type = unsigned int \\\[2\\\]" \
+ "whatis unsigned int array"
+
+# We already tested whether long prints as long, so here we accept int
+# No need for more than one xfail for the same thing.
+gdb_test "whatis v_long_array" \
+ "type = (int|long|long int) \\\[2\\\]" \
+ "whatis long array"
+
+gdb_test "whatis v_signed_long_array" \
+ "type = (signed |)(int|long|long int) \\\[2\\\]" \
+ "whatis signed long array"
+
+gdb_test "whatis v_unsigned_long_array" \
+ "type = (unsigned (int|long|long int)|long unsigned int) \\\[2\\\]" \
+ "whatis unsigned long array"
+
+gdb_test "whatis v_float_array" \
+ "type = float \\\[2\\\]" \
+ "whatis float array"
+
+gdb_test "whatis v_double_array" \
+ "type = double \\\[2\\\]" \
+ "whatis double array"
+
+
+# test whatis command with pointers
+#
+# We already tested whether char prints as char, so accept various perversions
+# here. We especially want to make sure we test that it doesn't print as
+# caddr_t.
+gdb_test "whatis v_char_pointer" \
+ "type = (unsigned |signed |)char \\*" \
+ "whatis char pointer"
+
+gdb_test "whatis v_signed_char_pointer" \
+ "type = (unsigned |signed |)char \\*" \
+ "whatis signed char pointer"
+
+gdb_test "whatis v_unsigned_char_pointer" \
+ "type = unsigned char \\*" \
+ "whatis unsigned char pointer"
+
+gdb_test "whatis v_short_pointer" \
+ "type = (short|short int) \\*" \
+ "whatis short pointer"
+
+gdb_test "whatis v_signed_short_pointer" \
+ "type = (signed |)(short|short int) \\*" \
+ "whatis signed short pointer"
+
+gdb_test "whatis v_unsigned_short_pointer" \
+ "type = (unsigned short|short unsigned int) \\*" \
+ "whatis unsigned short pointer"
+
+gdb_test "whatis v_int_pointer" \
+ "type = int \\*" \
+ "whatis int pointer"
+
+gdb_test "whatis v_signed_int_pointer" \
+ "type = (signed |)int \\*" \
+ "whatis signed int pointer"
+
+gdb_test "whatis v_unsigned_int_pointer" \
+ "type = unsigned int \\*" \
+ "whatis unsigned int pointer"
+
+# We already tested whether long prints as long, so here we accept int
+gdb_test "whatis v_long_pointer" \
+ "type = (long|int|long int) \\*" \
+ "whatis long pointer"
+
+gdb_test "whatis v_signed_long_pointer" \
+ "type = (signed |)(long|int|long int) \\*" \
+ "whatis signed long pointer"
+
+gdb_test "whatis v_unsigned_long_pointer" \
+ "type = (unsigned (int|long|long int)|long unsigned int) \\*" \
+ "whatis unsigned long pointer"
+
+gdb_test "whatis v_float_pointer" \
+ "type = float \\*" \
+ "whatis float pointer"
+
+gdb_test "whatis v_double_pointer" \
+ "type = double \\*" \
+ "whatis double pointer"
+
+
+if { $hp_aCC_compiler } {
+ set unstruct "unnamed\.struct\..*"
+ set ununion "unnamed\.union\..*"
+} else {
+ set unstruct "\.\.\."
+ set ununion "\.\.\."
+}
+
+# test whatis command with structure types
+gdb_test "whatis v_struct1" \
+ "type = struct t_struct" \
+ "whatis named structure"
+
+gdb_test "whatis v_struct2" \
+ "type = struct \{$unstruct\}" \
+ "whatis unnamed structure"
+
+
+# test whatis command with union types
+gdb_test "whatis v_union" \
+ "type = union t_union" \
+ "whatis named union"
+
+gdb_test "whatis v_union2" \
+ "type = union \{$ununion\}" \
+ "whatis unnamed union"
+
+
+if { [istarget "hppa*-hp-hpux*"] && $hp_aCC_compiler } {
+ # HP-UX: HP aCC compiler w/ +objdebug option detects language as
+ # c++, so we need the 'void' pattern here.
+ # Without +objdebug compilation option we still need to match ''.
+ # - guo
+ set void "(void|)"
+} else {
+ set void ""
+}
+
+# test whatis command with functions return type
+gdb_test "whatis v_char_func" \
+ "type = (signed |unsigned |)char \\($void\\)" \
+ "whatis char function"
+
+gdb_test "whatis v_signed_char_func" \
+ "type = (signed |unsigned |)char \\($void\\)" \
+ "whatis signed char function"
+
+gdb_test "whatis v_unsigned_char_func" \
+ "type = unsigned char \\($void\\)" \
+ "whatis unsigned char function"
+
+gdb_test "whatis v_short_func" \
+ "type = short (int |)\\($void\\)" \
+ "whatis short function"
+
+gdb_test "whatis v_signed_short_func" \
+ "type = (signed |)short (int |)\\($void\\)" \
+ "whatis signed short function"
+
+gdb_test "whatis v_unsigned_short_func" \
+ "type = (unsigned short|short unsigned int) \\($void\\)" \
+ "whatis unsigned short function"
+
+gdb_test "whatis v_int_func" \
+ "type = int \\($void\\)" \
+ "whatis int function"
+
+gdb_test "whatis v_signed_int_func" \
+ "type = (signed |)int \\($void\\)" \
+ "whatis signed int function"
+
+gdb_test "whatis v_unsigned_int_func" \
+ "type = unsigned int \\($void\\)" \
+ "whatis unsigned int function"
+
+gdb_test "whatis v_long_func" \
+ "type = (long|int|long int) \\($void\\)" \
+ "whatis long function"
+
+gdb_test "whatis v_signed_long_func" \
+ "type = (signed |)(int|long|long int) \\($void\\)" \
+ "whatis signed long function"
+
+gdb_test "whatis v_unsigned_long_func" \
+ "type = (unsigned (int|long|long int)|long unsigned int) \\($void\\)" \
+ "whatis unsigned long function"
+
+# Sun /bin/cc calls this a function returning double.
+if {!$gcc_compiled} then {setup_xfail "*-sun-sunos4*"}
+gdb_test "whatis v_float_func" \
+ "type = float \\($void\\)" \
+ "whatis float function"
+
+gdb_test "whatis v_double_func" \
+ "type = double \\($void\\)" \
+ "whatis double function" \
+
+
+# test whatis command with some misc complicated types
+gdb_test "whatis s_link" \
+ "type = struct link \\*" \
+ "whatis complicated structure"
+
+gdb_test "whatis u_link" \
+ "type = union tu_link" \
+ "whatis complicated union"
+
+
+# test whatis command with enumerations
+gdb_test "whatis clunker" \
+ "type = enum cars" \
+ "whatis enumeration"
+
+
+# test whatis command with nested struct and union
+gdb_test "whatis nested_su" \
+ "type = struct outer_struct" \
+ "whatis outer structure"
+
+gdb_test "whatis nested_su.outer_int" \
+ "type = int" \
+ "whatis outer structure member"
+
+if {$hp_aCC_compiler} {
+ set outer "outer_struct::"
+} else {
+ set outer ""
+}
+
+gdb_test "whatis nested_su.inner_struct_instance" \
+ "type = struct ${outer}inner_struct" \
+ "whatis inner structure"
+
+gdb_test "whatis nested_su.inner_struct_instance.inner_int" \
+ "type = int" \
+ "whatis inner structure member"
+
+gdb_test "whatis nested_su.inner_union_instance" \
+ "type = union ${outer}inner_union" \
+ "whatis inner union"
+
+gdb_test "whatis nested_su.inner_union_instance.inner_union_int" \
+ "type = int" \
+ "whatis inner union member"
diff --git a/gdb/testsuite/gdb.c++/Makefile.in b/gdb/testsuite/gdb.c++/Makefile.in
new file mode 100644
index 00000000000..82672598750
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/Makefile.in
@@ -0,0 +1,27 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = ambiguous annota2 anon-union cplusfuncs cttiadd \
+ derivation inherit local member-ptr method misc \
+ overload ovldbreak ref-typ ref-typ2 templates userdef virtfunc namespace ref-types
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ *.o *.ci
+ -rm -f core ${EXECUTABLES}
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+
+Makefile: $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.c++/ambiguous.cc b/gdb/testsuite/gdb.c++/ambiguous.cc
new file mode 100644
index 00000000000..6ee7bc18ea9
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/ambiguous.cc
@@ -0,0 +1,110 @@
+
+void marker1()
+{
+ return;
+}
+
+class A1 {
+public:
+ int x;
+ int y;
+};
+
+class A2 {
+public:
+ int x;
+ int y;
+};
+
+class A3 {
+public:
+ int x;
+ int y;
+};
+
+class X : public A1, public A2 {
+public:
+ int z;
+};
+
+class L : public A1 {
+public:
+ int z;
+};
+
+class LV : public virtual A1 {
+public:
+ int z;
+};
+
+class M : public A2 {
+public:
+ int w;
+};
+
+class N : public L, public M {
+public:
+ int r;
+};
+
+class K : public A1 {
+public:
+ int i;
+};
+
+class KV : public virtual A1 {
+public:
+ int i;
+};
+
+class J : public K, public L {
+public:
+ int j;
+};
+
+class JV : public KV, public LV {
+public:
+ int jv;
+};
+
+class JVA1 : public KV, public LV, public A1 {
+public:
+ int jva1;
+};
+
+class JVA2 : public KV, public LV, public A2 {
+public:
+ int jva2;
+};
+
+class JVA1V : public KV, public LV, public virtual A1 {
+public:
+ int jva1v;
+};
+
+int main()
+{
+ A1 a1;
+ A2 a2;
+ A3 a3;
+ X x;
+ L l;
+ M m;
+ N n;
+ K k;
+ J j;
+ JV jv;
+ JVA1 jva1;
+ JVA2 jva2;
+ JVA1V jva1v;
+
+ int i;
+
+ i += k.i + m.w + a1.x + a2.x + a3.x + x.z + l.z + n.r + j.j;
+
+ marker1();
+
+}
+
+
+
diff --git a/gdb/testsuite/gdb.c++/ambiguous.exp b/gdb/testsuite/gdb.c++/ambiguous.exp
new file mode 100644
index 00000000000..4224b2d79fd
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/ambiguous.exp
@@ -0,0 +1,237 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file is part of the gdb testsuite
+
+# tests relating to ambiguous class members
+# Written by Satish Pai <pai@apollo.hp.com> 1997-07-28
+
+# This file is part of the gdb testsuite
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "ambiguous"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1;
+}
+
+if { $gcc_compiled } then { continue }
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
+ send_gdb "cont\n"
+ gdb_expect {
+ -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
+ send_gdb "up\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" { pass "up from marker1" }
+ timeout { fail "up from marker1" }
+ }
+ }
+ -re "$gdb_prompt $" { fail "continue to marker1" }
+ timeout { fail "(timeout) continue to marker1" }
+ }
+
+# print out various class objects' members. The values aren't
+# important, just check that the warning is emitted at the
+# right times.
+
+# X is derived from A1 and A2; both A1 and A2 have a member 'x'
+send_gdb "print x.x\n"
+gdb_expect {
+ -re "warning: x ambiguous; using X::A2::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" {
+ pass "print x.x"
+ }
+ -re "warning: x ambiguous; using X::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" {
+ pass "print x.x"
+ }
+ -re ".*$gdb_prompt $" { fail "print x.x" }
+ timeout { fail "(timeout) print x.x" }
+}
+
+
+# N is derived from A1 and A2, but not immediately -- two steps
+# up in the hierarchy. Both A1 and A2 have a member 'x'.
+send_gdb "print n.x\n"
+gdb_expect {
+ -re "warning: x ambiguous; using N::M::A2::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" {
+ pass "print n.x"
+ }
+ -re "warning: x ambiguous; using N::L::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" {
+ pass "print n.x"
+ }
+ -re ".*$gdb_prompt $" { fail "print n.x" }
+ timeout { fail "(timeout) print n.x" }
+}
+
+# J is derived from A1 twice. A1 has a member x.
+send_gdb "print j.x\n"
+gdb_expect {
+ -re "warning: x ambiguous; using J::L::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" {
+ pass "print j.x"
+ }
+ -re "warning: x ambiguous; using J::K::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" {
+ pass "print j.x"
+ }
+ -re ".*$gdb_prompt $" { fail "print j.x" }
+ timeout { fail "(timeout) print j.x" }
+}
+
+# JV is derived from A1 but A1 is a virtual base. Should not
+# report an ambiguity in this case.
+send_gdb "print jv.x\n"
+gdb_expect {
+ -re "warning: x ambiguous.*Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" {
+ fail "print jv.x (ambiguity reported)"
+ }
+ -re "\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { pass "print jv.x" }
+ -re ".*$gdb_prompt $" { fail "print jv.x (??)" }
+ timeout { fail "(timeout) print jv.x" }
+}
+
+# JVA1 is derived from A1; A1 occurs as a virtual base in two
+# ancestors, and as a non-virtual immediate base. Ambiguity must
+# be reported.
+send_gdb "print jva1.x\n"
+gdb_expect {
+ -re "warning: x ambiguous; using JVA1::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" {
+ pass "print jva1.x"
+ }
+ -re "warning: x ambiguous; using JVA1::KV::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" {
+ pass "print jva1.x"
+ }
+ -re ".*$gdb_prompt $" { fail "print jva1.x" }
+ timeout { fail "(timeout) print jva1.x" }
+}
+
+# JVA2 is derived from A1 & A2; A1 occurs as a virtual base in two
+# ancestors, and A2 is a non-virtual immediate base. Ambiguity must
+# be reported as A1 and A2 both have a member 'x'.
+send_gdb "print jva2.x\n"
+gdb_expect {
+ -re "warning: x ambiguous; using JVA2::A2::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" {
+ pass "print jva2.x"
+ }
+ -re "warning: x ambiguous; using JVA2::KV::A1::x. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" {
+ pass "print jva2.x"
+ }
+ -re ".*$gdb_prompt $" { fail "print jva2.x" }
+ timeout { fail "(timeout) print jva2.x" }
+}
+
+# JVA1V is derived from A1; A1 occurs as a virtual base in two
+# ancestors, and also as a virtual immediate base. Ambiguity must
+# not be reported.
+send_gdb "print jva1v.x\n"
+gdb_expect {
+ -re "warning: x ambiguous.*Use a cast to disambiguate.\r\n\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" {
+ fail "print jva1v.x (ambiguity reported)"
+ }
+ -re "\\$\[0-9\]* = \[-\]*\[0-9\]*\r\n$gdb_prompt $" { pass "print jva1v.x" }
+ -re ".*$gdb_prompt $" { fail "print jva1v.x (??)" }
+ timeout { fail "(timeout) print jva1v.x" }
+}
+
+# Now check for ambiguous bases.
+
+# J is derived from A1 twice; report ambiguity if a J is
+# cast to an A1.
+send_gdb "print (A1)j\n"
+gdb_expect {
+ -re "warning: A1 ambiguous; using J::L::A1. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" {
+ pass "print (A1)j"
+ }
+ -re "warning: A1 ambiguous; using J::K::A1. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" {
+ pass "print (A1)j"
+ }
+ -re ".*$gdb_prompt $" { fail "print (A1)j" }
+ timeout { fail "(timeout) print (A1)j" }
+}
+
+# JV is derived from A1 twice, but A1 is a virtual base; should
+# not report ambiguity when a JV is cast to an A1.
+send_gdb "print (A1)jv\n"
+gdb_expect {
+ -re "warning: A1 ambiguous.*Use a cast to disambiguate.\r\n\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" {
+ fail "print (A1)jv (ambiguity reported)"
+ }
+ -re "\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" { pass "print (A1)jv" }
+ -re ".*$gdb_prompt $" { fail "print (A1)jv (??)" }
+ timeout { fail "(timeout) print (A1)jv" }
+}
+
+# JVA1 is derived from A1; A1 is a virtual base and also a
+# non-virtual base. Must report ambiguity if a JVA1 is cast to an A1.
+send_gdb "print (A1)jva1\n"
+gdb_expect {
+ -re "warning: A1 ambiguous; using JVA1::A1. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" {
+ pass "print (A1)jva1"
+ }
+ -re "warning: A1 ambiguous; using JVA1::KV::A1. Use a cast to disambiguate.\r\n\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" {
+ pass "print (A1)jva1"
+ }
+ -re ".*$gdb_prompt $" { fail "print (A1)jva1" }
+ timeout { fail "(timeout) print (A1)jva1" }
+}
+
+# JVA1V is derived from A1; A1 is a virtual base indirectly
+# and also directly; must not report ambiguity when a JVA1V is cast to an A1.
+send_gdb "print (A1)jva1v\n"
+gdb_expect {
+ -re "warning: A1 ambiguous.*Use a cast to disambiguate.\r\n\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" {
+ fail "print (A1)jva1v (ambiguity reported)"
+ }
+ -re "\\$\[0-9\]* = \{x = \[-\]*\[0-9\]*, y = \[-\]*\[0-9\]*\}\r\n$gdb_prompt $" { pass "print (A1)jva1v"
+ }
+ -re ".*$gdb_prompt $" { fail "print (A1)jva1v (??)" }
+ timeout { fail "(timeout) print (A1)jva1v" }
+}
+
diff --git a/gdb/testsuite/gdb.c++/annota2.cc b/gdb/testsuite/gdb.c++/annota2.cc
new file mode 100644
index 00000000000..234752e49af
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/annota2.cc
@@ -0,0 +1,28 @@
+#include <stdio.h>
+
+class A {
+public:
+ int x;
+ int y;
+ int foo (int arg);
+};
+
+
+int A::foo (int arg)
+{
+ x += arg;
+ return arg *2;
+}
+
+int main()
+{
+ A a;
+
+ a.x = 0;
+ a.x = 1;
+ a.y = 2;
+
+ printf ("a.x is %d\n", a.x);
+ return 0;
+}
+
diff --git a/gdb/testsuite/gdb.c++/annota2.exp b/gdb/testsuite/gdb.c++/annota2.exp
new file mode 100644
index 00000000000..51c11168c71
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/annota2.exp
@@ -0,0 +1,231 @@
+# Copyright 1999, 2000, 2001
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "annota2"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++ additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# are we on a target board? If so, don't run these tests.
+# note: this is necessary because we cannot use runto_main (which would
+# work for remote targets too) because of the different prompt we get
+# when using annotation level 2.
+#
+if [is_remote target] then {
+ return 0
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+#
+# line number where we need to stop in main
+#
+set main_line 25
+
+# The commands we test here produce many lines of output; disable "press
+# <return> to continue" prompts.
+send_gdb "set height 0\n"
+gdb_expect -re "$gdb_prompt $"
+
+#
+# break at main
+#
+gdb_test "break 25" \
+ "Breakpoint.*at.* file .*$srcfile, line.*" \
+ "breakpoint main"
+
+
+#
+# NOTE: this prompt is OK only when the annotation level is > 1
+# NOTE: When this prompt is in use the gdb_test procedure cannot be used because
+# it assumes that the last char of the gdb_prompt is a white space. This is not
+# true with this annotated prompt. So we must use send_gdb and gdb_expect.
+#
+
+set old_gdb_prompt $gdb_prompt
+set gdb_prompt "\r\n\032\032pre-prompt\r\n$gdb_prompt \r\n\032\032prompt\r\n"
+
+send_gdb "set annotate 2\n"
+gdb_expect {
+ -re "set annotate 2\r\n$gdb_prompt$" { pass "annotation set at level 2" }
+ -re ".*$gdb_prompt$" { fail "annotation set at level 2" }
+ timeout { fail "annotation set at level 2 (timeout)" }
+ }
+
+send_gdb "run\n"
+ gdb_expect {
+ -re "$main_line.*$gdb_prompt$" { pass "run until main breakpoint" }
+ -re ".*$gdb_prompt$" { fail "run until main breakpoint" }
+ timeout { fail "run until main breakpoint (timeout)" }
+ }
+
+#
+# print class 'a' with public fields.
+# this will test:
+# annotate-field-begin
+# annotate-field-name-end
+# annotate-field-value
+# annotate-field-end
+#
+send_gdb "print a\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032value-history-begin 1 -\r\n.*= \r\n\032\032value-history-value\r\n\\{\r\n\032\032field-begin -\r\nx\r\n\032\032field-name-end\r\n = \r\n\032\032field-value\r\n1\r\n\032\032field-end\r\n, \r\n\032\032field-begin -\r\ny\r\n\032\032field-name-end\r\n = \r\n\032\032field-value\r\n2\r\n\032\032field-end\r\n\\}\r\n\r\n\032\032value-history-end\r\n$gdb_prompt$" \
+ { pass "print class" }
+ -re ".*$gdb_prompt$" { fail "print class" }
+ timeout { fail "print class (timeout)" }
+}
+
+#
+# continue until exit
+# this will test:
+# annotate-exited
+#
+send_gdb "continue\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\na.x is 1\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032exited 0\r\n\r\nProgram exited normally.\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
+ { pass "continue until exit" }
+ -re ".*$gdb_prompt$" { fail "continue to exit" }
+ timeout { fail "continue to exit (timeout)" }
+}
+
+#
+# delete all breakpoints
+#
+send_gdb "delete\n"
+gdb_expect {
+ -re ".*Delete all breakpoints. \\(y or n\\) \r\n\032\032query.*$" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "\r\n\032\032post-query\r\n$gdb_prompt$" { pass "delete bps" }
+ -re ".*$gdb_prompt$" { fail "delete bps" }
+ timeout { fail "delete bps (timeout)" }
+ }
+ }
+ -re ".*$gdb_prompt$" { fail "delete bps" }
+ timeout { fail "delete bps (timeout)" }
+}
+
+#
+# break at first line of main.
+#
+send_gdb "break 22\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\nBreakpoint.*at $hex: file.*$srcfile, line.*\r\n$gdb_prompt$" \
+ { pass "breakpoint at main" }
+ -re ".*$gdb_prompt$" { fail "break at main" }
+ timeout { fail "break at main (timeout)" }
+}
+
+#
+# change value of main_line
+#
+set main_line 22
+
+#
+# run program up to breakpoint.
+#
+
+
+send_gdb "run\n"
+ gdb_expect {
+ -re "$main_line.*$gdb_prompt$" { pass "run until main breakpoint" }
+ -re ".*$gdb_prompt$" { fail "run until main breakpoint" }
+ timeout { fail "run until main breakpoint (timeout)" }
+ }
+
+#
+# set up a watch point on a.x
+#
+send_gdb "watch a.x\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032breakpoints-invalid\r\n.*atchpoint 3: a.x\r\n$gdb_prompt$" \
+ { pass "set watch on a.x" }
+ -re ".*$gdb_prompt$" { fail "set watch on a.x" }
+ timeout { fail "set watch on a.x (timeout)" }
+}
+
+#
+# do a next, so that the watchpoint triggers. This will test:
+# annotate-watchpoint
+#
+send_gdb "next\n"
+gdb_expect {
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032watchpoint 3\r\nWatchpoint 3: a.x\r\n\r\nOld value = 0\r\nNew value = 1\r\n\r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*$srcfile\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$decimal\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source .*$srcfile.*beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \
+ { pass "watch triggered on a.x" }
+ -re "\r\n\032\032post-prompt\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032frames-invalid\r\n\r\n\032\032watchpoint 3\r\n\.*atchpoint 3: a.x\r\n\r\nOld value = 0\r\nNew value = 1\r\n\r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*$srcfile\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$decimal\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source .*$srcfile.*beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n.*$gdb_prompt$" \
+ { pass "watch triggered on a.x" }
+ -re ".*$gdb_prompt$" { fail "watch triggered on a.x" }
+ timeout { fail "watch triggered on a.x (timeout)" }
+}
+
+
+#
+# send ^C to gdb, so that the quit() function gets called
+# and annotate-quit is tested
+# test:
+# annotate-quit
+#
+# This test sometimes fails, but not reproducibly. See gdb/544.
+#
+send_gdb "\003"
+gdb_expect {
+ -re "\r\n\032\032error-begin\r\nQuit\r\n\r\n\032\032quit\r\n$gdb_prompt$" \
+ { pass "annotate-quit" }
+ -re ".*$gdb_prompt$" { fail "annotate-quit" }
+ timeout { fail "annotate-quit (timeout)" }
+}
+
+#
+# FIXME: the testsuite does not currently have tests for
+# annotate_catchpoints and annotate_function_call
+# and a few variants of the annotations that are
+# tested (marked by FIXME on the annot?.exp files)
+#
+
+# reinstall the old prompt for the rest of the testsuite.
+
+set gdb_prompt $old_gdb_prompt
+
diff --git a/gdb/testsuite/gdb.c++/anon-union.cc b/gdb/testsuite/gdb.c++/anon-union.cc
new file mode 100644
index 00000000000..0b3fd130aeb
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/anon-union.cc
@@ -0,0 +1,55 @@
+
+struct Foo {
+ union {
+ int zero;
+ unsigned int one;
+ } num1;
+ struct X {
+ int rock;
+ unsigned int rock2;
+ };
+ union {
+ int pebble;
+ X x;
+ union {
+ int qux;
+ unsigned int mux;
+ };
+ unsigned int boulder;
+ };
+ union {
+ int paper;
+ unsigned int cloth;
+ };
+ union {
+ int two;
+ unsigned int three;
+ } num2;
+};
+
+union Bar {
+ int x;
+ unsigned int y;
+};
+
+
+int main()
+{
+ Foo foo = {0, 0};
+
+ foo.paper = 33;
+ foo.pebble = 44;
+ foo.mux = 55;
+
+ Bar bar = {0};
+
+ union {
+ int z;
+ unsigned int w;
+ }; w = 0;
+
+ bar.x = 33;
+
+ w = 45;
+
+}
diff --git a/gdb/testsuite/gdb.c++/anon-union.exp b/gdb/testsuite/gdb.c++/anon-union.exp
new file mode 100644
index 00000000000..9b86b5d94ab
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/anon-union.exp
@@ -0,0 +1,347 @@
+# Tests for anonymous union support.
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Written by Satish Pai <pai@apollo.hp.com> 1997-08-19
+
+# This file is part of the gdb testsuite
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "anon-union"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Start with a fresh gdb
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+send_gdb "set width 0\n"
+gdb_expect -re "$gdb_prompt $"
+
+#send_gdb "ptype foo\n"
+#gdb_expect {
+# -re "\r\n$gdb_prompt $" {
+# pass "ptype foo"
+# }
+# -re ".*$gdb_prompt $" { fail "ptype foo" }
+# timeout { fail "(timeout) ptype foo" }
+#}
+
+#send_gdb "ptype bar\n"
+#gdb_expect {
+# -re "\r\n$gdb_prompt $" {
+# pass "ptype foo"
+# }
+# -re ".*$gdb_prompt $" { fail "ptype foo" }
+# timeout { fail "(timeout) ptype foo" }
+#}
+
+# NOTE: Add -- ptype foo.x, etc. when things are working
+
+#Initialize foo
+send_gdb "next\n"
+gdb_expect {
+ -re "40\[ \t\]*foo.paper = 33;\r\n$gdb_prompt $" {
+ pass "next 1"
+ }
+ -re ".*$gdb_prompt $" { fail "next 1" }
+ timeout { fail "(timeout) next 1" }
+}
+
+# Print out the big anon union.
+send_gdb "print foo\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 0, cloth = 0\}, num2 = \{two = 0, three = 0\}\}\r\n$gdb_prompt $" {
+ pass "print foo 1"
+ }
+ -re ".*$gdb_prompt $" { fail "print foo 1" }
+ timeout { fail "(timeout) print foo 1" }
+}
+
+# Step over assignment to member
+
+send_gdb "next\n"
+gdb_expect {
+ -re "41\[ \t\]*foo.pebble = 44;\r\n$gdb_prompt $" {
+ pass "next 1"
+ }
+ -re ".*$gdb_prompt $" { fail "next 1" }
+ timeout { fail "(timeout) next 1" }
+}
+
+# Now print out anon union again
+send_gdb "print foo\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 33, cloth = 33\}, num2 = \{two = 0, three = 0\}\}\r\n$gdb_prompt $" {
+ pass "print foo 2"
+ }
+ -re ".*$gdb_prompt $" { fail "print foo 2" }
+ timeout { fail "(timeout) print foo 2" }
+}
+
+# Modify the member just set
+send_gdb "set var foo.cloth = 35\n"
+gdb_expect {
+ -re "\r\n$gdb_prompt $" {
+ pass "set var foo.cloth"
+ }
+ timeout { fail "(timeout) set var foo.cloth" }
+}
+
+# Now print out anon union again to see if the right member was set
+send_gdb "print foo\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 0, x = \{rock = 0, rock2 = 0\}, \{qux = 0, mux = 0\}, boulder = 0\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}\r\n$gdb_prompt $" {
+ pass "print foo 3"
+ }
+ -re ".*$gdb_prompt $" { fail "print foo 3" }
+ timeout { fail "(timeout) print foo 3" }
+}
+
+
+# Step over next assignment to member
+
+send_gdb "next\n"
+gdb_expect {
+ -re "42\[ \t\]*foo.mux = 55;\r\n$gdb_prompt $" {
+ pass "next 2"
+ }
+ -re ".*$gdb_prompt $" { fail "next 2" }
+ timeout { fail "(timeout) next 2" }
+}
+
+# Now print out anon union again
+send_gdb "print foo\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 44, x = \{rock = 44, rock2 = 0\}, \{qux = 44, mux = 44\}, boulder = 44\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}\r\n$gdb_prompt $" {
+ pass "print foo 4"
+ }
+ -re ".*$gdb_prompt $" { fail "print foo 4" }
+ timeout { fail "(timeout) print foo 4" }
+}
+
+# Modify the member just set
+send_gdb "set var foo.pebble = 45\n"
+gdb_expect {
+ -re "\r\n$gdb_prompt $" {
+ pass "set var foo.pebble"
+ }
+ timeout { fail "(timeout) set var foo.pebble" }
+}
+
+# Now print out anon union again to see if the right member was set
+send_gdb "print foo\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 45, x = \{rock = 45, rock2 = 0\}, \{qux = 45, mux = 45\}, boulder = 45\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}\r\n$gdb_prompt $" {
+ pass "print foo 5"
+ }
+ -re ".*$gdb_prompt $" { fail "print foo 5" }
+ timeout { fail "(timeout) print foo 5" }
+}
+
+# Modify another member at a different level
+send_gdb "set var foo.qux = 46\n"
+gdb_expect {
+ -re "\r\n$gdb_prompt $" {
+ pass "set var foo.qux"
+ }
+ timeout { fail "(timeout) set var foo.qux" }
+}
+
+# Now print out anon union again to see if the right member was set
+send_gdb "print foo\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 46, x = \{rock = 46, rock2 = 0\}, \{qux = 46, mux = 46\}, boulder = 46\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}\r\n$gdb_prompt $" {
+ pass "print foo 6"
+ }
+ -re ".*$gdb_prompt $" { fail "print foo 6" }
+ timeout { fail "(timeout) print foo 6" }
+}
+
+# Modify the member at another level, but not the first one in the union
+send_gdb "set var foo.mux = 47\n"
+gdb_expect {
+ -re "\r\n$gdb_prompt $" {
+ pass "set var foo.mux"
+ }
+ timeout { fail "(timeout) set var foo.mux" }
+}
+
+# Now print out anon union again to see if things worked
+send_gdb "print foo\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 47, x = \{rock = 47, rock2 = 0\}, \{qux = 47, mux = 47\}, boulder = 47\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}\r\n$gdb_prompt $" {
+ pass "print foo 7"
+ }
+ -re ".*$gdb_prompt $" { fail "print foo 7" }
+ timeout { fail "(timeout) print foo 7" }
+}
+
+# Modify a member of a struct in an anon union
+send_gdb "set var foo.x.rock = 48\n"
+gdb_expect {
+ -re "\r\n$gdb_prompt $" {
+ pass "set var foo.x.rock"
+ }
+ timeout { fail "(timeout) set var foo.x.rock" }
+}
+
+# Now print out anon union again to see if things worked
+send_gdb "print foo\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 48, x = \{rock = 48, rock2 = 0\}, \{qux = 48, mux = 48\}, boulder = 48\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}\r\n$gdb_prompt $" {
+ pass "print foo 8"
+ }
+ -re ".*$gdb_prompt $" { fail "print foo 8" }
+ timeout { fail "(timeout) print foo 8" }
+}
+
+# Modify a member of a struct in an anon union, but something
+# that doesn't alias to some other union member
+send_gdb "set var foo.x.rock2 = 49\n"
+gdb_expect {
+ -re "\r\n$gdb_prompt $" {
+ pass "set var foo.x.rock2"
+ }
+ timeout { fail "(timeout) set var foo.x.rock2" }
+}
+
+# Now print out anon union again to see if things worked
+send_gdb "print foo\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{num1 = \{zero = 0, one = 0\}, \{pebble = 48, x = \{rock = 48, rock2 = 49\}, \{qux = 48, mux = 48\}, boulder = 48\}, \{paper = 35, cloth = 35\}, num2 = \{two = 0, three = 0\}\}\r\n$gdb_prompt $" {
+ pass "print foo 9"
+ }
+ -re ".*$gdb_prompt $" { fail "print foo 9" }
+ timeout { fail "(timeout) print foo 9" }
+}
+
+
+# Step over next four assignments
+send_gdb "next 4\n"
+gdb_expect {
+ -re "53\[ \t\]*w = 45;\r\n$gdb_prompt $" {
+ pass "next 3"
+ }
+ -re ".*$gdb_prompt $" { fail "next 3" }
+ timeout { fail "(timeout) next 3" }
+}
+
+# Tests for anon unions that are not members of a class or struct
+
+send_gdb "print w\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 0\r\n$gdb_prompt $" {
+ pass "print w 1"
+ }
+ -re ".*$gdb_prompt $" { fail "print w 1" }
+ timeout { fail "(timeout) print w 1" }
+}
+
+send_gdb "print z\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 0\r\n$gdb_prompt $" {
+ pass "print z 1"
+ }
+ -re ".*$gdb_prompt $" { fail "print z 1" }
+ timeout { fail "(timeout) print z 1" }
+}
+
+# Step over next assignment to w
+send_gdb "next\n"
+gdb_expect {
+ -re "55\[ \t\]*\}\r\n$gdb_prompt $" {
+ pass "next 4"
+ }
+ -re ".*$gdb_prompt $" { fail "next 4" }
+ timeout { fail "(timeout) next 4" }
+}
+
+# See if the change in value is noticed
+send_gdb "print w\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 45\r\n$gdb_prompt $" {
+ pass "print w 2"
+ }
+ -re ".*$gdb_prompt $" { fail "print w 2" }
+ timeout { fail "(timeout) print w 2" }
+}
+
+# See if z shows the same value
+send_gdb "print z\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 45\r\n$gdb_prompt $" {
+ pass "print z 2"
+ }
+ -re ".*$gdb_prompt $" { fail "print z 2" }
+ timeout { fail "(timeout) print z 2" }
+}
+
+# Set the anon union member
+send_gdb "set var z = 27\n"
+gdb_expect {
+ -re "\r\n$gdb_prompt $" {
+ pass "set var z"
+ }
+ timeout { fail "(timeout) set var z" }
+}
+
+# See if the change in value is noticed
+send_gdb "print w\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 27\r\n$gdb_prompt $" {
+ pass "print w 3"
+ }
+ -re ".*$gdb_prompt $" { fail "print w 3" }
+ timeout { fail "(timeout) print w 3" }
+}
+
+# See if z shows the same value
+send_gdb "print z\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 27\r\n$gdb_prompt $" {
+ pass "print z 3"
+ }
+ -re ".*$gdb_prompt $" { fail "print z 3" }
+ timeout { fail "(timeout) print z 3" }
+}
diff --git a/gdb/testsuite/gdb.c++/classes.exp b/gdb/testsuite/gdb.c++/classes.exp
new file mode 100644
index 00000000000..dbdea5d69c6
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/classes.exp
@@ -0,0 +1,929 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+set ws "\[\r\n\t \]+"
+set nl "\[\r\n\]+"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "misc"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+#
+# Test ptype of class objects.
+#
+
+proc test_ptype_class_objects {} {
+ global gdb_prompt
+ global ws
+ global nl
+
+ # Note that struct members are public by default, so we don't print
+ # "public:" for the public members of structs.
+ # Accept it as an expected failure if gdb just fails to distinguish between
+ # class and struct, and everything else is OK.
+
+ send_gdb "ptype struct default_public_struct\n"
+ gdb_expect {
+ -re "type = struct default_public_struct \{${ws}int a;${ws}int b;$nl\}$nl$gdb_prompt $" {
+ pass "ptype struct default_public_struct"
+ }
+ -re "type = class default_public_struct \{$nl.*int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype struct default_public_struct"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype struct default_public_struct" }
+ timeout { fail "ptype struct default_public_struct (timeout)" ; return }
+ }
+
+ # Note that struct members are public by default, so we don't print
+ # "public:" for the public members of structs.
+ # Accept it as an expected failure if gdb just fails to distinguish between
+ # class and struct, and everything else is OK.
+
+ send_gdb "ptype struct explicit_public_struct\n"
+ gdb_expect {
+ -re "type = struct explicit_public_struct \{${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype struct explicit_public_struct"
+ }
+ -re "type = class explicit_public_struct \{$nl.*int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype struct explicit_public_struct"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype struct explicit_public_struct" }
+ timeout { fail "ptype struct explicit_public_struct (timeout)" ; return }
+ }
+
+ # Accept it as an expected failure if gdb just fails to distinguish between
+ # class and struct, and everything else is OK.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype struct protected_struct\n"
+ gdb_expect {
+ -re "type = struct protected_struct \{${ws}protected:${ws}int a;${ws}int b;$nl\}$nl$gdb_prompt $" {
+ pass "ptype struct protected_struct (FIXME)"
+ }
+ -re "type = class protected_struct \{${ws}protected:${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype struct protected_struct (FIXME)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype struct protected_struct" }
+ timeout { fail "ptype struct protected_struct (timeout)" ; return }
+ }
+
+ # Accept it as an expected failure if gdb just fails to distinguish between
+ # class and struct, and everything else is OK.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype struct private_struct\n"
+ gdb_expect {
+ -re "type = struct private_struct \{${ws}private:${ws}int a;${ws}int b;$nl\}$nl$gdb_prompt $" {
+ pass "ptype struct private_struct (FIXME)"
+ }
+ -re "type = class private_struct \{${ws}private:${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype struct private_struct (FIXME)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype struct private_struct" }
+ timeout { fail "ptype struct private_struct (timeout)" ; return }
+ }
+
+ # Accept it as an expected failure if gdb just fails to distinguish between
+ # class and struct, and everything else is OK.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype struct mixed_protection_struct\n"
+ gdb_expect {
+ -re "type = struct mixed_protection_struct \{${ws}int a;${ws}int b;${ws}private:${ws}int c;${ws}int d;${ws}protected:${ws}int e;${ws}int f;${ws}public:${ws}int g;${ws}private:${ws}int h;${ws}protected:${ws}int i;$nl\}$nl$gdb_prompt $" {
+ pass "ptype struct mixed_protection_struct (FIXME)"
+ }
+ -re "type = struct mixed_protection_struct \{${ws}public:${ws}int a;${ws}int b;${ws}private:${ws}int c;${ws}int d;${ws}protected:${ws}int e;${ws}int f;${ws}public:${ws}int g;${ws}private:${ws}int h;${ws}protected:${ws}int i;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype struct mixed_protection_struct (extra public)"
+ }
+ -re "type = class mixed_protection_struct \{${ws}public:${ws}int a;${ws}int b;${ws}private:${ws}int c;${ws}int d;${ws}protected:${ws}int e;${ws}int f;${ws}public:${ws}int g;${ws}private:${ws}int h;${ws}protected:${ws}int i;$nl.*\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype struct mixed_protection_struct (FIXME)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype struct mixed_protection_struct" }
+ timeout { fail "ptype struct mixed_protection_struct (timeout)" ; return }
+ }
+
+ # Accept it as an expected failure if gdb just fails to distinguish between
+ # class and struct, and everything else is OK.
+
+ send_gdb "ptype class public_class\n"
+ gdb_expect {
+ -re "type = class public_class \{${ws}public:${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class public_class (FIXME)"
+ }
+ -re "type = struct public_class \{${ws}int a;${ws}int b;$nl\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class public_class (FIXME)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class public_class" }
+ timeout { fail "ptype class public_class (timeout)" ; return }
+ }
+
+ send_gdb "ptype class protected_class\n"
+ gdb_expect {
+ -re "type = class protected_class \{${ws}protected:${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class protected_class"
+ }
+ -re "type = struct protected_class \{${ws}int a;${ws}int b;$nl\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class protected_class"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class protected_class" }
+ timeout { fail "ptype class protected_class (timeout)" ; return }
+ }
+
+ # Accept it as an expected failure if gdb just emits a superflous "private:"
+ # attribute, since classes default to private and for consistency with
+ # structs (where we don't print the "public:" attribute) we don't print
+ # the "private:" attribute.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class default_private_class\n"
+ gdb_expect {
+ -re "type = class default_private_class \{${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class default_private_class (FIXME)"
+ }
+ -re "type = class default_private_class \{${ws}private:${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class default_private_class (FIXME)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class default_private_class" }
+ timeout { fail "ptype class default_private_class (timeout)" ; return }
+ }
+
+ send_gdb "ptype class explicit_private_class\n"
+ gdb_expect {
+ -re "type = class explicit_private_class \{${ws}private:${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class explicit_private_class"
+ }
+ -re "type = class explicit_private_class \{${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class explicit_private_class (OK for HP aCC)"
+ }
+ -re "type = struct explicit_private_class \{${ws}int a;${ws}int b;$nl.*\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class explicit_private_class"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class explicit_private_class" }
+ timeout { fail "ptype class explicit_private_class (timeout)" ; return }
+ }
+
+ send_gdb "ptype class mixed_protection_class\n"
+ gdb_expect {
+ -re "type = class mixed_protection_class \{${ws}public:${ws}int a;${ws}int b;${ws}private:${ws}int c;${ws}int d;${ws}protected:${ws}int e;${ws}int f;${ws}public:${ws}int g;${ws}private:${ws}int h;${ws}protected:${ws}int i;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class mixed_protection_class"
+ }
+ -re "type = struct mixed_protection_class \{${ws}int a;${ws}int b;${ws}int c;${ws}int d;${ws}int e;${ws}int f;${ws}int g;${ws}int h;${ws}int i;$nl.*\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class mixed_protection_class"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class mixed_protection_class" }
+ timeout { fail "ptype class mixed_protection_class (timeout)" ; return }
+ }
+
+ # This class does not use any C++-specific features, so it's fine for
+ # it to print as "struct".
+ send_gdb "ptype class A\n"
+ gdb_expect {
+ -re "type = (class|struct) A \{(${ws}public:|)${ws}int a;${ws}int x;((${ws}A & operator=\\(A const ?&\\);)|(${ws}A\\((A const|const A) ?&\\);)|(${ws}A\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class A"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class A"
+ }
+ timeout {
+ fail "ptype class A (timeout)"
+ return
+ }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class B\n"
+ gdb_expect {
+ -re "type = class B : public A \{${ws}public:${ws}int b;${ws}int x;${ws}B & operator=\\(B const ?&\\);${ws}B\\((B const|const B) ?&\\);${ws}B\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class B"
+ }
+ -re "type = class B : public A \{${ws}public:${ws}int b;${ws}int x;((${ws}B & operator=\\(B const ?&\\);)|(${ws}B\\(B const ?&\\);)|(${ws}B\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class B (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class B"
+ }
+ timeout {
+ fail "ptype class B (timeout)"
+ return
+ }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class C\n"
+ gdb_expect {
+ -re "type = class C : public A \{${ws}public:${ws}int c;${ws}int x;${ws}C & operator=\\(C const ?&\\);${ws}C\\((C const|const C) ?&\\);${ws}C\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class C"
+ }
+ -re "type = class C : public A \{${ws}public:${ws}int c;${ws}int x;((${ws}C & operator=\\(C const ?&\\);)|(${ws}C\\(C const ?&\\);)|(${ws}C\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class C (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class C"
+ }
+ timeout {
+ fail "ptype class C (timeout)"
+ return
+ }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class D\n"
+ gdb_expect {
+ -re "type = class D : public B, public C \{${ws}public:${ws}int d;${ws}int x;${ws}D & operator=\\(D const ?&\\);${ws}D\\((D const|const D) ?&\\);${ws}D\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class D"
+ }
+ -re "type = class D : public B, public C \{${ws}public:${ws}int d;${ws}int x;((${ws}D & operator=\\(D const ?&\\);)|(${ws}D\\(D const ?&\\);)|(${ws}D\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class D (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class D"
+ }
+ timeout {
+ fail "ptype class D (timeout)"
+ return
+ }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class E\n"
+ gdb_expect {
+ -re "type = class E : public D \{${ws}public:${ws}int e;${ws}int x;${ws}E & operator=\\(E const ?&\\);${ws}E\\((E const|const E) ?&\\);${ws}E\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class E"
+ }
+ -re "type = class E : public D \{${ws}public:${ws}int e;${ws}int x;((${ws}E & operator=\\(E const ?&\\);)|(${ws}E\\((E const|const E) ?&\\);)|(${ws}E\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class E"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class E"
+ }
+ timeout {
+ fail "ptype class E (timeout)"
+ return
+ }
+ }
+
+ # With g++ 2.x and stabs debug info, we misinterpret static methods
+ # whose name matches their argument mangling.
+ send_gdb "ptype class Static\n"
+ gdb_expect {
+ -re "type = (class|struct) Static \{(${ws}public:|)${ws}Static & operator=\\(Static const ?&\\);${ws}Static\\((Static const|const Static) ?&\\);${ws}Static\\((void|)\\);${ws}static void ii\\(int, int\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class Static"
+ }
+ -re "type = (class|struct) Static \{(${ws}public:|)${ws}static void ii\\(int, int\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class Static"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class Static"
+ }
+ timeout {
+ fail "ptype class Static (timeout)"
+ return
+ }
+ }
+
+ send_gdb "ptype class vA\n"
+ gdb_expect {
+ -re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vA"
+ }
+ -re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;${ws}vA & operator=\\(vA const ?&\\);${ws}vA\\((vA const|const vA) ?&\\);${ws}vA\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vA"
+ }
+ -re "type = (class|struct) vA \{(${ws}public:|)${ws}int va;${ws}int vx;((${ws}vA & operator=\\(vA const ?&\\);)|(${ws}vA\\(vA const ?&\\);)|(${ws}vA\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vA (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class vA"
+ }
+ timeout {
+ fail "ptype class vA (timeout)"
+ return
+ }
+ }
+
+ # Accept the form with embedded GNU style mangled virtual table constructs
+ # for now, but with a FIXME. At some future point, gdb should use a
+ # portable representation for the virtual table constructs.
+
+ # The format of a g++ virtual base pointer.
+ set vbptr "(_vb\[$.\]|__vb_)\[0-9\]?"
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class vB\n"
+ gdb_expect {
+ -re "type = class vB : public virtual vA \{${ws}public:${ws}int vb;${ws}int vx;${ws}vB & operator=\\(vB const ?&\\);${ws}vB\\((vB const|const vB) ?&\\);${ws}vB\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vB"
+ }
+ -re "type = class vB : public virtual vA \{${ws}private:${ws}vA \\*${vbptr}vA;${ws}public:${ws}int vb;${ws}int vx;${ws}vB & operator=\\(vB const ?&\\);${ws}vB\\(int, vB const ?&\\);${ws}vB\\(int\\);${ws}\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class vB (FIXME: non-portable virtual table constructs)"
+ }
+ -re "type = class vB : public virtual vA \{${ws}public:${ws}int vb;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vB"
+ }
+ -re "type = class vB : public virtual vA \{${ws}private:${ws}vA \\*_vb.vA;${ws}public:${ws}int vb;${ws}int vx;((${ws}vB & operator=\\(vB const ?&\\);)|(${ws}vB\\(int, vB const ?&\\);)|(${ws}vB\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class vB (FIXME) (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class vB"
+ }
+ timeout {
+ fail "ptype class vB (timeout)"
+ return
+ }
+ }
+
+ # Accept the form with embedded GNU style mangled virtual table constructs
+ # for now, but with a FIXME. At some future point, gdb should use a
+ # portable representation for the virtual table constructs.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class vC\n"
+ gdb_expect {
+ -re "type = class vC : public virtual vA \{${ws}public:${ws}int vc;${ws}int vx;${ws}vC & operator=\\(vC const ?&\\);${ws}vC\\((vC const|const vC) ?&\\);${ws}vC\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vC"
+ }
+ -re "type = class vC : public virtual vA \{${ws}private:${ws}vA \\*${vbptr}vA;${ws}public:${ws}int vc;${ws}int vx;${ws}vC & operator=\\(vC const ?&\\);${ws}vC\\(int, vC const ?&\\);${ws}vC\\(int\\);${ws}\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class vC (FIXME: non-portable virtual table constructs)"
+ }
+ -re "type = class vC : public virtual vA \{${ws}public:${ws}int vc;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vC"
+ }
+ -re "type = class vC : public virtual vA \{${ws}private:${ws}vA \\*_vb.vA;${ws}public:${ws}int vc;${ws}int vx;((${ws}vC & operator=\\(vC const ?&\\);)|(${ws}vC\\(int, vC const ?&\\);)|(${ws}vC\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class vC (FIXME) (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class vC"
+ }
+ timeout {
+ fail "ptype class vC (timeout)"
+ return
+ }
+ }
+
+ # Accept the form with embedded GNU style mangled virtual table constructs
+ # for now, but with a FIXME. At some future point, gdb should use a
+ # portable representation for the virtual table constructs.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class vD\n"
+ gdb_expect {
+ -re "type = class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;${ws}vD & operator=\\(vD const ?&\\);${ws}vD\\((vD const|const vD) ?&\\);${ws}vD\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vD"
+ }
+ -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \\*${vbptr}vC;${ws}vB \\*${vbptr}vB;${ws}public:${ws}int vd;${ws}int vx;${ws}vD & operator=\\(vD const ?&\\);${ws}vD\\(int, vD const ?&\\);${ws}vD\\(int\\);${ws}\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class vD (FIXME: non-portable virtual table constructs)"
+ }
+ -re "type = class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vD"
+ }
+ -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \\*_vb.vC;${ws}vB \\*_vb.vB;${ws}public:${ws}int vd;${ws}int vx;((${ws}vD & operator=\\(vD const ?&\\);)|(${ws}vD\\(int, vD const ?&\\);)|(${ws}vD\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class vD (FIXME) (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class vD"
+ }
+ timeout {
+ fail "ptype class vD (timeout)"
+ return
+ }
+ }
+
+ # Accept the form with embedded GNU style mangled virtual table constructs
+ # for now, but with a FIXME. At some future point, gdb should use a
+ # portable representation for the virtual table constructs.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class vE\n"
+ gdb_expect {
+ -re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;${ws}vE & operator=\\(vE const ?&\\);${ws}vE\\((vE const|const vE) ?&\\);${ws}vE\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vE"
+ }
+ -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \\*${vbptr}vD;${ws}public:${ws}int ve;${ws}int vx;${ws}vE & operator=\\(vE const ?&\\);${ws}vE\\(int, vE const ?&\\);${ws}vE\\(int\\);${ws}\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class vE (FIXME: non-portable virtual table constructs)"
+ }
+ -re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class vE"
+ }
+ -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \\*_vb.vD;${ws}public:${ws}int ve;${ws}int vx;((${ws}vE & operator=\\(vE const ?&\\);)|(${ws}vE\\(int, vE const ?&\\);)|(${ws}vE\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype class vE (FIXME) (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class vE"
+ }
+ timeout {
+ fail "ptype class vE (timeout)"
+ return
+ }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class Base1\n"
+ gdb_expect {
+ -re "type = class Base1 \{${ws}public:${ws}int x;${ws}Base1 & operator=\\(Base1 const ?&\\);${ws}Base1\\(((Base1 const)|(const Base1)) ?&\\);${ws}Base1\\(int\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class Base1"
+ }
+ -re "type = class Base1 \{${ws}public:${ws}int x;${ws}Base1\\(int\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class Base1"
+ }
+ -re "type = class Base1 \{${ws}public:${ws}int x;((${ws}Base1 & operator=\\(Base1 const ?&\\);)|(${ws}Base1\\(Base1 const ?&\\);)|(${ws}Base1\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class Base1 (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class Base1"
+ }
+ timeout {
+ fail "ptype class Base1 (timeout)"
+ return
+ }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class Foo\n"
+ gdb_expect {
+ -re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;\r\n${ws}Foo\\(int, int\\);${ws}int operator!\\((void|)\\);${ws}operator int\\((void|)\\);${ws}int times\\(int\\);$nl\}$nl$gdb_prompt $" {
+ pass "ptype class Foo"
+ }
+ -re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;${ws}Foo & operator=\\(Foo const ?&\\);${ws}Foo\\((Foo const|const Foo) ?&\\);${ws}Foo\\(int, int\\);${ws}int operator!\\((void|)\\);${ws}operator int\\((void|)\\);${ws}int times\\(int\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class Foo"
+ }
+ -re "type = class Foo \{${ws}public:${ws}int x;${ws}int y;${ws}static int st;((${ws}Foo & operator=\\(Foo const ?&\\);)|(${ws}Foo\\(Foo const ?&\\);)|(${ws}Foo\\(int, int\\);)|(${ws}int operator!\\((void|)\\);)|(${ws}int operator int\\((void|)\\);)|(${ws}int times\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class Foo (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class Foo"
+ }
+ timeout {
+ fail "ptype class Foo (timeout)"
+ return
+ }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class Bar\n"
+ gdb_expect {
+ -re "type = class Bar : public Base1, public Foo \{${ws}public:${ws}int z;${ws}Bar & operator=\\(Bar const ?&\\);${ws}Bar\\((Bar const|const Bar) ?&\\);${ws}Bar\\(int, int, int\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class Bar"
+ }
+ -re "type = class Bar : public Base1, public Foo \{${ws}public:${ws}int z;((${ws}Bar & operator=\\(Bar const ?&\\);)|(${ws}Bar\\(Bar const ?&\\);)|(${ws}Bar\\(int, int, int\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype class Bar (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype class Bar"
+ }
+ timeout {
+ fail "ptype class Bar (timeout)"
+ return
+ }
+ }
+}
+
+#
+# Test simple access to class members.
+#
+
+proc test_non_inherited_member_access {} {
+ global gdb_prompt
+
+ # Print non-inherited members of g_A.
+
+ gdb_test "print g_A.a" ".* = 1" "g_A.a incorrect"
+
+ gdb_test "print g_A.x" ".* = 2" "g_A.x incorrect"
+
+ # Print non-inherited members of g_B.
+
+ gdb_test "print g_B.b" ".* = 5" "g_B.b incorrect"
+
+ gdb_test "print g_B.x" ".* = 6" "g_B.x incorrect"
+
+ # Print non-inherited members of g_C.
+
+ gdb_test "print g_C.c" ".* = 9" "g_C.c incorrect"
+
+ gdb_test "print g_C.x" ".* = 10" "g_C.x incorrect"
+
+ # Print non-inherited members of g_D.
+
+ gdb_test "print g_D.d" ".* = 19" "g_D.d incorrect"
+
+ gdb_test "print g_D.x" ".* = 20" "g_D.x incorrect"
+
+ # Print non-inherited members of g_E.
+
+ gdb_test "print g_E.e" ".* = 31" "g_E.e incorrect"
+
+ gdb_test "print g_E.x" ".* = 32" "g_E.x incorrect"
+}
+
+#
+# Try access to non-members that are members of another class.
+# Should give errors.
+#
+
+proc test_wrong_class_members {} {
+ global gdb_prompt
+
+ gdb_test "print g_A.b" "There is no member( or method|) named b." "print g_A.b should be error"
+
+ gdb_test "print g_B.c" "There is no member( or method|) named c." "print g_B.c should be error"
+
+ gdb_test "print g_B.d" "There is no member( or method|) named d." "print g_B.d should be error"
+
+ gdb_test "print g_C.b" "There is no member( or method|) named b." "print g_C.b should be error"
+
+ gdb_test "print g_C.d" "There is no member( or method|) named d." "print g_C.d should be error"
+
+ gdb_test "print g_D.e" "There is no member( or method|) named e." "print g_D.e should be error"
+}
+
+#
+# Try access to non-members that are not members of any class.
+# Should give errors.
+#
+
+proc test_nonexistent_members {} {
+ global gdb_prompt
+
+ gdb_test "print g_A.y" "There is no member( or method|) named y." "print g_A.y should be error"
+
+ gdb_test "print g_B.z" "There is no member( or method|) named z." "print g_B.z should be error"
+
+ gdb_test "print g_C.q" "There is no member( or method|) named q." "print g_C.q should be error"
+
+ gdb_test "print g_D.p" "There is no member( or method|) named p." "print g_D.p should be error"
+}
+
+#
+# Call a method that expects a base class parameter with base, inherited,
+# and unrelated class arguments.
+#
+
+proc test_method_param_class {} {
+ gdb_test "call class_param.Aptr_a (&g_A)" ".* = 1" "base class param->a"
+ gdb_test "call class_param.Aptr_x (&g_A)" ".* = 2" "base class param->x"
+ gdb_test "call class_param.Aptr_a (&g_B)" ".* = 3" "inherited class param->a"
+ gdb_test "call class_param.Aptr_x (&g_B)" ".* = 4" "inherited class param->x"
+ gdb_test "call class_param.Aref_a (g_A)" ".* = 1" "base class (&param)->a"
+ gdb_test "call class_param.Aref_x (g_A)" ".* = 2" "base class (&param)->x"
+ gdb_test "call class_param.Aref_a (g_B)" ".* = 3" "inherited class (&param)->a"
+ gdb_test "call class_param.Aref_x (g_B)" ".* = 4" "inherited class (&param)->x"
+ gdb_test "call class_param.Aval_a (g_A)" ".* = 1" "base class param.a"
+ gdb_test "call class_param.Aval_x (g_A)" ".* = 2" "base class param.x"
+ gdb_test "call class_param.Aval_a (g_B)" ".* = 3" "inherited class param.a"
+ gdb_test "call class_param.Aval_x (g_B)" ".* = 4" "inherited class param.x"
+
+ gdb_test "call class_param.Aptr_a (&foo)" "Cannot resolve .*" "unrelated class *param"
+ gdb_test "call class_param.Aref_a (foo)" "Cannot resolve .*" "unrelated class &param"
+ gdb_test "call class_param.Aval_a (foo)" "Cannot resolve .*" "unrelated class param"
+}
+
+#
+# Examine a class with an enum field.
+#
+
+proc test_enums {} {
+ global gdb_prompt
+ global hp_aCC_compiler
+
+ # print the object
+ send_gdb "print obj_with_enum\n"
+ gdb_expect {
+ -re "\\$\[0-9\]* = \\{priv_enum = red, x = 0\\}.*$gdb_prompt $" { pass "print obj_with_enum (1)" }
+ -re "$gdb_prompt $" { fail "print obj_with_enum (1)" }
+ timeout { fail "(timeout) print obj_with_enum (1)" }
+ }
+
+ send_gdb "next\n"
+ gdb_expect {
+ -re "$gdb_prompt $" { pass "next" }
+ timeout { fail "(timeout) next" }
+ }
+
+ # print the object again
+ send_gdb "print obj_with_enum\n"
+ gdb_expect {
+ -re "\\$\[0-9\]* = \\{priv_enum = green, x = 0\\}.*$gdb_prompt $" { pass "print obj_with_enum (2)" }
+ -re "$gdb_prompt $" { fail "print obj_with_enum (2)" }
+ timeout { fail "(timeout) print obj_with_enum (2)" }
+ }
+
+ # print out the enum member
+ send_gdb "print obj_with_enum.priv_enum\n"
+ gdb_expect {
+ -re "\\$\[0-9\]* = green.*$gdb_prompt $" { pass "print obj_with_enum.priv_enum" }
+ -re "$gdb_prompt $" { fail "print obj_with_enum.priv_enum" }
+ timeout { fail "(timeout) print obj_with_enum.priv_enum" }
+ }
+
+ # ptype on the enum member
+ # The third success case is a little dubious, but it's not clear what
+ # ought to be required of a ptype on a private enum... -sts 19990324
+ send_gdb "ptype obj_with_enum.priv_enum\n"
+ gdb_expect {
+ -re "type = enum ClassWithEnum::PrivEnum \\{red, green, blue, yellow = 42\\}.*$gdb_prompt $" { pass "ptype obj_with_enum.priv_enum" }
+ -re "type = enum PrivEnum \\{red, green, blue, yellow = 42\\}.*$gdb_prompt $" { pass "ptype obj_with_enum.priv_enum" }
+ -re "type = enum \\{red, green, blue, yellow = 42\\}.*$gdb_prompt $" { pass "ptype obj_with_enum.priv_enum" }
+ -re "$gdb_prompt $" { fail "ptype obj_with_enum.priv_enum" }
+ timeout { fail "(timeout) ptype obj_with_enum.priv_enum" }
+ }
+
+ # ptype on the object
+ # g++ is putting out the wrong debug info. This works with aCC
+ if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
+ send_gdb "ptype obj_with_enum\n"
+ gdb_expect {
+ -re "type = class ClassWithEnum \\{\r\n\[ \t\]*public:\r\n\[ \t\]*(enum |)ClassWithEnum::PrivEnum priv_enum;\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { pass "ptype obj_with_enum" }
+ -re "$gdb_prompt $" { fail "ptype obj_with_enum" }
+ timeout { fail "(timeout) ptype obj_with_enum" }
+ }
+
+ # g++ is putting out the wrong debug info. This works with aCC
+ if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
+ send_gdb "print (ClassWithEnum::PrivEnum) 42\n"
+ gdb_expect {
+ -re "\\$\[0-9\]* = yellow.*$gdb_prompt $" { pass "print (ClassWithEnum::PrivEnum) 42" }
+ -re "$gdb_prompt $" { fail "print (ClassWithEnum::PrivEnum) 42" }
+ timeout { fail "(timeout) print (ClassWithEnum::PrivEnum) 42" }
+ }
+}
+
+#
+# Pointers to class members
+#
+
+proc test_pointers_to_class_members {} {
+ global gdb_prompt
+ global decimal
+ global nl
+
+ gdb_test "print Bar::z" ".* = .int\[ \]*\[( \]*Bar::&\[)\]+\[ \]*Bar::z" "print Bar::z"
+
+ gdb_test "print &Foo::x" ".* = .int\[ \]*\[( \]*Foo::\[*)\]+\[ \]*&Foo::x" "print &Foo::x"
+
+ gdb_test "print (int)&Foo::x" ".* = 0" "print (int)&Foo::x"
+
+ send_gdb "print (int)&Bar::y == 2*sizeof(int)\n"
+ gdb_expect {
+ -re ".* = true$nl$gdb_prompt $" {
+ pass "print (int)&Bar::y == 2*sizeof(int)"
+ }
+ -re "There is no field named y.*$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "print (int)&Bar::y == 2*sizeof(int)"
+ }
+ -re ".*$gdb_prompt $" { fail "print (int)&Bar::y == 2*sizeof(int)" }
+ timeout { fail "print (int)&Bar::y == 2*sizeof(int) (timeout)" ; return }
+ }
+
+ send_gdb "next 2\n"
+ setup_xfail "*-*-*"
+ gdb_expect {
+ -re "$decimal\[ \t\]+inheritance3 \[)(\]+;$nl$gdb_prompt $" {}
+ -re ".*$gdb_prompt $" { fail "next to inheritance3" ; return }
+ }
+ clear_xfail "*-*-*"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print (int)pmi == sizeof(int)" ".* = false" "print (int)pmi == sizeof(int)"
+}
+
+#
+# Test static members.
+#
+
+proc test_static_members {} {
+ global gdb_prompt
+ global hex
+ global nl
+
+ send_gdb "print Foo::st\n"
+ gdb_expect {
+ -re ".* = 100$nl$gdb_prompt $" {
+ pass "print Foo::st"
+ }
+ -re "There is no field named st.*$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "print Foo::st"
+ }
+ -re ".*$gdb_prompt $" { fail "print Foo::st" }
+ timeout { fail "print Foo::st (timeout)" ; return }
+ }
+
+ send_gdb "set foo.st = 200\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ }
+
+ send_gdb "print bar.st\n"
+ gdb_expect {
+ -re ".* = 200$nl$gdb_prompt $" {
+ pass "print bar.st"
+ }
+ -re "There is no member( or method|) named st.*$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "print bar.st"
+ }
+ -re ".*$gdb_prompt $" { fail "print bar.st" }
+ timeout { fail "print bar.st (timeout)" ; return }
+ }
+
+ send_gdb "print &foo.st\n"
+ gdb_expect {
+ -re ".* = .int \[*)\]+ $hex$nl$gdb_prompt $" {
+ pass "print &foo.st"
+ }
+ -re "There is no member( or method|) named st.*$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "print &foo.st"
+ }
+ -re ".*$gdb_prompt $" { fail "print &foo.st" }
+ timeout { fail "print &foo.st (timeout)" ; return }
+ }
+
+ set got_bar_st 0
+ send_gdb "print &Bar::st\n"
+ gdb_expect {
+ -re ".* = .int \[*)\]+ $hex$nl$gdb_prompt $" {
+ pass "print &Bar::st"
+ set got_bar_st 1
+ }
+ -re "There is no field named st.*$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "print &Bar::st"
+ }
+ -re ".*$gdb_prompt $" { fail "print &Bar::st" }
+ timeout { fail "print &Bar::st (timeout)" ; return }
+ }
+
+ if $got_bar_st then {
+ gdb_test "print *\$" ".* = 200" "print *\$"
+ }
+
+ gdb_test "set print static-members off" ""
+ gdb_test "print csi" \
+ "{x = 10, y = 20}" \
+ "print csi without static members"
+ gdb_test "print cnsi" \
+ "{x = 30, y = 40}" \
+ "print cnsi without static members"
+
+ gdb_test "set print static-members on" ""
+ setup_xfail_format "DWARF 1"
+ gdb_test "print csi" \
+ "{x = 10, y = 20, static null = {x = 0, y = 0, static null = <same as static member of an already seen type>}}" \
+ "print csi with static members"
+ setup_xfail_format "DWARF 1"
+ gdb_test "print cnsi" \
+ "{x = 30, y = 40, static null = {x = 0, y = 0, static null = <same as static member of an already seen type>, static yy = {z = 5, static xx = {x = 1, y = 2, static null = <same as static member of an already seen type>, static yy = <same as static member of an already seen type>}}}, static yy = <same as static member of an already seen type>}" \
+ "print cnsi with static members"
+}
+
+proc do_tests {} {
+ global prms_id
+ global bug_id
+ global subdir
+ global objdir
+ global srcdir
+ global binfile
+ global gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ send_gdb "set language c++\n"
+ gdb_expect -re "$gdb_prompt $"
+ send_gdb "set width 0\n"
+ gdb_expect -re "$gdb_prompt $"
+
+ # Get the debug format for the compiled test case.
+
+ if [ runto_main ] then {
+ get_debug_format
+ }
+
+ test_ptype_class_objects
+
+ if [ runto 'inheritance2' ] then {
+ test_non_inherited_member_access
+ test_wrong_class_members
+ test_nonexistent_members
+ test_method_param_class
+ }
+
+ gdb_breakpoint enums2
+ if [ gdb_continue "enums2(\\(\\)|)" ]==0 then {
+ gdb_test "finish" "" ""
+ test_enums
+ }
+
+ if [istarget "mips-idt-*"] then {
+ # Restart because IDT/SIM runs out of file descriptors.
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+ }
+
+ if [ runto_main ] then {
+ test_pointers_to_class_members
+ test_static_members
+ }
+
+ if [istarget "mips-idt-*"] then {
+ # Restart because IDT/SIM runs out of file descriptors.
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+ }
+
+ if [ runto marker_reg1 ] then {
+
+ gdb_test "finish" "Run till exit from.*" "finish from marker_reg1"
+
+ send_gdb "print v.method ()\n"
+ gdb_expect {
+ -re "= 82.*$gdb_prompt $" {
+ pass "calling method for small class"
+ }
+ -re "Address requested for identifier .v. which is in register.*$gdb_prompt $" {
+ setup_xfail "*-*-*" 2972
+ fail "calling method for small class"
+ }
+ -re ".*$gdb_prompt $" { fail "calling method for small class" }
+ timeout { fail "calling method for small class (timeout)" }
+ eof { fail "calling method for small class (eof)" }
+ }
+ }
+
+}
+
+do_tests
+
+send_gdb "maint demangle inheritance1__Fv\n"
+gdb_expect {
+ -re "inheritance1\\(void\\).*$gdb_prompt $" { pass "demangle" }
+ -re ".*$gdb_prompt $" { fail "demangle" }
+ timeout { fail "(timeout) demangle" }
+}
diff --git a/gdb/testsuite/gdb.c++/configure b/gdb/testsuite/gdb.c++/configure
new file mode 100644
index 00000000000..6d0b517b4a6
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/configure
@@ -0,0 +1,899 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=cplusfuncs.cc
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:573: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:594: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:612: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.c++/configure.in b/gdb/testsuite/gdb.c++/configure.in
new file mode 100644
index 00000000000..f989cb82865
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(cplusfuncs.cc)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.c++/cplusfuncs.cc b/gdb/testsuite/gdb.c++/cplusfuncs.cc
new file mode 100644
index 00000000000..7f033d6d90c
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/cplusfuncs.cc
@@ -0,0 +1,196 @@
+#include <stddef.h>
+
+class foo {
+public:
+ foo (int);
+ foo (int, const char *);
+ foo (foo&);
+ ~foo ();
+
+ void operator * (foo&);
+ void operator % (foo&);
+ void operator - (foo&);
+ void operator >> (foo&);
+ void operator != (foo&);
+ void operator > (foo&);
+ void operator >= (foo&);
+ void operator | (foo&);
+ void operator && (foo&);
+ void operator ! (void);
+ void operator ++ (int);
+ void operator = (foo&);
+ void operator += (foo&);
+ void operator *= (foo&);
+ void operator %= (foo&);
+ void operator >>= (foo&);
+ void operator |= (foo&);
+ void operator , (foo&);
+ void operator / (foo&);
+ void operator + (foo&);
+ void operator << (foo&);
+ void operator == (foo&);
+ void operator < (foo&);
+ void operator <= (foo&);
+ void operator & (foo&);
+ void operator ^ (foo&);
+ void operator || (foo&);
+ void operator ~ (void);
+ void operator -- (int);
+ foo* operator -> (void);
+ void operator -= (foo&);
+ void operator /= (foo&);
+ void operator <<= (foo&);
+ void operator &= (foo&);
+ void operator ^= (foo&);
+ void operator ->* (foo&);
+ void operator [] (foo&);
+ void operator () (foo&);
+ void* operator new (size_t) throw ();
+ void operator delete (void *);
+ /**/ operator int ();
+ /**/ operator char* ();
+
+ int foofunc (int); // forced to have int return type, which is required
+ int foofunc (int, signed char *); // forced to have int return type, which is required
+ int ifoo;
+ const char *ccpfoo;
+};
+
+#ifdef usestubs
+extern "C" {
+ void set_debug_traps();
+ void breakpoint();
+};
+#endif
+
+int main () {
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ int z=3;
+}
+
+foo::foo (int i) { ifoo = i;}
+foo::foo (int i, const char *ccp) { ifoo = i; ccpfoo = ccp; }
+foo::foo (foo& afoo) { afoo.ifoo = 0; }
+foo::~foo () {}
+
+void foo::operator * (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator % (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator - (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator >> (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator != (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator > (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator >= (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator | (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator && (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator ! (void) {}
+void foo::operator ++ (int ival) { ival = 0; }
+void foo::operator = (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator += (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator *= (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator %= (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator >>= (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator |= (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator , (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator / (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator + (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator << (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator == (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator < (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator <= (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator & (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator ^ (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator || (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator ~ (void) {}
+void foo::operator -- (int ival) { ival = 0; }
+foo* foo::operator -> (void) {return this;}
+void foo::operator -= (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator /= (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator <<= (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator &= (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator ^= (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator ->* (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator [] (foo& afoo) { afoo.ifoo = 0; }
+void foo::operator () (foo& afoo) { afoo.ifoo = 0; }
+void* foo::operator new (size_t ival) throw () { ival = 0; return 0; }
+void foo::operator delete (void *ptr) { ptr = 0; }
+/**/ foo::operator int () { return 0; }
+/**/ foo::operator char* () { return 0; }
+
+/* Some functions to test overloading by varying one argument type. */
+
+void overload1arg (void) { }
+void overload1arg (char arg) { arg = 0; }
+void overload1arg (signed char arg) { arg = 0; }
+void overload1arg (unsigned char arg) { arg = 0; }
+void overload1arg (short arg) { arg = 0; }
+void overload1arg (unsigned short arg) { arg = 0; }
+void overload1arg (int arg) { arg = 0; }
+void overload1arg (unsigned int arg) { arg = 0; }
+void overload1arg (long arg) { arg = 0; }
+void overload1arg (unsigned long arg) { arg = 0; }
+void overload1arg (float arg) { arg = 0; }
+void overload1arg (double arg) { arg = 0; }
+
+/* Some functions to test overloading by varying argument count. */
+
+void overloadargs (int a1) { a1 = 0; }
+void overloadargs (int a1, int a2) { a1 = a2 = 0; }
+void overloadargs (int a1, int a2, int a3) { a1 = a2 = a3 = 0; }
+void overloadargs (int a1, int a2, int a3, int a4)
+ { a1 = a2 = a3 = a4 = 0; }
+void overloadargs (int a1, int a2, int a3, int a4, int a5)
+ { a1 = a2 = a3 = a4 = a5 = 0; }
+void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6)
+ { a1 = a2 = a3 = a4 = a5 = a6 = 0; }
+void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0; }
+void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0; }
+void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0; }
+void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
+ a10 = 0; }
+void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10, int a11)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
+ a10 = a11 == 0; }
+
+/* Some hairy function definitions.
+ Use typedefs to help maintain sanity. */
+
+typedef int (*PFPc_i)(char *);
+typedef short (*PFPl_s)(long *);
+typedef short (*PFPc_s)(char *);
+typedef int (*PFl_i)(long);
+typedef PFl_i (*PFPc_PFl_i)(char *);
+typedef PFl_i (*PFPi_PFl_i)(int *);
+typedef PFl_i (*PFPFPc_i_PFl_i)(PFPc_i);
+typedef PFl_i (*PFs_PFl_i)(short);
+typedef int (*PFPFPl_s_i)(PFPl_s);
+typedef int (*PFPFPc_s_i)(PFPc_s);
+
+PFs_PFl_i hairyfunc1 (int arg) { arg = 0; return 0; }
+int hairyfunc2 (PFPc_i arg) { arg = 0; return 0; }
+int hairyfunc3 (PFPFPl_s_i arg) { arg = 0; return 0; }
+int hairyfunc4 (PFPFPc_s_i arg) { arg = 0; return 0; }
+int hairyfunc5 (PFPc_PFl_i arg) { arg = 0; return 0; }
+int hairyfunc6 (PFPi_PFl_i arg) { arg = 0; return 0; }
+int hairyfunc7 (PFPFPc_i_PFl_i arg) { arg = 0; return 0; }
+
+/* gdb has two demanglers (one for g++ 2.95, one for g++ 3).
+ These marker functions help me figure out which demangler is in use. */
+
+char * dm_type_char_star (char * p) { return p; }
+int dm_type_foo_ref (foo & foo) { return foo.ifoo; }
+int * dm_type_int_star (int * p) { return p; }
+long * dm_type_long_star (long * p) { return p; }
+int dm_type_unsigned_int (unsigned int i) { return i; }
+int dm_type_void (void) { return 0; }
+void * dm_type_void_star (void * p) { return p; }
diff --git a/gdb/testsuite/gdb.c++/cplusfuncs.exp b/gdb/testsuite/gdb.c++/cplusfuncs.exp
new file mode 100644
index 00000000000..9057cc290fc
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/cplusfuncs.exp
@@ -0,0 +1,542 @@
+# Copyright 1992, 1997, 1999, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+# Adapted for g++ 3.0 ABI by Michael Chastain. (chastain@redhat.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "cplusfuncs"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [get_compiler_info $binfile "c++"] } {
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+#
+# g++ changed its ABI between 2.95 and 3.0. gdb has two demanglers
+# for the two different styles. The two demanglers have some subtle
+# discrepancies in their output.
+#
+# old demangler new demangler
+# --- --------- --- ---------
+# "operator, " "operator,"
+# "char *" "char*"
+# "int *" "int*"
+# "long *" "long*"
+# "void *" "void*"
+# "foo &" "foo&"
+# "unsigned int" "unsigned"
+# "void" ""
+#
+# I probe for the forms in use.
+# The defaults are for the v3 demangler (as of 2001-02-13).
+#
+
+set dm_operator_comma ","
+set dm_type_char_star "char*"
+set dm_type_char_star_quoted "char\\*"
+set dm_type_foo_ref "foo&"
+set dm_type_int_star "int*"
+set dm_type_long_star "long*"
+set dm_type_unsigned_int "unsigned"
+set dm_type_void ""
+set dm_type_void_star "void*"
+
+proc probe_demangler { } {
+ global gdb_prompt
+ global dm_operator_comma
+ global dm_type_char_star
+ global dm_type_char_star_quoted
+ global dm_type_foo_ref
+ global dm_type_int_star
+ global dm_type_long_star
+ global dm_type_unsigned_int
+ global dm_type_void
+ global dm_type_void_star
+
+ send_gdb "print &'foo::operator,(foo&)'\n"
+ gdb_expect {
+ -re ".*foo::operator, \\(.*foo.*&.*\\).*\r\n$gdb_prompt $" {
+ # v2 demangler
+ set dm_operator_comma ", "
+ pass "detect dm_operator_comma"
+ }
+ -re ".*foo::operator,\\(.*foo.*&.*\\).*\r\n$gdb_prompt $" {
+ # v3 demangler
+ pass "detect dm_operator_comma"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "detect dm_operator_comma"
+ }
+ timeout {
+ fail "detect dm_operator_comma"
+ }
+ }
+
+ send_gdb "print &'dm_type_char_star'\n"
+ gdb_expect {
+ -re ".*dm_type_char_star\\(char \\*\\).*\r\n$gdb_prompt $" {
+ # v2 demangler
+ set dm_type_char_star "char *"
+ set dm_type_char_star_quoted "char \\*"
+ pass "detect dm_type_char_star"
+ }
+ -re ".*dm_type_char_star\\(char\\*\\).*\r\n$gdb_prompt $" {
+ # v3 demangler
+ pass "detect dm_type_char_star"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "detect dm_type_char_star"
+ }
+ timeout {
+ fail "detect dm_type_char_star (timeout)"
+ }
+ }
+
+ send_gdb "print &'dm_type_foo_ref'\n"
+ gdb_expect {
+ -re ".*dm_type_foo_ref\\(foo &\\).*\r\n$gdb_prompt $" {
+ # v2 demangler
+ set dm_type_foo_ref "foo &"
+ pass "detect dm_type_foo_ref"
+ }
+ -re ".*dm_type_foo_ref\\(foo&\\).*\r\n$gdb_prompt $" {
+ # v3 demangler
+ pass "detect dm_type_foo_ref"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "detect dm_type_foo_ref"
+ }
+ timeout {
+ fail "detect dm_type_foo_ref (timeout)"
+ }
+ }
+
+ send_gdb "print &'dm_type_int_star'\n"
+ gdb_expect {
+ -re ".*dm_type_int_star\\(int \\*\\).*\r\n$gdb_prompt $" {
+ # v2 demangler
+ set dm_type_int_star "int *"
+ pass "detect dm_type_int_star"
+ }
+ -re ".*dm_type_int_star\\(int\\*\\).*\r\n$gdb_prompt $" {
+ # v3 demangler
+ pass "detect dm_type_int_star"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "detect dm_type_int_star"
+ }
+ timeout {
+ fail "detect dm_type_int_star (timeout)"
+ }
+ }
+
+ send_gdb "print &'dm_type_long_star'\n"
+ gdb_expect {
+ -re ".*dm_type_long_star\\(long \\*\\).*\r\n$gdb_prompt $" {
+ # v2 demangler
+ set dm_type_long_star "long *"
+ pass "detect dm_type_long_star"
+ }
+ -re ".*dm_type_long_star\\(long\\*\\).*\r\n$gdb_prompt $" {
+ # v3 demangler
+ pass "detect dm_type_long_star"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "detect dm_type_long_star"
+ }
+ timeout {
+ fail "detect dm_type_long_star (timeout)"
+ }
+ }
+
+ send_gdb "print &'dm_type_unsigned_int'\n"
+ gdb_expect {
+ -re ".*dm_type_unsigned_int\\(unsigned int\\).*\r\n$gdb_prompt $" {
+ # v2 demangler
+ set dm_type_unsigned_int "unsigned int"
+ pass "detect dm_type_unsigned_int"
+ }
+ -re ".*dm_type_unsigned_int\\(unsigned\\).*\r\n$gdb_prompt $" {
+ # v3 demangler
+ pass "detect dm_type_unsigned_int"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "detect dm_type_unsigned_int"
+ }
+ timeout {
+ fail "detect dm_unsigned int (timeout)"
+ }
+ }
+
+ send_gdb "print &'dm_type_void'\n"
+ gdb_expect {
+ -re ".*dm_type_void\\(void\\).*\r\n$gdb_prompt $" {
+ # v2 demangler
+ set dm_type_void "void"
+ pass "detect dm_type_void"
+ }
+ -re ".*dm_type_void\\(\\).*\r\n$gdb_prompt $" {
+ # v3 demangler
+ pass "detect dm_type_void"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "detect dm_type_void"
+ }
+ timeout {
+ fail "detect dm_type_void (timeout)"
+ }
+ }
+
+ send_gdb "print &'dm_type_void_star'\n"
+ gdb_expect {
+ -re ".*dm_type_void_star\\(void \\*\\).*\r\n$gdb_prompt $" {
+ # v2 demangler
+ set dm_type_void_star "void *"
+ pass "detect dm_type_void_star"
+ }
+ -re ".*dm_type_void_star\\(void\\*\\).*\r\n$gdb_prompt $" {
+ # v3 demangler
+ pass "detect dm_type_void_star"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "detect dm_type_void_star"
+ }
+ timeout {
+ fail "detect dm_type_void_star (timeout)"
+ }
+ }
+}
+
+#
+# Lookup a specific C++ function and print the demangled type.
+# This form accepts the demangled type as a regexp.
+#
+
+proc info_func_regexp { name demangled } {
+ global gdb_prompt
+
+ send_gdb "info function $name\n"
+ gdb_expect {
+ -re ".*File .*:\r\n(class |)$demangled\r\n.*$gdb_prompt $" {
+ pass "info function for \"$name\""
+ }
+ -re ".*$gdb_prompt $" {
+ fail "info function for \"$name\""
+ }
+ timeout {
+ fail "info function for \"$name\" (timeout)"
+ }
+ }
+}
+
+#
+# Lookup a specific C++ function and print the demangled type.
+# This form accepts the demangled type as a literal string.
+#
+
+proc info_func { name demangled } {
+ info_func_regexp "$name" [string_to_regexp "$demangled"]
+}
+
+#
+# Print the address of a function.
+# This checks that I can lookup a fully qualified C++ function.
+# This also checks the argument types on the return string.
+#
+
+proc print_addr_2 { name good } {
+ global gdb_prompt
+ global hex
+
+ set good_pattern [string_to_regexp $good]
+
+ send_gdb "print &'$name'\n"
+ gdb_expect {
+ -re ".* = .* $hex <$good_pattern>\r\n$gdb_prompt $" {
+ pass "print &'$name'"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "print &'$name'"
+ }
+ timeout {
+ fail "print &'$name' (timeout)"
+ }
+ }
+}
+
+#
+# Simple interfaces to print_addr_2.
+#
+
+proc print_addr { name } {
+ print_addr_2 "$name" "$name"
+}
+
+#
+# Test name demangling for operators.
+#
+# The '(' at the end of each regex input pattern is so that we match only
+# the one we are looking for. I.E. "operator&" would match both
+# "operator&(foo &)" and "operator&&(foo &)".
+#
+# gdb-gnats bug gdb/18:
+# "gdb can't parse "info func operator*" or "info func operator\*".
+# The star in "operator*" is interpreted as a regexp, but the "\*"
+# in "operator\*" is not a legal operator.
+#
+
+proc test_lookup_operator_functions {} {
+ global dm_operator_comma
+ global dm_type_char_star
+ global dm_type_char_star_quoted
+ global dm_type_foo_ref
+ global dm_type_void
+ global dm_type_void_star
+
+ # operator* requires quoting so that GDB does not treat it as a regexp.
+ info_func "operator\\*(" "void foo::operator*($dm_type_foo_ref);"
+ info_func "operator%(" "void foo::operator%($dm_type_foo_ref);"
+ info_func "operator-(" "void foo::operator-($dm_type_foo_ref);"
+ info_func "operator>>(" "void foo::operator>>($dm_type_foo_ref);"
+ info_func "operator!=(" "void foo::operator!=($dm_type_foo_ref);"
+ info_func "operator>(" "void foo::operator>($dm_type_foo_ref);"
+ info_func "operator>=(" "void foo::operator>=($dm_type_foo_ref);"
+ info_func "operator|(" "void foo::operator|($dm_type_foo_ref);"
+ info_func "operator&&(" "void foo::operator&&($dm_type_foo_ref);"
+ info_func "operator!(" "void foo::operator!($dm_type_void);"
+ info_func "operator++(" "void foo::operator++(int);"
+ info_func "operator=(" "void foo::operator=($dm_type_foo_ref);"
+ info_func "operator+=(" "void foo::operator+=($dm_type_foo_ref);"
+ # operator*= requires quoting so that GDB does not treat it as a regexp.
+ info_func "operator\\*=(" "void foo::operator*=($dm_type_foo_ref);"
+ info_func "operator%=(" "void foo::operator%=($dm_type_foo_ref);"
+ info_func "operator>>=(" "void foo::operator>>=($dm_type_foo_ref);"
+ info_func "operator|=(" "void foo::operator|=($dm_type_foo_ref);"
+ info_func "operator$dm_operator_comma\(" \
+ "void foo::operator$dm_operator_comma\($dm_type_foo_ref);"
+ info_func "operator/(" "void foo::operator/($dm_type_foo_ref);"
+ info_func "operator+(" "void foo::operator+($dm_type_foo_ref);"
+ info_func "operator<<(" "void foo::operator<<($dm_type_foo_ref);"
+ info_func "operator==(" "void foo::operator==($dm_type_foo_ref);"
+ info_func "operator<(" "void foo::operator<($dm_type_foo_ref);"
+ info_func "operator<=(" "void foo::operator<=($dm_type_foo_ref);"
+ info_func "operator&(" "void foo::operator&($dm_type_foo_ref);"
+ info_func "operator^(" "void foo::operator^($dm_type_foo_ref);"
+ info_func "operator||(" "void foo::operator||($dm_type_foo_ref);"
+ info_func "operator~(" "void foo::operator~($dm_type_void);"
+ info_func "operator--(" "void foo::operator--(int);"
+ info_func "operator->(" "foo *foo::operator->($dm_type_void);"
+ info_func "operator-=(" "void foo::operator-=($dm_type_foo_ref);"
+ info_func "operator/=(" "void foo::operator/=($dm_type_foo_ref);"
+ info_func "operator<<=(" "void foo::operator<<=($dm_type_foo_ref);"
+ info_func "operator&=(" "void foo::operator&=($dm_type_foo_ref);"
+ info_func "operator^=(" "void foo::operator^=($dm_type_foo_ref);"
+ # operator->* requires quoting so that GDB does not treat it as a regexp.
+ info_func "operator->\\*(" "void foo::operator->*($dm_type_foo_ref);"
+
+ # operator[] needs double backslashes, so that a single backslash
+ # will be sent to GDB, preventing the square brackets from being
+ # evaluated as a regular expression.
+ info_func "operator\\\[\\\](" "void foo::operator\[\]($dm_type_foo_ref);"
+
+ # These are gnarly because they might end with 'static'.
+ set dm_type_void_star_regexp [string_to_regexp $dm_type_void_star]
+ info_func_regexp "operator new(" "void \\*foo::operator new\\(.*\\)(| static);"
+ info_func_regexp "operator delete(" "void foo::operator delete\\($dm_type_void_star_regexp\\)(| static);"
+
+ info_func "operator int(" "int foo::operator int($dm_type_void);"
+ info_func "operator()(" "void foo::operator()($dm_type_foo_ref);"
+ info_func "operator $dm_type_char_star_quoted\(" \
+ "char *foo::operator $dm_type_char_star\($dm_type_void);"
+
+}
+
+
+proc test_paddr_operator_functions {} {
+ global hex
+ global hp_aCC_compiler
+ global dm_operator_comma
+ global dm_type_char_star
+ global dm_type_foo_ref
+ global dm_type_long_star
+ global dm_type_unsigned_int
+ global dm_type_void
+ global dm_type_void_star
+
+ print_addr "foo::operator*($dm_type_foo_ref)"
+ print_addr "foo::operator%($dm_type_foo_ref)"
+ print_addr "foo::operator-($dm_type_foo_ref)"
+ print_addr "foo::operator>>($dm_type_foo_ref)"
+ print_addr "foo::operator!=($dm_type_foo_ref)"
+ print_addr "foo::operator>($dm_type_foo_ref)"
+ print_addr "foo::operator>=($dm_type_foo_ref)"
+ print_addr "foo::operator|($dm_type_foo_ref)"
+ print_addr "foo::operator&&($dm_type_foo_ref)"
+ print_addr "foo::operator!($dm_type_void)"
+ print_addr "foo::operator++(int)"
+ print_addr "foo::operator=($dm_type_foo_ref)"
+ print_addr "foo::operator+=($dm_type_foo_ref)"
+ print_addr "foo::operator*=($dm_type_foo_ref)"
+ print_addr "foo::operator%=($dm_type_foo_ref)"
+ print_addr "foo::operator>>=($dm_type_foo_ref)"
+ print_addr "foo::operator|=($dm_type_foo_ref)"
+ print_addr "foo::operator$dm_operator_comma\($dm_type_foo_ref)"
+ print_addr "foo::operator/($dm_type_foo_ref)"
+ print_addr "foo::operator+($dm_type_foo_ref)"
+ print_addr "foo::operator<<($dm_type_foo_ref)"
+ print_addr "foo::operator==($dm_type_foo_ref)"
+ print_addr "foo::operator<($dm_type_foo_ref)"
+ print_addr "foo::operator<=($dm_type_foo_ref)"
+ print_addr "foo::operator&($dm_type_foo_ref)"
+ print_addr "foo::operator^($dm_type_foo_ref)"
+ print_addr "foo::operator||($dm_type_foo_ref)"
+ print_addr "foo::operator~($dm_type_void)"
+ print_addr "foo::operator--(int)"
+ print_addr "foo::operator->($dm_type_void)"
+ print_addr "foo::operator-=($dm_type_foo_ref)"
+ print_addr "foo::operator/=($dm_type_foo_ref)"
+ print_addr "foo::operator<<=($dm_type_foo_ref)"
+ print_addr "foo::operator&=($dm_type_foo_ref)"
+ print_addr "foo::operator^=($dm_type_foo_ref)"
+ print_addr "foo::operator->*($dm_type_foo_ref)"
+ print_addr "foo::operator\[\]($dm_type_foo_ref)"
+ print_addr "foo::operator()($dm_type_foo_ref)"
+
+ gdb_test "print &'foo::operator new'" \
+ " = .* $hex <foo::operator new\\(.*\\)(| static)>"
+ if { !$hp_aCC_compiler } {
+ print_addr "foo::operator delete($dm_type_void_star)"
+ } else {
+ gdb_test "print &'foo::operator delete($dm_type_void_star) static'" \
+ " = .*(0x\[0-9a-f\]+|) <foo::operator delete.*>"
+ }
+
+ print_addr "foo::operator int($dm_type_void)"
+ print_addr "foo::operator $dm_type_char_star\($dm_type_void)"
+}
+
+#
+# Test overloaded functions (1 arg).
+#
+
+proc test_paddr_overloaded_functions {} {
+ global dm_type_unsigned_int
+ global dm_type_void
+
+ print_addr "overload1arg($dm_type_void)"
+ print_addr "overload1arg(char)"
+ print_addr "overload1arg(signed char)"
+ print_addr "overload1arg(unsigned char)"
+ print_addr "overload1arg(short)"
+ print_addr "overload1arg(unsigned short)"
+ print_addr "overload1arg(int)"
+ print_addr "overload1arg($dm_type_unsigned_int)"
+ print_addr "overload1arg(long)"
+ print_addr "overload1arg(unsigned long)"
+ print_addr "overload1arg(float)"
+ print_addr "overload1arg(double)"
+
+ print_addr "overloadargs(int)"
+ print_addr "overloadargs(int, int)"
+ print_addr "overloadargs(int, int, int)"
+ print_addr "overloadargs(int, int, int, int)"
+ print_addr "overloadargs(int, int, int, int, int)"
+ print_addr "overloadargs(int, int, int, int, int, int)"
+ print_addr "overloadargs(int, int, int, int, int, int, int)"
+ print_addr "overloadargs(int, int, int, int, int, int, int, int)"
+ print_addr "overloadargs(int, int, int, int, int, int, int, int, int)"
+ print_addr "overloadargs(int, int, int, int, int, int, int, int, int, int)"
+ print_addr "overloadargs(int, int, int, int, int, int, int, int, int, int, int)"
+}
+
+proc test_paddr_hairy_functions {} {
+ global gdb_prompt
+ global hex
+ global dm_type_char_star
+ global dm_type_int_star
+ global dm_type_long_star
+
+ print_addr_2 "hairyfunc1" "hairyfunc1(int)"
+ print_addr_2 "hairyfunc2" "hairyfunc2(int (*)($dm_type_char_star))"
+ print_addr_2 "hairyfunc3" "hairyfunc3(int (*)(short (*)($dm_type_long_star)))"
+ print_addr_2 "hairyfunc4" "hairyfunc4(int (*)(short (*)($dm_type_char_star)))"
+
+ # gdb-gnats bug gdb/19:
+ # "gdb v3 demangler fails on hairyfunc5 hairyfunc6 hairyfunc7"
+ print_addr_2 "hairyfunc5" "hairyfunc5(int (*(*)($dm_type_char_star))(long))"
+ print_addr_2 "hairyfunc6" "hairyfunc6(int (*(*)($dm_type_int_star))(long))"
+ print_addr_2 "hairyfunc7" "hairyfunc7(int (*(*)(int (*)($dm_type_char_star)))(long))"
+}
+
+proc do_tests {} {
+ global prms_id
+ global bug_id
+ global subdir
+ global objdir
+ global srcdir
+ global binfile
+ global gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ send_gdb "set language c++\n"
+ gdb_expect -re "$gdb_prompt $"
+ send_gdb "set width 0\n"
+ gdb_expect -re "$gdb_prompt $"
+
+ # Get the debug format for the compiled test case. If that
+ # format is DWARF 1 then just skip all the tests since none of
+ # them will pass.
+
+ if [ runto_main] then {
+ get_debug_format
+ if [ setup_xfail_format "DWARF 1" ] then {
+ fail "C++ tests skipped due to limited C++ support in DWARF 1 debug format"
+ return
+ }
+ clear_xfail "*-*-*"
+ }
+
+ probe_demangler
+ test_paddr_overloaded_functions
+ test_paddr_operator_functions
+ test_paddr_hairy_functions
+ test_lookup_operator_functions
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.c++/ctti.exp b/gdb/testsuite/gdb.c++/ctti.exp
new file mode 100644
index 00000000000..96e9fcff81a
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/ctti.exp
@@ -0,0 +1,269 @@
+# Copyright 1998, 1999, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+
+# This file is part of the gdb testsuite
+# file written by Elena Zannoni (ezannoni@cygnus.com)
+#
+# source files cttiadd.cc, cttiadd1.cc, cttiadd2.cc, cttiadd3.cc
+#
+
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+# Check to see if we have an executable to test. If not, then either we
+# haven't tried to compile one, or the compilation failed for some reason.
+# In either case, just notify the user and skip the tests in this file.
+
+set testfile "cttiadd"
+set srcfile ${testfile}.cc
+set srcfile1 ${testfile}1.cc
+set srcfile2 ${testfile}2.cc
+set srcfile3 ${testfile}3.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1;
+}
+
+if { $gcc_compiled } then { continue }
+
+#if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}" "${binfile}" executable {debug c++}] != "" } {
+# gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+#}
+
+set cmdline "$CXX_FOR_TARGET ${srcdir}/${subdir}/${srcfile} ${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3} -g -o ${binfile}"
+
+remote_exec build $cmdline
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+
+send_gdb "n\n"
+gdb_expect {
+ -re "$decimal.*i = 2;.*$gdb_prompt $" {
+ pass "next "
+ }
+ -re ".*$gdb_prompt $" { fail "next " }
+ timeout { fail "next " }
+ }
+
+
+send_gdb "n\n"
+gdb_expect {
+ -re "$decimal.*f = 4.5;.*$gdb_prompt $" {
+ pass "next "
+ }
+ -re ".*$gdb_prompt $" { fail "next " }
+ timeout { fail "next " }
+ }
+
+send_gdb "n\n"
+gdb_expect {
+ -re "$decimal.*c = add\\(c, c\\);.*$gdb_prompt $" {
+ pass "next "
+ }
+ -re ".*$gdb_prompt $" { fail "next " }
+ timeout { fail "next " }
+ }
+
+send_gdb "n\n"
+gdb_expect {
+ -re "$decimal.*i = add\\(i, i\\);.*$gdb_prompt $" {
+ pass "next "
+ }
+ -re ".*$gdb_prompt $" { fail "next " }
+ timeout { fail "next " }
+ }
+
+send_gdb "n\n"
+gdb_expect {
+ -re "$decimal.*f = add\\(f, f\\);.*$gdb_prompt $" {
+ pass "next "
+ }
+ -re ".*$gdb_prompt $" { fail "next " }
+ timeout { fail "next " }
+ }
+
+send_gdb "n\n"
+gdb_expect {
+ -re "$decimal.*add1\\(\\);.*$gdb_prompt $" {
+ pass "next "
+ }
+ -re ".*$gdb_prompt $" { fail "next " }
+ timeout { fail "next " }
+ }
+
+send_gdb "print c\n"
+gdb_expect {
+ -re ".$decimal = -62.*\r\n$gdb_prompt $" {
+ pass "print value of c"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of c" }
+ timeout { fail "(timeout) print value of c" }
+ }
+
+
+send_gdb "print f\n"
+gdb_expect {
+ -re ".$decimal = 9\r\n$gdb_prompt $" {
+ pass "print value of f"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of f" }
+ timeout { fail "(timeout) print value of f" }
+ }
+
+
+send_gdb "print i\n"
+gdb_expect {
+ -re ".$decimal = 4\r\n$gdb_prompt $" {
+ pass "print value of i"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of i" }
+ timeout { fail "(timeout) print value of i" }
+ }
+
+
+
+send_gdb "print add<int>(2,2)\n"
+gdb_expect {
+ -re ".$decimal = 4\r\n$gdb_prompt $" {
+ pass "print value of add<int>(2,2)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of add<int>(2,2)" }
+ timeout { fail "(timeout) print value of add<int>(2,2)" }
+ }
+
+send_gdb "print add<float>(2.3,2.3)\n"
+gdb_expect {
+ -re ".$decimal = 4\\.5\[0-9\]+\r\n$gdb_prompt $" {
+ pass "print value of add<float>(2.3,2.3)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of add<float>(2.3,2.3)" }
+ timeout { fail "(timeout) print value of add<float>(2.3,2.3)" }
+ }
+
+send_gdb "print add<char>('A','A')\n"
+gdb_expect {
+ -re ".$decimal = -126.*202.\r\n$gdb_prompt $" {
+ pass "print value of add<char>('A','A')"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of add<char>('A','A')" }
+ timeout { fail "(timeout) print value of add<char>('A','A')" }
+ }
+
+
+send_gdb "print add2<int>(2,2)\n"
+gdb_expect {
+ -re ".$decimal = 4\r\n$gdb_prompt $" {
+ pass "print value of add2<int>(2,2)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of add2<int>(2,2)" }
+ timeout { fail "(timeout) print value of add2<int>(2,2)" }
+ }
+
+send_gdb "print add2<float>(2.3,2.3)\n"
+gdb_expect {
+ -re ".$decimal = 4\\.5\[0-9\]+\r\n$gdb_prompt $" {
+ pass "print value of add2<float>(2.3,2.3)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of add2<float>(2.3,2.3)" }
+ timeout { fail "(timeout) print value of add2<float>(2.3,2.3)" }
+ }
+
+send_gdb "print add2<char>('A','A')\n"
+gdb_expect {
+ -re ".$decimal = -126.*202.\r\n$gdb_prompt $" {
+ pass "print value of add2<char>('A','A')"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of add2<char>('A','A')" }
+ timeout { fail "(timeout) print value of add2<char>('A','A')" }
+ }
+
+send_gdb "print add3<int>(2,2)\n"
+gdb_expect {
+ -re ".$decimal = 4\r\n$gdb_prompt $" {
+ pass "print value of add3<int>(2,2)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of add3<int>(2,2)" }
+ timeout { fail "(timeout) print value of add3<int>(2,2)" }
+ }
+
+send_gdb "print add3<float>(2.3,2.3)\n"
+gdb_expect {
+ -re ".$decimal = 4\\.5\[0-9\]+\r\n$gdb_prompt $" {
+ pass "print value of add3<float>(2.3,2.3)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of add3<float>(2.3,2.3)" }
+ timeout { fail "(timeout) print value of add3<float>(2.3,2.3)" }
+ }
+
+send_gdb "print add3<char>('A','A')\n"
+gdb_expect {
+ -re ".$decimal = -126.*202.\r\n$gdb_prompt $" {
+ pass "print value of add3<char>('A','A')"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of add3<char>('A','A')" }
+ timeout { fail "(timeout) print value of add3<char>('A','A')" }
+ }
+
+send_gdb "print add4<int>(2,2)\n"
+gdb_expect {
+ -re ".$decimal = 4\r\n$gdb_prompt $" {
+ pass "print value of add4<int>(2,2)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of add4<int>(2,2)" }
+ timeout { fail "(timeout) print value of add4<int>(2,2)" }
+ }
+
+send_gdb "print add4<float>(2.3,2.3)\n"
+gdb_expect {
+ -re ".$decimal = 4\\.5\[0-9\]+\r\n$gdb_prompt $" {
+ pass "print value of add4<float>(2.3,2.3)"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of add4<float>(2.3,2.3)" }
+ timeout { fail "(timeout) print value of add4<float>(2.3,2.3)" }
+ }
+
+send_gdb "print add4<char>('A','A')\n"
+gdb_expect {
+ -re ".$decimal = -126.*202.\r\n$gdb_prompt $" {
+ pass "print value of add4<char>('A','A')"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of add4<char>('A','A')" }
+ timeout { fail "(timeout) print value of add4<char>('A','A')" }
+ }
+
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.c++/cttiadd.cc b/gdb/testsuite/gdb.c++/cttiadd.cc
new file mode 100644
index 00000000000..1f50fae24c1
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/cttiadd.cc
@@ -0,0 +1,29 @@
+template<class T> T add(T v1, T v2)
+{
+ T v3;
+ v3 = v1;
+ v3 += v2;
+ return v3;
+ }
+
+int main()
+{
+ char c;
+ int i;
+ float f;
+ extern void add1();
+ extern void subr2();
+ extern void subr3();
+
+ c = 'a';
+ i = 2;
+ f = 4.5;
+
+ c = add(c, c);
+ i = add(i, i);
+ f = add(f, f);
+
+ add1();
+ subr2();
+ subr3();
+}
diff --git a/gdb/testsuite/gdb.c++/cttiadd1.cc b/gdb/testsuite/gdb.c++/cttiadd1.cc
new file mode 100644
index 00000000000..7113ecea421
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/cttiadd1.cc
@@ -0,0 +1,16 @@
+template<class T> T add(T v1, T v2);
+
+void add1()
+{
+ char c;
+ int i;
+ float f;
+
+ c = 'b';
+ i = 3;
+ f = 6.5;
+
+ c = add(c, c);
+ i = add(i, i);
+ f = add(f, f);
+}
diff --git a/gdb/testsuite/gdb.c++/cttiadd2.cc b/gdb/testsuite/gdb.c++/cttiadd2.cc
new file mode 100644
index 00000000000..d0d9891fb2f
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/cttiadd2.cc
@@ -0,0 +1,22 @@
+template<class T> T add2(T v1, T v2)
+{
+ T v3;
+ v3 = v1;
+ v3 += v2;
+ return v3;
+}
+
+void subr2()
+{
+ char c;
+ int i;
+ float f;
+
+ c = 'b';
+ i = 3;
+ f = 6.5;
+
+ c = add2(c, c);
+ i = add2(i, i);
+ f = add2(f, f);
+}
diff --git a/gdb/testsuite/gdb.c++/cttiadd3.cc b/gdb/testsuite/gdb.c++/cttiadd3.cc
new file mode 100644
index 00000000000..7ba1b019f16
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/cttiadd3.cc
@@ -0,0 +1,33 @@
+template<class T> T add3(T v1, T v2)
+{
+ T v3;
+ v3 = v1;
+ v3 += v2;
+ return v3;
+}
+
+template<class T> T add4(T v1, T v2)
+{
+ T v3;
+ v3 = v1;
+ v3 += v2;
+ return v3;
+}
+
+void subr3()
+{
+ char c;
+ int i;
+ float f;
+
+ c = 'b';
+ i = 3;
+ f = 6.5;
+
+ c = add3(c, c);
+ i = add3(i, i);
+ f = add3(f, f);
+ c = add4(c, c);
+ i = add4(i, i);
+ f = add4(f, f);
+}
diff --git a/gdb/testsuite/gdb.c++/demangle.exp b/gdb/testsuite/gdb.c++/demangle.exp
new file mode 100644
index 00000000000..45a89bd83c9
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/demangle.exp
@@ -0,0 +1,1579 @@
+# Copyright (C) 1992, 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+### The demangling style we last sent to GDB.
+set current_demangling_style none
+
+### Set GDB's current demangling style to STYLE. Subsequent calls to
+### test_demangle will include STYLE in the test name when reporting
+### passes and failures.
+proc set_demangling_style {style} {
+ global gdb_prompt
+ global current_demangling_style
+
+ send_gdb "set demangle-style $style\n"
+ gdb_expect {
+ -re "set demangle-style $style\[\r\n\]+$gdb_prompt $" {
+ pass "$style: set demangle-style"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$style: set demangle-style"
+ error "set_demangling_style: set style"
+ }
+ timeout {
+ fail "$style: set demangle-style (timeout)"
+ error "set_demangling_style: set style"
+ }
+ }
+
+ send_gdb "show demangle-style\n"
+ gdb_expect {
+ -re "The current C\[+\]+ demangling style is \"$style\".\r\n$gdb_prompt $" {
+ pass "$style: check demangling style"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$style: check demangling style"
+ error "set_demangling_style: check style"
+ }
+ timeout {
+ fail "$style: check demangling style (timeout)"
+ error "set_demangling_style: check style"
+ }
+ }
+
+ set current_demangling_style $style
+}
+
+
+### Utility function for test_demangling and test_demangling_exact.
+proc test_demangling_core {tester test result} {
+ global current_demangling_style
+
+ if {! [regexp {^([^ ]+): (.+)$} $test dummy style name]} {
+ error "bad test name passed to test_demangling"
+ }
+
+ if {[string compare $style $current_demangling_style]} {
+ set_demangling_style $style
+ }
+
+ $tester "maintenance demangle $name" $result $test
+}
+
+### Demangle an identifier, and check that the result matches a pattern.
+###
+### TEST should be of the form "STYLE: NAME", where STYLE is the name
+### of a demangling style (like "gnu" or "arm"), and NAME is a mangled
+### identifier to demangle. Pass when the result matches the regular
+### expression RESULT. Report passes and fails using TEST as the name
+### of the test.
+###
+### Why don't we just pass the STYLE and NAME as two separate
+### arguments, or let the style be a global variable? That would be
+### cleaner. However, doing it this way means that:
+###
+### 1) the name of the test, as recorded in the summary and log,
+### appears verbatim in the script, and
+###
+### 2) that test names are unique, even though we try to demangle the same
+### identifiers using several different mangling styles.
+###
+### This makes it a lot easier for people tracking down failures to
+### find the one they care about.
+
+proc test_demangling {test result} {
+ test_demangling_core gdb_test $test $result
+}
+
+### Like test_demangling, above, except that RESULT is not a regexp,
+### but a string that must match exactly.
+
+proc test_demangling_exact {test result} {
+ test_demangling_core gdb_test_exact $test $result
+}
+
+
+
+#
+# Test gnu style name demangling
+#
+
+proc test_gnu_style_demangling {} {
+ global gdb_prompt
+
+ test_demangling "gnu: Abort__FP6EditoriPCc" \
+ "Abort\[(\]+Editor \[*\]+, int, (const char|char const) \[*\]+\[)\]+"
+ test_demangling_exact "gnu: AddAlignment__9ivTSolverUiP12ivInteractorP7ivTGlue" "ivTSolver::AddAlignment(unsigned int, ivInteractor *, ivTGlue *)"
+ test_demangling "gnu: Append__15NameChooserViewPCc" \
+ "NameChooserView::Append\[(\]+(const char|char const) \[*\]+\[)\]+"
+ test_demangling_exact "gnu: ArrowheadIntersects__9ArrowLineP9ArrowheadR6BoxObjP7Graphic" "ArrowLine::ArrowheadIntersects(Arrowhead *, BoxObj &, Graphic *)"
+ test_demangling_exact "gnu: AtEnd__13ivRubberGroup" "ivRubberGroup::AtEnd(void)"
+ test_demangling_exact "gnu: BgFilter__9ivTSolverP12ivInteractor" "ivTSolver::BgFilter(ivInteractor *)"
+ test_demangling "gnu: BitPatterntoa__FRC10BitPatternccc" \
+ "BitPatterntoa\[(\]+(const BitPattern|BitPattern const) &, char, char, char\[)\]+"
+ test_demangling_exact "gnu: Check__6UArrayi" "UArray::Check(int)"
+ test_demangling_exact "gnu: CoreConstDecls__8TextCodeR7ostream" "TextCode::CoreConstDecls(ostream &)"
+ test_demangling_exact "gnu: Detach__8StateVarP12StateVarView" "StateVar::Detach(StateVarView *)"
+ test_demangling_exact "gnu: Done__9ComponentG8Iterator" "Component::Done(Iterator)"
+ test_demangling "gnu: DrawDestinationTransformedImage__FP7_XImageiiT0iiUlUiiiUiUlUlP4_XGCRC13ivTransformeriiii" \
+ "DrawDestinationTransformedImage\[(\]+_XImage \[*\]+, int, int, _XImage \[*\]+, int, int, unsigned long, unsigned int, int, int, unsigned int, unsigned long, unsigned long, _XGC \[*\]+, (const ivTransformer|ivTransformer const) &, int, int, int, int\[)\]+"
+
+ test_demangling "gnu: Edit__12StringEditorPCcii" \
+ "StringEditor::Edit\[(\]+(const char|char const) \[*\]+, int, int\[)\]+"
+ test_demangling_exact "gnu: Effect__11RelateManipR7ivEvent" "RelateManip::Effect(ivEvent &)"
+ test_demangling "gnu: FilterName__FPCc" \
+ "FilterName\[(\]+(const char|char const) \[*\]+\[)\]+"
+ test_demangling "gnu: Filter__6PSTextPCci" \
+ "PSText::Filter\[(\]+(const char|char const) \[*\]+, int\[)\]+"
+ test_demangling "gnu: FindColor__7CatalogPCciii" \
+ "Catalog::FindColor\[(\]+(const char|char const) \[*\]+, int, int, int\[)\]+"
+ test_demangling_exact "gnu: FindFixed__FRP4CNetP4CNet" "FindFixed(CNet *&, CNet *)"
+ test_demangling "gnu: FindFont__7CatalogPCcN21" \
+ "Catalog::FindFont\[(\]+(const char|char const) \[*\]+, (const char|char const) \[*\]+, (const char|char const) \[*\]+\[)\]+"
+ test_demangling_exact "gnu: Fix48_abort__FR8twolongs" "Fix48_abort(twolongs &)"
+ test_demangling_exact "gnu: GetBarInfo__15iv2_6_VScrollerP13ivPerspectiveRiT2" "iv2_6_VScroller::GetBarInfo(ivPerspective *, int &, int &)"
+ test_demangling_exact "gnu: GetBgColor__C9ivPainter" "ivPainter::GetBgColor(void) const"
+
+ test_demangling "gnu: Iisdouble__FPC6IntRep" \
+ "Iisdouble\[(\]+(const IntRep|IntRep const) \[*\]+\[)\]+"
+ test_demangling_exact "gnu: InsertBody__15H_PullrightMenuii" "H_PullrightMenu::InsertBody(int, int)"
+ test_demangling_exact "gnu: InsertCharacter__9TextManipc" "TextManip::InsertCharacter(char)"
+
+ test_demangling_exact "gnu: InsertToplevel__7ivWorldP12ivInteractorT1" "ivWorld::InsertToplevel(ivInteractor *, ivInteractor *)"
+ test_demangling_exact "gnu: InsertToplevel__7ivWorldP12ivInteractorT1iiUi" "ivWorld::InsertToplevel(ivInteractor *, ivInteractor *, int, int, unsigned int)"
+ test_demangling "gnu: IsADirectory__FPCcR4stat" \
+ "IsADirectory\[(\]+(const char|char const) \[*\]+, stat &\[)\]+"
+ test_demangling_exact "gnu: IsAGroup__FP11GraphicViewP11GraphicComp" "IsAGroup(GraphicView *, GraphicComp *)"
+ test_demangling_exact "gnu: IsA__10ButtonCodeUl" "ButtonCode::IsA(unsigned long)"
+
+ test_demangling_exact "gnu: ReadName__FR7istreamPc" "ReadName(istream &, char *)"
+ test_demangling_exact "gnu: Redraw__13StringBrowseriiii" "StringBrowser::Redraw(int, int, int, int)"
+ test_demangling_exact "gnu: Rotate__13ivTransformerf" "ivTransformer::Rotate(float)"
+ test_demangling_exact "gnu: Rotated__C13ivTransformerf" "ivTransformer::Rotated(float) const"
+ test_demangling_exact "gnu: Round__Ff" "Round(float)"
+
+ test_demangling_exact "gnu: SetExport__16MemberSharedNameUi" "MemberSharedName::SetExport(unsigned int)"
+ test_demangling_exact "gnu: Set__14ivControlState13ControlStatusUi" "ivControlState::Set(ControlStatus, unsigned int)"
+ test_demangling_exact "gnu: Set__5DFacePcii" "DFace::Set(char *, int, int)"
+
+ test_demangling_exact "gnu: VConvert__9ivTSolverP12ivInteractorRP8TElementT2" "ivTSolver::VConvert(ivInteractor *, TElement *&, TElement *&)"
+ test_demangling_exact "gnu: VConvert__9ivTSolverP7ivTGlueRP8TElement" "ivTSolver::VConvert(ivTGlue *, TElement *&)"
+ test_demangling_exact "gnu: VOrder__9ivTSolverUiRP12ivInteractorT2" "ivTSolver::VOrder(unsigned int, ivInteractor *&, ivInteractor *&)"
+ test_demangling "gnu: Valid__7CatalogPCcRP4Tool" \
+ "Catalog::Valid\[(\]+(const char|char const) \[*\]+, Tool \[*\]+&\[)\]+"
+ test_demangling_exact "gnu: _10PageButton\$__both" "PageButton::__both"
+ test_demangling_exact "gnu: _3RNG\$singleMantissa" "RNG::singleMantissa"
+ test_demangling_exact "gnu: _5IComp\$_release" "IComp::_release"
+ test_demangling_exact "gnu: _\$_10BitmapComp" "BitmapComp::~BitmapComp(void)"
+
+ test_demangling_exact "gnu: _\$_9__io_defs" "__io_defs::~__io_defs(void)"
+ test_demangling_exact "gnu: _\$_Q23foo3bar" "foo::bar::~bar(void)"
+ test_demangling_exact "gnu: _\$_Q33foo3bar4bell" "foo::bar::bell::~bell(void)"
+ test_demangling_exact "gnu: __10ivTelltaleiP7ivGlyph" "ivTelltale::ivTelltale(int, ivGlyph *)"
+ test_demangling_exact "gnu: __10ivViewportiP12ivInteractorUi" "ivViewport::ivViewport(int, ivInteractor *, unsigned int)"
+ test_demangling_exact "gnu: __10ostrstream" "ostrstream::ostrstream(void)"
+ test_demangling_exact "gnu: __10ostrstreamPcii" "ostrstream::ostrstream(char *, int, int)"
+ test_demangling "gnu: __11BasicDialogiPCcP13ivButtonStateN22Ui" \
+ "BasicDialog::BasicDialog\[(\]+int, (const char|char const) \[*\]+, ivButtonState \[*\]+, (const char|char const) \[*\]+, (const char|char const) \[*\]+, unsigned int\[)\]+"
+ test_demangling_exact "gnu: __11BitmapTablei" "BitmapTable::BitmapTable(int)"
+ test_demangling_exact "gnu: __12ViewportCodeP12ViewportComp" "ViewportCode::ViewportCode(ViewportComp *)"
+ test_demangling "gnu: __12iv2_6_BorderiPCci" \
+ "iv2_6_Border::iv2_6_Border\[(\]+int, (const char|char const) \[*\]+, int\[)\]+"
+ test_demangling_exact "gnu: __12iv2_6_Borderii" "iv2_6_Border::iv2_6_Border(int, int)"
+ test_demangling "gnu: __12ivBackgroundiP7ivGlyphPC7ivColor" \
+ "ivBackground::ivBackground\[(\]+int, ivGlyph \[*\]+, (const ivColor|ivColor const) \[*\]+\[)\]+"
+ test_demangling_exact "gnu: __12ivBreak_Listl" "ivBreak_List::ivBreak_List(long)"
+ test_demangling "gnu: __14TextInteractoriPCcUi" \
+ "TextInteractor::TextInteractor\[(\]+int, (const char|char const) \[*\]+, unsigned int\[)\]+"
+ test_demangling_exact "gnu: __14iv2_6_MenuItemiP12ivInteractor" "iv2_6_MenuItem::iv2_6_MenuItem(int, ivInteractor *)"
+ test_demangling "gnu: __14iv2_6_MenuItemiPCcP12ivInteractor" \
+ "iv2_6_MenuItem::iv2_6_MenuItem\[(\]+int, (const char|char const) \[*\]+, ivInteractor \[*\]+\[)\]+"
+
+ test_demangling_exact "gnu: __20DisplayList_IteratorR11DisplayList" "DisplayList_Iterator::DisplayList_Iterator(DisplayList &)"
+ test_demangling_exact "gnu: __3fooRT0" "foo::foo(foo &)"
+ test_demangling_exact "gnu: __3fooiN31" "foo::foo(int, int, int, int)"
+ test_demangling "gnu: __3fooiPCc" \
+ "foo::foo\[(\]+int, (const char|char const) \[*\]+\[)\]+"
+ test_demangling_exact "gnu: __3fooiRT0iT2iT2" "foo::foo(int, foo &, int, foo &, int, foo &)"
+ test_demangling "gnu: __6GetOptiPPcPCc" \
+ "GetOpt::GetOpt\[(\]+int, char \[*\]+\[*\]+, (const char|char const) \[*\]+\[)\]+"
+ test_demangling_exact "gnu: __6KeyMapPT0" "KeyMap::KeyMap(KeyMap *)"
+ test_demangling "gnu: __7ivWorldPCcRiPPcPC12ivOptionDescPC14ivPropertyData" \
+ "ivWorld::ivWorld\[(\]+(const char|char const) \[*\]+, int &, char \[*\]+\[*\]+, (const ivOptionDesc|ivOptionDesc const) \[*\]+, (const ivPropertyData|ivPropertyData const) \[*\]+\[)\]+"
+ test_demangling "gnu: __7procbufPCci" \
+ "procbuf::procbuf\[(\]+(const char|char const) \[*\]+, int\[)\]+"
+ test_demangling_exact "gnu: __8ArrowCmdP6EditorUiUi" "ArrowCmd::ArrowCmd(Editor *, unsigned int, unsigned int)"
+
+ test_demangling_exact "gnu: __9F_EllipseiiiiP7Graphic" "F_Ellipse::F_Ellipse(int, int, int, int, Graphic *)"
+ test_demangling_exact "gnu: __9FrameDataP9FrameCompi" "FrameData::FrameData(FrameComp *, int)"
+ test_demangling_exact "gnu: __9HVGraphicP9CanvasVarP7Graphic" "HVGraphic::HVGraphic(CanvasVar *, Graphic *)"
+ test_demangling_exact "gnu: __Q23foo3bar" "foo::bar::bar(void)"
+ test_demangling_exact "gnu: __Q33foo3bar4bell" "foo::bar::bell::bell(void)"
+ test_demangling_exact "gnu: __aa__3fooRT0" "foo::operator&&(foo &)"
+ test_demangling_exact "gnu: __aad__3fooRT0" "foo::operator&=(foo &)"
+ test_demangling_exact "gnu: __ad__3fooRT0" "foo::operator&(foo &)"
+ test_demangling_exact "gnu: __adv__3fooRT0" "foo::operator/=(foo &)"
+ test_demangling_exact "gnu: __aer__3fooRT0" "foo::operator^=(foo &)"
+ test_demangling_exact "gnu: __als__3fooRT0" "foo::operator<<=(foo &)"
+ test_demangling_exact "gnu: __amd__3fooRT0" "foo::operator%=(foo &)"
+ test_demangling_exact "gnu: __ami__3fooRT0" "foo::operator-=(foo &)"
+ test_demangling_exact "gnu: __aml__3FixRT0" "Fix::operator*=(Fix &)"
+ test_demangling_exact "gnu: __aml__5Fix16i" "Fix16::operator*=(int)"
+ test_demangling_exact "gnu: __aml__5Fix32RT0" "Fix32::operator*=(Fix32 &)"
+ test_demangling_exact "gnu: __aor__3fooRT0" "foo::operator|=(foo &)"
+ test_demangling_exact "gnu: __apl__3fooRT0" "foo::operator+=(foo &)"
+ test_demangling_exact "gnu: __ars__3fooRT0" "foo::operator>>=(foo &)"
+
+ test_demangling_exact "gnu: __as__3fooRT0" "foo::operator=(foo &)"
+ test_demangling_exact "gnu: __cl__3fooRT0" "foo::operator()(foo &)"
+ test_demangling_exact "gnu: __cl__6Normal" "Normal::operator()(void)"
+ test_demangling_exact "gnu: __cl__6Stringii" "String::operator()(int, int)"
+ test_demangling_exact "gnu: __cm__3fooRT0" "foo::operator, (foo &)"
+ test_demangling_exact "gnu: __co__3foo" "foo::operator~(void)"
+ test_demangling_exact "gnu: __dl__3fooPv" "foo::operator delete(void *)"
+ test_demangling_exact "gnu: __dv__3fooRT0" "foo::operator/(foo &)"
+ test_demangling_exact "gnu: __eq__3fooRT0" "foo::operator==(foo &)"
+ test_demangling_exact "gnu: __er__3fooRT0" "foo::operator^(foo &)"
+ test_demangling_exact "gnu: __ge__3fooRT0" "foo::operator>=(foo &)"
+ test_demangling_exact "gnu: __gt__3fooRT0" "foo::operator>(foo &)"
+ test_demangling_exact "gnu: __le__3fooRT0" "foo::operator<=(foo &)"
+ test_demangling_exact "gnu: __ls__3fooRT0" "foo::operator<<(foo &)"
+ test_demangling_exact "gnu: __ls__FR7ostreamPFR3ios_R3ios" "operator<<(ostream &, ios &(*)(ios &))"
+ test_demangling_exact "gnu: __ls__FR7ostreamR3Fix" "operator<<(ostream &, Fix &)"
+ test_demangling_exact "gnu: __lt__3fooRT0" "foo::operator<(foo &)"
+ test_demangling_exact "gnu: __md__3fooRT0" "foo::operator%(foo &)"
+ test_demangling_exact "gnu: __mi__3fooRT0" "foo::operator-(foo &)"
+ test_demangling_exact "gnu: __ml__3fooRT0" "foo::operator*(foo &)"
+ test_demangling_exact "gnu: __mm__3fooi" "foo::operator--(int)"
+
+ test_demangling_exact "gnu: __ne__3fooRT0" "foo::operator!=(foo &)"
+ test_demangling "gnu: __ne__FRC7ComplexT0" \
+ "operator!=\[(\]+(const Complex|Complex const) &, (const Complex|Complex const) &\[)\]+"
+ test_demangling "gnu: __ne__FRC7Complexd" \
+ "operator!=\[(\]+(const Complex|Complex const) &, double\[)\]+"
+ test_demangling "gnu: __ne__FRC9SubStringRC6String" \
+ "operator!=\[(\]+(const SubString|SubString const) &, (const String|String const) &\[)\]+"
+ test_demangling_exact "gnu: __nt__3foo" "foo::operator!(void)"
+ test_demangling_exact "gnu: __nw__3fooi" "foo::operator new(int)"
+ test_demangling_exact "gnu: __oo__3fooRT0" "foo::operator||(foo &)"
+ test_demangling_exact "gnu: __opPc__3foo" "foo::operator char *(void)"
+ test_demangling_exact "gnu: __opi__3foo" "foo::operator int(void)"
+ test_demangling_exact "gnu: __or__3fooRT0" "foo::operator|(foo &)"
+ test_demangling_exact "gnu: __pl__3fooRT0" "foo::operator+(foo &)"
+ test_demangling_exact "gnu: __pp__3fooi" "foo::operator++(int)"
+ test_demangling_exact "gnu: __rf__3foo" "foo::operator->(void)"
+ test_demangling_exact "gnu: __rm__3fooRT0" "foo::operator->*(foo &)"
+ test_demangling_exact "gnu: __rs__3fooRT0" "foo::operator>>(foo &)"
+ test_demangling "gnu: __vc__3fooRT0" "foo::operator\\\[\\\]\\(foo &\\)"
+ test_demangling "gnu: _gsub__6StringRC5RegexPCci" \
+ "String::_gsub\[(\]+(const Regex|Regex const) &, (const char|char const) \[*\]+, int\[)\]+"
+ test_demangling_exact "gnu: _new_Fix__FUs" "_new_Fix(unsigned short)"
+
+ # gcc 2.4.5 (and earlier) style virtual tables. We want to continue to
+ # correctly demangle these even if newer compilers use a different form.
+ test_demangling_exact "gnu: _vt.foo" "foo virtual table"
+ test_demangling_exact "gnu: _vt.foo.bar" "foo::bar virtual table"
+ test_demangling_exact "gnu: _vt\$foo" "foo virtual table"
+ test_demangling_exact "gnu: _vt\$foo\$bar" "foo::bar virtual table"
+
+ test_demangling_exact "gnu: append__7ivGlyphPT0" "ivGlyph::append(ivGlyph *)"
+ test_demangling "gnu: arg__FRC7Complex" \
+ "arg\[(\]+(const Complex|Complex const) &\[)\]+"
+ test_demangling_exact "gnu: clearok__FP7_win_sti" "clearok(_win_st *, int)"
+
+ test_demangling_exact "gnu: complexfunc2__FPFPc_i" "complexfunc2(int (*)(char *))"
+ test_demangling_exact "gnu: complexfunc3__FPFPFPl_s_i" "complexfunc3(int (*)(short (*)(long *)))"
+ test_demangling_exact "gnu: complexfunc4__FPFPFPc_s_i" "complexfunc4(int (*)(short (*)(char *)))"
+ test_demangling_exact "gnu: complexfunc5__FPFPc_PFl_i" "complexfunc5(int (*(*)(char *))(long))"
+ test_demangling_exact "gnu: complexfunc6__FPFPi_PFl_i" "complexfunc6(int (*(*)(int *))(long))"
+ test_demangling_exact "gnu: complexfunc7__FPFPFPc_i_PFl_i" "complexfunc7(int (*(*)(int (*)(char *)))(long))"
+ test_demangling "gnu: contains__C9BitStringRC10BitPattern" \
+ "BitString::contains\[(\]+(const BitPattern|BitPattern const) &\[)\]+ const"
+ test_demangling "gnu: contains__C9BitStringRC12BitSubStringi" \
+ "BitString::contains\[(\]+(const BitSubString|BitSubString const) &, int\[)\]+ const"
+ test_demangling "gnu: contains__C9BitStringRT0" \
+ "BitString::contains\[(\]+(const BitString|BitString const) &\[)\]+ const"
+ test_demangling "gnu: div__FPC6IntRepT0P6IntRep" \
+ "div\[(\]+(const IntRep|IntRep const) \[*\]+, (const IntRep|IntRep const) \[*\]+, IntRep \[*\]+\[)\]+"
+ test_demangling "gnu: div__FPC6IntReplP6IntRep" \
+ "div\[(\]+(const IntRep|IntRep const) \[*\]+, long, IntRep \[*\]+\[)\]+"
+ test_demangling "gnu: div__FRC8RationalT0R8Rational" \
+ "div\[(\]+(const Rational|Rational const) &, (const Rational|Rational const) &, Rational &\[)\]+"
+ test_demangling "gnu: divide__FRC7IntegerT0R7IntegerT2" \
+ "divide\[(\]+(const Integer|Integer const) &, (const Integer|Integer const) &, Integer &, Integer &\[)\]+"
+ test_demangling "gnu: divide__FRC7IntegerlR7IntegerRl" \
+ "divide\[(\]+(const Integer|Integer const) &, long, Integer &, long &\[)\]+"
+ test_demangling "gnu: enable__14DocumentViewerPCcUi" \
+ "DocumentViewer::enable\[(\]+(const char|char const) \[*\]+, unsigned int\[)\]+"
+
+ test_demangling_exact "gnu: foo__FiN30" "foo(int, int, int, int)"
+ test_demangling_exact "gnu: foo__FiR3fooiT1iT1" "foo(int, foo &, int, foo &, int, foo &)"
+ test_demangling_exact "gnu: foo___3barl" "bar::foo_(long)"
+ test_demangling_exact "gnu: insert__15ivClippingStacklRP8_XRegion" "ivClippingStack::insert(long, _XRegion *&)"
+ test_demangling_exact "gnu: insert__16ChooserInfo_ListlR11ChooserInfo" "ChooserInfo_List::insert(long, ChooserInfo &)"
+ test_demangling_exact "gnu: insert__17FontFamilyRepListlRP15ivFontFamilyRep" "FontFamilyRepList::insert(long, ivFontFamilyRep *&)"
+ test_demangling_exact "gnu: leaveok__FP7_win_stc" "leaveok(_win_st *, char)"
+ test_demangling_exact "gnu: left_mover__C7ivMFKitP12ivAdjustableP7ivStyle" "ivMFKit::left_mover(ivAdjustable *, ivStyle *) const"
+ test_demangling "gnu: matches__C9BitStringRC10BitPatterni" \
+ "BitString::matches\[(\]+(const BitPattern|BitPattern const) &, int\[)\]+ const"
+ test_demangling "gnu: matches__C9SubStringRC5Regex" \
+ "SubString::matches\[(\]+(const Regex|Regex const) &\[)\]+ const"
+
+ test_demangling_exact "gnu: overload1arg__FSc" "overload1arg(signed char)"
+ test_demangling_exact "gnu: overload1arg__FUc" "overload1arg(unsigned char)"
+ test_demangling_exact "gnu: overload1arg__FUi" "overload1arg(unsigned int)"
+ test_demangling_exact "gnu: overload1arg__FUl" "overload1arg(unsigned long)"
+ test_demangling_exact "gnu: overload1arg__FUs" "overload1arg(unsigned short)"
+ test_demangling_exact "gnu: overload1arg__Fc" "overload1arg(char)"
+ test_demangling_exact "gnu: overload1arg__Fd" "overload1arg(double)"
+ test_demangling_exact "gnu: overload1arg__Ff" "overload1arg(float)"
+ test_demangling_exact "gnu: overload1arg__Fi" "overload1arg(int)"
+ test_demangling_exact "gnu: overload1arg__Fl" "overload1arg(long)"
+ test_demangling_exact "gnu: overload1arg__Fs" "overload1arg(short)"
+ test_demangling_exact "gnu: overload1arg__Fv" "overload1arg(void)"
+ test_demangling_exact "gnu: overloadargs__Fi" "overloadargs(int)"
+ test_demangling_exact "gnu: overloadargs__Fii" "overloadargs(int, int)"
+ test_demangling_exact "gnu: overloadargs__Fiii" "overloadargs(int, int, int)"
+ test_demangling_exact "gnu: overloadargs__Fiiii" "overloadargs(int, int, int, int)"
+
+ test_demangling_exact "gnu: overloadargs__Fiiiii" "overloadargs(int, int, int, int, int)"
+ test_demangling_exact "gnu: overloadargs__Fiiiiii" "overloadargs(int, int, int, int, int, int)"
+ test_demangling_exact "gnu: overloadargs__Fiiiiiii" "overloadargs(int, int, int, int, int, int, int)"
+ test_demangling_exact "gnu: overloadargs__Fiiiiiiii" "overloadargs(int, int, int, int, int, int, int, int)"
+ test_demangling_exact "gnu: overloadargs__Fiiiiiiiii" "overloadargs(int, int, int, int, int, int, int, int, int)"
+ test_demangling_exact "gnu: overloadargs__Fiiiiiiiiii" "overloadargs(int, int, int, int, int, int, int, int, int, int)"
+ test_demangling_exact "gnu: overloadargs__Fiiiiiiiiiii" "overloadargs(int, int, int, int, int, int, int, int, int, int, int)"
+ test_demangling "gnu: pick__13ivCompositionP8ivCanvasRC12ivAllocationiR5ivHit" \
+ "ivComposition::pick\[(\]+ivCanvas \[*\]+, (const ivAllocation|ivAllocation const) &, int, ivHit &\[)\]+"
+ test_demangling "gnu: pointer__C11ivHScrollerRC7ivEventRC12ivAllocation" \
+ "ivHScroller::pointer\[(\]+(const ivEvent|ivEvent const) &, (const ivAllocation|ivAllocation const) &\[)\]+ const"
+ test_demangling_exact "gnu: poke__8ivRasterUlUlffff" "ivRaster::poke(unsigned long, unsigned long, float, float, float, float)"
+ test_demangling_exact "gnu: polar__Fdd" "polar(double, double)"
+ test_demangling "gnu: read__10osStdInputRPCc" \
+ "osStdInput::read\[(\]+(const char|char const) \[*\]+&\[)\]+"
+
+ test_demangling_exact "gnu: scale__13ivTransformerff" "ivTransformer::scale(float, float)"
+ test_demangling "gnu: scanw__12CursesWindowPCce" \
+ "CursesWindow::scanw\[(\]+(const char|char const) \[*\]+,...\[)\]+"
+ test_demangling "gnu: scmp__FPCcT0" \
+ "scmp\[(\]+(const char|char const) \[*\]+, (const char|char const) \[*\]+\[)\]+"
+ test_demangling_exact "gnu: sgetn__7filebufPci" "filebuf::sgetn(char *, int)"
+ test_demangling_exact "gnu: shift__FP5_FrepiT0" "shift(_Frep *, int, _Frep *)"
+ test_demangling_exact "gnu: test__C6BitSeti" "BitSet::test(int) const"
+ test_demangling_exact "gnu: test__C6BitSetii" "BitSet::test(int, int) const"
+ test_demangling "gnu: testbit__FRC7Integerl" \
+ "testbit\[(\]+(const Integer|Integer const) &, long\[)\]+"
+ test_demangling_exact "gnu: text_source__8Documentl" "Document::text_source(long)"
+ test_demangling_exact "gnu: variance__6Erlangd" "Erlang::variance(double)"
+ test_demangling "gnu: vform__8iostreamPCcPc" \
+ "iostream::vform\[(\]+(const char|char const) \[*\]+, char \[*\]+\[)\]+"
+ test_demangling_exact "gnu: view__14DocumentViewerP8ItemViewP11TabularItem" "DocumentViewer::view(ItemView *, TabularItem *)"
+ test_demangling_exact "gnu: xy_extents__11ivExtensionffff" "ivExtension::xy_extents(float, float, float, float)"
+ test_demangling_exact "gnu: zero__8osMemoryPvUi" "osMemory::zero(void *, unsigned int)"
+ test_demangling_exact "gnu: _2T4\$N" "T4::N"
+ test_demangling_exact "gnu: _Q22T42t1\$N" "T4::t1::N"
+ test_demangling_exact "gnu: get__2T1" "T1::get(void)"
+ test_demangling_exact "gnu: get__Q22T11a" "T1::a::get(void)"
+ test_demangling_exact "gnu: get__Q32T11a1b" "T1::a::b::get(void)"
+ test_demangling_exact "gnu: get__Q42T11a1b1c" "T1::a::b::c::get(void)"
+ test_demangling_exact "gnu: get__Q52T11a1b1c1d" "T1::a::b::c::d::get(void)"
+ test_demangling_exact "gnu: put__2T1i" "T1::put(int)"
+ test_demangling_exact "gnu: put__Q22T11ai" "T1::a::put(int)"
+ test_demangling_exact "gnu: put__Q32T11a1bi" "T1::a::b::put(int)"
+ test_demangling_exact "gnu: put__Q42T11a1b1ci" "T1::a::b::c::put(int)"
+ test_demangling_exact "gnu: put__Q52T11a1b1c1di" "T1::a::b::c::d::put(int)"
+
+ test_demangling_exact "gnu: bar__3fooPv" "foo::bar(void *)"
+ test_demangling "gnu: bar__3fooPCv" \
+ "foo::bar\[(\]+(const void|void const) *\[*\]+\[)\]+"
+ test_demangling_exact "gnu: bar__C3fooPv" "foo::bar(void *) const"
+ test_demangling "gnu: bar__C3fooPCv" \
+ "foo::bar\[(\]+(const void|void const) *\[*\]+\[)\]+ const"
+ test_demangling_exact "gnu: __eq__3fooRT0" "foo::operator==(foo &)"
+ test_demangling "gnu: __eq__3fooRC3foo" \
+ "foo::operator==\[(\]+(const foo|foo const) &\[)\]+"
+ test_demangling_exact "gnu: __eq__C3fooR3foo" "foo::operator==(foo &) const"
+ test_demangling "gnu: __eq__C3fooRT0" \
+ "foo::operator==\[(\]+(const foo|foo const) &\[)\]+ const"
+
+ test_demangling_exact "gnu: elem__t6vector1Zdi" "vector<double>::elem(int)"
+ test_demangling_exact "gnu: elem__t6vector1Zii" "vector<int>::elem(int)"
+ test_demangling_exact "gnu: __t6vector1Zdi" "vector<double>::vector(int)"
+ test_demangling_exact "gnu: __t6vector1Zii" "vector<int>::vector(int)"
+ test_demangling_exact "gnu: _\$_t6vector1Zdi" "vector<double>::~vector(int)"
+ test_demangling_exact "gnu: _\$_t6vector1Zii" "vector<int>::~vector(int)"
+
+ test_demangling_exact "gnu: __nw__t2T11ZcUi" "T1<char>::operator new(unsigned int)"
+ test_demangling_exact "gnu: __nw__t2T11Z1tUi" "T1<t>::operator new(unsigned int)"
+ test_demangling_exact "gnu: __dl__t2T11ZcPv" "T1<char>::operator delete(void *)"
+ test_demangling_exact "gnu: __dl__t2T11Z1tPv" "T1<t>::operator delete(void *)"
+ test_demangling_exact "gnu: __t2T11Zci" "T1<char>::T1(int)"
+ test_demangling_exact "gnu: __t2T11Zc" "T1<char>::T1(void)"
+ test_demangling_exact "gnu: __t2T11Z1ti" "T1<t>::T1(int)"
+ test_demangling_exact "gnu: __t2T11Z1t" "T1<t>::T1(void)"
+
+ test_demangling_exact "gnu: __Q2t4List1Z10VHDLEntity3Pix" \
+ "List<VHDLEntity>::Pix::Pix(void)"
+
+ test_demangling_exact "gnu: __Q2t4List1Z10VHDLEntity3PixPQ2t4List1Z10VHDLEntity7element" \
+ "List<VHDLEntity>::Pix::Pix(List<VHDLEntity>::element *)"
+
+ test_demangling_exact "gnu: __Q2t4List1Z10VHDLEntity3PixRCQ2t4List1Z10VHDLEntity3Pix" \
+ "List<VHDLEntity>::Pix::Pix(List<VHDLEntity>::Pix const &)"
+
+ test_demangling_exact "gnu: __Q2t4List1Z10VHDLEntity7elementRC10VHDLEntityPT0" \
+ "List<VHDLEntity>::element::element(VHDLEntity const &, List<VHDLEntity>::element *)"
+
+ test_demangling_exact "gnu: __Q2t4List1Z10VHDLEntity7elementRCQ2t4List1Z10VHDLEntity7element" \
+ "List<VHDLEntity>::element::element(List<VHDLEntity>::element const &)"
+
+ test_demangling_exact "gnu: __cl__C11VHDLLibraryGt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity" \
+ "VHDLLibrary::operator()(PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >) const"
+
+ test_demangling_exact "gnu: __cl__Ct4List1Z10VHDLEntityRCQ2t4List1Z10VHDLEntity3Pix" \
+ "List<VHDLEntity>::operator()(List<VHDLEntity>::Pix const &) const"
+
+ test_demangling_exact "gnu: __ne__FPvRCQ2t4List1Z10VHDLEntity3Pix" \
+ "operator!=(void *, List<VHDLEntity>::Pix const &)"
+
+ test_demangling_exact "gnu: __ne__FPvRCt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity" \
+ "operator!=(void *, PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> > const &)"
+
+ test_demangling_exact "gnu: __t4List1Z10VHDLEntityRCt4List1Z10VHDLEntity" \
+ "List<VHDLEntity>::List(List<VHDLEntity> const &)"
+
+ test_demangling_exact "gnu: __t4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity" \
+ "PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX(void)"
+
+ test_demangling_exact "gnu: __t4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntityP14VHDLLibraryRepGQ2t4List1Z10VHDLEntity3Pix" \
+ "PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX(VHDLLibraryRep *, List<VHDLEntity>::Pix)"
+
+ test_demangling_exact "gnu: __t4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntityRCt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity" \
+ "PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> >::PixX(PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> > const &)"
+
+ test_demangling_exact "gnu: nextE__C11VHDLLibraryRt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity" \
+ "VHDLLibrary::nextE(PixX<VHDLLibrary, VHDLLibraryRep, List<VHDLEntity> > &) const"
+
+ test_demangling_exact "gnu: next__Ct4List1Z10VHDLEntityRQ2t4List1Z10VHDLEntity3Pix" \
+ "List<VHDLEntity>::next(List<VHDLEntity>::Pix &) const"
+
+ test_demangling_exact "gnu: _GLOBAL_\$D\$set" "global destructors keyed to set"
+
+ test_demangling_exact "gnu: _GLOBAL_\$I\$set" "global constructors keyed to set"
+
+ test_demangling_exact "gnu: __as__t5ListS1ZUiRCt5ListS1ZUi" \
+ "ListS<unsigned int>::operator=(ListS<unsigned int> const &)"
+
+ test_demangling_exact "gnu: __cl__Ct5ListS1ZUiRCQ2t5ListS1ZUi3Vix" \
+ "ListS<unsigned int>::operator()(ListS<unsigned int>::Vix const &) const"
+
+ test_demangling_exact "gnu: __cl__Ct5SetLS1ZUiRCQ2t5SetLS1ZUi3Vix" \
+ "SetLS<unsigned int>::operator()(SetLS<unsigned int>::Vix const &) const"
+
+ test_demangling_exact "gnu: __t10ListS_link1ZUiRCUiPT0" \
+ "ListS_link<unsigned int>::ListS_link(unsigned int const &, ListS_link<unsigned int> *)"
+
+ test_demangling_exact "gnu: __t10ListS_link1ZUiRCt10ListS_link1ZUi" \
+ "ListS_link<unsigned int>::ListS_link(ListS_link<unsigned int> const &)"
+
+ test_demangling_exact "gnu: __t5ListS1ZUiRCt5ListS1ZUi" \
+ "ListS<unsigned int>::ListS(ListS<unsigned int> const &)"
+
+ test_demangling_exact "gnu: next__Ct5ListS1ZUiRQ2t5ListS1ZUi3Vix" \
+ "ListS<unsigned int>::next(ListS<unsigned int>::Vix &) const"
+
+ test_demangling_exact "gnu: __ne__FPvRCQ2t5SetLS1ZUi3Vix" \
+ "operator!=(void *, SetLS<unsigned int>::Vix const &)"
+ test_demangling_exact "gnu: __t8ListElem1Z5LabelRt4List1Z5Label" \
+ "ListElem<Label>::ListElem(List<Label> &)"
+ test_demangling_exact "gnu: __t8BDDHookV1ZPcRCPc" \
+ "BDDHookV<char *>::BDDHookV(char *const &)"
+
+ test_demangling_exact "gnu: _vt\$t8BDDHookV1ZPc" "BDDHookV<char *> virtual table"
+
+ test_demangling_exact "gnu: __ne__FPvRCQ211BDDFunction4VixB" \
+ "operator!=(void *, BDDFunction::VixB const &)"
+ test_demangling_exact "gnu: __eq__FPvRCQ211BDDFunction4VixB" \
+ "operator==(void *, BDDFunction::VixB const &)"
+
+ test_demangling_exact "gnu: relativeId__CQ36T_phi210T_preserve8FPC_nextRCQ26T_phi210T_preserveRC10Parameters" \
+ "T_phi2::T_preserve::FPC_next::relativeId(T_phi2::T_preserve const &, Parameters const &) const"
+
+ test_demangling_exact "gnu: _Utf390_1__1_9223372036854775807__9223372036854775" \
+ "Can't demangle \"_Utf390_1__1_9223372036854775807__9223372036854775\""
+ test_demangling_exact "gnu: foo__I40" "foo(int64_t)"
+ test_demangling_exact "gnu: foo__I_200_" "foo(int512_t)"
+ test_demangling_exact "gnu: foo__I_200" "Can't demangle \"foo__I_200\""
+
+ ## Buffer overrun. Should make GDB crash. Woo hoo!
+ test_demangling_exact "gnu: foo__I_4000000000000000000000000000000000000000000000000000000000000000000000000" "Can't demangle \"foo__I_4000000000000000000000000000000000000000000000000000000000000000000000000\""
+
+ ## 1999-04-19: "Fix from Dale Hawkins". Shouldn't segfault.
+ # Accept even a dubious demangling; the string is ambiguous.
+ send_gdb "maintenance demangle __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator\n"
+ gdb_expect {
+ -re "virtual function thunk \\(delta:-64\\) for CosNaming::_proxy_NamingContext::_0RL__list\\(unsigned long, _CORBA_Unbounded_Sequence<CosNaming::Binding> \\*\\&, CosNaming::BindingIterator \\*\\&\\)\r\n$gdb_prompt $" {
+ pass "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator"
+ }
+ -re ".*Can't demangle \"__thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator\"\r\n$gdb_prompt $" {
+ pass "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator"
+ }
+ timeout {
+ fail "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator (timeout)"
+ }
+ }
+}
+
+#
+# Test lucid style name demangling
+#
+
+proc test_lucid_style_demangling {} {
+ test_demangling_exact "lucid: WS__FR7istream" "WS(istream &)"
+ test_demangling_exact "lucid: __aa__3fooFR3foo" "foo::operator&&(foo &)"
+ test_demangling_exact "lucid: __aad__3fooFR3foo" "foo::operator&=(foo &)"
+ test_demangling_exact "lucid: __ad__3fooFR3foo" "foo::operator&(foo &)"
+ test_demangling_exact "lucid: __adv__3fooFR3foo" "foo::operator/=(foo &)"
+ test_demangling_exact "lucid: __adv__7complexF7complex" "complex::operator/=(complex)"
+ test_demangling_exact "lucid: __aer__3fooFR3foo" "foo::operator^=(foo &)"
+ test_demangling_exact "lucid: __als__3fooFR3foo" "foo::operator<<=(foo &)"
+ test_demangling_exact "lucid: __amd__3fooFR3foo" "foo::operator%=(foo &)"
+ test_demangling_exact "lucid: __ami__3fooFR3foo" "foo::operator-=(foo &)"
+ test_demangling_exact "lucid: __amu__3fooFR3foo" "foo::operator*=(foo &)"
+ test_demangling_exact "lucid: __amu__7complexF7complex" "complex::operator*=(complex)"
+ test_demangling_exact "lucid: __aor__3fooFR3foo" "foo::operator|=(foo &)"
+ test_demangling_exact "lucid: __apl__3fooFR3foo" "foo::operator+=(foo &)"
+ test_demangling_exact "lucid: __ars__3fooFR3foo" "foo::operator>>=(foo &)"
+ test_demangling_exact "lucid: __as__18istream_withassignFP9streambuf" "istream_withassign::operator=(streambuf *)"
+ test_demangling_exact "lucid: __as__18istream_withassignFR7istream" "istream_withassign::operator=(istream &)"
+ test_demangling_exact "lucid: __as__3fooFR3foo" "foo::operator=(foo &)"
+ test_demangling_exact "lucid: __as__3iosFR3ios" "ios::operator=(ios &)"
+ test_demangling_exact "lucid: __cl__3fooFR3foo" "foo::operator()(foo &)"
+ test_demangling_exact "lucid: __cm__3fooFR3foo" "foo::operator, (foo &)"
+
+ test_demangling_exact "lucid: __co__3fooFv" "foo::operator~(void)"
+ test_demangling_exact "lucid: __ct__10istrstreamFPc" "istrstream::istrstream(char *)"
+ test_demangling_exact "lucid: __ct__10istrstreamFPci" "istrstream::istrstream(char *, int)"
+ test_demangling_exact "lucid: __ct__10ostrstreamFPciT2" "ostrstream::ostrstream(char *, int, int)"
+ test_demangling_exact "lucid: __ct__10ostrstreamFv" "ostrstream::ostrstream(void)"
+ test_demangling_exact "lucid: __ct__10smanip_intFPFR3iosi_R3iosi" "smanip_int::smanip_int(ios &(*)(ios &, int), int)"
+ test_demangling "lucid: __ct__11c_exceptionFPcRC7complexT2" "c_exception::c_exception\[(\]+char \[*\]+, (const complex|complex const) &, (const complex|complex const) &\[)\]+"
+ test_demangling "lucid: __ct__11fstreambaseFPCciT2" "fstreambase::fstreambase\[(\]+(const char|char const) \[*\]+, int, int\[)\]+"
+ test_demangling_exact "lucid: __ct__11fstreambaseFi" "fstreambase::fstreambase(int)"
+ test_demangling_exact "lucid: __ct__11fstreambaseFiPcT1" "fstreambase::fstreambase(int, char *, int)"
+ test_demangling_exact "lucid: __ct__11fstreambaseFv" "fstreambase::fstreambase(void)"
+ test_demangling_exact "lucid: __ct__11smanip_longFPFR3iosl_R3iosl" "smanip_long::smanip_long(ios &(*)(ios &, long), long)"
+ test_demangling_exact "lucid: __ct__11stdiostreamFP4FILE" "stdiostream::stdiostream(FILE *)"
+ test_demangling_exact "lucid: __ct__12strstreambufFPFl_PvPFPv_v" "strstreambuf::strstreambuf(void *(*)(long), void (*)(void *))"
+ test_demangling_exact "lucid: __ct__12strstreambufFPUciT1" "strstreambuf::strstreambuf(unsigned char *, int, unsigned char *)"
+ test_demangling_exact "lucid: __ct__12strstreambufFPciT1" "strstreambuf::strstreambuf(char *, int, char *)"
+ test_demangling_exact "lucid: __ct__12strstreambufFi" "strstreambuf::strstreambuf(int)"
+ test_demangling_exact "lucid: __ct__12strstreambufFv" "strstreambuf::strstreambuf(void)"
+ test_demangling_exact "lucid: __ct__13strstreambaseFPciT1" "strstreambase::strstreambase(char *, int, char *)"
+ test_demangling_exact "lucid: __ct__3fooFR3foo" "foo::foo(foo &)"
+
+ test_demangling_exact "lucid: __ct__3fooFi" "foo::foo(int)"
+ test_demangling_exact "lucid: __ct__3fooFiN31" "foo::foo(int, int, int, int)"
+ test_demangling "lucid: __ct__3fooFiPCc" \
+ "foo::foo\[(\]+int, (const char|char const) \[*\]+\[)\]+"
+ test_demangling_exact "lucid: __ct__3fooFiR3fooT1T2T1T2" "foo::foo(int, foo &, int, foo &, int, foo &)"
+ test_demangling_exact "lucid: __ct__3iosFP9streambuf" "ios::ios(streambuf *)"
+ test_demangling_exact "lucid: __ct__7filebufFiPcT1" "filebuf::filebuf(int, char *, int)"
+ test_demangling "lucid: __ct__7fstreamFPCciT2" \
+ "fstream::fstream\[(\]+(const char|char const) \[*\]+, int, int\[)\]+"
+ test_demangling_exact "lucid: __ct__7fstreamFiPcT1" "fstream::fstream(int, char *, int)"
+ test_demangling_exact "lucid: __ct__7istreamFP9streambuf" "istream::istream(streambuf *)"
+ test_demangling_exact "lucid: __ct__7istreamFP9streambufiP7ostream" "istream::istream(streambuf *, int, ostream *)"
+ test_demangling_exact "lucid: __ct__7istreamFiPcT1" "istream::istream(int, char *, int)"
+ test_demangling_exact "lucid: __ct__7istreamFiT1P7ostream" "istream::istream(int, int, ostream *)"
+ test_demangling_exact "lucid: __ct__7ostreamFP9streambuf" "ostream::ostream(streambuf *)"
+ test_demangling_exact "lucid: __ct__7ostreamFiPc" "ostream::ostream(int, char *)"
+ test_demangling "lucid: __ct__8ifstreamFPCciT2" \
+ "ifstream::ifstream\[(\]+(const char|char const) \[*\]+, int, int\[)\]+"
+ test_demangling_exact "lucid: __ct__8ifstreamFiPcT1" "ifstream::ifstream(int, char *, int)"
+
+ test_demangling_exact "lucid: __ct__Q23foo3barFv" "foo::bar::bar(void)"
+ test_demangling_exact "lucid: __ct__Q33foo3bar4bellFv" "foo::bar::bell::bell(void)"
+ test_demangling_exact "lucid: __dl__3fooSFPv" "foo::operator delete(void *) static"
+ test_demangling_exact "lucid: __dl__FPv" "operator delete(void *)"
+ test_demangling_exact "lucid: __dt__10istrstreamFv" "istrstream::~istrstream(void)"
+
+ test_demangling_exact "lucid: __dt__Q23foo3barFv" "foo::bar::~bar(void)"
+ test_demangling_exact "lucid: __dt__Q33foo3bar4bellFv" "foo::bar::bell::~bell(void)"
+ test_demangling_exact "lucid: __dv__3fooFR3foo" "foo::operator/(foo &)"
+ test_demangling_exact "lucid: __dv__F7complexT1" "operator/(complex, complex)"
+ test_demangling_exact "lucid: __eq__3fooFR3foo" "foo::operator==(foo &)"
+ test_demangling_exact "lucid: __er__3fooFR3foo" "foo::operator^(foo &)"
+ test_demangling_exact "lucid: __ge__3fooFR3foo" "foo::operator>=(foo &)"
+ test_demangling_exact "lucid: __gt__3fooFR3foo" "foo::operator>(foo &)"
+ test_demangling_exact "lucid: __le__3fooFR3foo" "foo::operator<=(foo &)"
+ test_demangling_exact "lucid: __ls__3fooFR3foo" "foo::operator<<(foo &)"
+ test_demangling_exact "lucid: __ls__7ostreamFP9streambuf" "ostream::operator<<(streambuf *)"
+
+ test_demangling "lucid: __ls__7ostreamFPCc" \
+ "ostream::operator<<\[(\]+(const char|char const) \[*\]+\[)\]+"
+ test_demangling_exact "lucid: __ls__7ostreamFPFR3ios_R3ios" "ostream::operator<<(ios &(*)(ios &))"
+ test_demangling_exact "lucid: __ls__7ostreamFPv" "ostream::operator<<(void *)"
+ test_demangling_exact "lucid: __ls__7ostreamFUi" "ostream::operator<<(unsigned int)"
+ test_demangling_exact "lucid: __ls__7ostreamFUl" "ostream::operator<<(unsigned long)"
+ test_demangling_exact "lucid: __ls__7ostreamFd" "ostream::operator<<(double)"
+ test_demangling_exact "lucid: __ls__7ostreamFf" "ostream::operator<<(float)"
+ test_demangling_exact "lucid: __ls__7ostreamFi" "ostream::operator<<(int)"
+ test_demangling_exact "lucid: __ls__7ostreamFl" "ostream::operator<<(long)"
+ test_demangling_exact "lucid: __ls__FR7ostream7complex" "operator<<(ostream &, complex)"
+ test_demangling_exact "lucid: __lt__3fooFR3foo" "foo::operator<(foo &)"
+ test_demangling_exact "lucid: __md__3fooFR3foo" "foo::operator%(foo &)"
+ test_demangling_exact "lucid: __mi__3fooFR3foo" "foo::operator-(foo &)"
+ test_demangling_exact "lucid: __ml__3fooFR3foo" "foo::operator*(foo &)"
+ test_demangling_exact "lucid: __ml__F7complexT1" "operator*(complex, complex)"
+ test_demangling_exact "lucid: __mm__3fooFi" "foo::operator--(int)"
+ test_demangling_exact "lucid: __ne__3fooFR3foo" "foo::operator!=(foo &)"
+ test_demangling_exact "lucid: __nt__3fooFv" "foo::operator!(void)"
+ test_demangling_exact "lucid: __nw__3fooSFi" "foo::operator new(int) static"
+ test_demangling_exact "lucid: __nw__FUi" "operator new(unsigned int)"
+ test_demangling_exact "lucid: __nw__FUiPv" "operator new(unsigned int, void *)"
+ test_demangling_exact "lucid: __oo__3fooFR3foo" "foo::operator||(foo &)"
+ test_demangling_exact "lucid: __opPc__3fooFv" "foo::operator char *(void)"
+ test_demangling_exact "lucid: __opi__3fooFv" "foo::operator int(void)"
+ test_demangling_exact "lucid: __or__3fooFR3foo" "foo::operator|(foo &)"
+
+ test_demangling_exact "lucid: __pl__3fooFR3foo" "foo::operator+(foo &)"
+ test_demangling_exact "lucid: __pp__3fooFi" "foo::operator++(int)"
+ test_demangling_exact "lucid: __pt__3fooFv" "foo::operator->(void)"
+ test_demangling_exact "lucid: __rm__3fooFR3foo" "foo::operator->*(foo &)"
+ test_demangling_exact "lucid: __rs__3fooFR3foo" "foo::operator>>(foo &)"
+ test_demangling_exact "lucid: __rs__7istreamFP9streambuf" "istream::operator>>(streambuf *)"
+ test_demangling_exact "lucid: __rs__7istreamFPFR3ios_R3ios" "istream::operator>>(ios &(*)(ios &))"
+ test_demangling_exact "lucid: __rs__7istreamFPFR7istream_R7istream" "istream::operator>>(istream &(*)(istream &))"
+ test_demangling_exact "lucid: __rs__7istreamFPUc" "istream::operator>>(unsigned char *)"
+ test_demangling_exact "lucid: __rs__7istreamFPc" "istream::operator>>(char *)"
+ test_demangling_exact "lucid: __rs__7istreamFRUi" "istream::operator>>(unsigned int &)"
+ test_demangling_exact "lucid: __rs__7istreamFRUl" "istream::operator>>(unsigned long &)"
+ test_demangling_exact "lucid: __rs__7istreamFRUs" "istream::operator>>(unsigned short &)"
+ test_demangling_exact "lucid: __rs__7istreamFRd" "istream::operator>>(double &)"
+ test_demangling_exact "lucid: __rs__7istreamFRf" "istream::operator>>(float &)"
+ test_demangling_exact "lucid: __rs__7istreamFRi" "istream::operator>>(int &)"
+ test_demangling_exact "lucid: __rs__7istreamFRl" "istream::operator>>(long &)"
+ test_demangling_exact "lucid: __rs__7istreamFRs" "istream::operator>>(short &)"
+ test_demangling_exact "lucid: __rs__FR7istreamR7complex" "operator>>(istream &, complex &)"
+ test_demangling "lucid: __vc__3fooFR3foo" "foo::operator\\\[\\\]\\(foo &\\)"
+ test_demangling_exact "lucid: __vtbl__10istrstream" "istrstream virtual table"
+ test_demangling_exact "lucid: __vtbl__17ostream__iostream__19iostream_withassign" "iostream_withassign::ostream__iostream virtual table"
+
+ test_demangling_exact "lucid: __vtbl__3ios" "ios virtual table"
+ test_demangling_exact "lucid: __vtbl__3ios__13strstreambase" "strstreambase::ios virtual table"
+
+ # GDB 930414 demangles this as t_cc_main_ (obviously wrong).
+ # GDB 930701 gets into an infinite loop.
+ # GDB 930727 says "Can't demangle".
+ # What is the correct demangling? FIXME.
+ setup_xfail "*-*-*"
+ test_demangling_exact "lucid: __vtbl__3foo__vt_cc_main_" ""
+
+ test_demangling_exact "lucid: abs__F7complex" "abs(complex)"
+ test_demangling_exact "lucid: allocate__9streambufFv" "streambuf::allocate(void)"
+ test_demangling_exact "lucid: attach__11fstreambaseFi" "fstreambase::attach(int)"
+ test_demangling_exact "lucid: bitalloc__3iosSFv" "ios::bitalloc(void) static"
+ test_demangling_exact "lucid: chr__FiT1" "chr(int, int)"
+ test_demangling_exact "lucid: complex_error__FR11c_exception" "complex_error(c_exception &)"
+ test_demangling_exact "lucid: complexfunc2__FPFPc_i" "complexfunc2(int (*)(char *))"
+ test_demangling_exact "lucid: complexfunc3__FPFPFPl_s_i" "complexfunc3(int (*)(short (*)(long *)))"
+
+ test_demangling_exact "lucid: complexfunc4__FPFPFPc_s_i" "complexfunc4(int (*)(short (*)(char *)))"
+ test_demangling_exact "lucid: complexfunc5__FPFPc_PFl_i" "complexfunc5(int (*(*)(char *))(long))"
+ test_demangling_exact "lucid: complexfunc6__FPFPi_PFl_i" "complexfunc6(int (*(*)(int *))(long))"
+ test_demangling_exact "lucid: complexfunc7__FPFPFPc_i_PFl_i" "complexfunc7(int (*(*)(int (*)(char *)))(long))"
+ test_demangling_exact "lucid: complicated_put__7ostreamFc" "ostream::complicated_put(char)"
+ test_demangling_exact "lucid: conv10__FlPc" "conv10(long, char *)"
+ test_demangling_exact "lucid: conv16__FUlPc" "conv16(unsigned long, char *)"
+ test_demangling_exact "lucid: dec__FR3ios" "dec(ios &)"
+ test_demangling_exact "lucid: dec__Fli" "dec(long, int)"
+ test_demangling_exact "lucid: dofield__FP7ostreamPciT2T3" "dofield(ostream *, char *, int, char *, int)"
+
+ test_demangling_exact "lucid: flags__3iosFl" "ios::flags(long)"
+ test_demangling_exact "lucid: flags__3iosFv" "ios::flags(void)"
+ test_demangling_exact "lucid: foo__FiN31" "foo(int, int, int, int)"
+ test_demangling_exact "lucid: foo__FiR3fooT1T2T1T2" "foo(int, foo &, int, foo &, int, foo &)"
+ test_demangling_exact "lucid: foo___3barFl" "bar::foo_(long)"
+ test_demangling "lucid: form__FPCce" "form\[(\]+(const char|char const) \[*\]+,...\[)\]+"
+ test_demangling_exact "lucid: get__7istreamFPcic" "istream::get(char *, int, char)"
+ test_demangling_exact "lucid: get__7istreamFR9streambufc" "istream::get(streambuf &, char)"
+ test_demangling_exact "lucid: get_complicated__7istreamFRUc" "istream::get_complicated(unsigned char &)"
+ test_demangling_exact "lucid: get_complicated__7istreamFRc" "istream::get_complicated(char &)"
+ test_demangling_exact "lucid: getline__7istreamFPUcic" "istream::getline(unsigned char *, int, char)"
+ test_demangling_exact "lucid: getline__7istreamFPcic" "istream::getline(char *, int, char)"
+
+ test_demangling_exact "lucid: ignore__7istreamFiT1" "istream::ignore(int, int)"
+ test_demangling_exact "lucid: init__12strstreambufFPciT1" "strstreambuf::init(char *, int, char *)"
+ test_demangling_exact "lucid: init__3iosFP9streambuf" "ios::init(streambuf *)"
+ test_demangling_exact "lucid: initcount__13Iostream_init" "Iostream_init::initcount"
+ test_demangling_exact "lucid: ipfx__7istreamFi" "istream::ipfx(int)"
+ test_demangling_exact "lucid: ls_complicated__7ostreamFUc" "ostream::ls_complicated(unsigned char)"
+ test_demangling_exact "lucid: ls_complicated__7ostreamFc" "ostream::ls_complicated(char)"
+ test_demangling "lucid: open__11fstreambaseFPCciT2" \
+ "fstreambase::open\[(\]+(const char|char const) \[*\]+, int, int\[)\]+"
+ test_demangling "lucid: open__7filebufFPCciT2" \
+ "filebuf::open\[(\]+(const char|char const) \[*\]+, int, int\[)\]+"
+
+ test_demangling_exact "lucid: overload1arg__FSc" "overload1arg(signed char)"
+ test_demangling_exact "lucid: overload1arg__FUc" "overload1arg(unsigned char)"
+ test_demangling_exact "lucid: overload1arg__FUi" "overload1arg(unsigned int)"
+ test_demangling_exact "lucid: overload1arg__FUl" "overload1arg(unsigned long)"
+ test_demangling_exact "lucid: overload1arg__FUs" "overload1arg(unsigned short)"
+ test_demangling_exact "lucid: overload1arg__Fc" "overload1arg(char)"
+ test_demangling_exact "lucid: overload1arg__Fd" "overload1arg(double)"
+ test_demangling_exact "lucid: overload1arg__Ff" "overload1arg(float)"
+ test_demangling_exact "lucid: overload1arg__Fi" "overload1arg(int)"
+ test_demangling_exact "lucid: overload1arg__Fl" "overload1arg(long)"
+ test_demangling_exact "lucid: overload1arg__Fs" "overload1arg(short)"
+ test_demangling_exact "lucid: overload1arg__Fv" "overload1arg(void)"
+ test_demangling_exact "lucid: overloadargs__FiN21" "overloadargs(int, int, int)"
+ test_demangling_exact "lucid: overloadargs__FiN31" "overloadargs(int, int, int, int)"
+ test_demangling_exact "lucid: overloadargs__FiN41" "overloadargs(int, int, int, int, int)"
+ test_demangling_exact "lucid: overloadargs__FiN51" "overloadargs(int, int, int, int, int, int)"
+ test_demangling_exact "lucid: overloadargs__FiN61" "overloadargs(int, int, int, int, int, int, int)"
+
+ test_demangling_exact "lucid: overloadargs__FiN71" "overloadargs(int, int, int, int, int, int, int, int)"
+ test_demangling_exact "lucid: overloadargs__FiN81" "overloadargs(int, int, int, int, int, int, int, int, int)"
+ test_demangling_exact "lucid: overloadargs__FiN91" "overloadargs(int, int, int, int, int, int, int, int, int, int)"
+ test_demangling_exact "lucid: overloadargs__FiN91N11" "overloadargs(int, int, int, int, int, int, int, int, int, int, int)"
+ test_demangling_exact "lucid: overloadargs__FiT1" "overloadargs(int, int)"
+ test_demangling_exact "lucid: polar__FdT1" "polar(double, double)"
+ test_demangling_exact "lucid: pow__F7complexT1" "pow(complex, complex)"
+ test_demangling_exact "lucid: pow__F7complexd" "pow(complex, double)"
+ test_demangling_exact "lucid: pow__F7complexi" "pow(complex, int)"
+ test_demangling_exact "lucid: pow__Fd7complex" "pow(double, complex)"
+ test_demangling_exact "lucid: pstart__FPciT2" "pstart(char *, int, int)"
+ test_demangling_exact "lucid: put__7ostreamFc" "ostream::put(char)"
+
+ test_demangling_exact "lucid: read__7istreamFPci" "istream::read(char *, int)"
+ test_demangling_exact "lucid: resetiosflags__FR3iosl" "resetiosflags(ios &, long)"
+ test_demangling_exact "lucid: restore_errno__FRi" "restore_errno(int &)"
+ test_demangling_exact "lucid: rs_complicated__7istreamFRUc" "istream::rs_complicated(unsigned char &)"
+ test_demangling_exact "lucid: rs_complicated__7istreamFRc" "istream::rs_complicated(char &)"
+ test_demangling_exact "lucid: seekg__7istreamFl8seek_dir" "istream::seekg(long, seek_dir)"
+ test_demangling_exact "lucid: seekoff__12strstreambufFl8seek_diri" "strstreambuf::seekoff(long, seek_dir, int)"
+ test_demangling_exact "lucid: seekoff__9streambufFlQ2_3ios12ios_seek_diri" "streambuf::seekoff(long, ios::ios_seek_dir, int)"
+ test_demangling_exact "lucid: seekpos__9streambufFli" "streambuf::seekpos(long, int)"
+ test_demangling_exact "lucid: set_new_handler__FPFv_v" "set_new_handler(void (*)(void))"
+ test_demangling_exact "lucid: setb__9streambufFPcT1i" "streambuf::setb(char *, char *, int)"
+
+ test_demangling_exact "lucid: setb__FR3iosi" "setb(ios &, int)"
+ test_demangling_exact "lucid: setbuf__11fstreambaseFPci" "fstreambase::setbuf(char *, int)"
+ test_demangling_exact "lucid: setbuf__9streambufFPUci" "streambuf::setbuf(unsigned char *, int)"
+ test_demangling_exact "lucid: setbuf__9streambufFPciT2" "streambuf::setbuf(char *, int, int)"
+ test_demangling_exact "lucid: setf__3iosFlT1" "ios::setf(long, long)"
+ test_demangling_exact "lucid: setfill__FR3iosi" "setfill(ios &, int)"
+ test_demangling_exact "lucid: setg__9streambufFPcN21" "streambuf::setg(char *, char *, char *)"
+ test_demangling_exact "lucid: setp__9streambufFPcT1" "streambuf::setp(char *, char *)"
+
+ test_demangling "lucid: sputn__9streambufFPCci" \
+ "streambuf::sputn\[(\]+(const char|char const) \[*\]+, int\[)\]+"
+ test_demangling "lucid: str__FPCci" \
+ "str\[(\]+(const char|char const) \[*\]+, int\[)\]+"
+ test_demangling_exact "lucid: tie__3iosFP7ostream" "ios::tie(ostream *)"
+ test_demangling_exact "lucid: uconv10__FUlPc" "uconv10(unsigned long, char *)"
+
+ test_demangling "lucid: write__7ostreamFPCci" \
+ "ostream::write\[(\]+(const char|char const) \[*\]+, int\[)\]+"
+ test_demangling_exact "lucid: xget__7istreamFPc" "istream::xget(char *)"
+ test_demangling_exact "lucid: xsgetn__9streambufFPci" "streambuf::xsgetn(char *, int)"
+ test_demangling "lucid: xsputn__9streambufFPCci" \
+ "streambuf::xsputn\[(\]+(const char|char const) \[*\]+, int\[)\]+"
+
+ test_demangling_exact "lucid: _Utf390_1__1_9223372036854775807__9223372036854775" \
+ "Can't demangle \"_Utf390_1__1_9223372036854775807__9223372036854775\""
+}
+
+#
+# Test arm style name demangling
+#
+
+proc test_arm_style_demangling {} {
+ test_demangling_exact "arm: __dt__21T5__pt__11_PFiPPdPv_iFv" "T5<int (*)(int, double **, void *)>::~T5(void)"
+
+ test_demangling_exact "arm: __ct__1cFi" "c::c(int)"
+
+ test_demangling_exact "arm: __dt__11T5__pt__2_iFv" "T5<int>::~T5(void)"
+
+ test_demangling_exact "arm: __dt__11T5__pt__2_cFv" "T5<char>::~T5(void)"
+
+ test_demangling_exact "arm: __ct__2T2Fi" "T2::T2(int)"
+ test_demangling_exact "arm: __dt__2T1Fv" "T1::~T1(void)"
+
+ test_demangling_exact "arm: __dt__12T5__pt__3_1xFv" "T5<x>::~T5(void)"
+
+ test_demangling_exact "arm: __dt__17T5__pt__8_PFcPv_iFv" "T5<int (*)(char, void *)>::~T5(void)"
+
+ test_demangling "arm: g__FP1cPC1cT1" \
+ "g\[(\]+c *\[*\]+, (const c|c const) *\[*\]+, c *\[*\]+\[)\]+"
+ test_demangling "arm: g__FPUlPCUlT1" \
+ "g\[(\]+unsigned long \[*\]+, (const unsigned long|unsigned long const) \[*\]+, unsigned long \[*\]+\[)\]+"
+ test_demangling "arm: g__FPUiPCUiT1" \
+ "g\[(\]+unsigned int \[*\]+, (const unsigned int|unsigned int const) \[*\]+, unsigned int \[*\]+\[)\]+"
+ test_demangling "arm: g__FPUsPCUsT1" \
+ "g\[(\]+unsigned short \[*\]+, (const unsigned short|unsigned short const) \[*\]+, unsigned short \[*\]+\[)\]+"
+ test_demangling "arm: g__FPUcPCUcT1" \
+ "g\[(\]+unsigned char \[*\]+, (const unsigned char|unsigned char const) \[*\]+, unsigned char \[*\]+\[)\]+"
+ test_demangling "arm: g__F1TPlPClT2" \
+ "g\[(\]+T, long \[*\]+, (const long|long const) \[*\]+, long \[*\]+\[)\]+"
+ test_demangling "arm: g__F1RRlRClT2" \
+ "g\[(\]+R, long &, (const long|long const) &, long &\[)\]+"
+ test_demangling "arm: g__F1TPiPCiT2" \
+ "g\[(\]+T, int \[*\]+, (const int|int const) \[*\]+, int \[*\]+\[)\]+"
+ test_demangling "arm: g__F1RRiRCiT2" \
+ "g\[(\]+R, int &, (const int|int const) &, int &\[)\]+"
+ test_demangling "arm: g__F1TPsPCsT2" \
+ "g\[(\]+T, short \[*\]+, (const short|short const) \[*\]+, short \[*\]+\[)\]+"
+ test_demangling "arm: g__F1RRsRCsT2" \
+ "g\[(\]+R, short &, (const short|short const) &, short &\[)\]+"
+ test_demangling "arm: g__F1TPcPCcT2" \
+ "g\[(\]+T, char \[*\]+, (const char|char const) \[*\]+, char \[*\]+\[)\]+"
+ test_demangling "arm: g__F1RRcRCcT2" \
+ "g\[(\]+R, char &, (const char|char const) &, char &\[)\]+"
+
+ test_demangling_exact "arm: __ct__21T5__pt__11_PFiPPdPv_iFi" "T5<int (*)(int, double **, void *)>::T5(int)"
+
+ test_demangling "arm: __gt__FRC2T2c" \
+ "operator>\[(\]+(const T2|T2 const) &, char\[)\]+"
+ test_demangling "arm: __ge__FRC2T2c" \
+ "operator>=\[(\]+(const T2|T2 const) &, char\[)\]+"
+ test_demangling "arm: __lt__FRC2T2c" \
+ "operator<\[(\]+(const T2|T2 const) &, char\[)\]+"
+
+ test_demangling "arm: __le__FRC2T2c" \
+ "operator<=\[(\]+(const T2|T2 const) &, char\[)\]+"
+ test_demangling "arm: __ne__FRC2T2c" \
+ "operator!=\[(\]+(const T2|T2 const) &, char\[)\]+"
+ test_demangling "arm: __eq__FRC2T2c" \
+ "operator==\[(\]+(const T2|T2 const) &, char\[)\]+"
+ test_demangling_exact "arm: __amd__FR2T2i" "operator%=(T2 &, int)"
+ test_demangling_exact "arm: __adv__FR2T2i" "operator/=(T2 &, int)"
+ test_demangling_exact "arm: __amu__FR2T2i" "operator*=(T2 &, int)"
+ test_demangling_exact "arm: __ami__FR2T2i" "operator-=(T2 &, int)"
+ test_demangling_exact "arm: __apl__FR2T2i" "operator+=(T2 &, int)"
+ test_demangling_exact "arm: __nw__2T1SFUi" "T1::operator new(unsigned int) static"
+ test_demangling_exact "arm: __dl__2T1SFPv" "T1::operator delete(void *) static"
+ test_demangling_exact "arm: put__2T7SFi" "T7::put(int) static"
+
+ test_demangling_exact "arm: __dl__12T5__pt__3_1xSFPv" "T5<x>::operator delete(void *) static"
+
+ test_demangling_exact "arm: h__FUc" "h(unsigned char)"
+ test_demangling_exact "arm: f__Fic" "f(int, char)"
+ test_demangling_exact "arm: h__FUi" "h(unsigned int)"
+ test_demangling_exact "arm: h__Fci" "h(char, int)"
+ test_demangling_exact "arm: h__FUl" "h(unsigned long)"
+ test_demangling_exact "arm: h__Fcl" "h(char, long)"
+ test_demangling_exact "arm: h__FUs" "h(unsigned short)"
+ test_demangling_exact "arm: h__Fcs" "h(char, short)"
+ test_demangling "arm: __amd__FR2T2RC2T2" \
+ "operator%=\[(\]+T2 &, (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __adv__FR2T2RC2T2" \
+ "operator/=\[(\]+T2 &, (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __amu__FR2T2RC2T2" \
+ "operator\[*\]+=\[(\]+T2 &, (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __ami__FR2T2RC2T2" \
+ "operator-=\[(\]+T2 &, (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __apl__FR2T2RC2T2" \
+ "operator\[+\]+=\[(\]+T2 &, (const T2|T2 const) &\[)\]+"
+
+ test_demangling "arm: g__F1SRPUlRPCUlT2" \
+ "g\[(\]+S, unsigned long \[*\]+&, (const unsigned long|unsigned long const) \[*\]+&, unsigned long \[*\]+&\[)\]+"
+ test_demangling "arm: g__F1SRPUiRPCUiT2" \
+ "g\[(\]+S, unsigned int \[*\]+&, (const unsigned int|unsigned int const) \[*\]+&, unsigned int \[*\]+&\[)\]+"
+ test_demangling "arm: g__F1SRPUsRPCUsT2" \
+ "g\[(\]+S, unsigned short \[*\]+&, (const unsigned short|unsigned short const) \[*\]+&, unsigned short \[*\]+&\[)\]+"
+ test_demangling "arm: g__F1SRPUcRPCUcT2" \
+ "g\[(\]+S, unsigned char \[*\]+&, (const unsigned char|unsigned char const) \[*\]+&, unsigned char \[*\]+&\[)\]+"
+ test_demangling "arm: g__F1T1SRPlRPClT3" \
+ "g\[(\]+T, S, long \[*\]+&, (const long|long const) \[*\]+&, long \[*\]+&\[)\]+"
+ test_demangling "arm: g__F1T1SRPiRPCiT3" \
+ "g\[(\]+T, S, int \[*\]+&, (const int|int const) \[*\]+&, int \[*\]+&\[)\]+"
+ test_demangling "arm: g__F1T1SRPcRPCcT3" \
+ "g\[(\]+T, S, char \[*\]+&, (const char|char const) \[*\]+&, char \[*\]+&\[)\]+"
+
+ test_demangling_exact "arm: X__12T5__pt__3_1x" "T5<x>::X"
+
+ test_demangling_exact "arm: __ct__11T5__pt__2_iFi" "T5<int>::T5(int)"
+
+ test_demangling_exact "arm: __ct__11T5__pt__2_cFi" "T5<char>::T5(int)"
+
+ test_demangling "arm: __gt__FRC2T2T1" \
+ "operator>\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __ge__FRC2T2T1" \
+ "operator>=\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __lt__FRC2T2T1" \
+ "operator<\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __le__FRC2T2T1" \
+ "operator<=\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __ne__FRC2T2T1" \
+ "operator!=\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __eq__FRC2T2T1" \
+ "operator==\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: g__FcR1cRC1cT2" \
+ "g\[(\]+char, c &, (const c|c const) &, c &\[)\]+"
+ test_demangling "arm: g__FcRPdRPCdT2" \
+ "g\[(\]+char, double *\[*\]+&, (const double|double const) *\[*\]+&, double *\[*\]+&\[)\]+"
+ test_demangling "arm: g__FcRPfRPCfT2" \
+ "g\[(\]+char, float *\[*\]+&, (const float|float const) *\[*\]+&, float *\[*\]+&\[)\]+"
+ test_demangling_exact "arm: h__FcT1" "h(char, char)"
+ test_demangling_exact "arm: f__Ficd" "f(int, char, double)"
+ test_demangling "arm: g__F1T1SdRPsRPCsT4" \
+ "g\[(\]+T, S, double, short \[*\]+&, (const short|short const) \[*\]+&, short \[*\]+&\[)\]+"
+ test_demangling "arm: g__F1cC1cT1" \
+ "g\[(\]+c, (const c|c const), c\[)\]+"
+ test_demangling "arm: g__FPdPCdT1" \
+ "g\[(\]+double *\[*\]+, (const double|double const) *\[*\]+, double *\[*\]+\[)\]+"
+ test_demangling "arm: g__FPfPCfT1" \
+ "g\[(\]+float *\[*\]+, (const float|float const) *\[*\]+, float *\[*\]+\[)\]+"
+
+ test_demangling "arm: g__FUlCUlT1" \
+ "g\[(\]+unsigned long, (const unsigned long|unsigned long const), unsigned long\[)\]+"
+ test_demangling "arm: g__FPlPClT1" \
+ "g\[(\]+long \[*\]+, (const long|long const) \[*\]+, long \[*\]+\[)\]+"
+ test_demangling "arm: g__FUiCUiT1" \
+ "g\[(\]+unsigned int, (const unsigned int|unsigned int const), unsigned int\[)\]+"
+ test_demangling "arm: g__FPiPCiT1" \
+ "g\[(\]+int \[*\]+, (const int|int const) \[*\]+, int \[*\]+\[)\]+"
+ test_demangling "arm: g__FUsCUsT1" \
+ "g\[(\]+unsigned short, (const unsigned short|unsigned short const), unsigned short\[)\]+"
+ test_demangling "arm: g__FPsPCsT1" \
+ "g\[(\]+short \[*\]+, (const short|short const) \[*\]+, short \[*\]+\[)\]+"
+ test_demangling "arm: g__FUcCUcT1" \
+ "g\[(\]+unsigned char, (const unsigned char|unsigned char const), unsigned char\[)\]+"
+ test_demangling "arm: g__FPcPCcT1" \
+ "g\[(\]+char \[*\]+, (const char|char const) \[*\]+, char \[*\]+\[)\]+"
+ test_demangling "arm: g__F1TlClT2" \
+ "g\[(\]+T, long, (const long|long const), long\[)\]+"
+ test_demangling "arm: g__F1TiCiT2" \
+ "g\[(\]+T, int, (const int|int const), int\[)\]+"
+ test_demangling "arm: g__F1TsCsT2" \
+ "g\[(\]+T, short, (const short|short const), short\[)\]+"
+ test_demangling "arm: g__F1TcCcT2" \
+ "g\[(\]+T, char, (const char|char const), char\[)\]+"
+
+ test_demangling_exact "arm: __dl__17T5__pt__8_PFcPv_iSFPv" "T5<int (*)(char, void *)>::operator delete(void *) static"
+
+ test_demangling "arm: printf__FPCce" \
+ "printf\[(\]+(const char|char const) \[*\]+,...\[)\]+"
+
+ test_demangling_exact "arm: X__17T5__pt__8_PFcPv_i" "T5<int (*)(char, void *)>::X"
+
+ test_demangling_exact "arm: __ct__12T5__pt__3_1xFi" "T5<x>::T5(int)"
+
+ test_demangling "arm: g__F1SRUlRCUlT2" \
+ "g\[(\]+S, unsigned long &, (const unsigned long|unsigned long const) &, unsigned long &\[)\]+"
+ test_demangling "arm: g__F1SRPlRPClT2" \
+ "g\[(\]+S, long \[*\]+&, (const long|long const) \[*\]+&, long \[*\]+&\[)\]+"
+ test_demangling "arm: g__F1RRUiRCUiT2" \
+ "g\[(\]+R, unsigned int &, (const unsigned int|unsigned int const) &, unsigned int &\[)\]+"
+ test_demangling "arm: g__F1SRPiRPCiT2" \
+ "g\[(\]+S, int \[*\]+&, (const int|int const) \[*\]+&, int \[*\]+&\[)\]+"
+ test_demangling "arm: g__F1RRUsRCUsT2" \
+ "g\[(\]+R, unsigned short &, (const unsigned short|unsigned short const) &, unsigned short &\[)\]+"
+ test_demangling "arm: g__F1SRPsRPCsT2" \
+ "g\[(\]+S, short \[*\]+&, (const short|short const) \[*\]+&, short \[*\]+&\[)\]+"
+ test_demangling "arm: g__F1RRUcRCUcT2" \
+ "g\[(\]+R, unsigned char &, (const unsigned char|unsigned char const) &, unsigned char &\[)\]+"
+ test_demangling "arm: g__F1SRPcRPCcT2" \
+ "g\[(\]+S, char \[*\]+&, (const char|char const) \[*\]+&, char \[*\]+&\[)\]+"
+ test_demangling "arm: g__F1T1RRlRClT3" \
+ "g\[(\]+T, R, long &, (const long|long const) &, long &\[)\]+"
+ test_demangling "arm: g__F1T1RRiRCiT3" \
+ "g\[(\]+T, R, int &, (const int|int const) &, int &\[)\]+"
+ test_demangling "arm: g__F1T1RRsRCsT3" \
+ "g\[(\]+T, R, short &, (const short|short const) &, short &\[)\]+"
+ test_demangling "arm: g__F1T1RRcRCcT3" \
+ "g\[(\]+T, R, char &, (const char|char const) &, char &\[)\]+"
+
+ test_demangling_exact "arm: __dl__21T5__pt__11_PFiPPdPv_iSFPv" "T5<int (*)(int, double **, void *)>::operator delete(void *) static"
+
+ test_demangling_exact "arm: __std__foo" "global destructors keyed to foo"
+
+ test_demangling_exact "arm: __sti__bar" "global constructors keyed to bar"
+
+ test_demangling_exact "arm: f__FicdPcPFci_v" "f(int, char, double, char *, void (*)(char, int))"
+ test_demangling_exact "arm: f__FicdPcPFic_v" "f(int, char, double, char *, void (*)(int, char))"
+ test_demangling_exact "arm: get__2T7SFv" "T7::get(void) static"
+
+ test_demangling_exact "arm: X__21T5__pt__11_PFiPPdPv_i" "T5<int (*)(int, double **, void *)>::X"
+
+ test_demangling "arm: g__FcRdRCdT2" \
+ "g\[(\]+char, double &, (const double|double const) &, double &\[)\]+"
+ test_demangling "arm: g__FcRfRCfT2" \
+ "g\[(\]+char, float &, (const float|float const) &, float &\[)\]+"
+ test_demangling "arm: __md__FC2T2i" \
+ "operator%\[(\]+(const T2|T2 const), int\[)\]+"
+ test_demangling "arm: __dv__FC2T2i" \
+ "operator/\[(\]+(const T2|T2 const), int\[)\]+"
+ test_demangling "arm: __ml__FC2T2i" \
+ "operator\[*\]+\[(\]+(const T2|T2 const), int\[)\]+"
+ test_demangling "arm: __mi__FC2T2i" \
+ "operator-\[(\]+(const T2|T2 const), int\[)\]+"
+ test_demangling "arm: __pl__FC2T2i" \
+ "operator\[+\]+\[(\]+(const T2|T2 const), int\[)\]+"
+
+ test_demangling_exact "arm: __dl__11T5__pt__2_iSFPv" "T5<int>::operator delete(void *) static"
+
+ test_demangling_exact "arm: __dl__11T5__pt__2_cSFPv" "T5<char>::operator delete(void *) static"
+
+ test_demangling_exact "arm: h__Fc" "h(char)"
+ test_demangling_exact "arm: h__Fd" "h(double)"
+ test_demangling_exact "arm: h__Ff" "h(float)"
+ test_demangling_exact "arm: h__Fi" "h(int)"
+ test_demangling_exact "arm: f__Fi" "f(int)"
+ test_demangling_exact "arm: h__Fl" "h(long)"
+
+ test_demangling_exact "arm: h__Fs" "h(short)"
+ test_demangling "arm: __md__FC2T2RC2T2" \
+ "operator%\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __dv__FC2T2RC2T2" \
+ "operator/\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __ml__FC2T2RC2T2" \
+ "operator\[*\]+\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __mi__FC2T2RC2T2" \
+ "operator-\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: __pl__FC2T2RC2T2" \
+ "operator\[+\]+\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+"
+ test_demangling "arm: g__FcRP1cRPC1cT2" \
+ "g\[(\]+char, c *\[*\]+&, (const c|c const) *\[*\]+&, c *\[*\]+&\[)\]+"
+
+ test_demangling_exact "arm: X__11T5__pt__2_c" "T5<char>::X"
+
+ test_demangling_exact "arm: X__11T5__pt__2_i" "T5<int>::X"
+
+ test_demangling "arm: g__FdCdT1" \
+ "g\[(\]+double, (const double|double const), double\[)\]+"
+ test_demangling "arm: g__FfCfT1" \
+ "g\[(\]+float, (const float|float const), float\[)\]+"
+ test_demangling "arm: g__FlClT1" \
+ "g\[(\]+long, (const long|long const), long\[)\]+"
+ test_demangling "arm: g__FiCiT1" \
+ "g\[(\]+int, (const int|int const), int\[)\]+"
+ test_demangling "arm: g__FsCsT1" \
+ "g\[(\]+short, (const short|short const), short\[)\]+"
+ test_demangling "arm: g__FcCcT1" \
+ "g\[(\]+char, (const char|char const), char\[)\]+"
+
+ test_demangling_exact "arm: __ct__17T5__pt__8_PFcPv_iFi" "T5<int (*)(char, void *)>::T5(int)"
+
+ test_demangling_exact "arm: f__FicdPc" "f(int, char, double, char *)"
+ test_demangling_exact "arm: __nw__FUi" "operator new(unsigned int)"
+ test_demangling_exact "arm: __ct__Q3_2T11a1bSFi" "T1::a::b::b(int) static"
+ test_demangling_exact "arm: __dt__Q3_2T11a1bSFi" "T1::a::b::~b(int) static"
+ test_demangling_exact "arm: put__Q3_2T11a1bSFi" "T1::a::b::put(int) static"
+ test_demangling_exact "arm: get__Q2_2T11aSFv" "T1::a::get(void) static"
+ test_demangling_exact "arm: put__2T1SFi" "T1::put(int) static"
+ test_demangling_exact "arm: put__Q5_2T11a1b1c1dSFi" "T1::a::b::c::d::put(int) static"
+ test_demangling_exact "arm: get__Q4_2T11a1b1cSFv" "T1::a::b::c::get(void) static"
+ test_demangling_exact "arm: put__Q2_2T11aSFi" "T1::a::put(int) static"
+ test_demangling_exact "arm: put__Q4_2T11a1b1cSFi" "T1::a::b::c::put(int) static"
+ test_demangling_exact "arm: get__Q3_2T11a1bSFv" "T1::a::b::get(void) static"
+ test_demangling_exact "arm: get__2T1SFv" "T1::get(void) static"
+ test_demangling_exact "arm: get__Q5_2T11a1b1c1dSFv" "T1::a::b::c::d::get(void) static"
+
+ test_demangling_exact "arm: __dt__11T1__pt__2_cFv" "T1<char>::~T1(void)"
+
+ test_demangling_exact "arm: __dt__12T1__pt__3_1tFv" "T1<t>::~T1(void)"
+
+ test_demangling_exact "arm: __dl__12T1__pt__3_1tSFPv" "T1<t>::operator delete(void *) static"
+
+ test_demangling_exact "arm: __ct__11T1__pt__2_cFi" "T1<char>::T1(int)"
+
+ test_demangling_exact "arm: __ct__11T1__pt__2_cFv" "T1<char>::T1(void)"
+
+ test_demangling_exact "arm: __ct__12T1__pt__3_1tFi" "T1<t>::T1(int)"
+
+ test_demangling_exact "arm: __ct__12T1__pt__3_1tFv" "T1<t>::T1(void)"
+
+ test_demangling_exact "arm: __dl__11T1__pt__2_cSFPv" "T1<char>::operator delete(void *) static"
+
+ test_demangling_exact "arm: bar__3fooFPv" "foo::bar(void *)"
+ test_demangling "arm: bar__3fooFPCv" \
+ "foo::bar\[(\]+(const void|void const) *\[*\]+\[)\]+"
+ test_demangling_exact "arm: bar__3fooCFPv" "foo::bar(void *) const"
+ test_demangling "arm: bar__3fooCFPCv" \
+ "foo::bar\[(\]+(const void|void const) *\[*\]+\[)\]+ const"
+ test_demangling_exact "arm: __eq__3fooFR3foo" "foo::operator==(foo &)"
+ test_demangling "arm: __eq__3fooFRC3foo" \
+ "foo::operator==\[(\]+(const foo|foo const) &\[)\]+"
+ test_demangling_exact "arm: __eq__3fooCFR3foo" "foo::operator==(foo &) const"
+ test_demangling "arm: __eq__3fooCFRC3foo" \
+ "foo::operator==\[(\]+(const foo|foo const) &\[)\]+ const"
+
+ test_demangling_exact "arm: elem__15vector__pt__2_dFi" "vector<double>::elem(int)"
+
+ test_demangling_exact "arm: elem__15vector__pt__2_iFi" "vector<int>::elem(int)"
+
+ test_demangling_exact "arm: __ct__15vector__pt__2_dFi" "vector<double>::vector(int)"
+
+ test_demangling_exact "arm: __ct__15vector__pt__2_iFi" "vector<int>::vector(int)"
+
+ test_demangling_exact "arm: __ct__25DListNode__pt__9_R6RLabelFR6RLabelP25DListNode__pt__9_R6RLabelT2" \
+ "DListNode<RLabel &>::DListNode(RLabel &, DListNode<RLabel &> *, DListNode<RLabel &> *)"
+
+ test_demangling_exact "arm: bar__3fooFiT16FooBar" "foo::bar(int, int, FooBar)"
+
+ test_demangling_exact "arm: bar__3fooFPiN51PdN37PcN211T1iN215" \
+ "foo::bar(int *, int *, int *, int *, int *, int *, double *, double *, double *, double *, char *, char *, char *, int *, int, int, int)"
+
+ test_demangling_exact "arm: _Utf390_1__1_9223372036854775807__9223372036854775" \
+ "Can't demangle \"_Utf390_1__1_9223372036854775807__9223372036854775\""
+}
+
+proc test_hp_style_demangling {} {
+
+ # HP aCC mangling style is based on ARM for all the basic stuff,
+ # so first we use some of the ARM tests here. Later we have HP-specific
+ # tests.
+
+ test_demangling "hp: g__FP1cPC1cT1" \
+ "g\[(\]+c *\[*\]+, (const c|c const) *\[*\]+, c *\[*\]+\[)\]+"
+ test_demangling "hp: g__FPUlPCUlT1" \
+ "g\[(\]+unsigned long \[*\]+, (const unsigned long|unsigned long const) \[*\]+, unsigned long \[*\]+\[)\]+"
+ test_demangling "hp: g__FPUiPCUiT1" \
+ "g\[(\]+unsigned int \[*\]+, (const unsigned int|unsigned int const) \[*\]+, unsigned int \[*\]+\[)\]+"
+ test_demangling "hp: g__FPUsPCUsT1" \
+ "g\[(\]+unsigned short \[*\]+, (const unsigned short|unsigned short const) \[*\]+, unsigned short \[*\]+\[)\]+"
+ test_demangling "hp: g__FPUcPCUcT1" \
+ "g\[(\]+unsigned char \[*\]+, (const unsigned char|unsigned char const) \[*\]+, unsigned char \[*\]+\[)\]+"
+ test_demangling "hp: g__F1TPlPClT2" \
+ "g\[(\]+T, long \[*\]+, (const long|long const) \[*\]+, long \[*\]+\[)\]+"
+ test_demangling "hp: g__F1RRlRClT2" \
+ "g\[(\]+R, long &, (const long|long const) &, long &\[)\]+"
+ test_demangling "hp: g__F1TPiPCiT2" \
+ "g\[(\]+T, int \[*\]+, (const int|int const) \[*\]+, int \[*\]+\[)\]+"
+ test_demangling "hp: g__F1RRiRCiT2" \
+ "g\[(\]+R, int &, (const int|int const) &, int &\[)\]+"
+ test_demangling "hp: g__F1TPsPCsT2" \
+ "g\[(\]+T, short \[*\]+, (const short|short const) \[*\]+, short \[*\]+\[)\]+"
+ test_demangling "hp: g__F1RRsRCsT2" \
+ "g\[(\]+R, short &, (const short|short const) &, short &\[)\]+"
+ test_demangling "hp: g__F1TPcPCcT2" \
+ "g\[(\]+T, char \[*\]+, (const char|char const) \[*\]+, char \[*\]+\[)\]+"
+ test_demangling "hp: g__F1RRcRCcT2" \
+ "g\[(\]+R, char &, (const char|char const) &, char &\[)\]+"
+
+ test_demangling "hp: __gt__FRC2T2c" \
+ "operator>\[(\]+(const T2|T2 const) &, char\[)\]+"
+ test_demangling "hp: __ge__FRC2T2c" \
+ "operator>=\[(\]+(const T2|T2 const) &, char\[)\]+"
+ test_demangling "hp: __lt__FRC2T2c" \
+ "operator<\[(\]+(const T2|T2 const) &, char\[)\]+"
+
+ test_demangling "hp: __le__FRC2T2c" \
+ "operator<=\[(\]+(const T2|T2 const) &, char\[)\]+"
+ test_demangling "hp: __ne__FRC2T2c" \
+ "operator!=\[(\]+(const T2|T2 const) &, char\[)\]+"
+ test_demangling "hp: __eq__FRC2T2c" \
+ "operator==\[(\]+(const T2|T2 const) &, char\[)\]+"
+ test_demangling_exact "hp: __amd__FR2T2i" "operator%=(T2 &, int)"
+ test_demangling_exact "hp: __adv__FR2T2i" "operator/=(T2 &, int)"
+ test_demangling_exact "hp: __amu__FR2T2i" "operator*=(T2 &, int)"
+ test_demangling_exact "hp: __ami__FR2T2i" "operator-=(T2 &, int)"
+ test_demangling_exact "hp: __apl__FR2T2i" "operator+=(T2 &, int)"
+ test_demangling_exact "hp: __nw__2T1SFUi" "T1::operator new(unsigned int) static"
+ test_demangling_exact "hp: __dl__2T1SFPv" "T1::operator delete(void *) static"
+ test_demangling_exact "hp: put__2T7SFi" "T7::put(int) static"
+
+ test_demangling_exact "hp: h__FUc" "h(unsigned char)"
+ test_demangling_exact "hp: f__Fic" "f(int, char)"
+ test_demangling_exact "hp: h__FUi" "h(unsigned int)"
+ test_demangling_exact "hp: h__Fci" "h(char, int)"
+ test_demangling_exact "hp: h__FUl" "h(unsigned long)"
+ test_demangling_exact "hp: h__Fcl" "h(char, long)"
+ test_demangling_exact "hp: h__FUs" "h(unsigned short)"
+ test_demangling_exact "hp: h__Fcs" "h(char, short)"
+ test_demangling "hp: __amd__FR2T2RC2T2" \
+ "operator%=\[(\]+T2 &, (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __adv__FR2T2RC2T2" \
+ "operator/=\[(\]+T2 &, (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __amu__FR2T2RC2T2" \
+ "operator\[*\]+=\[(\]+T2 &, (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __ami__FR2T2RC2T2" \
+ "operator-=\[(\]+T2 &, (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __apl__FR2T2RC2T2" \
+ "operator\[+\]+=\[(\]+T2 &, (const T2|T2 const) &\[)\]+"
+
+ test_demangling "hp: g__F1SRPUlRPCUlT2" \
+ "g\[(\]+S, unsigned long \[*\]+&, (const unsigned long|unsigned long const) \[*\]+&, unsigned long \[*\]+&\[)\]+"
+ test_demangling "hp: g__F1SRPUiRPCUiT2" \
+ "g\[(\]+S, unsigned int \[*\]+&, (const unsigned int|unsigned int const) \[*\]+&, unsigned int \[*\]+&\[)\]+"
+ test_demangling "hp: g__F1SRPUsRPCUsT2" \
+ "g\[(\]+S, unsigned short \[*\]+&, (const unsigned short|unsigned short const) \[*\]+&, unsigned short \[*\]+&\[)\]+"
+ test_demangling "hp: g__F1SRPUcRPCUcT2" \
+ "g\[(\]+S, unsigned char \[*\]+&, (const unsigned char|unsigned char const) \[*\]+&, unsigned char \[*\]+&\[)\]+"
+ test_demangling "hp: g__F1T1SRPlRPClT3" \
+ "g\[(\]+T, S, long \[*\]+&, (const long|long const) \[*\]+&, long \[*\]+&\[)\]+"
+ test_demangling "hp: g__F1T1SRPiRPCiT3" \
+ "g\[(\]+T, S, int \[*\]+&, (const int|int const) \[*\]+&, int \[*\]+&\[)\]+"
+ test_demangling "hp: g__F1T1SRPcRPCcT3" \
+ "g\[(\]+T, S, char \[*\]+&, (const char|char const) \[*\]+&, char \[*\]+&\[)\]+"
+
+
+ test_demangling "hp: __gt__FRC2T2T1" \
+ "operator>\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __ge__FRC2T2T1" \
+ "operator>=\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __lt__FRC2T2T1" \
+ "operator<\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __le__FRC2T2T1" \
+ "operator<=\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __ne__FRC2T2T1" \
+ "operator!=\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __eq__FRC2T2T1" \
+ "operator==\[(\]+(const T2|T2 const) &, (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: g__FcR1cRC1cT2" \
+ "g\[(\]+char, c &, (const c|c const) &, c &\[)\]+"
+ test_demangling "hp: g__FcRPdRPCdT2" \
+ "g\[(\]+char, double *\[*\]+&, (const double|double const) *\[*\]+&, double *\[*\]+&\[)\]+"
+ test_demangling "hp: g__FcRPfRPCfT2" \
+ "g\[(\]+char, float *\[*\]+&, (const float|float const) *\[*\]+&, float *\[*\]+&\[)\]+"
+ test_demangling_exact "hp: h__FcT1" "h(char, char)"
+ test_demangling_exact "hp: f__Ficd" "f(int, char, double)"
+ test_demangling "hp: g__F1T1SdRPsRPCsT4" \
+ "g\[(\]+T, S, double, short \[*\]+&, (const short|short const) \[*\]+&, short \[*\]+&\[)\]+"
+ test_demangling "hp: g__F1cC1cT1" \
+ "g\[(\]+c, (const c|c const), c\[)\]+"
+ test_demangling "hp: g__FPdPCdT1" \
+ "g\[(\]+double *\[*\]+, (const double|double const) *\[*\]+, double *\[*\]+\[)\]+"
+ test_demangling "hp: g__FPfPCfT1" \
+ "g\[(\]+float *\[*\]+, (const float|float const) *\[*\]+, float *\[*\]+\[)\]+"
+
+ test_demangling "hp: g__FUlCUlT1" \
+ "g\[(\]+unsigned long, (const unsigned long|unsigned long const), unsigned long\[)\]+"
+ test_demangling "hp: g__FPlPClT1" \
+ "g\[(\]+long \[*\]+, (const long|long const) \[*\]+, long \[*\]+\[)\]+"
+ test_demangling "hp: g__FUiCUiT1" \
+ "g\[(\]+unsigned int, (const unsigned int|unsigned int const), unsigned int\[)\]+"
+ test_demangling "hp: g__FPiPCiT1" \
+ "g\[(\]+int \[*\]+, (const int|int const) \[*\]+, int \[*\]+\[)\]+"
+ test_demangling "hp: g__FUsCUsT1" \
+ "g\[(\]+unsigned short, (const unsigned short|unsigned short const), unsigned short\[)\]+"
+ test_demangling "hp: g__FPsPCsT1" \
+ "g\[(\]+short \[*\]+, (const short|short const) \[*\]+, short \[*\]+\[)\]+"
+ test_demangling "hp: g__FUcCUcT1" \
+ "g\[(\]+unsigned char, (const unsigned char|unsigned char const), unsigned char\[)\]+"
+ test_demangling "hp: g__FPcPCcT1" \
+ "g\[(\]+char \[*\]+, (const char|char const) \[*\]+, char \[*\]+\[)\]+"
+ test_demangling "hp: g__F1TlClT2" \
+ "g\[(\]+T, long, (const long|long const), long\[)\]+"
+ test_demangling "hp: g__F1TiCiT2" \
+ "g\[(\]+T, int, (const int|int const), int\[)\]+"
+ test_demangling "hp: g__F1TsCsT2" \
+ "g\[(\]+T, short, (const short|short const), short\[)\]+"
+ test_demangling "hp: g__F1TcCcT2" \
+ "g\[(\]+T, char, (const char|char const), char\[)\]+"
+
+ test_demangling "hp: printf__FPCce" \
+ "printf\[(\]+(const char|char const) \[*\]+,...\[)\]+"
+
+
+ test_demangling "hp: g__F1SRUlRCUlT2" \
+ "g\[(\]+S, unsigned long &, (const unsigned long|unsigned long const) &, unsigned long &\[)\]+"
+ test_demangling "hp: g__F1SRPlRPClT2" \
+ "g\[(\]+S, long \[*\]+&, (const long|long const) \[*\]+&, long \[*\]+&\[)\]+"
+ test_demangling "hp: g__F1RRUiRCUiT2" \
+ "g\[(\]+R, unsigned int &, (const unsigned int|unsigned int const) &, unsigned int &\[)\]+"
+ test_demangling "hp: g__F1SRPiRPCiT2" \
+ "g\[(\]+S, int \[*\]+&, (const int|int const) \[*\]+&, int \[*\]+&\[)\]+"
+ test_demangling "hp: g__F1RRUsRCUsT2" \
+ "g\[(\]+R, unsigned short &, (const unsigned short|unsigned short const) &, unsigned short &\[)\]+"
+ test_demangling "hp: g__F1SRPsRPCsT2" \
+ "g\[(\]+S, short \[*\]+&, (const short|short const) \[*\]+&, short \[*\]+&\[)\]+"
+ test_demangling "hp: g__F1RRUcRCUcT2" \
+ "g\[(\]+R, unsigned char &, (const unsigned char|unsigned char const) &, unsigned char &\[)\]+"
+ test_demangling "hp: g__F1SRPcRPCcT2" \
+ "g\[(\]+S, char \[*\]+&, (const char|char const) \[*\]+&, char \[*\]+&\[)\]+"
+ test_demangling "hp: g__F1T1RRlRClT3" \
+ "g\[(\]+T, R, long &, (const long|long const) &, long &\[)\]+"
+ test_demangling "hp: g__F1T1RRiRCiT3" \
+ "g\[(\]+T, R, int &, (const int|int const) &, int &\[)\]+"
+ test_demangling "hp: g__F1T1RRsRCsT3" \
+ "g\[(\]+T, R, short &, (const short|short const) &, short &\[)\]+"
+ test_demangling "hp: g__F1T1RRcRCcT3" \
+ "g\[(\]+T, R, char &, (const char|char const) &, char &\[)\]+"
+
+
+ test_demangling_exact "hp: f__FicdPcPFci_v" "f(int, char, double, char *, void (*)(char, int))"
+ test_demangling_exact "hp: f__FicdPcPFic_v" "f(int, char, double, char *, void (*)(int, char))"
+ test_demangling_exact "hp: get__2T7SFv" "T7::get(void) static"
+
+
+ test_demangling "hp: g__FcRdRCdT2" \
+ "g\[(\]+char, double &, (const double|double const) &, double &\[)\]+"
+ test_demangling "hp: g__FcRfRCfT2" \
+ "g\[(\]+char, float &, (const float|float const) &, float &\[)\]+"
+ test_demangling "hp: __md__FC2T2i" \
+ "operator%\[(\]+(const T2|T2 const), int\[)\]+"
+ test_demangling "hp: __dv__FC2T2i" \
+ "operator/\[(\]+(const T2|T2 const), int\[)\]+"
+ test_demangling "hp: __ml__FC2T2i" \
+ "operator\[*\]+\[(\]+(const T2|T2 const), int\[)\]+"
+ test_demangling "hp: __mi__FC2T2i" \
+ "operator-\[(\]+(const T2|T2 const), int\[)\]+"
+ test_demangling "hp: __pl__FC2T2i" \
+ "operator\[+\]+\[(\]+(const T2|T2 const), int\[)\]+"
+
+
+ test_demangling_exact "hp: h__Fc" "h(char)"
+ test_demangling_exact "hp: h__Fd" "h(double)"
+ test_demangling_exact "hp: h__Ff" "h(float)"
+ test_demangling_exact "hp: h__Fi" "h(int)"
+ test_demangling_exact "hp: f__Fi" "f(int)"
+ test_demangling_exact "hp: h__Fl" "h(long)"
+
+ test_demangling_exact "hp: h__Fs" "h(short)"
+ test_demangling "hp: __md__FC2T2RC2T2" \
+ "operator%\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __dv__FC2T2RC2T2" \
+ "operator/\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __ml__FC2T2RC2T2" \
+ "operator\[*\]+\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __mi__FC2T2RC2T2" \
+ "operator-\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: __pl__FC2T2RC2T2" \
+ "operator\[+\]+\[(\]+(const T2|T2 const), (const T2|T2 const) &\[)\]+"
+ test_demangling "hp: g__FcRP1cRPC1cT2" \
+ "g\[(\]+char, c *\[*\]+&, (const c|c const) *\[*\]+&, c *\[*\]+&\[)\]+"
+
+
+ test_demangling "hp: g__FdCdT1" \
+ "g\[(\]+double, (const double|double const), double\[)\]+"
+ test_demangling "hp: g__FfCfT1" \
+ "g\[(\]+float, (const float|float const), float\[)\]+"
+ test_demangling "hp: g__FlClT1" \
+ "g\[(\]+long, (const long|long const), long\[)\]+"
+ test_demangling "hp: g__FiCiT1" \
+ "g\[(\]+int, (const int|int const), int\[)\]+"
+ test_demangling "hp: g__FsCsT1" \
+ "g\[(\]+short, (const short|short const), short\[)\]+"
+ test_demangling "hp: g__FcCcT1" \
+ "g\[(\]+char, (const char|char const), char\[)\]+"
+
+
+ test_demangling_exact "hp: f__FicdPc" "f(int, char, double, char *)"
+ test_demangling_exact "hp: __nw__FUi" "operator new(unsigned int)"
+ test_demangling_exact "hp: __ct__Q3_2T11a1bSFi" "T1::a::b::b(int) static"
+ test_demangling_exact "hp: __dt__Q3_2T11a1bSFi" "T1::a::b::~b(int) static"
+ test_demangling_exact "hp: put__Q3_2T11a1bSFi" "T1::a::b::put(int) static"
+ test_demangling_exact "hp: get__Q2_2T11aSFv" "T1::a::get(void) static"
+ test_demangling_exact "hp: put__2T1SFi" "T1::put(int) static"
+ test_demangling_exact "hp: put__Q5_2T11a1b1c1dSFi" "T1::a::b::c::d::put(int) static"
+ test_demangling_exact "hp: get__Q4_2T11a1b1cSFv" "T1::a::b::c::get(void) static"
+ test_demangling_exact "hp: put__Q2_2T11aSFi" "T1::a::put(int) static"
+ test_demangling_exact "hp: put__Q4_2T11a1b1cSFi" "T1::a::b::c::put(int) static"
+ test_demangling_exact "hp: get__Q3_2T11a1bSFv" "T1::a::b::get(void) static"
+ test_demangling_exact "hp: get__2T1SFv" "T1::get(void) static"
+ test_demangling_exact "hp: get__Q5_2T11a1b1c1dSFv" "T1::a::b::c::d::get(void) static"
+
+
+ test_demangling_exact "hp: bar__3fooFPv" "foo::bar(void *)"
+ test_demangling "hp: bar__3fooFPCv" \
+ "foo::bar\[(\]+(const void|void const) *\[*\]+\[)\]+"
+ test_demangling_exact "hp: bar__3fooCFPv" "foo::bar(void *) const"
+ test_demangling "hp: bar__3fooCFPCv" \
+ "foo::bar\[(\]+(const void|void const) *\[*\]+\[)\]+ const"
+ test_demangling_exact "hp: __eq__3fooFR3foo" "foo::operator==(foo &)"
+ test_demangling "hp: __eq__3fooFRC3foo" \
+ "foo::operator==\[(\]+(const foo|foo const) &\[)\]+"
+ test_demangling_exact "hp: __eq__3fooCFR3foo" "foo::operator==(foo &) const"
+ test_demangling "hp: __eq__3fooCFRC3foo" \
+ "foo::operator==\[(\]+(const foo|foo const) &\[)\]+ const"
+
+ test_demangling_exact "hp: bar__3fooFiT16FooBar" "foo::bar(int, int, FooBar)"
+
+ test_demangling_exact "hp: bar__3fooFPiN51PdN37PcN211T1iN215" \
+ "foo::bar(int *, int *, int *, int *, int *, int *, double *, double *, double *, double *, char *, char *, char *, int *, int, int, int)"
+
+
+ # HP aCC specific tests. HP aCC demangling does not use __pt__ for
+ # template specifications. There are other differences as well.
+
+ test_demangling_exact "hp: __dt__2T5XTPFiPPdPv_i__Fv" "T5<int (*)(int, double **, void *)>::~T5(void)"
+
+ test_demangling_exact "hp: __ct__1cFi" "c::c(int)"
+
+ test_demangling_exact "hp: __dt__2T5XTi__Fv" "T5<int>::~T5(void)"
+
+ test_demangling_exact "hp: __dt__2T5XTc__Fv" "T5<char>::~T5(void)"
+
+ test_demangling_exact "hp: __ct__2T2Fi" "T2::T2(int)"
+ test_demangling_exact "hp: __dt__2T1Fv" "T1::~T1(void)"
+
+ test_demangling_exact "hp: __dt__2T5XT1x__Fv" "T5<x>::~T5(void)"
+
+ test_demangling_exact "hp: __dt__2T5XTPFcPv_i__Fv" "T5<int (*)(char, void *)>::~T5(void)"
+
+ test_demangling_exact "hp: __ct__2T5XTPFiPPdPv_i__Fi" "T5<int (*)(int, double **, void *)>::T5(int)"
+
+ test_demangling_exact "hp: __dl__2T5XT1x__SFPv" "T5<x>::operator delete(void *) static"
+
+ test_demangling_exact "hp: X__2T5XT1x" "T5<x>::X"
+
+ test_demangling_exact "hp: __ct__2T5XTi__Fi" "T5<int>::T5(int)"
+
+ test_demangling_exact "hp: __ct__2T5XTc__Fi" "T5<char>::T5(int)"
+
+ test_demangling_exact "hp: __dl__2T5XTPFcPv_i__SFPv" "T5<int (*)(char, void *)>::operator delete(void *) static"
+
+ test_demangling_exact "hp: X__2T5XTPFcPv_i" "T5<int (*)(char, void *)>::X"
+
+ test_demangling_exact "hp: __ct__2T5XT1x__Fi" "T5<x>::T5(int)"
+
+ test_demangling_exact "hp: __dl__2T5XTPFiPPdPv_i__SFPv" "T5<int (*)(int, double **, void *)>::operator delete(void *) static"
+ test_demangling_exact "hp: X__2T5XTPFiPPdPv_i" "T5<int (*)(int, double **, void *)>::X"
+
+ test_demangling_exact "hp: __dl__2T5XTi__SFPv" "T5<int>::operator delete(void *) static"
+
+ test_demangling_exact "hp: __dl__2T5XTc__SFPv" "T5<char>::operator delete(void *) static"
+
+ test_demangling_exact "hp: X__2T5XTc" "T5<char>::X"
+
+ test_demangling_exact "hp: X__2T5XTi" "T5<int>::X"
+
+ test_demangling_exact "hp: __ct__2T5XTPFcPv_i__Fi" "T5<int (*)(char, void *)>::T5(int)"
+
+ test_demangling_exact "hp: __dt__2T1XTc__Fv" "T1<char>::~T1(void)"
+
+ test_demangling_exact "hp: __dt__2T1XT1t__Fv" "T1<t>::~T1(void)"
+
+ test_demangling_exact "hp: __dl__2T1XT1t__SFPv" "T1<t>::operator delete(void *) static"
+
+ test_demangling_exact "hp: __ct__2T1XTc__Fi" "T1<char>::T1(int)"
+
+ test_demangling_exact "hp: __ct__2T1XTc__Fv" "T1<char>::T1(void)"
+
+ test_demangling_exact "hp: __ct__2T1XT1t__Fi" "T1<t>::T1(int)"
+
+ test_demangling_exact "hp: __ct__2T1XT1t__Fv" "T1<t>::T1(void)"
+
+ test_demangling_exact "hp: __dl__2T1XTc__SFPv" "T1<char>::operator delete(void *) static"
+
+ test_demangling_exact "hp: elem__6vectorXTd__Fi" "vector<double>::elem(int)"
+
+ test_demangling_exact "hp: elem__6vectorXTi__Fi" "vector<int>::elem(int)"
+
+ test_demangling_exact "hp: __ct__6vectorXTd__Fi" "vector<double>::vector(int)"
+
+ test_demangling_exact "hp: __ct__6vectorXTi__Fi" "vector<int>::vector(int)"
+
+ test_demangling_exact "hp: __ct__9DListNodeXTR6RLabel__FR6RLabelP9DListNodeXTR6RLabel_T2" \
+ "DListNode<RLabel &>::DListNode(RLabel &, DListNode<RLabel &> *, DListNode<RLabel &> *)"
+
+
+ # Absolute integer constants in template args
+
+ test_demangling_exact "hp: elem__6vectorXTiUP34__Fi" "vector<int,34U>::elem(int)"
+ test_demangling_exact "hp: elem__6vectorXUP2701Td__Fi" "vector<2701U,double>::elem(int)"
+ test_demangling_exact "hp: elem__6vectorXTiSP334__Fi" "vector<int,334>::elem(int)"
+ test_demangling_exact "hp: elem__6vectorXTiSN67__Fi" "vector<int,-67>::elem(int)"
+ test_demangling_exact "hp: elem__6vectorXTiSM__SCFPPd" "vector<int,-2147483648>::elem(double **) static const"
+ test_demangling_exact "hp: elem__6vectorXTiSN67UP4000TRs__Fi" "vector<int,-67,4000U,short &>::elem(int)"
+ test_demangling_exact "hp: elem__6vectorXTiSN67TRdTFPv_i__Fi" "vector<int,-67,double &,int (void *)>::elem(int)"
+ test_demangling_exact "hp: X__6vectorXTiSN67TdTPvUP5TRs" "vector<int,-67,double,void *,5U,short &>::X"
+
+ # Named constants in template args
+
+ test_demangling_exact "hp: elem__6vectorXTiA3foo__Fi" "vector<int,&foo>::elem(int)"
+ test_demangling_exact "hp: elem__6vectorXTiA3fooTPvA5Label__FiPPvT2" "vector<int,&foo,void *,&Label>::elem(int, void **, void **)"
+ test_demangling_exact "hp: elem__6vectorXTiSN42A3foo__Fi" "vector<int,-42,&foo>::elem(int)"
+
+ # Alternate entry points for functions
+
+ test_demangling_exact "hp: __ct__2T5XTPFcPv_i__Fi_2" "T5<int (*)(char, void *)>::T5(int)"
+ test_demangling_exact "hp: __ct__2T5XTPFcPv_i__Fi_19" "T5<int (*)(char, void *)>::T5(int)"
+ test_demangling_exact "hp: f__FicdPcPFci_v_34" "f(int, char, double, char *, void (*)(char, int))"
+
+
+ # Template partial specializations
+
+# FIXME! The # characters don't go through expect, and backslashes don't seem to work.
+# test_demangling_exact "hp: spec__13Spec<#1,#1.*>XTiTPi_FPi" "Spec<int,int *>::spec(int *)"
+# test_demangling_exact "hp: spec__16Spec<#1,#1.&,#1>XTiTRiTi_FPi" "Spec<int,int &, int>::spec(int *)"
+# Fake test -- replace # with %
+ test_demangling_exact "hp: spec__13Spec<%1,%1.*>XTiTPi_FPi" "Spec<int,int *>::spec(int *)"
+ test_demangling_exact "hp: spec__16Spec<%1,%1.&,%1>XTiTRiTi_FPi" "Spec<int,int &,int>::spec(int *)"
+
+ # Global template functions
+
+ test_demangling_exact "hp: add__XTc_FcT1" "add<char>(char, char)"
+ test_demangling_exact "hp: add__XTcSP9A5label_FcPPlT1" "add<char,9,&label>(char, long **, char)"
+ test_demangling_exact "hp: add__XTPfTFPd_f_FcT1" "add<float *,float (double *)>(char, char)"
+
+ # Template for template arg
+
+ test_demangling_exact "hp: unLink__12basic_stringXTcT18string_char_traitsXTc_T9allocator_Fv" "basic_string<char,string_char_traits<char>,allocator>::unLink(void)"
+
+ test_demangling_exact "hp: _Utf390_1__1_9223372036854775807__9223372036854775" \
+ "Can't demangle \"_Utf390_1__1_9223372036854775807__9223372036854775\""
+}
+
+
+proc catch_demangling_errors {command} {
+ if {[catch $command result]} {
+ puts "ERROR: demangle.exp: while running $command: $result"
+ }
+}
+
+# Test support for different demangling styles. Note that this does
+# not depend upon running the test program and does not depend upon
+# gdb being able to lookup any C++ symbols. It simply calls the
+# internal demangler with synthesized strings and tests the results.
+
+proc do_tests {} {
+ global prms_id
+ global bug_id
+ global subdir
+ global gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+
+ send_gdb "set language c++\n"
+ gdb_expect -re "$gdb_prompt $"
+ send_gdb "set width 0\n"
+ gdb_expect -re "$gdb_prompt $"
+
+ # Using catch_demangling_errors this way ensures that, if one of
+ # the functions raises a Tcl error, then it'll get reported, and
+ # the rest of the functions will still run.
+ catch_demangling_errors test_lucid_style_demangling
+ catch_demangling_errors test_gnu_style_demangling
+ catch_demangling_errors test_arm_style_demangling
+ catch_demangling_errors test_hp_style_demangling
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.c++/derivation.cc b/gdb/testsuite/gdb.c++/derivation.cc
new file mode 100644
index 00000000000..99efa7605a4
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/derivation.cc
@@ -0,0 +1,240 @@
+class A {
+public:
+ int a;
+ int aa;
+
+ A()
+ {
+ a=1;
+ aa=2;
+ }
+ int afoo();
+ int foo();
+
+};
+
+
+
+class B {
+public:
+ int b;
+ int bb;
+
+ B()
+ {
+ b=3;
+ bb=4;
+ }
+ int bfoo();
+ int foo();
+
+};
+
+
+
+class C {
+public:
+ int c;
+ int cc;
+
+ C()
+ {
+ c=5;
+ cc=6;
+ }
+ int cfoo();
+ int foo();
+
+};
+
+
+
+class D : private A, public B, protected C {
+public:
+ int d;
+ int dd;
+
+ D()
+ {
+ d =7;
+ dd=8;
+ }
+ int dfoo();
+ int foo();
+
+};
+
+
+class E : public A, B, protected C {
+public:
+ int e;
+ int ee;
+
+ E()
+ {
+ e =9;
+ ee=10;
+ }
+ int efoo();
+ int foo();
+
+};
+
+
+class F : A, public B, C {
+public:
+ int f;
+ int ff;
+
+ F()
+ {
+ f =11;
+ ff=12;
+ }
+ int ffoo();
+ int foo();
+
+};
+
+class G : private A, public B, protected C {
+public:
+ int g;
+ int gg;
+ int a;
+ int b;
+ int c;
+
+ G()
+ {
+ g =13;
+ gg =14;
+ a=15;
+ b=16;
+ c=17;
+
+ }
+ int gfoo();
+ int foo();
+
+};
+
+
+
+
+int A::afoo() {
+ return 1;
+}
+
+int B::bfoo() {
+ return 2;
+}
+
+int C::cfoo() {
+ return 3;
+}
+
+int D::dfoo() {
+ return 4;
+}
+
+int E::efoo() {
+ return 5;
+}
+
+int F::ffoo() {
+ return 6;
+}
+
+int G::gfoo() {
+ return 77;
+}
+
+int A::foo()
+{
+ return 7;
+
+}
+
+int B::foo()
+{
+ return 8;
+
+}
+
+int C::foo()
+{
+ return 9;
+
+}
+
+int D::foo()
+{
+ return 10;
+
+}
+
+int E::foo()
+{
+ return 11;
+
+}
+
+int F::foo()
+{
+ return 12;
+
+}
+
+int G::foo()
+{
+ return 13;
+
+}
+
+
+void marker1()
+{
+}
+
+
+int main(void)
+{
+
+ A a_instance;
+ B b_instance;
+ C c_instance;
+ D d_instance;
+ E e_instance;
+ F f_instance;
+ G g_instance;
+
+ #ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+ #endif
+
+
+ marker1();
+
+ a_instance.a = 20;
+ a_instance.aa = 21;
+ b_instance.b = 22;
+ b_instance.bb = 23;
+ c_instance.c = 24;
+ c_instance.cc = 25;
+ d_instance.d = 26;
+ d_instance.dd = 27;
+ e_instance.e = 28;
+ e_instance.ee =29;
+ f_instance.f =30;
+ f_instance.ff =31;
+
+
+
+
+ return 0;
+
+}
+
+
+
diff --git a/gdb/testsuite/gdb.c++/derivation.exp b/gdb/testsuite/gdb.c++/derivation.exp
new file mode 100644
index 00000000000..9128730bcd9
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/derivation.exp
@@ -0,0 +1,319 @@
+# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This file is part of the gdb testsuite
+#
+
+#
+# tests for inheritance, with several derivations types combinations (private,
+# public, protected)
+# classes have simple members and member functions.
+#
+
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "derivation"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+if ![runto 'marker1'] then {
+ perror "couldn't run to marker1"
+ continue
+}
+
+gdb_test "up" ".*main.*" "up from marker1"
+
+
+
+send_gdb "print a_instance\n"
+gdb_expect {
+ -re ".\[0-9\]* = \{a = 1, aa = 2\}\r\n$gdb_prompt $" {
+ pass "print value of a_instance"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of a_instance" }
+ timeout { fail "(timeout) print value of a_instance" }
+ }
+
+
+send_gdb "ptype a_instance\n"
+gdb_expect {
+ -re "type = class A \{\r\n\[\t \]*public:\r\n\[\t \]*int a;\r\n\[\t \]*int aa;\[\r\n\t ]+A & operator=\\(A const ?&\\);\[\r\n\t ]+A\\((A const|const A) ?&\\);\[\r\n\t ]+A\\((void|)\\);\r\n\[\t \]*int afoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $" { pass "ptype a_instance (with synth ops)" }
+ -re "type = class A \{\r\n\[\t \]*public:\r\n\[\t \]*int a;\r\n\[\t \]*int aa;\[\r\n\t \]+A\\(void\\);\r\n\[\t \]*int afoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $" { pass "ptype a_instance (no synth ops)" }
+ -re ".*$gdb_prompt $" { fail "ptype a_instance" }
+ timeout { fail "(timeout) ptype a_instance" }
+}
+
+
+send_gdb "print d_instance\n"
+gdb_expect {
+ -re ".\[0-9\]* = \{<A> = \{a = 1, aa = 2\}, <B> = \{b = 3, bb = 4\}, <C> = \{c = 5, cc = 6\}, d = 7, dd = 8\}\r\n$gdb_prompt $" {
+ pass "print value of d_instance"
+ }
+ -re ".\[0-9\]* = \{<class A> = \{a = 1, aa = 2\}, <class B> = \{b = 3, bb = 4\}, <class C> = \{c = 5, cc = 6\}, d = 7, dd = 8\}\r\n$gdb_prompt $" {
+ pass "print value of d_instance"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of d_instance" }
+ timeout { fail "(timeout) print value of d_instance" }
+ }
+
+ if {$gcc_compiled} then {
+ send_gdb "ptype d_instance\n"
+ gdb_expect {
+ -re "type = class D : private A, public B, (protected|private) C \{\r\n\[\t \]*public:\r\n\[\t \]*int d;\r\n\[\t \]*int dd;\[\r\n\t ]+D & operator=\\(D const ?&\\);\[\r\n\t ]+D\\((D const|const D) ?&\\);\[\r\n\t \]+D\\((void|)\\);\r\n\[\t \]*int dfoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $" { pass "ptype d_instance" }
+ -re "type = class D : private A, public B, (protected|private) C \{\r\n\[\t \]*public:\r\n\[\t \]*int d;\r\n\[\t \]*int dd;\[\r\n\t ]+D & operator=\\(D const ?&\\);\[\r\n\t ]+D\\((D const|const D) ?&\\);\[\r\n\t \]+D\\((void|)\\);\r\n\[\t \]*int dfoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $" { pass "ptype d_instance" }
+ -re "type = class D : private A, public B, (protected|private) C \{\r\n\[\t \]*public:\r\n\[\t \]*int d;\r\n\[\t \]*int dd;\[\r\n\t \]+D\\(void\\);\r\n\[\t \]*int dfoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $" { pass "ptype d_instance" }
+ -re ".*$gdb_prompt $" { fail "ptype d_instance" }
+ timeout { fail "(timeout) ptype d_instance" }
+ }
+ } else {
+ send_gdb "ptype d_instance\n"
+ gdb_expect {
+ -re "type = class D : private A, public B, protected C \{\r\n\[\t \]*public:\r\n\[\t \]*int d;\r\n\[\t \]*int dd;\[\r\n\t \]+D\\(void\\);\r\n\[\t \]*int dfoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $" { pass "ptype d_instance" }
+ -re ".*$gdb_prompt $" { fail "ptype d_instance" }
+ timeout { fail "(timeout) ptype d_instance" }
+ }
+ }
+
+
+send_gdb "print e_instance\n"
+gdb_expect {
+ -re ".\[0-9\]* = \{<A> = \{a = 1, aa = 2\}, <B> = \{b = 3, bb = 4\}, <C> = \{c = 5, cc = 6\}, e = 9, ee = 10\}\r\n$gdb_prompt $" {
+ pass "print value of e_instance"
+ }
+ -re ".\[0-9\]* = \{<class A> = \{a = 1, aa = 2\}, <class B> = \{b = 3, bb = 4\}, <class C> = \{c = 5, cc = 6\}, e = 9, ee = 10\}\r\n$gdb_prompt $" {
+ pass "print value of e_instance"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of e_instance" }
+ timeout { fail "(timeout) print value of e_instance" }
+ }
+
+ if {$gcc_compiled} {
+ send_gdb "ptype e_instance\n"
+ gdb_expect {
+ -re "type = class E : public A, private B, (protected|private) C \{\r\n\[\t \]*public:\r\n\[\t \]*int e;\r\n\[\t \]*int ee;\[\r\n\t ]+E & operator=\\(E const ?&\\);\[\r\n\t ]+E\\((E const|const E) ?&\\);\[\r\n\t \]+E\\((void|)\\);\r\n\[\t \]*int efoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $" { pass "ptype e_instance" }
+ -re "type = class E : public A, private B, (protected|private) C \{\r\n\[\t \]*public:\r\n\[\t \]*int e;\r\n\[\t \]*int ee;\[\r\n\t \]+E\\((void|)\\);\r\n\[\t \]*int efoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $" { pass "ptype e_instance" }
+ -re ".*$gdb_prompt $" { fail "ptype e_instance" }
+ timeout { fail "(timeout) ptype e_instance" }
+ }
+ } else {
+ send_gdb "ptype e_instance\n"
+ gdb_expect {
+ -re "type = class E : public A, private B, protected C \{\r\n\[\t \]*public:\r\n\[\t \]*int e;\r\n\[\t \]*int ee;\[\r\n\t \]+E\\((void|)\\);\r\n\[\t \]*int efoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $" { pass "ptype e_instance" }
+ -re ".*$gdb_prompt $" { fail "ptype e_instance" }
+ timeout { fail "(timeout) ptype e_instance" }
+ }
+ }
+
+
+send_gdb "print f_instance\n"
+gdb_expect {
+ -re ".\[0-9\]* = \{<A> = \{a = 1, aa = 2\}, <B> = \{b = 3, bb = 4\}, <C> = \{c = 5, cc = 6\}, f = 11, ff = 12\}\r\n$gdb_prompt $" {
+ pass "print value of f_instance"
+ }
+ -re ".\[0-9\]* = \{<class A> = \{a = 1, aa = 2\}, <class B> = \{b = 3, bb = 4\}, <class C> = \{c = 5, cc = 6\}, f = 11, ff = 12\}\r\n$gdb_prompt $" {
+ pass "print value of f_instance"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of f_instance" }
+ timeout { fail "(timeout) print value of f_instance" }
+ }
+
+send_gdb "ptype f_instance\n"
+gdb_expect {
+ -re "type = class F : private A, public B, private C \{\r\n\[\t \]*public:\r\n\[\t \]*int f;\r\n\[\t \]*int ff;\[\r\n\t ]+F & operator=\\(F const ?&\\);\[\r\n\t ]+F\\((F const|const F) ?&\\);\[\r\n\t \]+F\\((void|)\\);\r\n\[\t \]*int ffoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $" { pass "ptype f_instance" }
+ -re "type = class F : private A, public B, private C \{\r\n\[\t \]*public:\r\n\[\t \]*int f;\r\n\[\t \]*int ff;\[\r\n\t \]+F\\((void|)\\);\r\n\[\t \]*int ffoo\\((void|)\\);\r\n\[\t \]*int foo\\((void|)\\);\r\n\}.*$gdb_prompt $" { pass "ptype f_instance" }
+ -re ".*$gdb_prompt $" { fail "ptype f_instance" }
+ timeout { fail "(timeout) ptype f_instance" }
+}
+
+
+
+send_gdb "print d_instance.a\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print value of d_instance.a"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of d_instance.a" }
+ timeout { fail "(timeout) print value of d_instance.a" }
+ }
+
+send_gdb "print d_instance.aa\n"
+gdb_expect {
+ -re ".\[0-9\]* = 2.*$gdb_prompt $" {
+ pass "print value of d_instance.aa"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of d_instance.aa" }
+ timeout { fail "(timeout) print value of d_instance.aa" }
+ }
+
+send_gdb "print d_instance.b\n"
+gdb_expect {
+ -re ".\[0-9\]* = 3.*$gdb_prompt $" {
+ pass "print value of d_instance.b"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of d_instance.b" }
+ timeout { fail "(timeout) print value of d_instance.b" }
+ }
+
+send_gdb "print d_instance.bb\n"
+gdb_expect {
+ -re ".\[0-9\]* = 4.*$gdb_prompt $" {
+ pass "print value of d_instance.bb"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of d_instance.bb" }
+ timeout { fail "(timeout) print value of d_instance.bb" }
+ }
+
+send_gdb "print d_instance.c\n"
+gdb_expect {
+ -re ".\[0-9\]* = 5.*$gdb_prompt $" {
+ pass "print value of d_instance.c"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of d_instance.c" }
+ timeout { fail "(timeout) print value of d_instance.c" }
+ }
+
+send_gdb "print d_instance.cc\n"
+gdb_expect {
+ -re ".\[0-9\]* = 6.*$gdb_prompt $" {
+ pass "print value of d_instance.cc"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of d_instance.cc" }
+ timeout { fail "(timeout) print value of d_instance.cc" }
+ }
+
+send_gdb "print d_instance.d\n"
+gdb_expect {
+ -re ".\[0-9\]* = 7.*$gdb_prompt $" {
+ pass "print value of d_instance.d"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of d_instance.d" }
+ timeout { fail "(timeout) print value of d_instance.d" }
+ }
+
+send_gdb "print d_instance.dd\n"
+gdb_expect {
+ -re ".\[0-9\]* = 8.*$gdb_prompt $" {
+ pass "print value of d_instance.dd"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of d_instance.dd" }
+ timeout { fail "(timeout) print value of d_instance.dd" }
+ }
+
+send_gdb "print g_instance.a\n"
+gdb_expect {
+ -re "warning.*$gdb_prompt $" {
+ # The compiler doesn't think this is ambiguous.
+ fail "print value of g_instance.a"
+ }
+ -re ".\[0-9\]* = 15.*$gdb_prompt $" {
+ pass "print value of g_instance.a"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of g_instance.a" }
+ timeout { fail "(timeout) print value of g_instance.a" }
+ }
+
+send_gdb "print g_instance.b\n"
+gdb_expect {
+ -re "warning.*$gdb_prompt $" {
+ # The compiler doesn't think this is ambiguous.
+ fail "print value of g_instance.b"
+ }
+ -re ".\[0-9\]* = 16.*$gdb_prompt $" {
+ pass "print value of g_instance.b"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of g_instance.b" }
+ timeout { fail "(timeout) print value of g_instance.b" }
+ }
+
+send_gdb "print g_instance.c\n"
+gdb_expect {
+ -re "warning.*$gdb_prompt $" {
+ # The compiler doesn't think this is ambiguous.
+ fail "print value of g_instance.c"
+ }
+ -re ".\[0-9\]* = 17.*$gdb_prompt $" {
+ pass "print value of g_instance.c"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of g_instance.c" }
+ timeout { fail "(timeout) print value of g_instance.c" }
+ }
+
+send_gdb "print g_instance.afoo()\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print value of g_instance.afoo()"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of g_instance.afoo()" }
+ timeout { fail "(timeout) print value of g_instance.afoo()" }
+ }
+
+send_gdb "print g_instance.bfoo()\n"
+gdb_expect {
+ -re ".\[0-9\]* = 2.*$gdb_prompt $" {
+ pass "print value of g_instance.bfoo()"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of g_instance.bfoo()" }
+ timeout { fail "(timeout) print value of g_instance.bfoo()" }
+ }
+
+send_gdb "print g_instance.cfoo()\n"
+gdb_expect {
+ -re ".\[0-9\]* = 3.*$gdb_prompt $" {
+ pass "print value of g_instance.cfoo()"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of g_instance.cfoo()" }
+ timeout { fail "(timeout) print value of g_instance.cfoo()" }
+ }
diff --git a/gdb/testsuite/gdb.c++/hang.H b/gdb/testsuite/gdb.c++/hang.H
new file mode 100644
index 00000000000..26fec8792ad
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/hang.H
@@ -0,0 +1,12 @@
+struct A
+{
+ struct B *b_ptr_in_a;
+};
+
+struct C
+{
+ struct B
+ {
+ int member_of_B_in_C;
+ };
+};
diff --git a/gdb/testsuite/gdb.c++/hang.exp b/gdb/testsuite/gdb.c++/hang.exp
new file mode 100644
index 00000000000..4c117a10744
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/hang.exp
@@ -0,0 +1,128 @@
+# Copyright (C) 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile hang
+set binfile ${objdir}/${subdir}/${testfile}
+
+foreach file {hang1 hang2 hang3} {
+ if {[gdb_compile "${srcdir}/${subdir}/${file}.C" "${file}.o" object {c++ debug}] != ""} {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+}
+
+if {[gdb_compile "hang1.o hang2.o hang3.o" ${binfile} executable {c++ debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+# As of May 1, 2002, GDB hangs trying to read the debug info for the
+# `hang2.o' compilation unit from the executable `hang', when compiled
+# by g++ 2.96 with STABS debugging info. Here's what's going on, as
+# best as I can tell.
+#
+# The definition of `struct A' in `hang.H' refers to `struct B' as an
+# incomplete type. The stabs declare type number (1,3) to be a cross-
+# reference type, `xsB:'.
+#
+# The definition of `struct C' contains a nested definition for
+# `struct B' --- or more properly, `struct C::B'. However, the stabs
+# fail to qualify the structure tag: it just looks like a definition
+# for `struct B'. I think this is a compiler bug, but perhaps GCC
+# doesn't emit qualified names for a reason.
+#
+# `hang.H' gets #included by both `hang1.C' and `hang2.C'. So the
+# stabs for `struct A', the incomplete `struct B', and `struct C'
+# appear in both hang1.o's and hang2.o's stabs.
+#
+# When those two files are linked together, since hang2.o appears
+# later in the command line, its #inclusion of `hang.H' gets replaced
+# with an N_EXCL stab, referring back to hang1.o's stabs for the
+# header file.
+#
+# When GDB builds psymtabs for the executable hang, it notes that
+# hang2.o's stabs contain an N_EXCL referring to a header that appears
+# in full in hang1.o's stabs. So hang2.o's psymtab lists a dependency
+# on hang1.o's psymtab.
+#
+# When the user types the command `print var_in_b', GDB scans the
+# psymtabs for a symbol by that name, and decides to read full symbols
+# for `hang2.o'.
+#
+# Since `hang2.o''s psymtab lists `hang1.o' as a dependency, GDB first
+# reads `hang1.o''s symbols. When GDB sees `(1,3)=xsB:', it creates a
+# type object for `struct B', sets its TYPE_FLAG_STUB flag, and
+# records it as type number `(1,3)'.
+#
+# When GDB finds the definition of `struct C::B', since the stabs
+# don't indicate that the type is nested within C, it treats it as
+# a definition of `struct B'.
+#
+# When GDB is finished reading `hang1.o''s symbols, it calls
+# `cleanup_undefined_types'. This function mistakes the definition of
+# `struct C::B' for a definition for `struct B', and overwrites the
+# incomplete type object for the real `struct B', using `memcpy'. Now
+# stabs type number `(1,3)' refers to this (incorrect) complete type.
+# Furthermore, the `memcpy' simply copies the original's `cv_type'
+# field to the target, giving the target a corrupt `cv_type' ring: the
+# chain does not point back to the target type.
+#
+# Having satisfied `hang2.o''s psymtab's dependencies, GDB begins to
+# read `hang2.o''s symbols. These contain the true definition for
+# `struct B', which refers to type number `(1,3)' as the type it's
+# defining. GDB looks up type `(1,3)', and finds the (incorrect)
+# complete type established by the call to `cleanup_undefined_types'
+# above. However, it doesn't notice that the type is already defined,
+# and passes it to `read_struct_type', which then writes the new
+# definition's size, field list, etc. into the type object which
+# already has those fields initialized. Adding insult to injury,
+# `read_struct_type' then calls `finish_cv_type'; since the `memcpy'
+# in `cleanup_undefined_types' corrupted the target type's `cv_type'
+# ring, `finish_cv_type' enters an infinite loop.
+
+# This checks that GDB recognizes when a structure is about to be
+# overwritten, and refuses, with a complaint.
+gdb_test "print var_in_b" " = 1729" "doesn't overwrite struct type"
+
+# This checks that cleanup_undefined_types doesn't create corrupt
+# cv_type chains. Note that var_in_hang3 does need to be declared in
+# a separate compilation unit, whose psymtab depends on hang1.o's
+# psymtab. Otherwise, GDB won't call cleanup_undefined_types (as it
+# finishes hang1.o's symbols) before it calls make_cv_type (while
+# reading hang3.o's symbols).
+#
+# The bug only happens when you compile with -gstabs+; Otherwise, GCC
+# won't include the `const' qualifier on `const_B_ptr' in `hang3.o''s
+# STABS, so GDB won't try to create a const variant of the smashed
+# struct type, and get caught by the corrupted cv_type chain.
+gdb_test "print var_in_hang3" " = 42" "doesn't corrupt cv_type chain"
diff --git a/gdb/testsuite/gdb.c++/hang1.C b/gdb/testsuite/gdb.c++/hang1.C
new file mode 100644
index 00000000000..4b04d77e68c
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/hang1.C
@@ -0,0 +1,3 @@
+#include "hang.H"
+
+int main (int argc, char **argv) { return 0; }
diff --git a/gdb/testsuite/gdb.c++/hang2.C b/gdb/testsuite/gdb.c++/hang2.C
new file mode 100644
index 00000000000..59732f87d63
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/hang2.C
@@ -0,0 +1,8 @@
+#include "hang.H"
+
+struct B
+{
+ int member_of_B;
+};
+
+int var_in_b = 1729;
diff --git a/gdb/testsuite/gdb.c++/hang3.C b/gdb/testsuite/gdb.c++/hang3.C
new file mode 100644
index 00000000000..92c82fa2441
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/hang3.C
@@ -0,0 +1,4 @@
+#include "hang.H"
+
+const struct B *const_B_ptr;
+int var_in_hang3 = 42;
diff --git a/gdb/testsuite/gdb.c++/inherit.exp b/gdb/testsuite/gdb.c++/inherit.exp
new file mode 100644
index 00000000000..286c27b09f3
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/inherit.exp
@@ -0,0 +1,1062 @@
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+set ws "\[\r\n\t \]+"
+set nl "\[\r\n\]+"
+
+# The format of a g++ virtual base pointer.
+set vbptr "(_vb\[$.\]|__vb_)\[0-9\]?"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+# Note - create separate "inherit" executable from misc.cc
+
+set testfile "inherit"
+set srcfile misc.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+#
+# Single inheritance, print individual members.
+#
+
+proc test_print_si_members {} {
+ # Print all members of g_A using fully qualified form.
+
+ gdb_test "print g_A.A::a" ".* = 1" "print g_A.A::a"
+
+ gdb_test "print g_A.A::x" ".* = 2" "print g_A.A::x"
+
+ # Print members of g_A using nonambiguous compact form.
+
+ gdb_test "print g_A.a" ".* = 1" "print g_A.a"
+
+ gdb_test "print g_A.x" ".* = 2" "print g_A.x"
+
+ # Print all members of g_B using fully qualified form.
+
+ gdb_test "print g_B.A::a" ".* = 3" "print g_B.A::a"
+
+ gdb_test "print g_B.A::x" ".* = 4" "print g_B.A::x"
+
+ gdb_test "print g_B.B::b" ".* = 5" "print g_B.B::b"
+
+ gdb_test "print g_B.B::x" ".* = 6" "print g_B.B::x"
+
+ # Print members of g_B using nonambiguous compact form.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_B.a" ".* = 3" "print g_B.a"
+
+ gdb_test "print g_B.b" ".* = 5" "print g_B.b"
+
+ gdb_test "print g_B.x" ".* = 6" "print g_B.x"
+
+ # Print all members of g_C using fully qualified form.
+
+ gdb_test "print g_C.A::a" ".* = 7" "print g_C.A::a"
+
+ gdb_test "print g_C.A::x" ".* = 8" "print g_C.A::x"
+
+ gdb_test "print g_C.C::c" ".* = 9" "print g_C.C::c"
+
+ gdb_test "print g_C.C::x" ".* = 10" "print g_C.C::x"
+
+ # Print members of g_C using nonambiguous compact form.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_C.a" ".* = 7" "print g_C.a"
+
+ gdb_test "print g_C.c" ".* = 9" "print g_C.c"
+
+ gdb_test "print g_C.x" ".* = 10" "print g_C.x"
+}
+
+#
+# Single inheritance, print type definitions.
+#
+
+proc test_ptype_si {} {
+ global gdb_prompt
+ global ws
+ global nl
+ global hp_aCC_compiler
+
+ # Print class A as a type.
+
+ send_gdb "ptype A\n"
+ gdb_expect {
+ -re "type = class A \{$nl.*\[ \]*int a;$nl\[ \]*int x;$nl.*\[ \]*\}$nl$gdb_prompt $" {
+ pass "ptype A (FIXME)"
+ }
+ -re "type = struct A \{$nl\[ \]*int a;$nl\[ \]*int x;$nl\[ \]*\}$nl$gdb_prompt $" {
+ setup_xfail "*-*-*"
+ fail "ptype A (FIXME)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype A" }
+ timeout { fail "ptype A (timeout)" ; return }
+ }
+
+ # Print class A as an explicit class.
+
+ send_gdb "ptype class A\n"
+ gdb_expect {
+ -re "type = class A \{$nl.*\[ \]*int a;$nl\[ \]*int x;$nl.*\[ \]*\}$nl$gdb_prompt $" {
+ pass "ptype class A (FIXME)"
+ }
+ -re "type = struct A \{$nl\[ \]*int a;$nl\[ \]*int x;$nl\[ \]*\}$nl$gdb_prompt $" {
+ if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
+ fail "ptype class A (FIXME)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class A" }
+ timeout { fail "ptype class A (timeout)" ; return }
+ }
+
+ # Print type of an object of type A.
+
+ send_gdb "ptype g_A\n"
+ gdb_expect {
+ -re "type = class A \{$nl.*\[ \]*int a;$nl\[ \]*int x;$nl.*\[ \]*\}$nl$gdb_prompt $" {
+ pass "ptype g_A (FIXME)"
+ }
+ -re "type = struct A \{$nl\[ \]*int a;$nl\[ \]*int x;$nl\[ \]*\}$nl$gdb_prompt $" {
+ if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
+ fail "ptype g_A (FIXME)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype g_A" }
+ timeout { fail "ptype g_A (timeout)" ; return }
+ }
+
+ # Print class B as a type.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "ptype B" "type = class B : public A \{$nl\[ \]*public:$nl\[ \]*int b;$nl\[ \]*int x;$nl.*\}" "ptype B"
+
+ # Print class B as an explicit class.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "ptype class B" "type = class B : public A \{$nl\[ \]*public:$nl\[ \]*int b;$nl\[ \]*int x;$nl.*\}" "ptype class B"
+
+ # Print type of an object of type B.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "ptype g_B" "type = class B : public A \{$nl\[ \]*public:$nl\[ \]*int b;$nl\[ \]*int x;$nl.*\}" "ptype g_B"
+
+ # Print class C as a type.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "ptype C" "type = class C : public A \{$nl\[ \]*public:$nl\[ \]*int c;$nl\[ \]*int x;$nl.*\}" "ptype C"
+
+ # Print class C as an explicit class.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "ptype class C" "type = class C : public A \{$nl\[ \]*public:$nl\[ \]*int c;$nl\[ \]*int x;$nl.*\}" "ptype class C"
+
+ # Print type of an object of type g_C.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "ptype g_C" "type = class C : public A \{$nl\[ \]*public:$nl\[ \]*int c;$nl\[ \]*int x;$nl.*\}" "ptype g_C"
+
+ # gcc cygnus-2.3.3 (Q1) has this bug, but it was fixed as of
+ # cygnus-2.3.3-930417. PR 2819.
+ send_gdb "ptype tagless_struct\n"
+ gdb_expect {
+ -re "type = class \{${ws}public:${ws}int one;${ws}int two;${ws}tagless_struct & operator=\\(tagless_struct (const ?)?&\\);${ws}tagless_struct\\(tagless_struct (const ?)?&\\);${ws}tagless_struct\\(\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype tagless struct"
+ }
+ -re "type = class \{${ws}public:${ws}int one;${ws}int two;;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype tagless struct"
+ }
+ -re "type = (struct|class).*\{.*int one;.*int two;.*\}$nl$gdb_prompt $" {
+ pass "ptype tagless struct (obsolete gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype tagless struct"
+ }
+ timeout {
+ fail "ptype tagless struct (timeout)"
+ }
+ }
+
+ send_gdb "ptype v_tagless\n"
+ gdb_expect {
+ -re "type = class \{${ws}public:${ws}int one;${ws}int two;${ws}tagless_struct & operator=\\(tagless_struct (const ?)?&\\);${ws}tagless_struct\\(tagless_struct (const ?)?&\\);${ws}tagless_struct\\(\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype variable of type tagless struct"
+ }
+ -re "type = class \{${ws}public:${ws}int one;${ws}int two;;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype tagless struct"
+ }
+ -re "type = (struct|class).*\{.*int one;.*int two;.*\}$nl$gdb_prompt $" {
+ pass "ptype variable of type tagless struct (obsolete gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype variable of type tagless struct"
+ }
+ timeout {
+ fail "ptype variable of type tagless struct (timeout)"
+ }
+ }
+}
+
+#
+# Single inheritance, print complete classes.
+#
+
+proc test_print_si_classes {} {
+ # Print all members of g_A.
+
+ gdb_test "print g_A" ".* = \{a = 1, x = 2\}" "print g_A"
+
+ # Print all members of g_B.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_B" ".* = \{\<(class |)A\> = \{a = 3, x = 4\}, b = 5, x = 6\}" "print g_B"
+
+ # Print all members of g_C.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_C" ".* = \{\<(class |)A\> = \{a = 7, x = 8\}, c = 9, x = 10\}" "print g_C"
+}
+
+#
+# Single inheritance, print anonymous unions.
+# GDB versions prior to 4.14 entered an infinite loop when printing
+# the type of a class containing an anonymous union, and they were also
+# incapable of printing the member of an anonymous union.
+# We test the printing of the member first, and perform the other tests
+# only if the test succeeds, to avoid the infinite loop.
+#
+
+proc test_print_anon_union {} {
+ global gdb_prompt
+ global ws
+ global nl
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_anon_union.a" ".* = 2" "print anonymous union member"
+ setup_xfail_format "DWARF 1"
+ send_gdb "print g_anon_union\n"
+ gdb_expect {
+ -re ".* = \{one = 1, ( = |)\{a = 2, b = 2\}\}$nl$gdb_prompt $" {
+ pass "print variable of type anonymous union"
+ }
+ -re ".* = .*\{one = 1, ( = |)\{a = 2, b = .*\}\}$nl$gdb_prompt $" {
+ pass "print variable of type anonymous union (obsolete gcc or gdb)"
+ }
+ -re ".*$nl$gdb_prompt $" {
+ fail "print variable of type anonymous union"
+ }
+ timeout {
+ fail "print variableof type anonymous union (timeout)"
+ }
+ }
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype g_anon_union\n"
+ gdb_expect {
+ -re "type = class class_with_anon_union \{${ws}public:${ws}int one;${ws}union \{${ws}public:${ws}int a;${ws}long int b;${ws}union \{\.\.\.\} & operator=\\(union \{\.\.\.\} &\\);${ws}\\\$_0 \\(union \{\.\.\.\} &\\);${ws}\\\$_0 \\(\\);${ws}\};${ws}class_with_anon_union & operator=\\(class_with_anon_union const &\\);${ws}class_with_anon_union\\(class_with_anon_union const &\\);${ws}class_with_anon_union\\(void\\);${ws}\}$nl$gdb_prompt $" {
+ pass "print type of anonymous union"
+ }
+ -re "type = class class_with_anon_union \{${ws}public:${ws}int one;${ws}union \{${ws}int a;${ws}long int b;${ws}\};${ws}class_with_anon_union & operator=\\(class_with_anon_union const ?&\\);${ws}class_with_anon_union\\(class_with_anon_union const ?&\\);${ws}class_with_anon_union\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "print type of anonymous union"
+ }
+ -re "type = class class_with_anon_union \{${ws}public:${ws}int one;${ws}union \{${ws}int a;${ws}long int b;${ws}\};${ws}\}$nl$gdb_prompt $" {
+ pass "print type of anonymous union"
+ }
+ -re "type = (struct|class).*\{.*int one;.*union \{.*int a;.*(long|long int|int) b;.*\};.*\}$nl$gdb_prompt $" {
+ pass "print type of anonymous union (obsolete gcc or gdb)"
+ }
+ -re ".*$nl$gdb_prompt $" {
+ fail "print type of anonymous union"
+ }
+ timeout {
+ fail "print type of anonymous union (timeout)"
+ }
+ }
+}
+
+#
+# Multiple inheritance, print individual members.
+#
+
+proc test_print_mi_members {} {
+ global gdb_prompt
+ global nl
+ global hp_aCC_compiler
+
+ # Print all members of g_A.
+
+ gdb_test "print g_A.A::a" ".* = 1" "print g_A.A::a"
+
+ gdb_test "print g_A.A::x" ".* = 2" "print g_A.A::x"
+
+ # Print all members of g_B.
+
+ gdb_test "print g_B.A::a" ".* = 3" "print g_B.A::a"
+
+ gdb_test "print g_B.A::x" ".* = 4" "print g_B.A::x"
+
+ gdb_test "print g_B.B::b" ".* = 5" "print g_B.B::b"
+
+ gdb_test "print g_B.B::x" ".* = 6" "print g_B.B::x"
+
+ # Print all members of g_C.
+
+ gdb_test "print g_C.A::a" ".* = 7" "print g_C.A::a"
+
+ gdb_test "print g_C.A::x" ".* = 8" "print g_C.A::x"
+
+ gdb_test "print g_C.C::c" ".* = 9" "print g_C.C::c"
+
+ gdb_test "print g_C.C::x" ".* = 10" "print g_C.C::x"
+
+ # Print all members of g_D.
+
+ # The following is ambiguous, and gdb should detect this.
+ # For now, accept gdb's behavior as an expected failure if it
+ # simply prints either member correctly.
+
+ if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
+ send_gdb "print g_D.A::a\n"
+ gdb_expect {
+ -re "warning: A ambiguous; using D::C::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 15$nl$gdb_prompt $" {
+ pass "print g_D.A::a"
+ }
+ -re "warning: A ambiguous; using D::B::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 11$nl$gdb_prompt $" {
+ pass "print g_D.A::a (using B)"
+ }
+ -re ".* = 15$nl$gdb_prompt $" {
+ fail "print g_D.A::a (FIXME)"
+ }
+ -re ".* = 11$nl$gdb_prompt $" {
+ fail "print g_D.A::a (FIXME)"
+ }
+ -re ".*$gdb_prompt $" { fail "print g_D.A::a" }
+ timeout { fail "print g_D.A::a (timeout)" ; return }
+ }
+
+ # The following is ambiguous, and gdb should detect this.
+ # For now, accept gdb's behavior as an expected failure if it
+ # simply prints either member correctly.
+
+ if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
+ send_gdb "print g_D.A::x\n"
+ gdb_expect {
+ -re "warning: A ambiguous; using D::C::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 16$nl$gdb_prompt $" {
+ pass "print g_D.A::x"
+ }
+ -re "warning: A ambiguous; using D::B::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 12$nl$gdb_prompt $" {
+ pass "print g_D.A::x (using B)"
+ }
+ -re ".* = 16$nl$gdb_prompt $" {
+ fail "print g_D.A::x (FIXME)"
+ }
+ -re ".* = 12$nl$gdb_prompt $" {
+ fail "print g_D.A::x (FIXME)"
+ }
+ -re ".*$gdb_prompt $" { fail "print g_D.A::x" }
+ timeout { fail "print g_D.A::x (timeout)" ; return }
+ }
+
+ gdb_test "print g_D.B::b" ".* = 13" "print g_D.B::b"
+
+ gdb_test "print g_D.B::x" ".* = 14" "print g_D.B::x"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_D.C::c" ".* = 17" "print g_D.C::c"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_D.C::x" ".* = 18" "print g_D.C::x"
+
+ gdb_test "print g_D.D::d" ".* = 19" "print g_D.D::d"
+
+ gdb_test "print g_D.D::x" ".* = 20" "print g_D.D::x"
+
+ # Print all members of g_E.
+
+ # The following is ambiguous, and gdb should detect this.
+ # For now, accept gdb's behavior as an expected failure if it
+ # simply prints either member correctly.
+
+ setup_xfail "*-*-*"
+ send_gdb "print g_E.A::a\n"
+ gdb_expect {
+ -re ".* = 21$nl$gdb_prompt $" {
+ fail "print g_E.A::a (FIXME)"
+ }
+ -re ".* = 25$nl$gdb_prompt $" {
+ fail "print g_E.A::a (FIXME)"
+ }
+ -re ".*$gdb_prompt $" { fail "print g_E.A::a" }
+ timeout { fail "print g_E.A::a (timeout)" ; return }
+ }
+
+ # The following is ambiguous, and gdb should detect this.
+ # For now, accept gdb's behavior as an expected failure if it
+ # simply prints either member correctly.
+
+ if {!$hp_aCC_compiler} {setup_xfail "*-*-*"}
+ send_gdb "print g_E.A::x\n"
+ gdb_expect {
+ -re "warning: A ambiguous; using E::D::C::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 26$nl$gdb_prompt $" {
+ pass "print g_E.A::x"
+ }
+ -re "warning: A ambiguous; using E::D::B::A. Use a cast to disambiguate.$nl\\$\[0-9\]* = 22$nl$gdb_prompt $" {
+ pass "print g_E.A::x (using B)"
+ }
+ -re ".* = 26$nl$gdb_prompt $" {
+ fail "print g_E.A::x (FIXME)"
+ }
+ -re ".* = 22$nl$gdb_prompt $" {
+ fail "print g_E.A::x (FIXME)"
+ }
+ -re ".*$gdb_prompt $" { fail "print g_E.A::x" }
+ timeout { fail "print g_E.A::x (timeout)" ; return }
+ }
+
+ gdb_test "print g_E.B::b" ".* = 23" "print g_E.B::b"
+
+ gdb_test "print g_E.B::x" ".* = 24" "print g_E.B::x"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_E.C::c" ".* = 27" "print g_E.C::c"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_E.C::x" ".* = 28" "print g_E.C::x"
+
+ gdb_test "print g_E.D::d" ".* = 29" "print g_E.D::d"
+
+ gdb_test "print g_E.D::x" ".* = 30" "print g_E.D::x"
+
+ gdb_test "print g_E.E::e" ".* = 31" "print g_E.E::e"
+
+ gdb_test "print g_E.E::x" ".* = 32" "print g_E.E::x"
+}
+
+#
+# Multiple inheritance, print type definitions.
+#
+
+proc test_ptype_mi {} {
+ global nl
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "ptype D" "type = class D : public B, public C \{$nl\[ \]*public:$nl\[ \]*int d;$nl\[ \]*int x;$nl.*\}" "ptype D"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "ptype class D" "type = class D : public B, public C \{$nl\[ \]*public:$nl\[ \]*int d;$nl\[ \]*int x;$nl.*\}" "ptype class D"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "ptype g_D" "type = class D : public B, public C \{$nl\[ \]*public:$nl\[ \]*int d;$nl\[ \]*int x;$nl.*\}" "ptype g_D"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "ptype E" "type = class E : public D \{$nl\[ \]*public:$nl\[ \]*int e;$nl\[ \]*int x;$nl.*\}" "ptype E"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "ptype class E" "type = class E : public D \{$nl\[ \]*public:$nl\[ \]*int e;$nl\[ \]*int x;$nl.*\}" "ptype class E"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "ptype g_E" "type = class E : public D \{$nl\[ \]*public:$nl\[ \]*int e;$nl\[ \]*int x;$nl.*\}" "ptype g_E"
+}
+
+#
+# Multiple inheritance, print complete classes.
+#
+
+proc test_print_mi_classes {} {
+ # Print all members of g_D.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_D" ".* = \{\<(class |)B\> = \{\<(class |)A\> = \{a = 11, x = 12\}, b = 13, x = 14\}, \<(class |)C\> = \{\<(class |)A\> = \{a = 15, x = 16\}, c = 17, x = 18\}, d = 19, x = 20\}" "print g_D"
+
+ # Print all members of g_E.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_E" ".* = \{\<(class |)D\> = \{\<(class |)B\> = \{\<(class |)A\> = \{a = 21, x = 22\}, b = 23, x = 24\}, \<(class |)C\> = \{\<(class |)A\> = \{a = 25, x = 26\}, c = 27, x = 28\}, d = 29, x = 30\}, e = 31, x = 32\}" "print g_E"
+}
+
+#
+# Single virtual inheritance, print individual members.
+#
+
+proc test_print_svi_members {} {
+ global gdb_prompt
+ global decimal
+ global nl
+
+ # Print all members of g_vA.
+
+ gdb_test "print g_vA.vA::va" ".* = 1" "print g_vA.vA::va"
+
+ gdb_test "print g_vA.vA::vx" ".* = 2" "print g_vA.vA::vx"
+
+ # Print members of g_vA using compact form.
+
+ gdb_test "print g_vA.va" ".* = 1" "print g_vA.va"
+
+ gdb_test "print g_vA.vx" ".* = 2" "print g_vA.vx"
+
+ # Print all members of g_vB.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "print g_vB.vA::va\n"
+ gdb_expect {
+ -re ".* = 3$nl$gdb_prompt $" { pass "print g_vB.vA::va" }
+ -re ".*virtual baseclass botch.*$gdb_prompt $" {
+ # Does not happen with gcc cygnus-2.4.5-930828
+ fail "print g_vB.vA::va (known bug with gcc cygnus-2.4.5-930417)"
+ # Many of the rest of these tests have the same problem.
+ return 0
+ }
+ -re ".*$gdb_prompt $" { fail "print g_vB.vA::va" }
+ timeout { fail "print g_vB.vA::va (timeout)" ; return }
+ }
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vB.vA::vx" ".* = 4" "print g_vB.vA::vx"
+
+ gdb_test "print g_vB.vB::vb" ".* = 5" "print g_vB.vB::vb"
+
+ gdb_test "print g_vB.vB::vx" ".* = 6" "print g_vB.vB::vx"
+
+ # Print members of g_vB using compact form.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vB.va" ".* = 3" "print g_vB.va"
+
+ gdb_test "print g_vB.vb" ".* = 5" "print g_vB.vb"
+
+ gdb_test "print g_vB.vx" ".* = 6" "print g_vB.vx"
+
+ # Print all members of g_vC.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vC.vA::va" ".* = 7" "print g_vC.vA::va"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vC.vA::vx" ".* = 8" "print g_vC.vA::vx"
+
+ gdb_test "print g_vC.vC::vc" ".* = 9" "print g_vC.vC::vc"
+
+ gdb_test "print g_vC.vC::vx" ".* = 10" "print g_vC.vC::vx"
+
+ # Print members of g_vC using compact form.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vC.va" ".* = 7" "print g_vC.va"
+
+ gdb_test "print g_vC.vc" ".* = 9" "print g_vC.vc"
+
+ gdb_test "print g_vC.vx" ".* = 10" "print g_vC.vx"
+}
+
+#
+# Single virtual inheritance, print type definitions.
+#
+
+proc test_ptype_vi {} {
+ global gdb_prompt
+ global ws
+ global nl
+ global vbptr
+
+ # This class does not use any C++-specific features, so it's fine for
+ # it to print as "struct".
+ send_gdb "ptype vA\n"
+ gdb_expect {
+ -re "type = class vA \{$nl\[ \]*public:$nl\[ \]*int va;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype vA"
+ }
+ -re "type = struct vA \{$nl\[ \]*int va;$nl\[ \]*int vx;$nl\}$nl$gdb_prompt $" {
+ pass "ptype vA"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype vA" }
+ timeout { fail "ptype vA (timeout)" ; return }
+ }
+
+ # This class does not use any C++-specific features, so it's fine for
+ # it to print as "struct".
+ send_gdb "ptype class vA\n"
+ gdb_expect {
+ -re "type = class vA \{$nl\[ \]*public:$nl\[ \]*int va;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class vA"
+ }
+ -re "type = struct vA \{$nl\[ \]*int va;$nl\[ \]*int vx;$nl\}$nl$gdb_prompt $" {
+ pass "ptype class vA"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class vA" }
+ timeout { fail "ptype class vA (timeout)" ; return }
+ }
+
+ # This class does not use any C++-specific features, so it's fine for
+ # it to print as "struct".
+ send_gdb "ptype g_vA\n"
+ gdb_expect {
+ -re "type = class vA \{$nl\[ \]*public:$nl\[ \]*int va;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype g_vA"
+ }
+ -re "type = struct vA \{$nl\[ \]*int va;$nl\[ \]*int vx;$nl\}$nl$gdb_prompt $" {
+ pass "ptype g_vA"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype g_vA" }
+ timeout { fail "ptype g_vA (timeout)" ; return }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype vB\n"
+ gdb_expect {
+ -re "ptype vB${nl}type = class vB : public virtual vA \{$nl private:${ws}vA \\*${vbptr}vA;$nl public:${ws}int vb;${ws}int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype vB"
+ }
+ -re "ptype vB${nl}type = class vB : public virtual vA \{$nl public:${ws}int vb;${ws}int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype vB (aCC)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype vB" }
+ timeout { fail "ptype vB (timeout)" }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class vB\n"
+ gdb_expect {
+ -re "type = class vB : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class vB"
+ }
+ -re "type = class vB : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class vB (aCC)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class vB" }
+ timeout { fail "ptype class vB (timeout)" }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype g_vB\n"
+ gdb_expect {
+ -re "type = class vB : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype g_vB"
+ }
+ -re "type = class vB : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vb;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype g_vB (aCC)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype g_vB" }
+ timeout { fail "ptype g_vB (timeout)" }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype vC\n"
+ gdb_expect {
+ -re "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype vC"
+ }
+ -re "type = class vC : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype vC (aCC)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype vC" }
+ timeout { fail "ptype vC (timeout)" }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class vC\n"
+ gdb_expect {
+ -re "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class vC"
+ }
+ -re "type = class vC : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype class vC (aCC)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class vC" }
+ timeout { fail "ptype class vC (timeout)" }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype g_vC\n"
+ gdb_expect {
+ -re "type = class vC : public virtual vA \{$nl\[ \]*private:$nl\[ \]*vA \\*${vbptr}vA;$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype g_vC"
+ }
+ -re "type = class vC : public virtual vA \{$nl\[ \]*public:$nl\[ \]*int vc;$nl\[ \]*int vx;$nl.*\}$nl$gdb_prompt $" {
+ pass "ptype g_vC (aCC)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype g_vC" }
+ timeout { fail "ptype g_vC (timeout)" }
+ }
+}
+
+#
+# Single virtual inheritance, print complete classes.
+#
+
+proc test_print_svi_classes {} {
+ global gdb_prompt
+ global hex
+ global decimal
+ global nl
+ global vbptr
+
+ # Print all members of g_vA.
+
+ gdb_test "print g_vA" ".* = \{va = 1, vx = 2\}" "print g_vA"
+
+ # Print all members of g_vB.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "print g_vB\n"
+ gdb_expect {
+ -re ".* = \{\<class vA\> = \{va = 3, vx = 4\}, vb = 5, vx = 6, Virtual table at $hex\}$nl$gdb_prompt $" {
+ pass "print g_vB (aCC)"
+ }
+ -re ".* = \{\<class vA\> = \{va = 3, vx = 4\}, vb = 5, vx = 6, __vfp = $hex\}$nl$gdb_prompt $" {
+ pass "print g_vB (aCC)"
+ }
+ -re ".* = \{\<vA\> = \{va = 3, vx = 4\}, ${vbptr}vA = $hex, vb = 5, vx = 6\}$nl$gdb_prompt $" {
+ pass "print g_vB"
+ }
+ -re ".* = \{\<vA\> = \{va = 3, vx = 4\}, _vptr.vB = $hex, vb = 5, vx = 6\}$nl$gdb_prompt $" {
+ pass "print g_vB (FIXME v3 vtbl ptr)"
+ }
+ -re ".*invalid address 0x0.*$gdb_prompt $" {
+ # Does not happen with gcc cygnus-2.4.5-930828
+ fail "print g_vB (known bug with gcc cygnus-2.4.5-930417)"
+ # Many of the rest of these tests have the same problem.
+ return 0
+ }
+ -re ".*$gdb_prompt $" { fail "print g_vB" }
+ timeout { fail "print g_vB (timeout)" ; return }
+ }
+
+ # Print all members of g_vC.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "print g_vC\n"
+ gdb_expect {
+ -re ".* = \{\<class vA\> = \{va = 7, vx = 8\}, vc = 9, vx = 10, Virtual table at $hex\}$nl$gdb_prompt $" {
+ pass "print g_vC (aCC)"
+ }
+ -re ".* = \{\<class vA\> = \{va = 7, vx = 8\}, vc = 9, vx = 10, __vfp = $hex\}$nl$gdb_prompt $" {
+ pass "print g_vC (aCC)"
+ }
+ -re ".* = \{\<vA\> = \{va = 7, vx = 8\}, ${vbptr}vA = $hex, vc = 9, vx = 10\}$nl$gdb_prompt $" {
+ pass "print g_vC"
+ }
+ -re ".* = \{\<vA\> = \{va = 7, vx = 8\}, _vptr.vC = $hex, vc = 9, vx = 10\}$nl$gdb_prompt $" {
+ pass "print g_vC (FIXME v3 vtbl ptr)"
+ }
+ -re ".*$gdb_prompt $" { fail "print g_vC" }
+ timeout { fail "print g_vC (timeout)" }
+ }
+}
+
+#
+# Multiple virtual inheritance, print individual members.
+#
+
+proc test_print_mvi_members {} {
+ global gdb_prompt
+ global decimal
+ global nl
+
+ # Print all members of g_vD.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "print g_vD.vA::va\n"
+ gdb_expect {
+ -re ".* = 19$nl$gdb_prompt $" { pass "print g_vD.vA::va" }
+ -re ".*virtual baseclass botch.*$gdb_prompt $" {
+ # Does not happen with gcc cygnus-2.4.5-930828
+ fail "print g_vD.vA::va (known bug with gcc cygnus-2.4.5-930417)"
+ # Many of the rest of these tests have the same problem.
+ return 0
+ }
+ -re ".*$gdb_prompt $" { fail "print g_vD.vA::va" }
+ timeout { fail "print g_vD.vA::va (timeout)" ; return }
+ }
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vD.vA::vx" ".* = 20" "print g_vD.vA::vx"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vD.vB::vb" ".* = 21" "print g_vD.vB::vb"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vD.vB::vx" ".* = 22" "print g_vD.vB::vx"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vD.vC::vc" ".* = 23" "print g_vD.vC::vc"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vD.vC::vx" ".* = 24" "print g_vD.vC::vx"
+
+ gdb_test "print g_vD.vD::vd" ".* = 25" "print g_vD.vD::vd"
+
+ gdb_test "print g_vD.vD::vx" ".* = 26" "print g_vD.vD::vx"
+
+ # Print all members of g_vE.
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vE.vA::va" ".* = 0" "print g_vE.vA::va"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vE.vA::vx" ".* = 0" "print g_vE.vA::vx"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vE.vB::vb" ".* = 0" "print g_vE.vB::vb"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vE.vB::vx" ".* = 0" "print g_vE.vB::vx"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vE.vC::vc" ".* = 0" "print g_vE.vC::vc"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vE.vC::vx" ".* = 0" "print g_vE.vC::vx"
+
+ setup_xfail_format "DWARF 1"
+ gdb_test "print g_vE.vD::vd" ".* = 0" "print g_vE.vD::vd"
+
+ gdb_test "print g_vE.vD::vx" ".* = 0" "print g_vE.vD::vx"
+
+ gdb_test "print g_vE.vE::ve" ".* = 27" "print g_vE.vE::ve"
+
+ gdb_test "print g_vE.vE::vx" ".* = 28" "print g_vE.vE::vx"
+}
+
+#
+# Multiple virtual inheritance, print type definitions.
+#
+
+proc test_ptype_mvi {} {
+ global gdb_prompt
+ global ws
+ global nl
+ global vbptr
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype vD\n"
+ gdb_expect {
+ -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \\*${vbptr}vC;${ws}vB \\*${vbptr}vB;${ws}public:${ws}int vd;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
+ pass "ptype vD"
+ }
+ -re ".*class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;.*\}.*$gdb_prompt $" {
+ pass "ptype vD"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype vD" }
+ timeout { fail "(timeout) ptype vD" }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class vD\n"
+ gdb_expect {
+ -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \\*${vbptr}vC;${ws}vB \\*${vbptr}vB;${ws}public:${ws}int vd;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
+ pass "ptype class vD"
+ }
+ -re ".*class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;.*\}.*$gdb_prompt $" {
+ pass "ptype class vD"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class vD" }
+ timeout { fail "(timeout) ptype class vD" }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype g_vD\n"
+ gdb_expect {
+ -re "type = class vD : public virtual vB, public virtual vC \{${ws}private:${ws}vC \\*${vbptr}vC;${ws}vB \\*${vbptr}vB;${ws}public:${ws}int vd;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
+ pass "ptype g_vD"
+ }
+ -re ".*class vD : public virtual vB, public virtual vC \{${ws}public:${ws}int vd;${ws}int vx;\r\n.*\}.*$gdb_prompt $" {
+ pass "ptype g_vD"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype g_vD" }
+ timeout { fail "(timeout) ptype g_vD" }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype vE\n"
+ gdb_expect {
+ -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \\*${vbptr}vD;${ws}public:${ws}int ve;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
+ pass "ptype vE"
+ }
+ -re ".*class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;\r\n.*\}.*$gdb_prompt $" {
+ pass "ptype vE"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype vE" }
+ timeout { fail "(timeout) ptype vE" }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype class vE\n"
+ gdb_expect {
+ -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \\*${vbptr}vD;${ws}public:${ws}int ve;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
+ pass "ptype class vE"
+ }
+ -re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;\r\n.*\}.*$gdb_prompt $" {
+ pass "ptype class vE"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype class vE" }
+ timeout { fail "(timeout) ptype class vE" }
+ }
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "ptype g_vE\n"
+ gdb_expect {
+ -re "type = class vE : public virtual vD \{${ws}private:${ws}vD \\*${vbptr}vD;${ws}public:${ws}int ve;${ws}int vx;$nl.*\}.*$gdb_prompt $" {
+ pass "ptype g_vE"
+ }
+ -re "type = class vE : public virtual vD \{${ws}public:${ws}int ve;${ws}int vx;\r\n.*\}.*$gdb_prompt $" {
+ pass "ptype g_vE"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype g_vE" }
+ timeout { fail "(timeout) ptype g_vE" }
+ }
+}
+
+#
+# Multiple virtual inheritance, print complete classes.
+#
+
+proc test_print_mvi_classes {} {
+ global gdb_prompt
+ global hex
+ global decimal
+ global nl
+ global vbptr
+
+ # Print all members of g_vD.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "print g_vD\n"
+ gdb_expect {
+ -re ".* = \{\<class vB\> = \{\<class vA\> = \{va = 19, vx = 20\}, vb = 21, vx = 22, Virtual table at $hex\}, \<class vC\> = \{vc = 23, vx = 24, Virtual table at $hex\}, vd = 25, vx = 26, Virtual table at $hex\}$nl$gdb_prompt $" {
+ pass "print g_vD (aCC)"
+ }
+ -re ".* = \{\<class vB\> = \{\<class vA\> = \{va = 19, vx = 20\}, vb = 21, vx = 22, __vfp = $hex\}, \<class vC\> = \{vc = 23, vx = 24, __vfp = $hex\}, vd = 25, vx = 26, __vfp = $hex\}$nl$gdb_prompt $" {
+ pass "print g_vD (aCC)"
+ }
+ -re ".* = \{\<vB\> = \{\<vA\> = \{va = 19, vx = 20\}, ${vbptr}vA = $hex, vb = 21, vx = 22\}, \<vC\> = \{${vbptr}vA = $hex, vc = 23, vx = 24\}, ${vbptr}vC = $hex, ${vbptr}vB = $hex, vd = 25, vx = 26\}$nl$gdb_prompt $" {
+ pass "print g_vD"
+ }
+ -re ".* = \{\<vB\> = \{\<vA\> = \{va = 19, vx = 20\}, _vptr.vB = $hex, vb = 21, vx = 22\}, \<vC\> = \{_vptr.vC = $hex, vc = 23, vx = 24\}, _vptr.vD = $hex, vd = 25, vx = 26\}$nl$gdb_prompt $" {
+ pass "print g_vD (FIXME v3 vtbl ptr)"
+ }
+ -re ".*invalid address 0x0.*$gdb_prompt $" {
+ # Does not happen with gcc cygnus-2.4.5-930828
+ fail "print g_vD (known bug with gcc cygnus-2.4.5-930417)"
+ # Many of the rest of these tests have the same problem.
+ return 0
+ }
+ -re ".*$gdb_prompt $" { fail "print g_vD" }
+ timeout { fail "print g_vD (timeout)" ; return }
+ }
+
+ # Print all members of g_vE.
+
+ setup_xfail_format "DWARF 1"
+ send_gdb "print g_vE\n"
+ gdb_expect {
+ -re ".* = \{\<class vD\> = \{\<class vB\> = \{\<class vA\> = \{va = 0, vx = 0\}, vb = 0, vx = 0, Virtual table at $hex\}, \<class vC\> = \{vc = 0, vx = 0, Virtual table at $hex\}, vd = 0, vx = 0, Virtual table at $hex\}, ve = 27, vx = 28, Virtual table at $hex\}$nl$gdb_prompt $" {
+ pass "print g_vE (aCC)"
+ }
+ -re ".* = \{\<class vD\> = \{\<class vB\> = \{\<class vA\> = \{va = 0, vx = 0\}, vb = 0, vx = 0, __vfp = $hex\}, \<class vC\> = \{vc = 0, vx = 0, __vfp = $hex\}, vd = 0, vx = 0, __vfp = $hex\}, ve = 27, vx = 28, __vfp = $hex\}$nl$gdb_prompt $" {
+ pass "print g_vE (aCC)"
+ }
+ -re ".* = \{\<vD\> = \{\<vB\> = \{\<vA\> = \{va = 0, vx = 0\}, ${vbptr}vA = $hex, vb = 0, vx = 0\}, \<vC\> = \{${vbptr}vA = $hex, vc = 0, vx = 0\}, ${vbptr}vC = $hex, ${vbptr}vB = $hex, vd = 0, vx = 0\}, ${vbptr}vD = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
+ pass "print g_vE"
+ }
+ -re ".* = \{\<vD\> = \{\<vB\> = \{\<vA\> = \{va = 0, vx = 0\}, _vptr.vB = $hex *(\<VTT for vD\>)?, vb = 0, vx = 0\}, \<vC\> = \{_vptr.vC = $hex *(\<VTT for vD\>)?, vc = 0, vx = 0\}, _vptr.vD = $hex, vd = 0, vx = 0\}, _vptr.vE = $hex, ve = 27, vx = 28\}$nl$gdb_prompt $" {
+ pass "print g_vE (FIXME v3 vtbl ptr)"
+ }
+ -re ".*$gdb_prompt $" { fail "print g_vE" }
+ timeout { fail "print g_vE (timeout)" }
+ }
+}
+
+proc do_tests {} {
+ global prms_id
+ global bug_id
+ global subdir
+ global objdir
+ global srcdir
+ global binfile
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language c++" ""
+ gdb_test "set width 0" ""
+
+ # Get the debug format for the compiled test case.
+
+ if { ![ runto_main] } {
+ gdb_suppress_tests;
+ } else {
+ get_debug_format
+ }
+
+ test_ptype_si
+ test_ptype_mi
+ test_ptype_vi
+ test_ptype_mvi
+
+ gdb_stop_suppressing_tests;
+
+ if { ![ runto 'inheritance2' ] } {
+ gdb_suppress_tests;
+ }
+
+ test_print_si_members
+ test_print_si_classes
+ test_print_mi_members
+ test_print_mi_classes
+ test_print_anon_union
+
+ gdb_stop_suppressing_tests;
+
+ if { ![ runto 'inheritance4' ] } {
+ gdb_suppress_tests;
+ }
+
+ test_print_svi_members
+ test_print_svi_classes
+ test_print_mvi_members
+ test_print_mvi_classes
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.c++/local.cc b/gdb/testsuite/gdb.c++/local.cc
new file mode 100644
index 00000000000..5bfc44ac43b
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/local.cc
@@ -0,0 +1,61 @@
+// Tests for local types
+
+void marker1 (void)
+{
+}
+
+
+int foobar (int x)
+{
+ class Local {
+ public:
+ int loc1;
+ char loc_foo (char c)
+ {
+ return c + 3;
+ }
+ };
+
+ Local l;
+ static Local l1;
+ char c;
+
+ l.loc1 = 23;
+
+ c = l.loc_foo('x');
+ return c + 2;
+}
+
+int main()
+{
+ int c;
+
+ c = foobar (31);
+
+ { // inner block
+ class InnerLocal {
+ public:
+ char ilc;
+ int * ip;
+ int il_foo (unsigned const char & uccr)
+ {
+ return uccr + 333;
+ }
+ class NestedInnerLocal {
+ public:
+ int nil;
+ int nil_foo (int i)
+ {
+ return i * 27;
+ }
+ };
+ NestedInnerLocal nest1;
+ };
+
+ InnerLocal il;
+
+ il.ilc = 'b';
+ il.ip = &c;
+ marker1();
+ }
+}
diff --git a/gdb/testsuite/gdb.c++/local.exp b/gdb/testsuite/gdb.c++/local.exp
new file mode 100644
index 00000000000..3ec2d5ef8b5
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/local.exp
@@ -0,0 +1,199 @@
+# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# tests for local variables
+# Written by Satish Pai <pai@apollo.hp.com> 1997-07-08
+# Cleaned by Michael Chastain <mec@shout.net> 2002-04-08
+
+
+# This file is part of the gdb testsuite
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "local"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info $binfile "c++"] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+if ![runto 'marker1'] then {
+ perror "couldn't run to marker1"
+ continue
+}
+
+gdb_test "up" ".*main.*" "up from marker1"
+
+# Local classes in g++ get names like "main.1::InnerLocal", just like local
+# static variables. Some targets use "___" instead of ".".
+
+# ---
+# Pattern 1:
+# PASS
+# dwarf-2
+# gcc 2.95.3
+#
+# Pattern 2:
+# FAIL
+# This has a duplicate "char loc_foo" line. This is a bug.
+# Historically this has been an XFAIL.
+# dwarf-2
+# gcc 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+#
+# Pattern 3:
+# PASS
+# stabs+
+# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+#
+# Pattern 4:
+# This an old pattern from the hppa aCC version of this file.
+# I left it alone.
+#
+# chastain 2002-04-08
+
+set sep "(\[.\]|___)\[0-9\]"
+
+send_gdb "ptype Local\n"
+gdb_expect {
+ -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" }
+ -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*char loc_foo\\((const *|)char\\);\[\r\n\t \]*\}.*$gdb_prompt $" {
+ # setup_kfail "gdb/483"
+ fail "ptype Local (gdb/483)"
+ }
+ -re "type = class Local \{\[\r\n\t \]*public:\[\r\n\t \]*int loc1;\[\r\n\t \]*Local & operator *=\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((foobar__Fi${sep}::|)Local const *&\\);\[\r\n\t \]*Local\\((void|)\\);\[\r\n\t \]*char loc_foo\\(char\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype Local" }
+ -re "type = class Local \{\r\n\[\t \]*public:\r\n\[\t \]*int loc1;\r\n\r\n\[\t \]*char loc_foo\\(char\\);\r\n\[\t \]*\\(Local at.*local\\.cc:\[0-9\]*\\)\r\n\}.*$gdb_prompt $" { xpass "ptype Local (old aCC)" }
+ -re ".*$gdb_prompt $" { fail "ptype Local" }
+ timeout { fail "(timeout) ptype Local" }
+}
+
+# DTS CLLbs14316 and CLLbs17058
+# coulter - I added a clause for HP's aCC compiler. We print out the type
+# as xx instead of const unsigned char, but we still have an expected failure
+# because of two reasons:
+# There is a number at the end of InnerLocal4 which should not be there,
+# DTS CLLbs14316
+# The line number for the class
+# setup_xfail "hppa*-*-*" CLLbs14316
+
+# ---
+# Pattern 1:
+# PASS
+# dwarf-2
+# 2.95.3, 2.96-rh, 3.0.4, 3.1, gcc-3_1-branch, HEAD
+#
+# Pattern 2:
+# PASS
+# stabs+
+# 2.95.3, 2.96-rh, 3.0.4, 3.1, gcc-3_1-branch, HEAD
+#
+# Pattern 3:
+# Old hppa pattern.
+#
+# Pattern 4:
+# Old hppa pattern.
+#
+# chastain 2002-05-27
+
+send_gdb "ptype InnerLocal\n"
+gdb_expect {
+ -re "type = class InnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*char ilc;\[\r\n\t \]*int \\* *ip;\[\r\n\t \]*(InnerLocal::|)NestedInnerLocal nest1;\[\r\n\t \]*int il_foo\\((unsigned char const|const unsigned char) *&\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal (pattern 1)" }
+ -re "type = class InnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*char ilc;\[\r\n\t \]*int \\* *ip;\[\r\n\t \]*(InnerLocal::|)NestedInnerLocal nest1;\[\r\n\t \]*InnerLocal *& operator *=\\((main${sep}::|)InnerLocal const *&\\);\[\r\n\t \]*InnerLocal\\((main${sep}::|)InnerLocal const *&\\);\[\r\n\t \]*InnerLocal\\((void|)\\);\[\r\n\t \]*int il_foo\\(unsigned char const *&\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal (pattern 2)" }
+ -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*InnerLocal::NestedInnerLocal nest1;\r\n\r\n\[\t \]*.int il_foo\\(unsigned char const &\\);\r\n\[\t \]*\}\[\t \]*\\(Local at.*local\\.cc:36\\).*$gdb_prompt $" { pass "ptype InnerLocal (old HP aCC)" }
+ -re "type = class InnerLocal \{\r\n\[\t \]*public:\r\n\[\t \]*char ilc;\r\n\[\t \]*int \\*ip;\r\n\[\t \]*class InnerLocal4::NestedInnerLocal nest1;\r\n\r\n\[\t \]*int il_foo\\(unsigned char const &\\);\r\n\[\t \]*\\(Local at.*local\.cc:\[0-9\]+\\)\r\n\}.*$gdb_prompt $" { pass "ptype InnerLocal (old HP aCC)" }
+ -re ".*$gdb_prompt $" { fail "ptype InnerLocal" }
+ timeout { fail "(timeout) ptype InnerLocal" }
+}
+
+#---
+# Pattern 1:
+# PASS
+# dwarf-2
+# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+#
+# Pattern 2:
+# PASS
+# stabs+
+# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+#
+# chastain 2002-04-08
+
+send_gdb "ptype NestedInnerLocal\n"
+gdb_expect {
+ -re "type = class NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype NestedInnerLocal" }
+ -re "type = class NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*NestedInnerLocal *& *operator *= *\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((void|)\\);\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype NestedInnerLocal" }
+ -re ".*$gdb_prompt $" { fail "ptype NestedInnerLocal" }
+ timeout { fail "(timeout) ptype NestedInnerLocal" }
+}
+
+# gdb incorrectly interprets the NestedInnerLocal in
+# InnerLocal::NestedInnerLocal as field name instead of a type name;
+# See CLLbs14784.
+
+#---
+# Pattern 3:
+# FAIL
+# The comment above, about CLLbs14784, is still correct.
+# dwarf-2
+# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+# stabs+
+# gcc 2.95.3, 2.96-rh, 3.0.4, gcc-3_1-branch, HEAD
+#
+# chastain 2002-04-08
+
+send_gdb "ptype InnerLocal::NestedInnerLocal\n"
+gdb_expect {
+ -re "type = class InnerLocal::NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" }
+ -re "type = class InnerLocal::NestedInnerLocal \{\[\r\n\t \]*public:\[\r\n\t \]*int nil;\[\r\n\t \]*NestedInnerLocal *& *operator *= *\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((main${sep}::|)InnerLocal::NestedInnerLocal const *&\\);\[\r\n\t \]*NestedInnerLocal\\((void|)\\);\[\r\n\t \]*int nil_foo\\(int\\);\[\r\n\t \]*\}.*$gdb_prompt $" { pass "ptype InnerLocal::NestedInnerLocal" }
+ -re "There is no field named NestedInnerLocal.*$gdb_prompt $" {
+ # setup_kfail "gdb/482"
+ fail "ptype InnerLocal::NestedInnerLocal (gdb/482)"
+ }
+ -re "No symbol .*NestedInnerLocal.* in current context.*$gdb_prompt $" { fail "ptype InnerLocal::NestedInnerLocal (bogus symbol lookup)" }
+ -re ".*$gdb_prompt $" { fail "ptype InnerLocal::NestedInnerLocal" }
+ timeout { fail "(timeout) ptype InnerLocal::NestedInnerLocal" }
+}
diff --git a/gdb/testsuite/gdb.c++/m-data.cc b/gdb/testsuite/gdb.c++/m-data.cc
new file mode 100644
index 00000000000..d9950274d7a
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/m-data.cc
@@ -0,0 +1,53 @@
+// 2002-05-13
+
+namespace __gnu_test
+{
+ enum region { oriental, egyptian, greek, etruscan, roman };
+
+ // Test one.
+ class gnu_obj_1
+ {
+ protected:
+ typedef region antiquities;
+ const bool test;
+ const int key1;
+ long key2;
+
+ antiquities value;
+
+ public:
+ gnu_obj_1(antiquities a, long l): test(true), key1(5), key2(l), value(a) {}
+ };
+
+ // Test two.
+ template<typename T>
+ class gnu_obj_2: public virtual gnu_obj_1
+ {
+ protected:
+ antiquities value_derived;
+
+ public:
+ gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { }
+ };
+
+ // Test three.
+ template<typename T>
+ class gnu_obj_3
+ {
+ protected:
+ typedef region antiquities;
+ gnu_obj_2<int> data;
+
+ public:
+ gnu_obj_3(antiquities b): data(etruscan) { }
+ };
+}
+
+int main()
+{
+ using namespace __gnu_test;
+ gnu_obj_1 test1(egyptian, 4589);
+ gnu_obj_2<long> test2(roman);
+ gnu_obj_3<long> test3(greek);
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.c++/m-data.exp b/gdb/testsuite/gdb.c++/m-data.exp
new file mode 100644
index 00000000000..ac6825870da
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/m-data.exp
@@ -0,0 +1,112 @@
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Tests for member data
+# 2002-05-13 Benjamin Kosnik <bkoz@redhat.com>
+
+# This file is part of the gdb testsuite
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { [skip_cplus_tests] } { continue }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "m-data"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# One.
+gdb_test "break 50" "Breakpoint \[0-9\]*.*line 50\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*m-data\\.cc:50\r\n.*" "continue to 50"
+
+# simple object, const bool
+gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, const bool"
+
+# simple object, const int
+gdb_test "print test1.key1" "\\$\[0-9\]* = 5" "simple object, const int"
+
+# simple object, long
+gdb_test "print test1.key2" "\\$\[0-9\]* = 4589" "simple object, long"
+
+# simple object, enum
+gdb_test "print test1.value" "\\$\[0-9\]* = egyptian" "simple object, enum"
+
+# Two.
+gdb_test "break 51" "Breakpoint \[0-9\]*.*line 51\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*m-data\\.cc:51\r\n.*" "continue to 51"
+
+# derived template object, base const bool
+gdb_test "print test2.test" "\\$\[0-9\]* = true" "derived template object, base const bool"
+
+# derived template object, base const int
+gdb_test "print test2.key1" "\\$\[0-9\]* = 5" "derived template object, base const int"
+
+# derived template object, base long
+gdb_test "print test2.key2" "\\$\[0-9\]* = 7" "derived template object, base long"
+
+# derived template object, base enum
+gdb_test "print test2.value" "\\$\[0-9\]* = oriental" "derived template object, base enum"
+
+# derived template object, enum
+gdb_test "print test2.value_derived" "\\$\[0-9\]* = roman" "derived template object, derived enum"
+
+# Three.
+gdb_test "break 52" "Breakpoint \[0-9\]*.*line 52\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*m-data\\.cc:52\r\n.*" "continue to 52"
+
+# template object, derived template data member's base const bool
+gdb_test "print test3.data.test" "\\$\[0-9\]* = true" "template object, const bool"
+
+# template object, derived template data member's base const int
+gdb_test "print test3.data.key1" "\\$\[0-9\]* = 5" "template object, const int"
+
+# template object, derived template data member's base long
+gdb_test "print test3.data.key2" "\\$\[0-9\]* = 7" "template object, long"
+
+# template object, derived template data member's base enum
+gdb_test "print test3.data.value" "\\$\[0-9\]* = oriental" "template object, base enum"
+
+# template object, derived template data member's enum
+gdb_test "print test3.data.value_derived" "\\$\[0-9]\* = etruscan" "template object, derived enum"
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.c++/m-static.cc b/gdb/testsuite/gdb.c++/m-static.cc
new file mode 100644
index 00000000000..24338014365
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/m-static.cc
@@ -0,0 +1,72 @@
+// 2002-05-13
+
+namespace __gnu_test
+{
+ enum region { oriental, egyptian, greek, etruscan, roman };
+
+ // Test one.
+ class gnu_obj_1
+ {
+ protected:
+ typedef region antiquities;
+ static const bool test = true;
+ static const int key1 = 5;
+ static long key2;
+
+ static antiquities value;
+
+ public:
+ gnu_obj_1(antiquities a, long l) {}
+ };
+
+ const bool gnu_obj_1::test;
+ const int gnu_obj_1::key1;
+ long gnu_obj_1::key2 = 77;
+ gnu_obj_1::antiquities gnu_obj_1::value = oriental;
+
+
+ // Test two.
+ template<typename T>
+ class gnu_obj_2: public virtual gnu_obj_1
+ {
+ public:
+ static antiquities value_derived;
+
+ public:
+ gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7) { }
+ };
+
+ template<typename T>
+ typename gnu_obj_2<T>::antiquities gnu_obj_2<T>::value_derived = etruscan;
+
+ // Test three.
+ template<typename T>
+ class gnu_obj_3
+ {
+ public:
+ typedef region antiquities;
+ static gnu_obj_2<int> data;
+
+ public:
+ gnu_obj_3(antiquities b) { }
+ };
+
+ template<typename T>
+ gnu_obj_2<int> gnu_obj_3<T>::data(etruscan);
+}
+
+// instantiate templates explicitly so their static members will exist
+template class __gnu_test::gnu_obj_2<int>;
+template class __gnu_test::gnu_obj_2<long>;
+template class __gnu_test::gnu_obj_3<long>;
+
+int main()
+{
+ using namespace __gnu_test;
+
+ gnu_obj_1 test1(egyptian, 4589);
+ gnu_obj_2<long> test2(roman);
+ gnu_obj_3<long> test3(greek);
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.c++/m-static.exp b/gdb/testsuite/gdb.c++/m-static.exp
new file mode 100644
index 00000000000..c05983b6538
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/m-static.exp
@@ -0,0 +1,112 @@
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Tests for member static data
+# 2002-05-13 Benjamin Kosnik <bkoz@redhat.com>
+
+# This file is part of the gdb testsuite
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { [skip_cplus_tests] } { continue }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "m-static"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# One.
+gdb_test "break 68" "Breakpoint \[0-9\]*.*line 68\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*m-static\\.cc:68\r\n.*" "continue to 68"
+
+# simple object, static const bool
+gdb_test "print test1.test" "\\$\[0-9\]* = true" "simple object, static const bool"
+
+# simple object, static const int
+gdb_test "print test1.key1" "\\$\[0-9\]* = 5" "simple object, static const int"
+
+# simple object, static long
+gdb_test "print test1.key2" "\\$\[0-9\]* = 77" "simple object, static long"
+
+# simple object, static enum
+gdb_test "print test1.value" "\\$\[0-9\]* = oriental" "simple object, static enum"
+
+# Two.
+gdb_test "break 69" "Breakpoint \[0-9\]*.*line 69\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*m-static\\.cc:69\r\n.*" "continue to 69"
+
+# derived template object, base static const bool
+gdb_test "print test2.test" "\\$\[0-9\]* = true" "derived template object, base static const bool"
+
+# derived template object, base static const int
+gdb_test "print test2.key1" "\\$\[0-9\]* = 5" "derived template object, base static const int"
+
+# derived template object, base static long
+gdb_test "print test2.key2" "\\$\[0-9\]* = 77" "derived template object, base static long"
+
+# derived template object, base static enum
+gdb_test "print test2.value" "\\$\[0-9\].* = oriental" "derived template object, base static enum"
+
+# derived template object, static enum
+gdb_test "print test2.value_derived" "\\$\[0-9\].* = etruscan" "derived template object, static enum"
+
+# Three.
+gdb_test "break 71" "Breakpoint \[0-9\]*.*line 71\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*m-static\\.cc:71\r\n.*" "continue to 71"
+
+# template object, static derived template data member's base static const bool
+gdb_test "print test3.data.test" "\\$\[0-9\].* = true" "template object, static const bool"
+
+# template object, static derived template data member's base static const int
+gdb_test "print test3.data.key1" "\\$\[0-9\].* = 5" "template object, static const int"
+
+# template object, static derived template data member's base static long
+gdb_test "print test3.data.key2" "\\$\[0-9\].* = 77" "template object, static long"
+
+# template object, static derived template data member's base static enum
+gdb_test "print test3.data.value" "\\$\[0-9\].* = oriental" "template object, static enum"
+
+# template object, static derived template data member's static enum
+gdb_test "print test3.data.value_derived" "\\$\[0-9\].* = etruscan" "template object, static derived enum"
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.c++/member-ptr.cc b/gdb/testsuite/gdb.c++/member-ptr.cc
new file mode 100644
index 00000000000..4beb92616d4
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/member-ptr.cc
@@ -0,0 +1,106 @@
+extern "C" {
+#include <stdio.h>
+}
+
+
+class A {
+public:
+ A();
+ int foo (int x);
+ int bar (int y);
+ virtual int baz (int z);
+ char c;
+ int j;
+ int jj;
+ static int s;
+};
+
+class B {
+public:
+ static int s;
+};
+
+int A::s = 10;
+int B::s = 20;
+
+A::A()
+{
+ c = 'x';
+ j = 5;
+}
+
+int A::foo (int dummy)
+{
+ j += 3;
+ return j + dummy;
+}
+
+int A::bar (int dummy)
+{
+ int r;
+ j += 13;
+ r = this->foo(15);
+ return r + j + 2 * dummy;
+}
+
+int A::baz (int dummy)
+{
+ int r;
+ j += 15;
+ r = this->foo(15);
+ return r + j + 12 * dummy;
+}
+
+int fum (int dummy)
+{
+ return 2 + 13 * dummy;
+}
+
+typedef int (A::*PMF)(int);
+
+typedef int A::*PMI;
+
+int main ()
+{
+ A a;
+ A * a_p;
+ PMF pmf;
+
+ PMF * pmf_p;
+ PMI pmi;
+
+ a.j = 121;
+ a.jj = 1331;
+
+ int k;
+
+ a_p = &a;
+
+ pmi = &A::j;
+ pmf = &A::bar;
+ pmf_p = &pmf;
+
+ pmi = NULL;
+
+ k = (a.*pmf)(3);
+
+ pmi = &A::jj;
+ pmf = &A::foo;
+ pmf_p = &pmf;
+
+ k = (a.*pmf)(4);
+
+ k = (a.**pmf_p)(5);
+
+ k = a.*pmi;
+
+
+ k = a.bar(2);
+
+ k += fum (4);
+
+ B b;
+
+ k += b.s;
+
+}
diff --git a/gdb/testsuite/gdb.c++/member-ptr.exp b/gdb/testsuite/gdb.c++/member-ptr.exp
new file mode 100644
index 00000000000..f21cd1506e7
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/member-ptr.exp
@@ -0,0 +1,549 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+# Tests for pointer-to-member support
+# Written by Satish Pai <pai@apollo.hp.com> 1997-08-19
+
+# This file is part of the gdb testsuite
+
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { [skip_cplus_tests] } { continue }
+
+#
+# test running programs
+#
+
+# Start with a fresh gdb
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+set prms_id 0
+set bug_id 0
+
+set testfile "member-ptr"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+# Nearly all of these tests fail when compiled with G++, so just give up
+# until GDB gets enhanced. -sts 1999-06-22
+
+if {$gcc_compiled} {
+ continue
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+send_gdb "break 83\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*.*line 83\\.\r\n$gdb_prompt $" {
+ pass "set break at 83"
+ }
+ -re ".*$gdb_prompt $" { fail "set break at 83" }
+ timeout { fail "(timeout) set break at 83" }
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\.\r\n\r\nBreakpoint.*at.*member-ptr\\.cc:83\r\n83\[ \t]*pmi = NULL;\r\n$gdb_prompt $" {
+ pass "continue to 83"
+ }
+ -re ".*$gdb_prompt $" { fail "continue to 83" }
+ timeout { fail "(timeout) continue to 83" }
+}
+
+# ptype on pointer to data member
+
+send_gdb "ptype pmi\n"
+gdb_expect {
+ -re "type = int \\( A::\\*\\)\r\n$gdb_prompt $" {
+ pass "ptype pmi"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype pmi" }
+ timeout { fail "(timeout) ptype pmi" }
+}
+
+# print pointer to data member
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print pmi\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\(int \\( A::\\*\\)\\) &A::j\r\n$gdb_prompt $" {
+ pass "print pmi"
+ }
+ -re ".*$gdb_prompt $" { fail "print pmi" }
+ timeout { fail "(timeout) print pmi" }
+}
+
+
+# print dereferenced pointer to data member
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print a.*pmi\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 121\r\n$gdb_prompt $" {
+ pass "print a.*pmi"
+ }
+ -re ".*$gdb_prompt $" { fail "print a.*pmi" }
+ timeout { fail "(timeout) print a.*pmi" }
+}
+
+# print dereferenced pointer to data member
+# this time, dereferenced through a pointer
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print a_p->*pmi\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 121\r\n$gdb_prompt $" {
+ pass "print a->*pmi"
+ }
+ -re ".*$gdb_prompt $" { fail "print a->*pmi" }
+ timeout { fail "(timeout) print a->*pmi" }
+}
+
+
+# set the pointer to data member
+
+send_gdb "set var pmi = &A::jj\n"
+gdb_expect {
+ -re "$gdb_prompt $" {
+ pass "set var (not really a pass)"
+ }
+ timeout { fail "(timeout) " }
+}
+
+# Now print the pointer again
+
+send_gdb "print pmi\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\(int \\( A::\\*\\)\\) &A::jj\r\n$gdb_prompt $" {
+ pass "print pmi after setting"
+ }
+ -re ".*$gdb_prompt $" { fail "print pmi after setting" }
+ timeout { fail "(timeout) print pmi after setting" }
+}
+
+# print dereferenced pointer to data member again
+
+send_gdb "print a.*pmi\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 1331\r\n$gdb_prompt $" {
+ pass "print a.*pmi after setting"
+ }
+ -re ".*$gdb_prompt $" { fail "print a.*pmi after setting" }
+ timeout { fail "(timeout) print a.*pmi after setting" }
+}
+
+# set the pointer to data member back to A::j
+
+send_gdb "set var pmi = &A::j\n"
+gdb_expect {
+ -re "$gdb_prompt $" {
+ pass "set var back to A::j (not really a pass)"
+ }
+ timeout { fail "(timeout) set var pmi" }
+}
+
+# print dereferenced pointer to data member yet again (extra check, why not)
+
+send_gdb "print a.*pmi\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 121\r\n$gdb_prompt $" {
+ pass "print a.*pmi after resetting"
+ }
+ -re ".*$gdb_prompt $" { fail "print a.*pmi after resetting" }
+ timeout { fail "(timeout) print a.*pmi after resetting" }
+}
+
+# Set the data member pointed to.
+
+send_gdb "print a.*pmi = 33\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 33\r\n$gdb_prompt $" {
+ pass "print command to set"
+ }
+ -re ".*$gdb_prompt $" { fail "print command to set" }
+ timeout { fail "(timeout) print command to set" }
+}
+
+# Now check that the data really was changed
+send_gdb "print a.*pmi\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 33\r\n$gdb_prompt $" {
+ pass "print a.*pmi after setting member pointed to"
+ }
+ -re ".*$gdb_prompt $" { fail "print a.*pmi after setting member pointed to" }
+ timeout { fail "(timeout) print a.*pmi after setting member pointed to" }
+}
+
+# Double-check by printing a.
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print a\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{c = 120 'x', j = 33, jj = 1331, static s = 10, Virtual table at $hex\}\r\n$gdb_prompt $" {
+ pass "print a after setting member pointed to by pmi"
+ }
+ -re ".*$gdb_prompt $" { fail "print a after setting member pointed to by pmi" }
+ timeout { fail "(timeout) print a after setting member pointed to by pmi" }
+}
+
+
+# Set the data member pointed to, using ->*
+
+send_gdb "print a_p->*pmi = 44\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 44\r\n$gdb_prompt $" {
+ pass "print command to set (->)"
+ }
+ -re ".*$gdb_prompt $" { fail "print command to set (->)" }
+ timeout { fail "(timeout) print command to set (->)" }
+}
+
+# Now check that the data really was changed
+send_gdb "print a_p->*pmi\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 44\r\n$gdb_prompt $" {
+ pass "print a_p->*pmi after setting member pointed to"
+ }
+ -re ".*$gdb_prompt $" { fail "print a_p->*pmi after setting member pointed to" }
+ timeout { fail "(timeout) print a_p->*pmi after setting member pointed to" }
+}
+
+# Double-check by printing a.
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print a\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{c = 120 'x', j = 44, jj = 1331, static s = 10, Virtual table at $hex\}\r\n$gdb_prompt $" {
+ pass "print a after setting member pointed to by pmi (->) "
+ }
+ -re ".*$gdb_prompt $" { fail "print a after setting member pointed to by pmi (->) " }
+ timeout { fail "(timeout) print a after setting member pointed to by pmi (->) " }
+}
+
+
+# Do a ptype on the dereferenced pointer to member
+# pai/1997-08-20 Doesn't work
+
+# send_gdb "ptype a.*pmi\n"
+# gdb_expect {
+# -re "type = int\r\n$gdb_prompt $" {
+# pass "ptype a.*pmi"
+# }
+# -re ".*$gdb_prompt $" { fail "ptype a.*pmi" }
+# timeout { fail "(timeout) ptype a.*pmi" }
+#}
+
+# Try to dereference the pointer to data member without any object
+
+send_gdb "print *pmi\n"
+gdb_expect {
+ -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
+ pass "attempt to print ptr to member without object"
+ }
+ -re ".*$gdb_prompt $" { fail "attempt to print ptr to member without object" }
+ timeout { fail "(timeout) attempt to print ptr to member without object" }
+}
+
+# Try to ptype a dereference of the pointer to data member without any object
+
+send_gdb "ptype *pmi\n"
+gdb_expect {
+ -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
+ pass "attempt to ptype ptr to member without object"
+ }
+ -re ".*$gdb_prompt $" { fail "attempt to ptype ptr to member without object" }
+ timeout { fail "(timeout) attempt to ptype ptr to member without object" }
+}
+
+# Ptype a pointer to a method.
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "ptype pmf\n"
+gdb_expect {
+ -re "type = int \\( A::\\*\\)\\(\\.\\.\\.\\)\r\n$gdb_prompt $" {
+ pass "ptype pmf"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype pmf" }
+ timeout { fail "(timeout) ptype pmf" }
+}
+
+# print a pointer to a method
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print pmf\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\(int \\( A::\\*\\)\\(\\.\\.\\.\\)\\) \\?\\? <not supported with HP aCC>\r\n$gdb_prompt $" {
+ pass "print pmf"
+ }
+ -re ".*$gdb_prompt $" { fail "print pmf" }
+ timeout { fail "(timeout) print pmf" }
+}
+
+
+# Ptype a pointer to a pointer to a method
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "ptype pmf_p\n"
+gdb_expect {
+ -re "type = int \\( A::\\*\\*\\)\\(\\.\\.\\.\\)\r\n$gdb_prompt $" {
+ pass "ptype pmf_p"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype pmf_p" }
+ timeout { fail "(timeout) ptype pmf_p" }
+}
+
+# print a pointer to a pointer to a method
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print pmf_p\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\(int \\( A::\\*\\*\\)\\(\\.\\.\\.\\)\\) $hex\r\n$gdb_prompt $" {
+ pass "print pmf_p"
+ }
+ -re ".*$gdb_prompt $" { fail "print pmf_p" }
+ timeout { fail "(timeout) print pmf_p" }
+}
+
+# print dereferenced pointer to method
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print a.*pmf\n"
+gdb_expect {
+ -re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
+ pass "print a.*pmf (known aCC limitation)"
+ }
+ -re ".*$gdb_prompt $" { fail "print a.*pmf" }
+ timeout { fail "(timeout) print a.*pmf" }
+}
+
+# print dereferenced pointer to method, using ->*
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print a_p->*pmf\n"
+gdb_expect {
+ -re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
+ pass "print a_p->*pmf (known aCC limitation)"
+ }
+ -re ".*$gdb_prompt $" { fail "print a_p->*pmf" }
+ timeout { fail "(timeout) print a_p->*pmf" }
+}
+
+# set the pointer to data member
+
+setup_xfail "hppa*-*-*"
+send_gdb "set var pmf = &A::foo\n"
+gdb_expect {
+ -re "Assignment to pointers to methods not implemented with HP aCC\r\n$gdb_prompt $" {
+ pass "set var pmf (known aCC limitation)"
+ }
+ -re ".*$gdb_prompt $" { fail "set var pmf" }
+ timeout { fail "(timeout) set var pmf" }
+}
+
+# Try to dereference the pointer to method without any object
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print *pmf\n"
+gdb_expect {
+ -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
+ pass "attempt to print ptr to method without object"
+ }
+ -re ".*$gdb_prompt $" { fail "attempt to print ptr to method without object" }
+ timeout { fail "(timeout) attempt to print ptr to method without object" }
+}
+
+# Try to ptype a dereference of the pointer to method without any object
+
+send_gdb "ptype *pmi\n"
+gdb_expect {
+ -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
+ pass "attempt to ptype ptr to member without object"
+ }
+ -re ".*$gdb_prompt $" { fail "attempt to ptype ptr to member without object" }
+ timeout { fail "(timeout) attempt to ptype ptr to member without object" }
+}
+
+# Check cast of pointer to member to integer
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print (int) pmi\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 8\r\n$gdb_prompt $" {
+ pass "casting pmi to int"
+ }
+ -re ".*$gdb_prompt $" { fail "casting pmi to int" }
+ timeout { fail "(timeout) casting pmi to int" }
+}
+
+# Check cast of pointer to method to integer
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print (int) pmf\n"
+gdb_expect {
+ -re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
+ pass "casting pmf to int (known aCC limitation)"
+ }
+ -re ".*$gdb_prompt $" { fail "casting pmf to int" }
+ timeout { fail "(timeout) casting pmf to int" }
+}
+
+# Try to invoke a function through a pointer to data member
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print (a.*pmi)(3)\n"
+gdb_expect {
+ -re "Not implemented: function invocation through pointer to method with HP aCC\r\n$gdb_prompt $" {
+ pass "print (a.*pmi)(3) -- error message should be different"
+ }
+ -re ".*$gdb_prompt $" { fail "print (a.*pmi)(3)" }
+ timeout { fail "(timeout) print (a.*pmi)(3)" }
+}
+
+# Try to invoke a function through a pointer to a method
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print (a.*pmf)(3)\n"
+gdb_expect {
+ -re "Not implemented: function invocation through pointer to method with HP aCC\r\n$gdb_prompt $" {
+ pass "print (a.*pmi)(3) -- known aCC limitation"
+ }
+ -re ".*$gdb_prompt $" { fail "print (a.*pmf)(3)" }
+ timeout { fail "(timeout) print (a.*pmf)(3)" }
+}
+
+
+# Go past assignment of NULL to pmi
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "next\n"
+gdb_expect {
+ -re "\r\n85\[ \t\]*k = \\(a.\\*pmf\\)\\(3\\);\r\n$gdb_prompt $" {
+ pass "next past 83"
+ }
+ -re ".*$gdb_prompt $" { fail "next past 83" }
+ timeout { fail "(timeout) next past 83" }
+}
+
+#send_gdb "print pmi\n"
+#gdb_expect {
+# -re "Attempted dereference of null pointer-to-member\r\n$gdb_prompt $" {
+# pass ""
+# }
+# -re ".*$gdb_prompt $" { fail "" }
+# timeout { fail "(timeout) " }
+#}
+
+# Dereference the null pointer to member
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print a.*pmi\n"
+gdb_expect {
+ -re "Attempted dereference of null pointer-to-member\r\n$gdb_prompt $" {
+ pass "print a.*NULL"
+ }
+ -re ".*$gdb_prompt $" { fail "print a.*NULL" }
+ timeout { fail "(timeout) print a.*NULL" }
+}
+
+
+# Go to another part of the program
+send_gdb "break 91\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]*.*line 91\\.\r\n$gdb_prompt $" {
+ pass "set break at 91"
+ }
+ -re ".*$gdb_prompt $" { fail "set break at 91" }
+ timeout { fail "(timeout) set break at 91" }
+}
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\.\r\n\r\nBreakpoint.*at.*member-ptr\\.cc:91\r\n91\[ \t]*k = \\(a.\\*pmf\\)\\(4\\);\r\n$gdb_prompt $" {
+ pass "continue to 91"
+ }
+ -re ".*$gdb_prompt $" { fail "continue to 91" }
+ timeout { fail "(timeout) continue to 91" }
+}
+
+
+# Now check again that pmi works even when not set to
+# something that's at the beginning of the object
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print pmi\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\(int \\( A::\\*\\)\\) &A::jj\r\n$gdb_prompt $" {
+ pass "print pmi (2)"
+ }
+ -re ".*$gdb_prompt $" { fail "print pmi (2)" }
+ timeout { fail "(timeout) print pmi (2)" }
+}
+
+
+# print dereferenced pointer to data member
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print a.*pmi\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 1331\r\n$gdb_prompt $" {
+ pass "print a.*pmi (2)"
+ }
+ -re ".*$gdb_prompt $" { fail "print a.*pmi (2)" }
+ timeout { fail "(timeout) print a.*pmi (2)" }
+}
+
+# print dereferenced pointer to data member
+# this time, dereferenced through a pointer
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "print a_p->*pmi\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 1331\r\n$gdb_prompt $" {
+ pass "print a->*pmi"
+ }
+ -re ".*$gdb_prompt $" { fail "print a->*pmi (2)" }
+ timeout { fail "(timeout) print a->*pmi (2)" }
+}
+
+
+# p a.*pmf - fail
+
+# p pmi
+
+# p a.*pmi
+
diff --git a/gdb/testsuite/gdb.c++/method.cc b/gdb/testsuite/gdb.c++/method.cc
new file mode 100644
index 00000000000..949b027a02e
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/method.cc
@@ -0,0 +1,80 @@
+// Class funk has a constructor and an ordinary method
+// Test for CHFts23426
+
+class funk
+{
+public:
+ funk();
+ void getFunky(int a, int b);
+ int data_;
+};
+
+funk::funk()
+ : data_(33)
+{
+}
+
+void funk::getFunky(int a, int b)
+{
+ int res;
+ res = a + b - data_;
+ data_ = res;
+}
+
+// Class A has const and volatile methods
+
+class A {
+public:
+ int x;
+ int y;
+ int foo (int arg);
+ int bar (int arg) const;
+ int baz (int arg, char c) volatile;
+ int qux (int arg, float f) const volatile;
+};
+
+int A::foo (int arg)
+{
+ x += arg;
+ return arg *2;
+}
+
+int A::bar (int arg) const
+{
+ return arg + 2 * x;
+}
+
+int A::baz (int arg, char c) volatile
+{
+ return arg - 2 * x + c;
+}
+
+int A::qux (int arg, float f) const volatile
+{
+ if (f > 0)
+ return 2 * arg - x;
+ else
+ return 2 * arg + x;
+}
+
+
+int main()
+{
+ A a;
+ int k;
+
+ k = 10;
+ a.x = k * 2;
+
+ k = a.foo(13);
+
+ k += a.bar(15);
+
+ // Test for CHFts23426 follows
+ funk f;
+ f.getFunky(1, 2);
+ return 0;
+}
+
+
+
diff --git a/gdb/testsuite/gdb.c++/method.exp b/gdb/testsuite/gdb.c++/method.exp
new file mode 100644
index 00000000000..a085b14cdcc
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/method.exp
@@ -0,0 +1,194 @@
+# Copyright 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# tests for misc. C++ method stuff
+# Written by Satish Pai <pai@apollo.hp.com> 1997-07-08
+
+# This file is part of the gdb testsuite
+
+# This tests:
+# 0. method arguments are correct
+# 1. access to class data members inside method scopes
+# 2. correct param types for methods in ptype.
+# 3. const and volatile methods
+
+# (#0 and #1 above relate to an HP specific problem -- GDB must correctly
+# integrate FPARAM symbols in HP debug info into the local var list
+# for the function or method's block.)
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "method"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info $binfile "c++"] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+gdb_test "break A::foo" \
+ "Breakpoint \[0-9\]* at $hex.*file .*method.cc, line 38\\."
+
+gdb_test "continue" \
+ "Continuing\\.\r\n\r\nBreakpoint \[0-9\]*, A::foo(\\(int\\)|) \\(this=$hex, arg=13\\) at .*method\\.cc:38\r\n38\[\t \]*x \\+= arg;" \
+ "continue to A::foo"
+
+# Check ability to access this-relative stuff.
+
+gdb_test "print x" \
+ "\\$\[0-9\]* = 20" \
+ "print x in A::foo"
+
+# Check access to this pointer
+
+gdb_test "print this" \
+ "\\$\[0-9\]* = \\((class |)A *\\* *(const|)\\) $hex" \
+ "print this in A::foo"
+
+# Now do everything over again for A::bar, because sometimes processing one method
+# (the first one) is fine, but the second one's debug info gets munged beyond recognition.
+
+gdb_test "break A::bar" \
+ "Breakpoint \[0-9\]* at $hex.*file .*method.cc, line 44\\."
+
+gdb_test "continue" \
+ "Continuing\\.\r\n\r\nBreakpoint \[0-9\]*, A::bar(\\(int\\) const|) \\(this=$hex, arg=15\\) at .*method\\.cc:44\r\n44\[\t \]*return arg \\+ 2 \\* x;" \
+ "continue to A::bar"
+
+# Check ability to access this-relative stuff.
+
+gdb_test "print x" \
+ "\\$\[0-9\]* = 33" \
+ "print x in A::bar"
+
+# Check access to this pointer
+
+get_debug_format
+
+send_gdb "print this\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\(const (class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
+ pass "print this in A::bar"
+ }
+ -re "\\$\[0-9\]* = \\((class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
+ # gcc versions up to 3.0.4 with -gstabs+ do not emit "const" indicators,
+ # so the output is "A *". It should be "const A *" or "const A * const".
+ setup_xfail_format "stabs"
+ fail "print this in A::bar (missing const)"
+ }
+ -re "\\$\[0-9\]* = \\(const (class |)\{\\.\\.\\.\} *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
+ # gcc versions gcc-3_1-branch%20020404 and HEAD%20020404 with -gstabs+
+ # produce good stabs, but gdb prints "const class {...} *" const.
+ # This is PR gdb/277.
+ # setup_kfail "gdb/277"
+ fail "print this in A::bar (gdb/277)"
+ }
+ -re ".*$gdb_prompt $" { fail "print this in A::bar" }
+ timeout { fail "(timeout) print this in A::bar" }
+}
+
+# Check again with funk::getFunky (this is the original test case
+# for CHFts23426); sometimes having a constructor with no arguments
+# will nuke the debug info read in for other methods in the class.
+
+gdb_test "break 21" \
+ "Breakpoint \[0-9\]* at $hex.*file .*method.cc, line 21\\."
+
+gdb_test "continue" \
+ "Continuing\\.\r\n\r\nBreakpoint \[0-9\]*, funk::getFunky(\\(int, int\\)|) \\(this=$hex, a=1, b=2\\) at .*method\\.cc:21\r\n21\[\t \]*data_ = res;" \
+ "continue to 21"
+
+# Check ability to access this-relative stuff.
+
+gdb_test "print data_" \
+ "\\$\[0-9\]* = 33" \
+ "print data_ in funk::getFunky"
+
+# Check access to this pointer
+
+gdb_test "print this" \
+ "\\$\[0-9\]* = \\((class |)funk *\\* *(const|)\\) $hex" \
+ "print this in funk::getFunky"
+
+# Check access to local variable
+
+gdb_test "print res" \
+ "\\$\[0-9\]* = -30" \
+ "print res in funk::getFunky"
+
+# Check ptype of class -- should show const/volatile methods
+
+send_gdb "ptype A\n"
+gdb_expect {
+ -re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\) volatile;\r\n\[ \]*int qux\\(int, float\\) (const volatile|volatile const);\r\n\}\r\n$gdb_prompt $" {
+ pass "ptype A"
+ }
+ -re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\[ \]*A & operator=\\(A const ?&\\);\r\n\[ \]*A\\(A const ?&\\);\r\n\[ \]*A\\((void|)\\);\r\n\[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\) volatile;\r\n\[ \]*int qux\\(int, float\\) (const volatile|volatile const);\r\n\}\r\n$gdb_prompt $" {
+ pass "ptype A"
+ }
+ -re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\);\r\n\[ \]*int qux\\(int, float\\) const;\r\n\}\r\n$gdb_prompt $" {
+ pass "ptype A (HP aCC bug -- volatile not indicated)"
+ }
+ -re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\) volatile;\r\n\[ \]*int qux\\(int, float\\) const volatile;\r\n\}\r\n$gdb_prompt $" {
+ pass "ptype A"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype A" }
+ timeout { fail "(timeout) ptype A" }
+}
+
+send_gdb "cont\n"
+gdb_expect {
+ -re "Continuing.\r\n\r\nProgram exited normally.*$gdb_prompt $" {
+ pass "finish program"
+ }
+ -re "Continuing.* EXIT code 0.*Program exited normally.*$gdb_prompt $" {
+ pass "finish program (exit wrapper)"
+ }
+ -re ".*$gdb_prompt $" { fail "finish program" }
+ default:{ fail "finish program (timeout)" }
+}
+
diff --git a/gdb/testsuite/gdb.c++/misc.cc b/gdb/testsuite/gdb.c++/misc.cc
new file mode 100644
index 00000000000..286c02bc6df
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/misc.cc
@@ -0,0 +1,587 @@
+// Test various -*- C++ -*- things.
+
+// ====================== basic C++ types =======================
+bool v_bool;
+bool v_bool_array[2];
+
+typedef struct fleep fleep;
+struct fleep { int a; } s;
+
+// ====================== simple class structures =======================
+
+struct default_public_struct {
+ // defaults to public:
+ int a;
+ int b;
+};
+
+struct explicit_public_struct {
+ public:
+ int a;
+ int b;
+};
+
+struct protected_struct {
+ protected:
+ int a;
+ int b;
+};
+
+struct private_struct {
+ private:
+ int a;
+ int b;
+};
+
+struct mixed_protection_struct {
+ public:
+ int a;
+ int b;
+ private:
+ int c;
+ int d;
+ protected:
+ int e;
+ int f;
+ public:
+ int g;
+ private:
+ int h;
+ protected:
+ int i;
+};
+
+class public_class {
+ public:
+ int a;
+ int b;
+};
+
+class protected_class {
+ protected:
+ int a;
+ int b;
+};
+
+class default_private_class {
+ // defaults to private:
+ int a;
+ int b;
+};
+
+class explicit_private_class {
+ private:
+ int a;
+ int b;
+};
+
+class mixed_protection_class {
+ public:
+ int a;
+ int b;
+ private:
+ int c;
+ int d;
+ protected:
+ int e;
+ int f;
+ public:
+ int g;
+ private:
+ int h;
+ protected:
+ int i;
+};
+
+class const_vol_method_class {
+public:
+ int a;
+ int b;
+ int foo (int &) const;
+ int bar (int &) volatile;
+ int baz (int &) const volatile;
+};
+
+int const_vol_method_class::foo (int & ir) const
+{
+ return ir + 3;
+}
+int const_vol_method_class::bar (int & ir) volatile
+{
+ return ir + 4;
+}
+int const_vol_method_class::baz (int & ir) const volatile
+{
+ return ir + 5;
+}
+
+// ========================= simple inheritance ==========================
+
+class A {
+ public:
+ int a;
+ int x;
+};
+
+A g_A;
+
+class B : public A {
+ public:
+ int b;
+ int x;
+};
+
+B g_B;
+
+class C : public A {
+ public:
+ int c;
+ int x;
+};
+
+C g_C;
+
+class D : public B, public C {
+ public:
+ int d;
+ int x;
+};
+
+D g_D;
+
+class E : public D {
+ public:
+ int e;
+ int x;
+};
+
+E g_E;
+
+class class_with_anon_union
+{
+ public:
+ int one;
+ union
+ {
+ int a;
+ long b;
+ };
+};
+
+class_with_anon_union g_anon_union;
+
+void inheritance2 (void)
+{
+}
+
+void inheritance1 (void)
+{
+ int ival;
+ int *intp;
+
+ // {A::a, A::x}
+
+ g_A.A::a = 1;
+ g_A.A::x = 2;
+
+ // {{A::a,A::x},B::b,B::x}
+
+ g_B.A::a = 3;
+ g_B.A::x = 4;
+ g_B.B::b = 5;
+ g_B.B::x = 6;
+
+ // {{A::a,A::x},C::c,C::x}
+
+ g_C.A::a = 7;
+ g_C.A::x = 8;
+ g_C.C::c = 9;
+ g_C.C::x = 10;
+
+ // {{{A::a,A::x},B::b,B::x},{{A::a,A::x},C::c,C::x},D::d,D::x}
+
+ // The following initialization code is non-portable, but allows us
+ // to initialize all members of g_D until we can fill in the missing
+ // initialization code with legal C++ code.
+
+ for (intp = (int *) &g_D, ival = 11;
+ intp < ((int *) &g_D + sizeof (g_D) / sizeof (int));
+ intp++, ival++)
+ {
+ *intp = ival;
+ }
+
+ // Overlay the nonportable initialization with legal initialization.
+
+ // ????? = 11; (g_D.A::a = 11; is ambiguous)
+ // ????? = 12; (g_D.A::x = 12; is ambiguous)
+/* djb 6-3-2000
+
+ This should take care of it. Rather than try to initialize using an ambiguous
+ construct, use 2 unambiguous ones for each. Since the ambiguous a/x member is
+ coming from C, and B, initialize D's C::a, and B::a, and D's C::x and B::x.
+ */
+ g_D.C::a = 15;
+ g_D.C::x = 12;
+ g_D.B::a = 11;
+ g_D.B::x = 12;
+ g_D.B::b = 13;
+ g_D.B::x = 14;
+ // ????? = 15;
+ // ????? = 16;
+ g_D.C::c = 17;
+ g_D.C::x = 18;
+ g_D.D::d = 19;
+ g_D.D::x = 20;
+
+
+ // {{{{A::a,A::x},B::b,B::x},{{A::a,A::x},C::c,C::x},D::d,D::x}},E::e,E::x}
+
+ // The following initialization code is non-portable, but allows us
+ // to initialize all members of g_D until we can fill in the missing
+ // initialization code with legal C++ code.
+
+ for (intp = (int *) &g_E, ival = 21;
+ intp < ((int *) &g_E + sizeof (g_E) / sizeof (int));
+ intp++, ival++)
+ {
+ *intp = ival;
+ }
+
+ // Overlay the nonportable initialization with legal initialization.
+
+ // ????? = 21; (g_E.A::a = 21; is ambiguous)
+ // ????? = 22; (g_E.A::x = 22; is ambiguous)
+ g_E.B::b = 23;
+ g_E.B::x = 24;
+ // ????? = 25;
+ // ????? = 26;
+ g_E.C::c = 27;
+ g_E.C::x = 28;
+ g_E.D::d = 29;
+ g_E.D::x = 30;
+ g_E.E::e = 31;
+ g_E.E::x = 32;
+
+ g_anon_union.one = 1;
+ g_anon_union.a = 2;
+
+ inheritance2 ();
+}
+
+// ======================== static member functions =====================
+
+class Static {
+public:
+ static void ii(int, int);
+};
+void Static::ii (int, int) { }
+
+// ======================== virtual base classes=========================
+
+class vA {
+ public:
+ int va;
+ int vx;
+};
+
+vA g_vA;
+
+class vB : public virtual vA {
+ public:
+ int vb;
+ int vx;
+};
+
+vB g_vB;
+
+class vC : public virtual vA {
+ public:
+ int vc;
+ int vx;
+};
+
+vC g_vC;
+
+class vD : public virtual vB, public virtual vC {
+ public:
+ int vd;
+ int vx;
+};
+
+vD g_vD;
+
+class vE : public virtual vD {
+ public:
+ int ve;
+ int vx;
+};
+
+vE g_vE;
+
+void inheritance4 (void)
+{
+}
+
+void inheritance3 (void)
+{
+ int ival;
+ int *intp;
+
+ // {vA::va, vA::vx}
+
+ g_vA.vA::va = 1;
+ g_vA.vA::vx = 2;
+
+ // {{vA::va, vA::vx}, vB::vb, vB::vx}
+
+ g_vB.vA::va = 3;
+ g_vB.vA::vx = 4;
+ g_vB.vB::vb = 5;
+ g_vB.vB::vx = 6;
+
+ // {{vA::va, vA::vx}, vC::vc, vC::vx}
+
+ g_vC.vA::va = 7;
+ g_vC.vA::vx = 8;
+ g_vC.vC::vc = 9;
+ g_vC.vC::vx = 10;
+
+ // {{{{vA::va, vA::vx}, vB::vb, vB::vx}, vC::vc, vC::vx}, vD::vd,vD::vx}
+
+ g_vD.vA::va = 11;
+ g_vD.vA::vx = 12;
+ g_vD.vB::vb = 13;
+ g_vD.vB::vx = 14;
+ g_vD.vC::vc = 15;
+ g_vD.vC::vx = 16;
+ g_vD.vD::vd = 17;
+ g_vD.vD::vx = 18;
+
+
+ // {{{{{vA::va,vA::vx},vB::vb,vB::vx},vC::vc,vC::vx},vD::vd,vD::vx},vE::ve,vE::vx}
+
+ g_vD.vA::va = 19;
+ g_vD.vA::vx = 20;
+ g_vD.vB::vb = 21;
+ g_vD.vB::vx = 22;
+ g_vD.vC::vc = 23;
+ g_vD.vC::vx = 24;
+ g_vD.vD::vd = 25;
+ g_vD.vD::vx = 26;
+ g_vE.vE::ve = 27;
+ g_vE.vE::vx = 28;
+
+ inheritance4 ();
+}
+
+// ======================================================================
+
+class Base1 {
+ public:
+ int x;
+ Base1(int i) { x = i; }
+};
+
+class Foo
+{
+ public:
+ int x;
+ int y;
+ static int st;
+ Foo (int i, int j) { x = i; y = j; }
+ int operator! ();
+ operator int ();
+ int times (int y);
+};
+
+class Bar : public Base1, public Foo {
+ public:
+ int z;
+ Bar (int i, int j, int k) : Base1 (10*k), Foo (i, j) { z = k; }
+};
+
+int Foo::operator! () { return !x; }
+
+int Foo::times (int y) { return x * y; }
+
+int Foo::st = 100;
+
+Foo::operator int() { return x; }
+
+Foo foo(10, 11);
+Bar bar(20, 21, 22);
+
+class ClassWithEnum {
+public:
+ enum PrivEnum { red, green, blue, yellow = 42 };
+ PrivEnum priv_enum;
+ int x;
+};
+
+void enums2 (void)
+{
+}
+
+/* classes.exp relies on statement order in this function for testing
+ enumeration fields. */
+
+void enums1 ()
+{
+ ClassWithEnum obj_with_enum;
+ obj_with_enum.priv_enum = ClassWithEnum::red;
+ obj_with_enum.x = 0;
+ enums2 ();
+ obj_with_enum.priv_enum = ClassWithEnum::green;
+}
+
+class ClassParam {
+public:
+ int Aptr_a (A *a) { return a->a; }
+ int Aptr_x (A *a) { return a->x; }
+ int Aref_a (A &a) { return a.a; }
+ int Aref_x (A &a) { return a.x; }
+ int Aval_a (A a) { return a.a; }
+ int Aval_x (A a) { return a.x; }
+};
+
+ClassParam class_param;
+
+class Contains_static_instance
+{
+ public:
+ int x;
+ int y;
+ Contains_static_instance (int i, int j) { x = i; y = j; }
+ static Contains_static_instance null;
+};
+
+Contains_static_instance Contains_static_instance::null(0,0);
+Contains_static_instance csi(10,20);
+
+class Contains_nested_static_instance
+{
+ public:
+ class Nested
+ {
+ public:
+ Nested(int i) : z(i) {}
+ int z;
+ static Contains_nested_static_instance xx;
+ };
+
+ Contains_nested_static_instance(int i, int j) : x(i), y(j) {}
+
+ int x;
+ int y;
+
+ static Contains_nested_static_instance null;
+ static Nested yy;
+};
+
+Contains_nested_static_instance Contains_nested_static_instance::null(0, 0);
+Contains_nested_static_instance::Nested Contains_nested_static_instance::yy(5);
+Contains_nested_static_instance
+ Contains_nested_static_instance::Nested::xx(1,2);
+Contains_nested_static_instance cnsi(30,40);
+
+typedef struct {
+ int one;
+ int two;
+} tagless_struct;
+tagless_struct v_tagless;
+
+/* Try to get the compiler to allocate a class in a register. */
+class small {
+ public:
+ int x;
+ int method ();
+};
+
+int
+small::method ()
+{
+ return x + 5;
+}
+
+void marker_reg1 () {}
+
+int
+register_class ()
+{
+ /* We don't call any methods for v, so gcc version cygnus-2.3.3-930220
+ might put this variable in a register. This is a lose, though, because
+ it means that GDB can't call any methods for that variable. */
+ register small v;
+
+ int i;
+
+ /* Perform a computation sufficiently complicated that optimizing compilers
+ won't optimized out the variable. If some compiler constant-folds this
+ whole loop, maybe using a parameter to this function here would help. */
+ v.x = 0;
+ for (i = 0; i < 13; ++i)
+ v.x += i;
+ --v.x; /* v.x is now 77 */
+ marker_reg1 ();
+ return v.x + 5;
+}
+
+void dummy()
+{
+ v_bool = true;
+ v_bool_array[0] = false;
+ v_bool_array[1] = v_bool;
+}
+
+void use_methods ()
+{
+ /* Refer to methods so that they don't get optimized away. */
+ int i;
+ i = class_param.Aptr_a (&g_A);
+ i = class_param.Aptr_x (&g_A);
+ i = class_param.Aref_a (g_A);
+ i = class_param.Aref_x (g_A);
+ i = class_param.Aval_a (g_A);
+ i = class_param.Aval_x (g_A);
+}
+
+
+int
+main()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ dummy();
+ inheritance1 ();
+ inheritance3 ();
+ enums1 ();
+ register_class ();
+
+ /* FIXME: pmi gets optimized out. Need to do some more computation with
+ it or something. (No one notices, because the test is xfail'd anyway,
+ but that probably won't always be true...). */
+ int Foo::* pmi = &Foo::y;
+
+ /* Make sure the AIX linker doesn't remove the variable. */
+ v_tagless.one = 5;
+
+ use_methods ();
+
+ return foo.*pmi;
+}
+
+/* Create an instance for some classes, otherwise they get optimized away. */
+
+default_public_struct default_public_s;
+explicit_public_struct explicit_public_s;
+protected_struct protected_s;
+private_struct private_s;
+mixed_protection_struct mixed_protection_s;
+public_class public_c;
+protected_class protected_c;
+default_private_class default_private_c;
+explicit_private_class explicit_private_c;
+mixed_protection_class mixed_protection_c;
diff --git a/gdb/testsuite/gdb.c++/misc.exp b/gdb/testsuite/gdb.c++/misc.exp
new file mode 100644
index 00000000000..a2d122fc69e
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/misc.exp
@@ -0,0 +1,159 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2002 Free Software
+# Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "misc"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+#
+# Deduce language of main()
+#
+
+proc deduce_language_of_main {} {
+ global gdb_prompt
+
+ # See what language gdb thinks main() is, prior to reading full symbols.
+ # I think this fails for COFF targets.
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"auto; currently c\[+\]+\".*$gdb_prompt $" {
+ pass "deduced language is C++, before full symbols"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "source language not correct for C++ (psymtabs only)"
+ return
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return
+ }
+ }
+
+ runto_main
+
+ # See if our idea of the language has changed.
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"auto; currently c\[+\]+\".*$gdb_prompt $" {
+ pass "deduced language is C++, after full symbols"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "source language not correct for C++ (full symbols)"
+ return
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return
+ }
+ }
+}
+
+proc test_expr { args } {
+ if { [llength $args] % 2 } {
+ warning "an even # of arguments should be passed to test_expr"
+ }
+ set last_ent [expr [llength $args] - 1];
+ set testname [lindex $args $last_ent];
+ if [gdb_test [lindex $args 0] "" "$testname (setup)"] {
+ gdb_suppress_tests;
+ }
+ for {set x 1} {$x < $last_ent} {set x [expr $x + 2]} {
+ if [gdb_test [lindex $args $x] [lindex $args [expr $x + 1]] "$testname ([lindex $args $x])"] {
+ gdb_suppress_tests;
+ }
+ }
+ gdb_stop_suppressing_tests;
+}
+
+proc do_tests {} {
+ global prms_id
+ global bug_id
+ global subdir
+ global objdir
+ global srcdir
+ global binfile
+ global gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ deduce_language_of_main
+ # Check for fixes for PRs 8916 and 8630
+ gdb_test "print s.a" ".* = 0" "print s.a for foo struct (known gcc 2.7.2 and earlier bug)"
+}
+
+do_tests
+
+test_expr "set language c++" \
+ "print 1 == 1" "print.*\\$\[0-9\]* = true" \
+ "print 1 == 2" "print.*\\$\[0-9\]* = false" \
+ "print as bool"
+
+# Test bool type printing, etc.
+# Note: Language is already set to C++ above!
+gdb_test "print v_bool" "\\$\[0-9\]* = false" "print a bool var"
+
+# set a bool variable
+test_expr "set variable v_bool = true" \
+ "print v_bool" "\\$\[0-9\]* = true" \
+ "set a bool var"
+
+# next print an array of bool
+gdb_test "print v_bool_array" "\\$\[0-9\]* = \\{false, false\\}" "print a bool array"
+
+# set elements of a bool array
+test_expr "set variable v_bool_array\[1\] = true" \
+ "print v_bool_array" "\\$\[0-9\]* = \\{false, true\\}" \
+ "set a bool array elem"
+
+# bool constants
+gdb_test "print true" "\\$\[0-9\]* = true" "print true"
+gdb_test "print false" "\\$\[0-9\]* = false" "print false"
+
+# arithmetic conversions
+gdb_test "print 1 + true" "\\$\[0-9\]* = 2" "1 + true"
+gdb_test "print 3 + false" "\\$\[0-9\]* = 3" "3 + false"
+gdb_test "print 1 < 2 < 3" "\\$\[0-9\]* = true" "1 < 2 < 3"
+gdb_test "print 2 < 1 > 4" "\\$\[0-9\]* = false" "2 < 1 > 4"
+gdb_test "print (bool)43" "\\$\[0-9\]* = true" "(bool)43"
+gdb_test "print (bool)0" "\\$\[0-9\]* = false" "(bool)0"
+gdb_test "print (bool)17.93" "\\$\[0-9\]* = true" "(bool)17.93"
+gdb_test "print (bool)0.0" "\\$\[0-9\]* = false" "(bool)0.0"
+gdb_test "print (int)true" "\\$\[0-9\]* = 1" "(int)true"
+gdb_test "print (int)false" "\\$\[0-9\]* = 0" "(int)false"
diff --git a/gdb/testsuite/gdb.c++/namespace.cc b/gdb/testsuite/gdb.c++/namespace.cc
new file mode 100644
index 00000000000..7667266c278
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/namespace.cc
@@ -0,0 +1,103 @@
+namespace AAA {
+ char c;
+ int i;
+ int A_xyzq (int);
+ char xyzq (char);
+ class inA {
+ public:
+ int xx;
+ int fum (int);
+ };
+};
+
+int AAA::inA::fum (int i)
+{
+ return 10 + i;
+}
+
+namespace BBB {
+ char c;
+ int i;
+ int B_xyzq (int);
+ char xyzq (char);
+
+ namespace CCC {
+ char xyzq (char);
+ };
+
+ class Class {
+ public:
+ char xyzq (char);
+ int dummy;
+ };
+};
+
+int AAA::A_xyzq (int x)
+{
+ return 2 * x;
+}
+
+char AAA::xyzq (char c)
+{
+ return 'a';
+}
+
+
+int BBB::B_xyzq (int x)
+{
+ return 3 * x;
+}
+
+char BBB::xyzq (char c)
+{
+ return 'b';
+}
+
+char BBB::CCC::xyzq (char c)
+{
+ return 'z';
+}
+
+char BBB::Class::xyzq (char c)
+{
+ return 'o';
+}
+
+void marker1(void)
+{
+ return;
+}
+
+
+int main ()
+{
+ using AAA::inA;
+ char c1;
+
+ using namespace BBB;
+
+ c1 = xyzq ('x');
+ c1 = AAA::xyzq ('x');
+ c1 = BBB::CCC::xyzq ('m');
+
+ inA ina;
+
+ ina.xx = 33;
+
+ int y;
+
+ y = AAA::A_xyzq (33);
+ y += B_xyzq (44);
+
+ BBB::Class cl;
+
+ c1 = cl.xyzq('e');
+
+ marker1();
+
+}
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.c++/namespace.exp b/gdb/testsuite/gdb.c++/namespace.exp
new file mode 100644
index 00000000000..3e502c4b50a
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/namespace.exp
@@ -0,0 +1,188 @@
+# Copyright 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# tests for namespaces
+# Written by Satish Pai <pai@apollo.hp.com> 1997-07-23
+
+# This file is part of the gdb testsuite
+
+# Note: These tests are geared to the HP aCC compiler,
+# which has an idiosyncratic way of emitting debug info
+# for namespaces.
+# Note: As of 2000-06-03, these pass under g++ - djb
+
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "namespace"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will a
+utomatically fail."
+}
+
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+if ![runto 'marker1'] then {
+ perror "couldn't run to marker1"
+ continue
+}
+
+gdb_test "up" ".*main.*" "up from marker1"
+
+# Access a data item inside a namespace using colons and
+# single quotes :-(
+
+send_gdb "print 'AAA::c'\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 0 '\\\\(0|000)'\r\n$gdb_prompt $" { pass "print 'AAA::c'" }
+ -re ".*$gdb_prompt $" { fail "print 'AAA::c'" }
+ timeout { fail "(timeout) print 'AAA::c'" }
+}
+
+# An object declared using "using".
+
+send_gdb "print ina\n"
+gdb_expect {
+ -re "\\$\[0-9\]+ = {xx = 33}.*$gdb_prompt $" {
+ pass "print ina"
+ }
+ -re ".*$gdb_prompt $" { fail "print ina" }
+ timeout { fail "(timeout) print ina" }
+}
+
+send_gdb "ptype ina\n"
+gdb_expect {
+ -re "type = class (AAA::|)inA \{\r\n\[ \]*public:\r\n\[ \]*int xx;\r\n\[ \]*\r\n\[ \]*.*int fum\\(int\\);\r\n\}\r\n$gdb_prompt $" {
+ pass "ptype ina"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype ina" }
+ timeout { fail "(timeout) ptype ina" }
+}
+
+# Check all functions are known to GDB
+
+setup_xfail hppa*-*-*11* CLLbs14869
+send_gdb "info func xyzq\n"
+gdb_expect {
+ -re "All functions.*File.*namespace.cc:\r\nint AAA::A_xyzq\\(int\\);\r\nint BBB::B_xyzq\\(int\\);\r\nchar AAA::xyzq\\(char\\);\r\nchar BBB::xyzq\\(char\\);\r\nchar BBB::CCC::xyzq\\(char\\);\r\nchar BBB::Class::xyzq\\(char\\);\r\n$gdb_prompt $" {
+ pass "info func xyzq"
+ }
+ -re "All functions.*File.*namespace.cc:\r\nint AAA::A_xyzq\\(int\\);\r\nchar AAA::xyzq\\(char\\);\r\nint BBB::B_xyzq\\(int\\);\r\nchar BBB::CCC::xyzq\\(char\\);\r\nchar BBB::Class::xyzq\\(char\\);\r\nchar BBB::xyzq\\(char\\);\r\n$gdb_prompt $" {
+ pass "info func xyzq"
+ }
+ -re ".*$gdb_prompt $" { fail "info func xyzq" }
+ timeout { fail "(timeout) info func xyzq" }
+}
+
+# Call a function in a namespace
+
+send_gdb "print 'AAA::xyzq'('x')\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 97 'a'\r\n$gdb_prompt $" {
+ pass "print 'AAA::xyzq'('x')"
+ }
+ -re ".*$gdb_prompt $" { fail "print 'AAA::xyzq'('x')" }
+ timeout { fail "(timeout) print 'AAA::xyzq'('x')" }
+}
+
+# Break on a function in a namespace
+
+send_gdb "break AAA::xyzq\n"
+gdb_expect {
+ -re "Breakpoint.*at $hex: file.*namespace.cc, line 42\\.\r\n$gdb_prompt $" {
+ pass "break AAA::xyzq"
+ }
+ -re ".*$gdb_prompt $" { fail "break AAA::xyzq" }
+ timeout { fail "(timeout) break AAA::xyzq" }
+}
+
+# Call a function in a nested namespace
+
+send_gdb "print 'BBB::CCC::xyzq'('x')\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 122 'z'\r\n$gdb_prompt $" {
+ pass "print 'BBB::CCC::xyzq'('x')"
+ }
+ -re ".*$gdb_prompt $" { fail "print 'BBB::CCC::xyzq'('x')" }
+ timeout { fail "(timeout) print 'BBB::CCC::xyzq'('x')" }
+}
+
+# Break on a function in a nested namespace
+
+send_gdb "break BBB::CCC::xyzq\n"
+gdb_expect {
+ -re "Breakpoint.*at $hex: file.*namespace.cc, line 58\\.\r\n$gdb_prompt $" {
+ pass "break BBB::CCC::xyzq"
+ }
+ -re ".*$gdb_prompt $" { fail "break BBB::CCC::xyzq" }
+ timeout { fail "(timeout) break BBB::CCC::xyzq" }
+}
+
+# Print address of a function in a class in a namespace
+
+send_gdb "print 'BBB::Class::xyzq'\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \{char \\((BBB::|)Class \\*( const|), (char|int)\\)\} $hex <BBB::Class::xyzq\\(char\\)>\r\n$gdb_prompt $" {
+ pass "print 'BBB::Class::xyzq'"
+ }
+ -re ".*$gdb_prompt $" { fail "print 'BBB::Class::xyzq'" }
+ timeout { fail "(timeout) print 'BBB::Class::xyzq'" }
+}
+
+# Break on a function in a class in a namespace
+
+send_gdb "break BBB::Class::xyzq\n"
+gdb_expect {
+ -re "Breakpoint.*at $hex: file.*namespace.cc, line 63\\.\r\n$gdb_prompt $" {
+ pass "break BBB::Class::xyzq"
+ }
+ -re ".*$gdb_prompt $" { fail "break BBB::Class::xyzq" }
+ timeout { fail "(timeout) break BBB::Class::xyzq" }
+}
+
diff --git a/gdb/testsuite/gdb.c++/overload.cc b/gdb/testsuite/gdb.c++/overload.cc
new file mode 100644
index 00000000000..97083c5640c
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/overload.cc
@@ -0,0 +1,161 @@
+#include <stddef.h>
+
+class foo {
+public:
+ foo (int);
+ foo (int, const char *);
+ foo (foo&);
+ ~foo ();
+ void foofunc (int);
+ void foofunc (int, signed char *);
+ int ifoo;
+ const char *ccpfoo;
+
+int overload1arg (void);
+int overload1arg (char);
+int overload1arg (signed char);
+int overload1arg (unsigned char);
+int overload1arg (short);
+int overload1arg (unsigned short);
+int overload1arg (int);
+int overload1arg (unsigned int);
+int overload1arg (long);
+int overload1arg (unsigned long);
+int overload1arg (float);
+int overload1arg (double);
+
+int overloadfnarg (void);
+int overloadfnarg (int);
+int overloadfnarg (int, int (*) (int));
+
+int overloadargs (int a1);
+int overloadargs (int a1, int a2);
+int overloadargs (int a1, int a2, int a3);
+int overloadargs (int a1, int a2, int a3, int a4);
+int overloadargs (int a1, int a2, int a3, int a4, int a5);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10, int a11);
+
+
+};
+
+void marker1()
+{}
+
+int main ()
+{
+ char arg2 = 2;
+ signed char arg3 =3;
+ unsigned char arg4 =4;
+ short arg5 =5;
+ unsigned short arg6 =6;
+ int arg7 =7;
+ unsigned int arg8 =8;
+ long arg9 =9;
+ unsigned long arg10 =10;
+ float arg11 =100.0;
+ double arg12 = 200.0;
+
+ char *str = (char *) "A";
+ foo foo_instance1(111);
+ foo foo_instance2(222, str);
+ foo foo_instance3(foo_instance2);
+
+ #ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+ #endif
+
+
+ marker1();
+ return 0;
+}
+
+foo::foo (int i) { ifoo = i; ccpfoo = NULL; }
+foo::foo (int i, const char *ccp) { ifoo = i; ccpfoo = ccp; }
+foo::foo (foo& afoo) { ifoo = afoo.ifoo; ccpfoo = afoo.ccpfoo;}
+foo::~foo () {}
+
+
+/* Some functions to test overloading by varying one argument type. */
+
+int foo::overload1arg (void) { return 1; }
+int foo::overload1arg (char arg) { arg = 0; return 2;}
+int foo::overload1arg (signed char arg) { arg = 0; return 3;}
+int foo::overload1arg (unsigned char arg) { arg = 0; return 4;}
+int foo::overload1arg (short arg) { arg = 0; return 5;}
+int foo::overload1arg (unsigned short arg) { arg = 0; return 6;}
+int foo::overload1arg (int arg) { arg = 0; return 7;}
+int foo::overload1arg (unsigned int arg) { arg = 0; return 8;}
+int foo::overload1arg (long arg) { arg = 0; return 9;}
+int foo::overload1arg (unsigned long arg) { arg = 0; return 10;}
+int foo::overload1arg (float arg) { arg = 0; return 11;}
+int foo::overload1arg (double arg) { arg = 0; return 12;}
+
+/* Test to see that we can explicitly request overloaded functions
+ with function pointers in the prototype. */
+
+int foo::overloadfnarg (void) { return ifoo * 20; }
+int foo::overloadfnarg (int arg) { arg = 0; return 13;}
+int foo::overloadfnarg (int arg, int (*foo) (int)) { return foo(arg); }
+
+/* Some functions to test overloading by varying argument count. */
+
+int foo::overloadargs (int a1)
+{ a1 = 0;
+return 1;}
+
+int foo::overloadargs (int a1, int a2)
+{ a1 = a2 = 0;
+return 2;}
+
+int foo::overloadargs (int a1, int a2, int a3)
+{ a1 = a2 = a3 = 0;
+return 3;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4)
+{ a1 = a2 = a3 = a4 = 0;
+return 4;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5)
+{ a1 = a2 = a3 = a4 = a5 = 0;
+return 5;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6)
+{ a1 = a2 = a3 = a4 = a5 = a6 = 0;
+return 6;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7)
+{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0;
+return 7;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8)
+{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0;
+return 8;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9)
+{
+ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0;
+ return 9;
+}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
+ a10 = 0; return 10;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10, int a11)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
+ a10 = a11 = 0; return 11;}
+
+
+
diff --git a/gdb/testsuite/gdb.c++/overload.exp b/gdb/testsuite/gdb.c++/overload.exp
new file mode 100644
index 00000000000..e9aaae04fea
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/overload.exp
@@ -0,0 +1,393 @@
+# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# written by Elena Zannoni (ezannoni@cygnus.com)
+
+# This file is part of the gdb testsuite
+#
+# tests for overloaded member functions. Command Line calls
+#
+
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "overload"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# set it up at a breakpoint so we can play with the variable values
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+if ![runto 'marker1'] then {
+ perror "couldn't run to marker1"
+ continue
+}
+
+gdb_test "up" ".*main.*" "up from marker1"
+
+send_gdb "print foo_instance1\n"
+gdb_expect {
+ -re ".\[0-9\]* = \{ifoo = 111, ccpfoo = 0x0\}\r\n$gdb_prompt $" {
+ pass "print foo_instance1"
+ }
+ -re ".*$gdb_prompt $" { fail "print foo_instance1" }
+ timeout { fail "(timeout) print foo_instance1" }
+ }
+
+
+setup_xfail "hppa*-*-*" CLLbs16901
+send_gdb "ptype foo_instance1\n"
+gdb_expect {
+ -re "type = class foo \{.*public:.*int ifoo;.*const char \\*ccpfoo;.*foo\\(int\\);.*foo\\(int, (const char|char const) \\*\\);.*foo\\(foo &\\);.*~foo\\(void\\);.*void foofunc\\(int\\);.*void foofunc\\(int, signed char \\*\\);.*int overload1arg\\(void\\);.*int overload1arg\\(char\\);.*int overload1arg\\(signed char\\);.*int overload1arg\\(unsigned char\\);.*int overload1arg\\(short\\);.*int overload1arg\\(unsigned short\\);.*int overload1arg\\(int\\);.*int overload1arg\\(unsigned int\\);.*int overload1arg\\(long\\);.*int overload1arg\\(unsigned long\\);.*int overload1arg\\(float\\);.*int overload1arg\\(double\\);.*int overloadargs\\(int\\);.*int overloadargs\\(int, int\\);.*int overloadargs\\(int, int, int\\);.*int overloadargs\\(int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int, int, int\\);\r\n\}\r\n$gdb_prompt $" {
+ pass "ptype foo_instance1 (HP aCC -- known quirk with ~foo parameter list)"
+ }
+ -re "type = class foo .*int overloadargs\\(int, int, int, int, int, int, int, int, int, int, int\\);\r\n\}\r\n$gdb_prompt $" {
+ pass "ptype foo_instance1 (shorter match)"
+ }
+ -re ".*$gdb_prompt $" { fail "ptype foo_instance1" }
+ timeout { fail "(timeout) ptype foo_instance1" }
+ }
+
+send_gdb "print foo_instance2\n"
+gdb_expect {
+ -re ".\[0-9\]* = \{ifoo = 222, ccpfoo = $hex \"A\"\}\r\n$gdb_prompt $" {
+ pass "print foo_instance2"
+ }
+ -re ".*$gdb_prompt $" { fail "print foo_instance2" }
+ timeout { fail "(timeout) print foo_instance2" }
+ }
+
+send_gdb "print foo_instance3\n"
+gdb_expect {
+ -re ".\[0-9\]* = \{ifoo = 222, ccpfoo = $hex \"A\"\}\r\n$gdb_prompt $" {
+ pass "print foo_instance3"
+ }
+ -re ".*$gdb_prompt $" { fail "print foo_instance3" }
+ timeout { fail "(timeout) print foo_instance3" }
+ }
+
+
+send_gdb "print foo_instance1.overloadargs(1)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1\r\n$gdb_prompt $" {
+ pass "print call overloaded func 1 arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func 1 arg" }
+ timeout { fail "(timeout) print call overloaded func 1 arg" }
+ }
+
+
+send_gdb "print foo_instance1.overloadargs(1, 2)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 2\r\n$gdb_prompt $" {
+ pass "print call overloaded func 2 args"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func 2 args" }
+ timeout { fail "(timeout) print call overloaded func 2 args" }
+ }
+
+
+send_gdb "print foo_instance1.overloadargs(1, 2, 3)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 3\r\n$gdb_prompt $" {
+ pass "print call overloaded func 3 args"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func 3 args" }
+ timeout { fail "(timeout) print call overloaded func 3 args" }
+ }
+
+
+send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 4\r\n$gdb_prompt $" {
+ pass "print call overloaded func 4 args"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func 4 args" }
+ timeout { fail "(timeout) print call overloaded func 4 args" }
+ }
+
+
+send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 5\r\n$gdb_prompt $" {
+ pass "print call overloaded func 5 args"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func 5 args" }
+ timeout { fail "(timeout) print call overloaded func 5 args" }
+ }
+
+
+send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 6\r\n$gdb_prompt $" {
+ pass "print call overloaded func 6 args"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func 6 args" }
+ timeout { fail "(timeout) print call overloaded func 6 args" }
+ }
+
+
+send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 7\r\n$gdb_prompt $" {
+ pass "print call overloaded func 7 args"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func 7 args" }
+ timeout { fail "(timeout) print call overloaded func 7 args" }
+ }
+
+
+send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 8\r\n$gdb_prompt $" {
+ pass "print call overloaded func 8 args"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func 8 args" }
+ timeout { fail "(timeout) print call overloaded func 8 args" }
+ }
+
+
+send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 9\r\n$gdb_prompt $" {
+ pass "print call overloaded func 9 args"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func 9 args" }
+ timeout { fail "(timeout) print call overloaded func 9 args" }
+ }
+
+
+send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 10\r\n$gdb_prompt $" {
+ pass "print call overloaded func 10 args"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func 10 args" }
+ timeout { fail "(timeout) print call overloaded func 10 args" }
+ }
+
+
+send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 11\r\n$gdb_prompt $" {
+ pass "print call overloaded func 11 args"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func 11 args" }
+ timeout { fail "(timeout) print call overloaded func 11 args" }
+ }
+
+
+send_gdb "print foo_instance1.overload1arg()\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1\r\n$gdb_prompt $" {
+ pass "print call overloaded func void arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func void arg" }
+ timeout { fail "(timeout) print call overloaded func void arg" }
+ }
+
+
+send_gdb "print foo_instance1.overload1arg((char)arg2)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 2\r\n$gdb_prompt $" {
+ pass "print call overloaded func char arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func char arg" }
+ timeout { fail "(timeout) print call overloaded func char arg" }
+ }
+
+
+send_gdb "print foo_instance1.overload1arg((signed char)arg3)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 3\r\n$gdb_prompt $" {
+ pass "print call overloaded func signed char arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func signed char arg" }
+ timeout { fail "(timeout) print call overloaded func signed char arg" }
+ }
+
+
+send_gdb "print foo_instance1.overload1arg((unsigned char)arg4)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 4\r\n$gdb_prompt $" {
+ pass "print call overloaded func unsigned char arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func unsigned char arg" }
+ timeout { fail "(timeout) print call overloaded func unsigned char arg" }
+ }
+
+
+# The overload resolver added by HP (valops.c:find_overload_match) doesn't
+# work right for G++ output, since the list of parameters seems not to
+# be filled in correctly. Until this gets fixed, don't expect to pass
+# some of these tests.
+
+setup_xfail "*-*-*" CLLbs16901
+
+send_gdb "print foo_instance1.overload1arg((short)arg5)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 5\r\n$gdb_prompt $" {
+ pass "print call overloaded func short arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func short arg" }
+ timeout { fail "(timeout) print call overloaded func short arg" }
+ }
+
+
+setup_xfail "*-*-*" CLLbs16901
+
+send_gdb "print foo_instance1.overload1arg((unsigned short)arg6)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 6\r\n$gdb_prompt $" {
+ pass "print call overloaded func unsigned short arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func unsigned short arg" }
+ timeout { fail "(timeout) print call overloaded func unsigned short arg" }
+ }
+
+
+send_gdb "print foo_instance1.overload1arg((int)arg7)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 7\r\n$gdb_prompt $" {
+ pass "print call overloaded func int arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func int arg" }
+ timeout { fail "(timeout) print call overloaded func int arg" }
+ }
+
+
+send_gdb "print foo_instance1.overload1arg((unsigned int)arg8)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 8\r\n$gdb_prompt $" {
+ pass "print call overloaded func unsigned int arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func unsigned int arg" }
+ timeout { fail "(timeout) print call overloaded func unsigned int arg" }
+ }
+
+
+setup_xfail "*-*-*" CLLbs16901
+
+send_gdb "print foo_instance1.overload1arg((long)arg9)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 9\r\n$gdb_prompt $" {
+ pass "print call overloaded func long arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func long arg" }
+ timeout { fail "(timeout) print call overloaded func long arg" }
+ }
+
+
+setup_xfail "*-*-*" CLLbs16901
+
+send_gdb "print foo_instance1.overload1arg((unsigned long)arg10)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 10\r\n$gdb_prompt $" {
+ pass "print call overloaded func unsigned long arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func unsigned long arg" }
+ timeout { fail "(timeout) print call overloaded func unsigned long arg" }
+ }
+
+
+send_gdb "print foo_instance1.overload1arg((float)arg11)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 11\r\n$gdb_prompt $" {
+ pass "print call overloaded func float arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func float arg" }
+ timeout { fail "(timeout) print call overloaded func float arg" }
+ }
+
+
+send_gdb "print foo_instance1.overload1arg((double)arg12)\n"
+gdb_expect {
+ -re ".\[0-9\]* = 12\r\n$gdb_prompt $" {
+ pass "print call overloaded func double arg"
+ }
+ -re ".*$gdb_prompt $" { fail "print call overloaded func double arg" }
+ timeout { fail "(timeout) print call overloaded func double arg" }
+ }
+
+# Now some tests to see if we can list overloaded functions properly:
+
+gdb_test "set listsize 1" "" ""
+# send_gdb "set listsize 1\n"
+# gdb_expect -re ".*$gdb_prompt $"
+
+#
+# Decide whether to use "()" or "(void)"
+#
+
+send_gdb "info func overloadfnarg\n"
+gdb_expect {
+ -re ".*overloadfnarg\\(void\\).*$gdb_prompt $" {
+ gdb_test "list foo::overloadfnarg(void)"\
+ ".*int foo::overloadfnarg.*\\(void\\).*" \
+ "list overloaded function with no args"
+ }
+ -re ".*overloadfnarg\\(\\).*$gdb_prompt $" {
+ gdb_test "list foo::overloadfnarg()"\
+ ".*int foo::overloadfnarg.*\\(void\\).*" \
+ "list overloaded function with no args"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "list overloaded function with no args (no matching symbol)"
+ }
+}
+
+gdb_test "list foo::overloadfnarg(int)"\
+ "int foo::overloadfnarg.*\\(int arg\\).*" \
+ "list overloaded function with int arg"
+
+gdb_test "list foo::overloadfnarg(int, int (*)(int))" \
+ "int foo::overloadfnarg.*\\(int arg, int \\(\\*foo\\) \\(int\\)\\).*" \
+ "list overloaded function with function ptr args"
+
+# This one crashes GDB. Don't know why yet.
+gdb_test "list \"foo::overloadfnarg(int, int (*)(int))\"" \
+ "int foo::overloadfnarg.*\\(int arg, int \\(\\*foo\\) \\(int\\)\\).*" \
+ "list overloaded function with function ptr args - quotes around argument"
diff --git a/gdb/testsuite/gdb.c++/ovldbreak.cc b/gdb/testsuite/gdb.c++/ovldbreak.cc
new file mode 100644
index 00000000000..9a5b5cbf7c7
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/ovldbreak.cc
@@ -0,0 +1,177 @@
+#include <stddef.h>
+
+class foo {
+public:
+ foo (int);
+ foo (int, const char *);
+ foo (foo&);
+ ~foo ();
+ void foofunc (int);
+ void foofunc (int, signed char *);
+ int ifoo;
+ const char *ccpfoo;
+
+int overload1arg (void);
+int overload1arg (char);
+int overload1arg (signed char);
+int overload1arg (unsigned char);
+int overload1arg (short);
+int overload1arg (unsigned short);
+int overload1arg (int);
+int overload1arg (unsigned int);
+int overload1arg (long);
+int overload1arg (unsigned long);
+int overload1arg (float);
+int overload1arg (double);
+
+int overloadargs (int a1);
+int overloadargs (int a1, int a2);
+int overloadargs (int a1, int a2, int a3);
+int overloadargs (int a1, int a2, int a3, int a4);
+int overloadargs (int a1, int a2, int a3, int a4, int a5);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10);
+int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10, int a11);
+
+
+};
+
+void marker1()
+{}
+
+int main ()
+{
+ char arg2 = 2;
+ signed char arg3 =3;
+ unsigned char arg4 =4;
+ short arg5 =5;
+ unsigned short arg6 =6;
+ int arg7 =7;
+ unsigned int arg8 =8;
+ long arg9 =9;
+ unsigned long arg10 =10;
+ float arg11 =100.0;
+ double arg12 = 200.0;
+
+ char ch='A';
+ foo foo_instance1(111);
+ foo foo_instance2(222, &ch);
+ foo foo_instance3(foo_instance2);
+
+ foo_instance1.overload1arg();
+ foo_instance1.overload1arg(arg2);
+ foo_instance1.overload1arg(arg3);
+ foo_instance1.overload1arg(arg4);
+ foo_instance1.overload1arg(arg5);
+ foo_instance1.overload1arg(arg6);
+ foo_instance1.overload1arg(arg7);
+ foo_instance1.overload1arg(arg8);
+ foo_instance1.overload1arg(arg9);
+ foo_instance1.overload1arg(arg10);
+ foo_instance1.overload1arg(arg11);
+ foo_instance1.overload1arg(arg12);
+
+ foo_instance1.overloadargs(1);
+ foo_instance1.overloadargs(1, 2);
+ foo_instance1.overloadargs(1, 2, 3);
+ foo_instance1.overloadargs(1, 2, 3, 4);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5, 6);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
+ foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
+
+
+ #ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+ #endif
+
+
+ marker1();
+ return 0;
+}
+
+foo::foo (int i) { ifoo = i;}
+foo::foo (int i, const char *ccp) { ifoo = i; ccpfoo = ccp; }
+foo::foo (foo& afoo) { ifoo = afoo.ifoo; ccpfoo = afoo.ccpfoo;}
+foo::~foo () {}
+
+
+/* Some functions to test overloading by varying one argument type. */
+
+int foo::overload1arg (void) { return 1; }
+int foo::overload1arg (char arg) { arg = 0; return 2;}
+int foo::overload1arg (signed char arg) { arg = 0; return 3;}
+int foo::overload1arg (unsigned char arg) { arg = 0; return 4;}
+int foo::overload1arg (short arg) { arg = 0; return 5;}
+int foo::overload1arg (unsigned short arg) { arg = 0; return 6;}
+int foo::overload1arg (int arg) { arg = 0; return 7;}
+int foo::overload1arg (unsigned int arg) { arg = 0; return 8;}
+int foo::overload1arg (long arg) { arg = 0; return 9;}
+int foo::overload1arg (unsigned long arg) { arg = 0; return 10;}
+int foo::overload1arg (float arg) { arg = 0; return 11;}
+int foo::overload1arg (double arg) { arg = 0; return 12;}
+
+
+/* Some functions to test overloading by varying argument count. */
+
+int foo::overloadargs (int a1)
+{ a1 = 0;
+return 1;}
+
+int foo::overloadargs (int a1, int a2)
+{ a1 = a2 = 0;
+return 2;}
+
+int foo::overloadargs (int a1, int a2, int a3)
+{ a1 = a2 = a3 = 0;
+return 3;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4)
+{ a1 = a2 = a3 = a4 = 0;
+return 4;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5)
+{ a1 = a2 = a3 = a4 = a5 = 0;
+return 5;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6)
+{ a1 = a2 = a3 = a4 = a5 = a6 = 0;
+return 6;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7)
+{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0;
+return 7;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8)
+{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0;
+return 8;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9)
+{
+ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0;
+ return 9;
+}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
+ a10 = 0; return 10;}
+
+int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
+ int a8, int a9, int a10, int a11)
+ { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
+ a10 = a11 = 0; return 11;}
+
+
+
diff --git a/gdb/testsuite/gdb.c++/ovldbreak.exp b/gdb/testsuite/gdb.c++/ovldbreak.exp
new file mode 100644
index 00000000000..9852cb597b1
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/ovldbreak.exp
@@ -0,0 +1,349 @@
+# Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# written by Elena Zannoni (ezannoni@cygnus.com)
+# modified by Michael Chastain (chastain@redhat.com)
+
+# This file is part of the gdb testsuite
+#
+# tests for overloaded member functions. Set breakpoints on
+# overloaded member functions
+#
+
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "ovldbreak"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# set it up at a breakpoint so we can play with the variable values
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+
+
+# When I ask gdb to set a breakpoint on an overloaded function,
+# gdb gives me a choice menu. I might get stuck in that choice menu
+# (for example, if C++ name mangling is not working properly).
+#
+# This procedure issues a command that works at either the menu
+# prompt or the command prompt to get back to the command prompt.
+#
+# Note that an empty line won't do it (it means 'repeat the previous command'
+# at top level). A line with a single space in it works nicely.
+
+proc take_gdb_out_of_choice_menu {} {
+ global gdb_prompt
+ send_gdb " \n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ }
+ timeout {
+ perror "could not resynchronize to command prompt (timeout)"
+ continue
+ }
+ }
+}
+
+
+
+# This procedure sets an overloaded breakpoint.
+# When I ask for such a breakpoint, gdb gives me a menu of 'cancel' 'all'
+# and a bunch of choices. I then choose from that menu by number.
+
+proc set_bp_overloaded {name expectedmenu mychoice bpnumber linenumber} {
+ global gdb_prompt hex srcfile
+
+ # Get into the overload menu.
+ send_gdb "break $name\n"
+ gdb_expect {
+ -re "$expectedmenu" {
+ pass "bp menu for $name choice $mychoice"
+
+ # Choose my choice.
+ send_gdb "$mychoice\n"
+ gdb_expect {
+ -re "Breakpoint $bpnumber at $hex: file.*$srcfile, line $linenumber.\r\n$gdb_prompt $" {
+ pass "set bp $bpnumber on $name $mychoice line $linenumber"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "set bp $bpnumber on $name $mychoice line $linenumber (bad bp)"
+ }
+ timeout {
+ fail "set bp $bpnumber on $name $mychoice line $linenumber (timeout)"
+ take_gdb_out_of_choice_menu
+ }
+ }
+ }
+ -re ".*\r\n> " {
+ fail "bp menu for $name choice $mychoice (bad menu)"
+ take_gdb_out_of_choice_menu
+ }
+ -re ".*$gdb_prompt $" {
+ fail "bp menu for $name choice $mychoice (no menu)"
+ }
+ timeout {
+ fail "bp menu for $name choice $mychoice (timeout)"
+ take_gdb_out_of_choice_menu
+ }
+ }
+}
+
+# This is the expected menu for overload1arg.
+# Note the arg type variations on lines 6 and 13.
+# This accommodates different versions of g++.
+
+set menu_overload1arg "\\\[0\\\] cancel\r\n\\\[1\\\] all\r\n\\\[2\\\] foo::overload1arg\\(double\\) at.*$srcfile:121\r\n\\\[3\\\] foo::overload1arg\\(float\\) at.*$srcfile:120\r\n\\\[4\\\] foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r\n\\\[5\\\] foo::overload1arg\\(long\\) at.*$srcfile:118\r\n\\\[6\\\] foo::overload1arg\\((unsigned int|unsigned)\\) at.*$srcfile:117\r\n\\\[7\\\] foo::overload1arg\\(int\\) at.*$srcfile:116\r\n\\\[8\\\] foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r\n\\\[9\\\] foo::overload1arg\\(short\\) at.*$srcfile:114\r\n\\\[10\\\] foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r\n\\\[11\\\] foo::overload1arg\\(signed char\\) at.*$srcfile:112\r\n\\\[12\\\] foo::overload1arg\\(char\\) at.*$srcfile:111\r\n\\\[13\\\] foo::overload1arg\\((void|)\\) at.*$srcfile:110\r\n> $"
+
+
+
+# Set breakpoints on foo::overload1arg, one by one.
+
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 12 2 111
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 11 3 112
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 10 4 113
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 9 5 114
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 8 6 115
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 7 7 116
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 6 8 117
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 5 9 118
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 4 10 119
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 3 11 120
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 2 12 121
+set_bp_overloaded "foo::overload1arg" "$menu_overload1arg" 13 13 110
+
+
+
+# Verify the breakpoints.
+
+gdb_test "info break" \
+ "Num Type\[\t \]+Disp Enb Address\[\t \]+What.*
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in main at.*$srcfile:49\r
+\[\t \]+breakpoint already hit 1 time\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short\\) at.*$srcfile:114\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long\\) at.*$srcfile:118\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+ "breakpoint info (after setting one-by-one)"
+
+
+
+# Test choice "cancel".
+# This is copy-and-paste from set_bp_overloaded.
+
+send_gdb "break foo::overload1arg\n"
+gdb_expect {
+ -re "$menu_overload1arg" {
+ pass "bp menu for foo::overload1arg choice cancel"
+ # Choose cancel.
+ send_gdb "0\n"
+ gdb_expect {
+ -re "canceled\r\n$gdb_prompt $" {
+ pass "set bp on overload1arg canceled"
+ }
+ -re "cancelled\r\n$gdb_prompt $" {
+ pass "set bp on overload1arg canceled"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "set bp on overload1arg canceled (bad message)"
+ }
+ timeout {
+ fail "set bp on overload1arg canceled (timeout)"
+ take_gdb_out_of_choice_menu
+ }
+ }
+ }
+ -re ".*\r\n> " {
+ fail "bp menu for foo::overload1arg choice cancel (bad menu)"
+ take_gdb_out_of_choice_menu
+ }
+ -re ".*$gdb_prompt $" {
+ fail "bp menu for foo::overload1arg choice cancel (no menu)"
+ }
+ timeout {
+ fail "bp menu for foo::overload1arg choice cancel (timeout)"
+ take_gdb_out_of_choice_menu
+ }
+}
+
+gdb_test "info break" \
+ "Num Type\[\t \]+Disp Enb Address\[\t \]+What.*
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in main at.*$srcfile:49\r
+\[\t \]+breakpoint already hit 1 time\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short\\) at.*$srcfile:114\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long\\) at.*$srcfile:118\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+ "breakpoint info (after cancel)"
+
+
+
+# Delete these breakpoints.
+
+send_gdb "delete breakpoints\n"
+gdb_expect {
+ -re "Delete all breakpoints.* $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ pass "delete all breakpoints"
+ }
+ timeout {
+ fail "delete all breakpoints (timeout)"
+ }
+ }
+ }
+ timeout {
+ fail "delete all breakpoints (timeout)"
+ }
+}
+
+gdb_test "info breakpoints" "No breakpoints or watchpoints." "breakpoint info (after delete)"
+
+
+
+# Test choice "all".
+# This is copy-and-paste from set_bp_overloaded.
+
+send_gdb "break foo::overload1arg\n"
+gdb_expect {
+ -re "$menu_overload1arg" {
+ pass "bp menu for foo::overload1arg choice all"
+ # Choose all.
+ send_gdb "1\n"
+ gdb_expect {
+ -re "Breakpoint $decimal at $hex: file.*$srcfile, line 121.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 120.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 119.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 118.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 117.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 116.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 115.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 114.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 113.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 112.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 111.\r\nBreakpoint $decimal at $hex: file.*$srcfile, line 110.\r\nwarning: Multiple breakpoints were set.\r\nwarning: Use the .delete. command to delete unwanted breakpoints.\r\n$gdb_prompt $" {
+ pass "set bp on overload1arg all"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "set bp on overload1arg all (bad message)"
+ }
+ timeout {
+ fail "set bp on overload1arg all (timeout)"
+ take_gdb_out_of_choice_menu
+ }
+ }
+ }
+ -re ".*\r\n> " {
+ fail "bp menu for foo::overload1arg choice all (bad menu)"
+ take_gdb_out_of_choice_menu
+ }
+ -re ".*$gdb_prompt $" {
+ fail "bp menu for foo::overload1arg choice all (no menu)"
+ }
+ timeout {
+ fail "bp menu for foo::overload1arg choice all (timeout)"
+ take_gdb_out_of_choice_menu
+ }
+}
+
+gdb_test "info break" \
+ "Num Type\[\t \]+Disp Enb Address\[\t \]+What.*
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(double\\) at.*$srcfile:121\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(float\\) at.*$srcfile:120\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned long\\) at.*$srcfile:119\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(long\\) at.*$srcfile:118\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((unsigned|unsigned int)\\) at.*$srcfile:117\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(int\\) at.*$srcfile:116\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned short\\) at.*$srcfile:115\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(short\\) at.*$srcfile:114\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(unsigned char\\) at.*$srcfile:113\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(signed char\\) at.*$srcfile:112\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\(char\\) at.*$srcfile:111\r
+\[0-9\]+\[\t \]+breakpoint keep y\[\t \]+$hex\[\t \]+in foo::overload1arg\\((void|)\\) at.*$srcfile:110" \
+ "breakpoint info (after setting on all)"
+
+
+
+# Run through each breakpoint.
+
+proc continue_to_bp_overloaded {bpnumber argtype actuals} {
+ global gdb_prompt hex decimal srcfile
+
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Continuing.\r\n\r\nBreakpoint ${bpnumber}, (${hex} in )?foo::overload1arg(\\(${argtype}\\))? \\(this=${hex}(, )?${actuals}\\) at.*${srcfile}:${decimal}\r\n${decimal}\[\t \]+int foo::overload1arg \\(${argtype}( arg)?\\).*\r\n.*$gdb_prompt $" {
+ pass "continue to bp overloaded : ${argtype}"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "continue to bp overloaded : ${argtype}"
+ }
+ timeout {
+ fail "continue to bp overloaded : ${argtype} (timeout)"
+ }
+ }
+}
+
+continue_to_bp_overloaded 25 "(void|)" ""
+continue_to_bp_overloaded 24 "char" "arg=2 \\'\\\\002\\'"
+continue_to_bp_overloaded 23 "signed char" "arg=3 \\'\\\\003\\'"
+continue_to_bp_overloaded 22 "unsigned char" "arg=4 \\'\\\\004\\'"
+continue_to_bp_overloaded 21 "short" "arg=5"
+continue_to_bp_overloaded 20 "unsigned short" "arg=6"
+continue_to_bp_overloaded 19 "int" "arg=7"
+continue_to_bp_overloaded 18 "(unsigned|unsigned int)" "arg=8"
+continue_to_bp_overloaded 17 "long" "arg=9"
+continue_to_bp_overloaded 16 "unsigned long" "arg=10"
+continue_to_bp_overloaded 15 "float" "arg=100"
+continue_to_bp_overloaded 14 "double" "arg=200"
+
+
+
+# That's all, folks.
+
+gdb_continue_to_end "finish program"
diff --git a/gdb/testsuite/gdb.c++/ref-types.cc b/gdb/testsuite/gdb.c++/ref-types.cc
new file mode 100644
index 00000000000..23cc51095e3
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/ref-types.cc
@@ -0,0 +1,79 @@
+int main2(void);
+
+void marker1 (void)
+{
+
+}
+
+
+
+int main(void)
+{
+ short s;
+ short &rs = s;
+ short *ps;
+ short *&rps = ps;
+ short as[4];
+ short (&ras)[4] = as;
+ s = -1;
+ ps = &s;
+ as[0] = 0;
+ as[1] = 1;
+ as[2] = 2;
+ as[3] = 3;
+
+ #ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+ #endif
+ marker1();
+
+ main2();
+
+ return 0;
+}
+
+int f()
+{
+ int f1;
+ f1 = 1;
+ return f1;
+}
+
+int main2(void)
+{
+ char C;
+ unsigned char UC;
+ short S;
+ unsigned short US;
+ int I;
+ unsigned int UI;
+ long L;
+ unsigned long UL;
+ float F;
+ double D;
+ char &rC = C;
+ unsigned char &rUC = UC;
+ short &rS = S;
+ unsigned short &rUS = US;
+ int &rI = I;
+ unsigned int &rUI = UI;
+ long &rL = L;
+ unsigned long &rUL = UL;
+ float &rF = F;
+ double &rD = D;
+ C = 'A';
+ UC = 21;
+ S = -14;
+ US = 7;
+ I = 102;
+ UI = 1002;
+ L = -234;
+ UL = 234;
+ F = 1.25E10;
+ D = -1.375E-123;
+ I = f();
+
+ return 0;
+
+}
diff --git a/gdb/testsuite/gdb.c++/ref-types.exp b/gdb/testsuite/gdb.c++/ref-types.exp
new file mode 100644
index 00000000000..dd06f027111
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/ref-types.exp
@@ -0,0 +1,663 @@
+# Tests for reference types with short type variables in GDB.
+# Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# written by Elena Zannoni (ezannoni@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "ref-types"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+if ![runto 'marker1'] then {
+ perror "couldn't run to marker1"
+ continue
+}
+
+gdb_test "up" ".*main.*" "up from marker1 1"
+
+proc gdb_start_again {} {
+ global srcdir
+ global subdir
+ global binfile
+ global gdb_prompt
+ global decimal
+
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load ${binfile}
+
+ source ${binfile}.ci
+
+ #
+ # set it up at a breakpoint so we can play with the variable values
+ #
+ if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+ }
+
+ if ![runto 'marker1'] then {
+ perror "couldn't run to marker1"
+ continue
+ }
+
+ gdb_test "up" ".*main.*" "up from marker1 2"
+}
+
+
+
+send_gdb "print s\n"
+gdb_expect {
+ -re ".\[0-9\]* = -1.*$gdb_prompt $" {
+ pass "print value of s"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of s" }
+ timeout { fail "(timeout) print value of s" }
+ }
+
+
+send_gdb "ptype s\n"
+gdb_expect {
+ -re "type = short.*$gdb_prompt $" { pass "ptype s" }
+ -re ".*$gdb_prompt $" { fail "ptype s" }
+ timeout { fail "(timeout) ptype s" }
+}
+
+
+send_gdb "print *ps\n"
+gdb_expect {
+ -re ".\[0-9\]* = -1.*$gdb_prompt $" {
+ pass "print value of ps"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of ps" }
+ timeout { fail "(timeout) print value of ps" }
+ }
+
+
+send_gdb "ptype ps\n"
+gdb_expect {
+ -re "type = short \*.*$gdb_prompt $" { pass "ptype ps" }
+ -re ".*$gdb_prompt $" { fail "ptype ps" }
+ timeout { fail "(timeout) ptype ps" }
+}
+
+send_gdb "print as\[0\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of as\[0\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of as\[0\]" }
+ timeout { fail "(timeout) print value of as\[0\]" }
+ }
+
+
+send_gdb "ptype as\n"
+gdb_expect {
+ -re "type = short \\\[4\\\].*$gdb_prompt $" { pass "ptype as" }
+ -re "type = short int \\\[4\\\].*$gdb_prompt $" { pass "ptype as" }
+ -re ".*$gdb_prompt $" { fail "ptype as" }
+ timeout { fail "(timeout) ptype as" }
+}
+
+send_gdb "print as\[1\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print value of as\[1\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of as\[1\]" }
+ timeout { fail "(timeout) print value of as\[1\]" }
+ }
+
+send_gdb "print as\[2\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = 2.*$gdb_prompt $" {
+ pass "print value of as\[2\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of as\[2\]" }
+ timeout { fail "(timeout) print value of as\[2\]" }
+ }
+
+send_gdb "print as\[3\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = 3.*$gdb_prompt $" {
+ pass "print value of as\[3\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of as\[3\]" }
+ timeout { fail "(timeout) print value of as\[3\]" }
+ }
+
+send_gdb "print rs\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(short &\\) @$hex: -1.*$gdb_prompt $" {
+ pass "print value of rs"
+ }
+ -re ".\[0-9\]* = \\(short int &\\) @$hex: -1.*$gdb_prompt $" {
+ pass "print value of rs"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rs" }
+ timeout { fail "(timeout) print value of rs" }
+ eof { fail "print rs ($GDB dumped core) (FIXME)" ; gdb_start_again ; }
+
+ }
+
+send_gdb "ptype rs\n"
+gdb_expect {
+ -re "type = short &.*$gdb_prompt $" { pass "ptype rs" }
+ -re "type = short int &.*$gdb_prompt $" { pass "ptype rs" }
+ -re ".*$gdb_prompt $" { fail "ptype rs" }
+ timeout { fail "(timeout) ptype rs" }
+}
+
+
+send_gdb "print *rps\n"
+gdb_expect {
+ -re ".\[0-9\]* = -1.*$gdb_prompt $" {
+ pass "print value of *rps"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of *rps" }
+ timeout { fail "(timeout) print value of *rps" }
+ }
+
+
+send_gdb "ptype rps\n"
+gdb_expect {
+ -re "type = short \\*&.*$gdb_prompt $" { pass "ptype rps" }
+ -re "type = short int \\*&.*$gdb_prompt $" { pass "ptype rps" }
+ -re ".*$gdb_prompt $" { fail "ptype rps" }
+ timeout { fail "(timeout) ptype rps" }
+}
+
+
+
+send_gdb "print ras\[0\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = 0.*$gdb_prompt $" {
+ pass "print value of ras\[0\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of ras\[0\]" }
+ timeout { fail "(timeout) print value of ras\[0\]" }
+ }
+
+
+send_gdb "ptype ras\n"
+gdb_expect {
+ -re "type = short \\\(&\\\)\\\[4\\\].*$gdb_prompt $" { pass "ptype ras" }
+ -re "type = short int \\\(&\\\)\\\[4\\\].*$gdb_prompt $" { pass "ptype ras" }
+ -re ".*$gdb_prompt $" { fail "ptype ras" }
+ timeout { fail "(timeout) ptype ras" }
+}
+
+send_gdb "print ras\[1\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.*$gdb_prompt $" {
+ pass "print value of ras\[1\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of ras\[1\]" }
+ timeout { fail "(timeout) print value of ras\[1\]" }
+ }
+
+send_gdb "print ras\[2\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = 2.*$gdb_prompt $" {
+ pass "print value of ras\[2\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of ras\[2\]" }
+ timeout { fail "(timeout) print value of ras\[2\]" }
+ }
+
+send_gdb "print ras\[3\]\n"
+gdb_expect {
+ -re ".\[0-9\]* = 3.*$gdb_prompt $" {
+ pass "print value of ras\[3\]"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of ras\[3\]" }
+ timeout { fail "(timeout) print value of ras\[3\]" }
+ }
+
+
+if ![runto 'f'] then {
+ perror "couldn't run to f"
+ continue
+}
+
+gdb_test "up" ".main2.*" "up from f"
+
+send_gdb "print C\n"
+gdb_expect {
+ -re ".\[0-9\]* = 65 \'A\'.*$gdb_prompt $" {
+ pass "print value of C"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of C" }
+ timeout { fail "(timeout) print value of C" }
+ }
+
+
+send_gdb "ptype C\n"
+gdb_expect {
+ -re "type = char.*$gdb_prompt $" { pass "ptype C" }
+ -re ".*$gdb_prompt $" { fail "ptype C" }
+ timeout { fail "(timeout) ptype C" }
+}
+
+
+send_gdb "print UC\n"
+gdb_expect {
+ -re ".\[0-9\]* = 21 '\.025'\.*$gdb_prompt $" {
+ pass "print value of UC"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of UC" }
+ timeout { fail "(timeout) print value of UC" }
+ }
+
+
+send_gdb "ptype UC\n"
+gdb_expect {
+ -re "type = unsigned char.*$gdb_prompt $" { pass "ptype UC" }
+ -re ".*$gdb_prompt $" { fail "ptype UC" }
+ timeout { fail "(timeout) ptype UC" }
+}
+
+
+send_gdb "print S\n"
+gdb_expect {
+ -re ".\[0-9\]* = -14.*$gdb_prompt $" {
+ pass "print value of S"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of S" }
+ timeout { fail "(timeout) print value of S" }
+ }
+
+
+send_gdb "ptype S\n"
+gdb_expect {
+ -re "type = short.*$gdb_prompt $" { pass "ptype S" }
+ -re ".*$gdb_prompt $" { fail "ptype S" }
+ timeout { fail "(timeout) ptype S" }
+}
+
+
+send_gdb "print US\n"
+gdb_expect {
+ -re ".\[0-9\]* = 7.*$gdb_prompt $" {
+ pass "print value of US"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of US" }
+ timeout { fail "(timeout) print value of US" }
+ }
+
+
+send_gdb "ptype US\n"
+gdb_expect {
+ -re "type = unsigned short.*$gdb_prompt $" { pass "ptype US" }
+ -re "type = short unsigned.*$gdb_prompt $" { pass "ptype US" }
+ -re ".*$gdb_prompt $" { fail "ptype US" }
+ timeout { fail "(timeout) ptype US" }
+}
+
+
+send_gdb "print I\n"
+gdb_expect {
+ -re ".\[0-9\]* = 102.*$gdb_prompt $" {
+ pass "print value of I"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of I" }
+ timeout { fail "(timeout) print value of I" }
+ }
+
+
+send_gdb "ptype I\n"
+gdb_expect {
+ -re "type = int.*$gdb_prompt $" { pass "ptype I" }
+ -re ".*$gdb_prompt $" { fail "ptype I" }
+ timeout { fail "(timeout) ptype I" }
+}
+
+
+send_gdb "print UI\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1002.*$gdb_prompt $" {
+ pass "print value of UI"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of UI" }
+ timeout { fail "(timeout) print value of UI" }
+ }
+
+
+send_gdb "ptype UI\n"
+gdb_expect {
+ -re "type = unsigned int.*$gdb_prompt $" { pass "ptype UI" }
+ -re ".*$gdb_prompt $" { fail "ptype UI" }
+ timeout { fail "(timeout) ptype UI" }
+}
+
+
+send_gdb "print L\n"
+gdb_expect {
+ -re ".\[0-9\]* = -234.*$gdb_prompt $" {
+ pass "print value of L"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of L" }
+ timeout { fail "(timeout) print value of L" }
+ }
+
+
+send_gdb "ptype L\n"
+gdb_expect {
+ -re "type = long.*$gdb_prompt $" { pass "ptype L" }
+ -re ".*$gdb_prompt $" { fail "ptype L" }
+ timeout { fail "(timeout) ptype L" }
+}
+
+
+send_gdb "print UL\n"
+gdb_expect {
+ -re ".\[0-9\]* = 234.*$gdb_prompt $" {
+ pass "print value of UL"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of UL" }
+ timeout { fail "(timeout) print value of UL" }
+ }
+
+
+send_gdb "ptype UL\n"
+gdb_expect {
+ -re "type = unsigned long.*$gdb_prompt $" { pass "ptype UL" }
+ -re "type = long unsigned.*$gdb_prompt $" { pass "ptype UL" }
+ -re ".*$gdb_prompt $" { fail "ptype UL" }
+ timeout { fail "(timeout) ptype UL" }
+}
+
+
+send_gdb "print F\n"
+gdb_expect {
+ -re ".\[0-9\]* = 1.2\[0-9\]*e\\+10.*$gdb_prompt $" {
+ pass "print value of F"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of F" }
+ timeout { fail "(timeout) print value of F" }
+ }
+
+
+
+send_gdb "ptype F\n"
+gdb_expect {
+ -re "type = float.*$gdb_prompt $" { pass "ptype F" }
+ -re ".*$gdb_prompt $" { fail "ptype F" }
+ timeout { fail "(timeout) ptype F" }
+}
+
+
+send_gdb "print D\n"
+gdb_expect {
+ -re ".\[0-9\]* = -1.375e-123.*$gdb_prompt $" {
+ pass "print value of D"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of D" }
+ timeout { fail "(timeout) print value of D" }
+ }
+
+
+send_gdb "ptype D\n"
+gdb_expect {
+ -re "type = double.*$gdb_prompt $" { pass "ptype D" }
+ -re ".*$gdb_prompt $" { fail "ptype D" }
+ timeout { fail "(timeout) ptype D" }
+}
+
+
+
+#
+# test reference types
+#
+
+
+
+
+send_gdb "ptype rC\n"
+gdb_expect {
+ -re "type = char &.*$gdb_prompt $" { pass "ptype rC" }
+ -re ".*$gdb_prompt $" { fail "ptype rC" }
+ timeout { fail "(timeout) ptype rC" }
+}
+
+
+
+
+send_gdb "ptype rUC\n"
+gdb_expect {
+ -re "type = unsigned char &.*$gdb_prompt $" { pass "ptype rUC" }
+ -re ".*$gdb_prompt $" { fail "ptype rUC" }
+ timeout { fail "(timeout) ptype rUC" }
+}
+
+
+
+send_gdb "ptype rS\n"
+gdb_expect {
+ -re "type = short &.*$gdb_prompt $" { pass "ptype rS" }
+ -re "type = short int &.*$gdb_prompt $" { pass "ptype rS" }
+ -re ".*$gdb_prompt $" { fail "ptype rS" }
+ timeout { fail "(timeout) ptype rS" }
+}
+
+
+
+send_gdb "ptype rUS\n"
+gdb_expect {
+ -re "type = unsigned short &.*$gdb_prompt $" { pass "ptype rUS" }
+ -re "type = short unsigned int &.*$gdb_prompt $" { pass "ptype rUS" }
+ -re ".*$gdb_prompt $" { fail "ptype rUS" }
+ timeout { fail "(timeout) ptype rUS" }
+}
+
+
+send_gdb "ptype rI\n"
+gdb_expect {
+ -re "type = int &.*$gdb_prompt $" { pass "ptype rI" }
+ -re ".*$gdb_prompt $" { fail "ptype rI" }
+ timeout { fail "(timeout) ptype rI" }
+}
+
+
+
+send_gdb "ptype rUI\n"
+gdb_expect {
+ -re "type = unsigned int &.*$gdb_prompt $" { pass "ptype rUI" }
+ -re ".*$gdb_prompt $" { fail "ptype rUI" }
+ timeout { fail "(timeout) ptype rUI" }
+}
+
+
+
+send_gdb "ptype rL\n"
+gdb_expect {
+ -re "type = long &.*$gdb_prompt $" { pass "ptype rL" }
+ -re "type = long int &.*$gdb_prompt $" { pass "ptype rL" }
+ -re ".*$gdb_prompt $" { fail "ptype rL" }
+ timeout { fail "(timeout) ptype rL" }
+}
+
+
+send_gdb "ptype rUL\n"
+gdb_expect {
+ -re "type = unsigned long &.*$gdb_prompt $" { pass "ptype rUL" }
+ -re "type = long unsigned int &.*$gdb_prompt $" { pass "ptype rUL" }
+ -re ".*$gdb_prompt $" { fail "ptype rUL" }
+ timeout { fail "(timeout) ptype rUL" }
+}
+
+
+send_gdb "ptype rF\n"
+gdb_expect {
+ -re "type = float &.*$gdb_prompt $" { pass "ptype rF" }
+ -re ".*$gdb_prompt $" { fail "ptype rF" }
+ timeout { fail "(timeout) ptype rF" }
+}
+
+
+send_gdb "ptype rD\n"
+gdb_expect {
+ -re "type = double &.*$gdb_prompt $" { pass "ptype rD" }
+ -re ".*$gdb_prompt $" { fail "ptype rD" }
+ timeout { fail "(timeout) ptype rD" }
+}
+
+
+send_gdb "print rC\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(char &\\) @$hex: 65 \'A\'.*$gdb_prompt $" {
+ pass "print value of rC"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rC" }
+ timeout { fail "(timeout) print value of rC" }
+ }
+
+
+send_gdb "print rUC\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(unsigned char &\\) @$hex: 21 \'.025\'.*$gdb_prompt $" {
+ pass "print value of rUC"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rUC" }
+ timeout { fail "(timeout) print value of rUC" }
+ }
+
+
+send_gdb "print rS\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(short &\\) @$hex: -14.*$gdb_prompt $" {
+ pass "print value of rS"
+ }
+ -re ".\[0-9\]* = \\(short int &\\) @$hex: -14.*$gdb_prompt $" {
+ pass "print value of rS"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rS" }
+ timeout { fail "(timeout) print value of rS" }
+ }
+
+
+send_gdb "print rUS\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(unsigned short &\\) @$hex: 7.*$gdb_prompt $" {
+ pass "print value of rUS"
+ }
+ -re ".\[0-9\]* = \\(short unsigned int &\\) @$hex: 7.*$gdb_prompt $" {
+ pass "print value of rUS"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rUS" }
+ timeout { fail "(timeout) print value of rUS" }
+ }
+
+
+send_gdb "print rI\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(int &\\) @$hex: 102.*$gdb_prompt $" {
+ pass "print value of rI"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rI" }
+ timeout { fail "(timeout) print value of rI" }
+ }
+
+
+send_gdb "print rUI\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(unsigned int &\\) @$hex: 1002.*$gdb_prompt $" {
+ pass "print value of UI"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rUI" }
+ timeout { fail "(timeout) print value of rUI" }
+ }
+
+
+send_gdb "print rL\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(long &\\) @$hex: -234.*$gdb_prompt $" {
+ pass "print value of rL"
+ }
+ -re ".\[0-9\]* = \\(long int &\\) @$hex: -234.*$gdb_prompt $" {
+ pass "print value of rL"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rL" }
+ timeout { fail "(timeout) print value of rL" }
+ }
+
+
+
+send_gdb "print rUL\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(unsigned long &\\) @$hex: 234.*$gdb_prompt $" {
+ pass "print value of rUL"
+ }
+ -re ".\[0-9\]* = \\(long unsigned int &\\) @$hex: 234.*$gdb_prompt $" {
+ pass "print value of rUL"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rUL" }
+ timeout { fail "(timeout) print value of rUL" }
+ }
+
+
+send_gdb "print rF\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(float &\\) @$hex: 1.2\[0-9\]*e\\+10.*$gdb_prompt $" {
+ pass "print value of rF"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rF" }
+ timeout { fail "(timeout) print value of rF" }
+ }
+
+
+send_gdb "print rD\n"
+gdb_expect {
+ -re ".\[0-9\]* = \\(double &\\) @$hex: -1.375e-123.*$gdb_prompt $" {
+ pass "print value of rD"
+ }
+ -re ".*$gdb_prompt $" { fail "print value of rD" }
+ timeout { fail "(timeout) print value of rD" }
+ }
+
diff --git a/gdb/testsuite/gdb.c++/templates.cc b/gdb/testsuite/gdb.c++/templates.cc
new file mode 100644
index 00000000000..c13f18b643f
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/templates.cc
@@ -0,0 +1,785 @@
+/* This test code is from Wendell Baker (wbaker@comet.berkeley.edu) */
+
+#include <stddef.h>
+
+int a_i;
+char a_c;
+double a_d;
+
+typedef void *Pix;
+
+int
+f(int i)
+{ return 0; }
+
+int
+f(int i, char c)
+{ return 0; }
+
+int
+f(int i, char c, double d)
+{ return 0; }
+
+int
+f(int i, char c, double d, char *cs)
+{ return 0; }
+
+int
+f(int i, char c, double d, char *cs, void (*fig)(int, char))
+{ return 0; }
+
+int
+f(int i, char c, double d, char *cs, void (*fig)(char, int))
+{ return 0; }
+
+class R {
+public:
+ int i;
+};
+class S {
+public:
+ int i;
+};
+class T {
+public:
+ int i;
+};
+
+char g(char, const char, volatile char)
+{ return 'c'; }
+char g(R, char&, const char&, volatile char&)
+{ return 'c'; }
+char g(char*, const char*, volatile char*)
+{ return 'c'; }
+char g(S, char*&, const char*&, volatile char*&)
+{ return 'c'; }
+
+signed char g(T,signed char, const signed char, volatile signed char)
+{ return 'c'; }
+signed char g(T, R, signed char&, const signed char&, volatile signed char&)
+{ return 'c'; }
+signed char g(T, signed char*, const signed char*, volatile signed char*)
+{ return 'c'; }
+signed char g(T, S, signed char*&, const signed char*&, volatile signed char*&)
+{ return 'c'; }
+
+unsigned char g(unsigned char, const unsigned char, volatile unsigned char)
+{ return 'c'; }
+unsigned char g(R, unsigned char&, const unsigned char&, volatile unsigned char&)
+{ return 'c'; }
+unsigned char g(unsigned char*, const unsigned char*, volatile unsigned char*)
+{ return 'c'; }
+unsigned char g(S, unsigned char*&, const unsigned char*&, volatile unsigned char*&)
+{ return 'c'; }
+
+short g(short, const short, volatile short)
+{ return 0; }
+short g(R, short&, const short&, volatile short&)
+{ return 0; }
+short g(short*, const short*, volatile short*)
+{ return 0; }
+short g(S, short*&, const short*&, volatile short*&)
+{ return 0; }
+
+signed short g(T, signed short, const signed short, volatile signed short)
+{ return 0; }
+signed short g(T, R, signed short&, const signed short&, volatile signed short&)
+{ return 0; }
+signed short g(T, signed short*, const signed short*, volatile signed short*)
+{ return 0; }
+signed short g(T, S, double, signed short*&, const signed short*&, volatile signed short*&)
+{ return 0; }
+
+unsigned short g(unsigned short, const unsigned short, volatile unsigned short)
+{ return 0; }
+unsigned short g(R, unsigned short&, const unsigned short&, volatile unsigned short&)
+{ return 0; }
+unsigned short g(unsigned short*, const unsigned short*, volatile unsigned short*)
+{ return 0; }
+unsigned short g(S, unsigned short*&, const unsigned short*&, volatile unsigned short*&)
+{ return 0; }
+
+int g(int, const int, volatile int)
+{ return 0; }
+int g(R, int&, const int&, volatile int&)
+{ return 0; }
+int g(int*, const int*, volatile int*)
+{ return 0; }
+int g(S, int*&, const int*&, volatile int*&)
+{ return 0; }
+
+signed int g(T, signed int, const signed int, volatile signed int)
+{ return 0; }
+signed int g(T, R, signed int&, const signed int&, volatile signed int&)
+{ return 0; }
+signed int g(T, signed int*, const signed int*, volatile signed int*)
+{ return 0; }
+signed int g(T, S, signed int*&, const signed int*&, volatile signed int*&)
+{ return 0; }
+
+unsigned int g(unsigned int, const unsigned int, volatile unsigned int)
+{ return 0; }
+unsigned int g(R, unsigned int&, const unsigned int&, volatile unsigned int&)
+{ return 0; }
+unsigned int g(unsigned int*, const unsigned int*, volatile unsigned int*)
+{ return 0; }
+unsigned int g(S, unsigned int*&, const unsigned int*&, volatile unsigned int*&)
+{ return 0; }
+
+long g(long, const long, volatile long)
+{ return 0; }
+long g(R, long&, const long&, volatile long&)
+{ return 0; }
+long g(long*, const long*, volatile long*)
+{ return 0; }
+long g(S, long*&, const long*&, volatile long*&)
+{ return 0; }
+
+signed long g(T, signed long, const signed long, volatile signed long)
+{ return 0; }
+signed long g(T, R, signed long&, const signed long&, volatile signed long&)
+{ return 0; }
+signed long g(T, signed long*, const signed long*, volatile signed long*)
+{ return 0; }
+signed long g(T, S, signed long*&, const signed long*&, volatile signed long*&)
+{ return 0; }
+
+unsigned long g(unsigned long, const unsigned long, volatile unsigned long)
+{ return 0; }
+unsigned long g(S, unsigned long&, const unsigned long&, volatile unsigned long&)
+{ return 0; }
+unsigned long g(unsigned long*, const unsigned long*, volatile unsigned long*)
+{ return 0; }
+unsigned long g(S, unsigned long*&, const unsigned long*&, volatile unsigned long*&)
+{ return 0; }
+
+#ifdef __GNUC__
+long long g(long long, const long long, volatile long long)
+{ return 0; }
+long long g(S, long long&, const long long&, volatile long long&)
+{ return 0; }
+long long g(long long*, const long long*, volatile long long*)
+{ return 0; }
+long long g(R, long long*&, const long long*&, volatile long long*&)
+{ return 0; }
+
+signed long long g(T, signed long long, const signed long long, volatile signed long long)
+{ return 0; }
+signed long long g(T, R, signed long long&, const signed long long&, volatile signed long long&)
+{ return 0; }
+signed long long g(T, signed long long*, const signed long long*, volatile signed long long*)
+{ return 0; }
+signed long long g(T, S, signed long long*&, const signed long long*&, volatile signed long long*&)
+{ return 0; }
+
+unsigned long long g(unsigned long long, const unsigned long long, volatile unsigned long long)
+{ return 0; }
+unsigned long long g(R, unsigned long long*, const unsigned long long*, volatile unsigned long long*)
+{ return 0; }
+unsigned long long g(unsigned long long&, const unsigned long long&, volatile unsigned long long&)
+{ return 0; }
+unsigned long long g(S, unsigned long long*&, const unsigned long long*&, volatile unsigned long long*&)
+{ return 0; }
+#endif
+
+float g(float, const float, volatile float)
+{ return 0; }
+float g(char, float&, const float&, volatile float&)
+{ return 0; }
+float g(float*, const float*, volatile float*)
+{ return 0; }
+float g(char, float*&, const float*&, volatile float*&)
+{ return 0; }
+
+double g(double, const double, volatile double)
+{ return 0; }
+double g(char, double&, const double&, volatile double&)
+{ return 0; }
+double g(double*, const double*, volatile double*)
+{ return 0; }
+double g(char, double*&, const double*&, volatile double*&)
+{ return 0; }
+
+#ifdef __GNUC__
+long double g(long double, const long double, volatile long double)
+{ return 0; }
+long double g(char, long double&, const long double&, volatile long double&)
+{ return 0; }
+long double g(long double*, const long double*, volatile long double*)
+{ return 0; }
+long double g(char, long double*&, const long double*&, volatile long double*&)
+{ return 0; }
+#endif
+
+class c {
+public:
+ c(int) {};
+ int i;
+};
+
+class c g(c, const c, volatile c)
+{ return 0; }
+c g(char, c&, const c&, volatile c&)
+{ return 0; }
+c g(c*, const c*, volatile c*)
+{ return 0; }
+c g(char, c*&, const c*&, volatile c*&)
+{ return 0; }
+
+/*
+void h(char = 'a')
+{ }
+void h(char, signed char = 'a')
+{ }
+void h(unsigned char = 'a')
+{ }
+*/
+/*
+void h(char = (char)'a')
+{ }
+void h(char, signed char = (signed char)'a')
+{ }
+void h(unsigned char = (unsigned char)'a')
+{ }
+
+
+void h(short = (short)43)
+{ }
+void h(char, signed short = (signed short)43)
+{ }
+void h(unsigned short = (unsigned short)43)
+{ }
+
+void h(int = (int)43)
+{ }
+void h(char, signed int = (signed int)43)
+{ }
+void h(unsigned int = (unsigned int)43)
+{ }
+
+
+void h(long = (long)43)
+{ }
+void h(char, signed long = (signed long)43)
+{ }
+void h(unsigned long = (unsigned long)43)
+{ }
+
+#ifdef __GNUC__
+void h(long long = 43)
+{ }
+void h(char, signed long long = 43)
+{ }
+void h(unsigned long long = 43)
+{ }
+#endif
+
+void h(float = 4.3e-10)
+{ }
+void h(double = 4.3)
+{ }
+#ifdef __GNUC__
+void h(long double = 4.33e33)
+{ }
+#endif
+*/
+
+/* An unneeded printf() definition - actually, just a stub - used to occupy
+ this space. It has been removed and replaced with this comment which
+ exists to occupy some lines so that templates.exp won't need adjustment. */
+
+class T1 {
+public:
+ static void* operator new(size_t) throw ();
+ static void operator delete(void *pointer);
+
+ void operator=(const T1&);
+ T1& operator=(int);
+
+ int operator==(int) const;
+ int operator==(const T1&) const;
+ int operator!=(int) const;
+ int operator!=(const T1&) const;
+
+ int operator<=(int) const;
+ int operator<=(const T1&) const;
+ int operator<(int) const;
+ int operator<(const T1&) const;
+ int operator>=(int) const;
+ int operator>=(const T1&) const;
+ int operator>(int) const;
+ int operator>(const T1&) const;
+
+ void operator+(int) const;
+ T1& operator+(const T1&) const;
+ void operator+=(int) const;
+ T1& operator+=(const T1&) const;
+
+ T1& operator++() const;
+
+ void operator-(int) const;
+ T1& operator-(const T1&) const;
+ void operator-=(int) const;
+ T1& operator-=(const T1&) const;
+
+ T1& operator--() const;
+
+ void operator*(int) const;
+ T1& operator*(const T1&) const;
+ void operator*=(int) const;
+ T1& operator*=(const T1&) const;
+
+ void operator/(int) const;
+ T1& operator/(const T1&) const;
+ void operator/=(int) const;
+ T1& operator/=(const T1&) const;
+
+ void operator%(int) const;
+ T1& operator%(const T1&) const;
+ void operator%=(int) const;
+ T1& operator%=(const T1&) const;
+
+ void operator&&(int) const;
+ T1& operator&&(const T1&) const;
+
+ void operator||(int) const;
+ T1& operator||(const T1&) const;
+
+ void operator&(int) const;
+ T1& operator&(const T1&) const;
+ void operator&=(int) const;
+ T1& operator&=(const T1&) const;
+
+ void operator|(int) const;
+ T1& operator|(const T1&) const;
+ void operator|=(int) const;
+ T1& operator|=(const T1&) const;
+
+ void operator^(int) const;
+ T1& operator^(const T1&) const;
+ void operator^=(int) const;
+ T1& operator^=(const T1&) const;
+
+ T1& operator!() const;
+ T1& operator~() const;
+};
+
+void*
+T1::operator new(size_t) throw ()
+{ return 0; }
+
+void
+T1::operator delete(void *pointer)
+{ }
+
+class T2 {
+public:
+ T2(int i): integer(i)
+ { }
+ int integer;
+};
+
+int operator==(const T2&, const T2&)
+{ return 0; }
+int operator==(const T2&, char)
+{ return 0; }
+int operator!=(const T2&, const T2&)
+{ return 0; }
+int operator!=(const T2&, char)
+{ return 0; }
+
+int operator<=(const T2&, const T2&)
+{ return 0; }
+int operator<=(const T2&, char)
+{ return 0; }
+int operator<(const T2&, const T2&)
+{ return 0; }
+int operator<(const T2&, char)
+{ return 0; }
+int operator>=(const T2&, const T2&)
+{ return 0; }
+int operator>=(const T2&, char)
+{ return 0; }
+int operator>(const T2&, const T2&)
+{ return 0; }
+int operator>(const T2&, char)
+{ return 0; }
+
+T2 operator+(const T2 t, int i)
+{ return t.integer + i; }
+T2 operator+(const T2 a, const T2& b)
+{ return a.integer + b.integer; }
+T2& operator+=(T2& t, int i)
+{ t.integer += i; return t; }
+T2& operator+=(T2& a, const T2& b)
+{ a.integer += b.integer; return a; }
+
+T2 operator-(const T2 t, int i)
+{ return t.integer - i; }
+T2 operator-(const T2 a, const T2& b)
+{ return a.integer - b.integer; }
+T2& operator-=(T2& t, int i)
+{ t.integer -= i; return t; }
+T2& operator-=(T2& a, const T2& b)
+{ a.integer -= b.integer; return a; }
+
+T2 operator*(const T2 t, int i)
+{ return t.integer * i; }
+T2 operator*(const T2 a, const T2& b)
+{ return a.integer * b.integer; }
+T2& operator*=(T2& t, int i)
+{ t.integer *= i; return t; }
+T2& operator*=(T2& a, const T2& b)
+{ a.integer *= b.integer; return a; }
+
+T2 operator/(const T2 t, int i)
+{ return t.integer / i; }
+T2 operator/(const T2 a, const T2& b)
+{ return a.integer / b.integer; }
+T2& operator/=(T2& t, int i)
+{ t.integer /= i; return t; }
+T2& operator/=(T2& a, const T2& b)
+{ a.integer /= b.integer; return a; }
+
+T2 operator%(const T2 t, int i)
+{ return t.integer % i; }
+T2 operator%(const T2 a, const T2& b)
+{ return a.integer % b.integer; }
+T2& operator%=(T2& t, int i)
+{ t.integer %= i; return t; }
+T2& operator%=(T2& a, const T2& b)
+{ a.integer %= b.integer; return a; }
+
+template<class T>
+class T5 {
+public:
+ T5(int);
+ T5(const T5<T>&);
+ ~T5();
+ static void* operator new(size_t) throw ();
+ static void operator delete(void *pointer);
+ int value();
+
+ static T X;
+ T x;
+ int val;
+};
+
+template<class T>
+T5<T>::T5(int v)
+{ val = v; }
+
+template<class T>
+T5<T>::T5(const T5<T>&)
+{}
+
+template<class T>
+T5<T>::~T5()
+{}
+
+template<class T>
+void*
+T5<T>::operator new(size_t) throw ()
+{ return 0; }
+
+template<class T>
+void
+T5<T>::operator delete(void *pointer)
+{ }
+
+template<class T>
+int
+T5<T>::value()
+{ return val; }
+
+
+#if ! defined(__GNUC__) || defined(GCC_BUG)
+template<class T>
+T T5<T>::X;
+#endif
+
+
+
+
+T5<char> t5c(1);
+T5<int> t5i(2);
+T5<int (*)(char, void *)> t5fi1(3);
+T5<int (*)(int, double **, void *)> t5fi2(4);
+
+
+
+
+
+
+class x {
+public:
+ int (*manage[5])(double,
+ void *(*malloc)(unsigned size),
+ void (*free)(void *pointer));
+ int (*device[5])(int open(const char *, unsigned mode, unsigned perms, int extra),
+ int *(*read)(int fd, void *place, unsigned size),
+ int *(*write)(int fd, void *place, unsigned size),
+ void (*close)(int fd));
+};
+T5<x> t5x(5);
+
+#if !defined(__GNUC__) || (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)
+template class T5<char>;
+template class T5<int>;
+template class T5<int (*)(char, void *)>;
+template class T5<int (*)(int, double **, void *)>;
+template class T5<x>;
+#endif
+
+class T7 {
+public:
+ static int get();
+ static void put(int);
+};
+
+int
+T7::get()
+{ return 1; }
+
+void
+T7::put(int i)
+{
+ // nothing
+}
+
+// More template kinds. GDB 4.16 didn't handle these, but
+// Wildebeest does. Note: Assuming HP aCC is used to compile
+// this file; with g++ or HP cfront or other compilers the
+// demangling may not get done correctly.
+
+// Ordinary template, to be instantiated with different types
+template<class T>
+class Foo {
+public:
+ int x;
+ T t;
+ T foo (int, T);
+};
+
+
+template<class T> T Foo<T>::foo (int i, T tt)
+{
+ return tt;
+}
+
+// Template with int parameter
+
+template<class T, int sz>
+class Bar {
+public:
+ int x;
+ T t;
+ T bar (int, T);
+};
+
+
+template<class T, int sz> T Bar<T, sz>::bar (int i, T tt)
+{
+ if (i < sz)
+ return tt;
+ else
+ return 0;
+}
+
+// function template with int parameter
+template<class T> int dummy (T tt, int i)
+{
+ return tt;
+}
+
+// Template with partial specializations
+template<class T1, class T2>
+class Spec {
+public:
+ int x;
+ T1 spec (T2);
+};
+
+template<class T1, class T2>
+T1 Spec<T1, T2>::spec (T2 t2)
+{
+ return 0;
+}
+
+template<class T>
+class Spec<T, T*> {
+public:
+ int x;
+ T spec (T*);
+};
+
+template<class T>
+T Spec<T, T*>::spec (T * tp)
+{
+ return *tp;
+}
+
+// Template with char parameter
+template<class T, char sz>
+class Baz {
+public:
+ int x;
+ T t;
+ T baz (int, T);
+};
+
+template<class T, char sz> T Baz<T, sz>::baz (int i, T tt)
+{
+ if (i < sz)
+ return tt;
+ else
+ return 0;
+}
+
+// Template with char * parameter
+template<class T, char * sz>
+class Qux {
+public:
+ int x;
+ T t;
+ T qux (int, T);
+};
+
+template<class T, char * sz> T Qux<T, sz>::qux (int i, T tt)
+{
+ if (sz[0] == 'q')
+ return tt;
+ else
+ return 0;
+}
+
+// Template with a function pointer parameter
+template<class T, int (*f)(int) >
+class Qux1 {
+public:
+ int x;
+ T t;
+ T qux (int, T);
+};
+
+template<class T, int (*f)(int)> T Qux1<T, f>::qux (int i, T tt)
+{
+ if (f != 0)
+ return tt;
+ else
+ return 0;
+}
+
+// Some functions to provide as arguments to template
+int gf1 (int a) {
+ return a * 2 + 13;
+}
+int gf2 (int a) {
+ return a * 2 + 26;
+}
+
+char string[3];
+
+
+// Template for nested instantiations
+
+template<class T>
+class Garply {
+public:
+ int x;
+ T t;
+ T garply (int, T);
+};
+
+template<class T> T Garply<T>::garply (int i, T tt)
+{
+ if (i > x)
+ return tt;
+ else
+ {
+ x += i;
+ return tt;
+ }
+}
+
+
+int main()
+{
+ int i;
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ i = i + 1;
+
+ // New tests added here
+
+ Foo<int> fint={0,0};
+ Foo<char> fchar={0,0};
+ Foo<volatile char *> fvpchar = {0, 0};
+
+ Bar<int, 33> bint;
+ Bar<int, (4 > 3)> bint2;
+
+ Baz<int, 's'> bazint;
+ Baz<char, 'a'> bazint2;
+
+ Qux<char, string> quxint2;
+ Qux<int, string> quxint;
+
+ Qux1<int, gf1> qux11;
+
+ int x = fint.foo(33, 47);
+ char c = fchar.foo(33, 'x');
+ volatile char * cp = fvpchar.foo(33, 0);
+
+ int y = dummy<int> (400, 600);
+
+ int z = bint.bar(55, 66);
+ z += bint2.bar(55, 66);
+
+ c = bazint2.baz(4, 'y');
+ c = quxint2.qux(4, 'z');
+
+ y = bazint.baz(4,3);
+ y = quxint.qux(4, 22);
+ y += qux11.qux(4, 22);
+
+ y *= gf1(y) - gf2(y);
+
+ Spec<int, char> sic;
+ Spec<int, int *> siip;
+
+ sic.spec ('c');
+ siip.spec (&x);
+
+ Garply<int> f;
+ Garply<char> fc;
+ f.x = 13;
+
+ Garply<Garply<char> > nf;
+ nf.x = 31;
+
+ x = f.garply (3, 4);
+
+ fc = nf.garply (3, fc);
+
+ y = x + fc.x;
+
+
+ return 0;
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.c++/templates.exp b/gdb/testsuite/gdb.c++/templates.exp
new file mode 100644
index 00000000000..a6d35fcb116
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/templates.exp
@@ -0,0 +1,455 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1999, 2000, 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+set ws "\[\r\n\t \]+"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "templates"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+source ${binfile}.ci
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+#
+# Test printing of the types of templates.
+#
+
+proc test_ptype_of_templates {} {
+ global gdb_prompt
+ global ws
+
+ send_gdb "ptype T5<int>\n"
+ gdb_expect {
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5<int> & operator=\\(T5<int> const ?&\\);${ws}T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
+ pass "ptype T5<int>"
+ }
+ -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}${ws}$gdb_prompt $" { pass "ptype T5<int> -- new with unsigned int" }
+ -re "type = class T5<int> \\{.*public:.*static int X;.*int x;.*int val;.*T5 \\(int\\);.*T5 \\(const class T5<int> &\\);.*void ~T5 \\(int\\);.*static void \\* new \\(unsigned long\\);.*static void delete \\(void ?\\*\\);.*int value \\((void|)\\);.*\\}\r\n$gdb_prompt $" { pass "ptype T5<int> -- new with unsigned long" }
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5<int> & operator=\\(T5<int> const ?&\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\((T5<int> const|const T5<int>) ?&\\);)|(${ws}~T5\\((void|)\\);)|(${ws}static void \\* operator new\\(unsigned( int| long)?\\);)|(${ws}static void operator delete\\(void ?\\*\\);)|(${ws}int value\\((void|)\\);))*${ws}\}\r\n$gdb_prompt $" {
+ pass "ptype T5<int> (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype T5<int>"
+ }
+ timeout {
+ fail "ptype T5<int> (timeout)"
+ }
+ }
+
+ send_gdb "ptype t5i\n"
+ gdb_expect {
+ -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5\\(int\\);${ws}T5\\(T5<int> const ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype T5<int> -- with several fixes from 4.17" }
+ -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned int\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype t5i<int> -- new with unsigned int" }
+ -re "type = class T5<int> \\{${ws}public:${ws}static int X;${ws}int x;${ws}int val;\r\n${ws}T5 \\(int\\);${ws}T5 \\(const class T5<int> &\\);${ws}void ~T5 \\(int\\);${ws}static void \\* new \\(unsigned long\\);${ws}static void delete \\(void ?\\*\\);${ws}int value \\((void|)\\);${ws}\\}\r\n$gdb_prompt $" { pass "ptype t5i<int> -- new with unsigned long" }
+ -re "type = class T5<int> \{.*public:.*static int X;.*int x;.*int val;.*.*T5 \\(int\\);.*.*void ~T5 \\(int\\).*.*.*int value \\((void|)\\);.*\}.*$gdb_prompt $" {
+ pass "ptype t5i"
+ }
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;${ws}T5<int> & operator=\\(T5<int> const ?&\\);${ws}T5\\(int\\);${ws}T5\\((T5<int> const|const T5<int>) ?&\\);${ws}~T5\\((void|)\\);${ws}static void \\* operator new\\(unsigned( int| long)?\\);${ws}static void operator delete\\(void ?\\*\\);${ws}int value\\((void|)\\);${ws}\}\r\n$gdb_prompt $" {
+ pass "ptype t5i"
+ }
+ -re "type = class T5<int> \{${ws}public:${ws}static int X;${ws}int x;${ws}int val;((${ws}T5<int> & operator=\\(T5<int> const ?&\\);)|(${ws}T5\\(int\\);)|(${ws}T5\\(T5<int> const ?&\\);)|(${ws}~T5\\((void|)\\);)|(${ws}static void \\* operator new\\(unsigned( int| long)?\\);)|(${ws}static void operator delete\\(void ?\\*\\);)|(${ws}int value\\((void|)\\);))*${ws}\}\r\n$gdb_prompt $" {
+ pass "ptype t5i (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype t5i"
+ }
+ timeout {
+ fail "ptype t5i (timeout)"
+ }
+ }
+}
+
+#
+# Test breakpoint setting on template methods.
+#
+
+proc test_template_breakpoints {} {
+ global gdb_prompt
+ global testfile
+ global srcdir
+ global hp_aCC_compiler
+
+ send_gdb "break T5<int>::T5\n"
+ gdb_expect {
+ -re "0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. T5<int>::T5\\(int\\) at .*\[\r\n\]*.3. T5<int>::T5\\((T5<int> const|const T5<int>) ?&\\) at .*\[\r\n\]*> $" {
+ gdb_test "0" \
+ "canceled" \
+ "constructor breakpoint (obsolete format!)"
+ }
+ -re ".0. cancel\[\r\n\]*.1. all\[\r\n\]*.2. T5<int>::T5\\((T5<int> const|const T5<int>) ?&\\) at .*templates.cc:.*\[\r\n\]*.3. T5<int>::T5\\(int\\) at .*templates.cc:.*\[\r\n\]*> $" {
+ gdb_test "0" \
+ "canceled" \
+ "constructor breakpoint"
+ }
+ -re ".*\n> $" {
+ gdb_test "0" \
+ "nonsense intended to insure that this test fails" \
+ "constructor breakpoint (bad menu choices)"
+ }
+ -re ".*$gdb_prompt $" { fail "constructor breakpoint" }
+ default { fail "constructor breakpoint (timeout)" }
+ }
+
+# See CLLbs14792
+ if {$hp_aCC_compiler} {setup_xfail hppa*-*-* CLLbs14792}
+ gdb_test "break T5<int>::~T5" \
+ "Breakpoint.*at.* file .*${testfile}.cc, line.*" \
+ "destructor breakpoint"
+
+ gdb_test "break T5<int>::value" \
+ "Breakpoint.*at.* file .*${testfile}.cc, line.*" \
+ "value method breakpoint"
+
+ delete_breakpoints
+}
+
+#
+# Test calling of template methods.
+#
+
+proc test_template_calls {} {
+ global gdb_prompt
+ global hp_aCC_compiler
+
+ if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ return
+ }
+
+ if {!$hp_aCC_compiler} {setup_xfail hppa*-*-*}
+ send_gdb "print t5i.value()\n"
+ gdb_expect {
+ -re ".* = 2\[\r\n\]*$gdb_prompt $" { pass "print t5i.value()" }
+ -re "Cannot invoke functions on this machine.*$gdb_prompt $" {
+ fail "print t5i.value()"
+ }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ xfail "print t5i.value"
+ }
+ -re ".*$gdb_prompt $" { fail "print t5i.value()" }
+ timeout { fail "print t5i.value() (timeout)" }
+ }
+}
+
+
+proc do_tests {} {
+ global prms_id
+ global bug_id
+ global subdir
+ global objdir
+ global srcdir
+ global binfile
+ global gdb_prompt
+ global supports_template_debugging
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ if { !$supports_template_debugging } {
+ warning "compiler lacks debugging info for templates; tests suppressed." 0
+ return
+ }
+
+ # Get the debug format for the compiled test case. If that
+ # format is DWARF 1 then just skip all the tests since none of
+ # them will pass.
+
+ if [ runto_main] then {
+ get_debug_format
+ if [ setup_xfail_format "DWARF 1" ] then {
+ fail "C++ tests skipped due to limited C++ support in DWARF 1 debug format"
+ return
+ }
+ clear_xfail "*-*-*"
+ }
+
+ test_ptype_of_templates
+ test_template_breakpoints
+
+ if [ runto_main] {
+ test_template_calls
+ }
+}
+
+do_tests
+
+
+# More tests for different kinds of template parameters,
+# templates with partial specializations, nested templates, etc.
+# These have been tested only with HP aCC. They probably won't
+# work with other compilers because of differences in mangling
+# schemes.
+# Added by Satish Pai <pai@apollo.hp.com> 1997-09-25
+# As of 2000-06-03, C++ support has been improved to the point that g++ can
+# pass all of theses, excluding what appears to be one that exposes a stabs bug. - djb
+
+# I don't know how HP could be passing these tests without this. They
+# weren't breakpointing past a point where the below expressions were
+# initialized in the actual source. - djb
+
+send_gdb "b 770\n"
+gdb_expect {
+ -re ".*$gdb_prompt $"
+}
+send_gdb "c\n"
+gdb_expect {
+ -re ".*$gdb_prompt $"
+}
+send_gdb "print fint\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{x = 0, t = 0\\}\r\n$gdb_prompt $" { pass "print fint" }
+ -re "$gdb_prompt $" { fail "print fint" }
+ timeout { fail "(timeout) print fint" }
+}
+
+send_gdb "print fvpchar\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{x = 0, t = 0x0\\}\r\n$gdb_prompt $" { pass "print fvpchar" }
+ -re "$gdb_prompt $" { fail "print fvpchar" }
+ timeout { fail "(timeout) print fvpchar" }
+}
+
+# Template Foo<T>
+
+setup_xfail hppa64-*-* CLLbs16092
+# g++ can't do the template instantiation in debug info trick, so we
+# fail this because it's not a real type.
+if {!$hp_aCC_compiler} { setup_xfail *-*-* }
+send_gdb "ptype Foo\n"
+gdb_expect {
+ -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Foo<volatile char \\*>\r\n\[ \t\]*(class |)Foo<char>\r\n\[ \t\]*(class |)Foo<int>\r\n$gdb_prompt $" { pass "ptype Foo" }
+ -re "type = template <(class |)T> (class |)Foo \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Foo" }
+ -re "$gdb_prompt $" { fail "ptype Foo" }
+ timeout { fail "(timeout) ptype Foo" }
+}
+
+# ptype Foo<int>
+
+send_gdb "ptype fint\n"
+gdb_expect {
+ -re "type = (class |)Foo<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int foo\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fint" }
+ -re "$gdb_prompt $" { fail "ptype fint" }
+ timeout { fail "(timeout) ptype fint" }
+}
+
+# ptype Foo<char>
+
+send_gdb "ptype fchar\n"
+gdb_expect {
+ -re "type = (class |)Foo<char> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*.*char foo\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fchar" }
+ -re "$gdb_prompt $" { fail "ptype fchar" }
+ timeout { fail "(timeout) ptype fchar" }
+}
+
+# ptype Foo<volatile char *>
+
+send_gdb "ptype fvpchar\n"
+gdb_expect {
+ -re "type = (class |)Foo<volatile char ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*char.*\\*t;\r\n\r\n\[ \t\]*.*char \\* foo\\(int,.*char.*\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype fvpchar" }
+ -re "$gdb_prompt $" { fail "ptype fvpchar" }
+ timeout { fail "(timeout) ptype fvpchar" }
+}
+
+# print a function from Foo<volatile char *>
+
+send_gdb "print Foo<volatile char *>::foo\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{.*char \\*\\((class |)Foo<volatile char \\*> \\*, int, .*char \\*\\)\\} $hex <Foo<.*char.*\\*>::foo\\(int, .*char.*\\*\\)>\r\n$gdb_prompt $" { pass "print Foo<volatile char *>::foo" }
+ -re "$gdb_prompt $" { fail "print Foo<volatile char *>::foo" }
+ timeout { fail "(timeout) print Foo<volatile char *>::foo" }
+}
+
+# Template Bar<T, int>
+
+setup_xfail hppa64-*-* CLLbs16092
+# same as Foo for g++
+if {!$hp_aCC_compiler} { setup_xfail *-*-* }
+send_gdb "ptype Bar\n"
+gdb_expect {
+ -re "type = template <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)1>\r\n\[ \t\]*(class |)Bar<int,(\\(int\\)|)33>\r\n$gdb_prompt $" { pass "ptype Bar" }
+ -re "type = <(class |)T, (class |)sz> (class |)Bar \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Bar" }
+ -re "$gdb_prompt $" { fail "ptype Bar" }
+ timeout { fail "(timeout) ptype Bar" }
+}
+
+
+# ptype Bar<int,33>
+
+send_gdb "ptype bint\n"
+gdb_expect {
+ -re "type = (class |)Bar<int,(\\(int\\)|)33> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int bar\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint" }
+ -re "$gdb_prompt $" { fail "ptype bint" }
+ timeout { fail "(timeout) ptype bint" }
+}
+
+# ptype Bar<int, (4>3)>
+
+send_gdb "ptype bint2\n"
+gdb_expect {
+ -re "type = (class |)Bar<int,(\\(int\\)|)1> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int bar\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bint2" }
+ -re "$gdb_prompt $" { fail "ptype bint2" }
+ timeout { fail "(timeout) ptype bint2" }
+}
+
+# Template Baz<T, char>
+
+setup_xfail hppa64-*-* CLLbs16092
+# Same as Foo, for g++
+if {!$hp_aCC_compiler} { setup_xfail *-*-* }
+send_gdb "ptype Baz\n"
+gdb_expect {
+ -re "type = template <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Baz<char,(\\(char\\)|)97>\r\n\[ \t\]*(class |)Baz<int,(\\(char\\)|)115>\r\n$gdb_prompt $" { pass "ptype Baz" }
+ -re "type = <(class |)T, (class |)sz> (class |)Baz \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Baz" }
+ -re "$gdb_prompt $" { fail "ptype Baz" }
+ timeout { fail "(timeout) ptype Baz" }
+}
+
+
+# ptype Baz<int, 's'>
+
+send_gdb "ptype bazint\n"
+gdb_expect {
+ -re "type = (class |)Baz<int,(\\(char\\)|)(115|\\'s\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int baz\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint" }
+ -re "$gdb_prompt $" { fail "ptype bazint" }
+ timeout { fail "(timeout) ptype bazint" }
+}
+
+# ptype Baz<char, 'a'>
+
+send_gdb "ptype bazint2\n"
+gdb_expect {
+ -re "type = (class |)Baz<char,(\\(char\\)|)(97|\\'a\\')> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*.*char baz\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype bazint2" }
+ -re "$gdb_prompt $" { fail "ptype bazint2" }
+ timeout { fail "(timeout) ptype bazint2" }
+}
+
+# Template Qux<T, int (*f)(int) >
+# Same as Foo for g++
+if {!$hp_aCC_compiler} {setup_xfail *-*-*}
+send_gdb "ptype Qux\n"
+gdb_expect {
+ -re "type = template <(class |)T, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Qux<int,&string>\r\n\[ \t\]*(class |)Qux<char,&string>\r\n$gdb_prompt $" { pass "ptype Qux" }
+ -re ".*type = template <(class |)T.*, (class |)sz> (class |)Qux \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*T t;\r\n\\}.*$gdb_prompt $" { pass "ptype Qux" }
+ -re "$gdb_prompt $" { fail "ptype Qux" }
+ timeout { fail "(timeout) ptype Qux" }
+}
+
+# pt Qux<int,&string>
+
+send_gdb "ptype quxint\n"
+gdb_expect {
+ -re "type = class Qux<int,&string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int qux\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint" }
+ -re "$gdb_prompt $" { fail "ptype quxint" }
+ timeout { fail "(timeout) ptype quxint" }
+}
+
+# pt Qux<char,0>
+
+# commented out this as quxint2 declaration was commented out in
+# templates.exp -- ovidiu
+# send_gdb "ptype quxint2\n"
+# gdb_expect {
+# -re "type = class Qux<char,&string> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*char t;\r\n\r\n\[ \t\]*char qux\\(int, char\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype quxint2" }
+# -re "$gdb_prompt $" { fail "ptype quxint2" }
+# timeout { fail "(timeout) ptype quxint2" }
+# }
+
+# Template Spec<T1, T2>
+
+setup_xfail hppa64-*-* CLLbs16092
+# Same as Foo for g++
+if {!$hp_aCC_compiler} { setup_xfail *-*-* }
+send_gdb "ptype Spec\n"
+gdb_expect {
+ -re "type = template <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\ntemplate instantiations:\r\n\[ \t\]*(class |)Spec<int,int \\*>\r\n\[ \t\]*(class |)Spec<int,char>\r\n$gdb_prompt $" { pass "ptype Spec" }
+ -re "type = <(class |)T1, (class |)T2> (class |)Spec \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\\}\r\n$gdb_prompt $" { xfail "ptype Spec" }
+ -re "$gdb_prompt $" { fail "ptype Spec" }
+ timeout { fail "(timeout) ptype Spec" }
+}
+
+# pt Spec<char,0>
+
+send_gdb "ptype siip\n"
+gdb_expect {
+ -re "type = class Spec<int,int ?\\*> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\r\n\[ \t\]*.*int spec\\(int ?\\*\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype siip" }
+ -re "$gdb_prompt $" { fail "ptype siip" }
+ timeout { fail "(timeout) ptype siip" }
+}
+
+# pt Garply<int>
+
+send_gdb "ptype Garply<int>\n"
+gdb_expect {
+ -re "type = class Garply<int> \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*int t;\r\n\r\n\[ \t\]*.*int garply\\(int, int\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply<int>" }
+ -re "$gdb_prompt $" { fail "ptype Garply<int>" }
+ timeout { fail "(timeout) ptype Garply<int>" }
+}
+
+# ptype of nested template name
+
+send_gdb "ptype Garply<Garply<char> >\n"
+gdb_expect {
+ -re "type = (class |)Garply<Garply<char> > \\{\r\n\[ \t\]*public:\r\n\[ \t\]*int x;\r\n\[ \t\]*.*(class |)Garply<char> t;\r\n\r\n\[ \t\]*.*(class |)Garply<char> garply\\(int, (class |)Garply<char>\\);\r\n\\}\r\n$gdb_prompt $" { pass "ptype Garply<Garply<char> >" }
+ -re "$gdb_prompt $" { fail "ptype Garply<Garply<char> >" }
+ timeout { fail "(timeout) ptype Garply<Garply<char> >" }
+}
+
+# print out a function from a nested template name
+
+send_gdb "print Garply<Garply<char> >::garply\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{(class |)Garply<char> \\((class |)Garply<Garply<char> > \\*, int, (class |)Garply<char>\\)\\} $hex <Garply<Garply<char>\[ \t\]*>::garply\\(int, (class |)Garply<char>\\)>\r\n$gdb_prompt $" { pass "print Garply<Garply<char> >::garply" }
+ -re ".*$gdb_prompt $" { fail "print Garply<Garply<char> >::garply" }
+ timeout { fail "print Garply<Garply<char> >::garply (timeout)" }
+}
+
+# djb - 06-03-2000
+# Now should work fine
+send_gdb "break Garply<Garply<char> >::garply\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]* at $hex: file .*templates.cc, line.*\r\n$gdb_prompt $" { pass "break Garply<Garply<char> >::garply" }
+ -re ".*$gdb_prompt $" { fail "break Garply<Garply<char> >::garply" }
+ timeout { fail "break Garply<Garply<char> >::garply (timeout)" }
+}
diff --git a/gdb/testsuite/gdb.c++/try_catch.cc b/gdb/testsuite/gdb.c++/try_catch.cc
new file mode 100644
index 00000000000..9a9c737b55d
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/try_catch.cc
@@ -0,0 +1,126 @@
+// 2002-05-27
+
+#include <exception>
+#include <stdexcept>
+#include <string>
+
+namespace __gnu_test
+{
+ enum region { oriental, egyptian, greek, etruscan, roman };
+
+ // Test one.
+ class gnu_obj_1
+ {
+ public:
+ typedef region antiquities;
+ const bool test;
+ const int key1;
+ long key2;
+
+ antiquities value;
+
+ gnu_obj_1(antiquities a, long l): test(true), key1(5), key2(l), value(a) {}
+ };
+
+ // Test two.
+ template<typename T>
+ class gnu_obj_2: public virtual gnu_obj_1
+ {
+ public:
+ antiquities value_derived;
+
+ gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { }
+ };
+
+ // Test three.
+ template<typename T>
+ class gnu_obj_3
+ {
+ public:
+ typedef region antiquities;
+ gnu_obj_2<int> data;
+
+ gnu_obj_3(antiquities b): data(etruscan) { }
+ };
+}
+
+int main()
+{
+ using namespace __gnu_test;
+
+ bool test = true;
+ const int i = 5;
+ int j = i;
+ gnu_obj_2<long> test2(roman);
+ gnu_obj_3<long> test3(greek);
+
+ // 1
+ try
+ {
+ ++j;
+ throw gnu_obj_1(egyptian, 4589);
+ }
+ catch (gnu_obj_1& obj)
+ {
+ ++j;
+ if (obj.value != egyptian)
+ test &= false;
+ if (obj.key2 != 4589)
+ test &= false;
+ }
+ catch (...)
+ {
+ j = 0;
+ test &= false;
+ }
+
+ // 2
+ try
+ {
+ ++j;
+ try
+ {
+ ++j;
+ try
+ {
+ ++j;
+ throw gnu_obj_1(egyptian, 4589);
+ }
+ catch (gnu_obj_1& obj)
+ {
+ ++j;
+ if (obj.value != egyptian)
+ test &= false;
+ if (obj.key2 != 4589)
+ test &= false;
+ }
+ }
+ catch (gnu_obj_1& obj)
+ {
+ ++j;
+ if (obj.value != egyptian)
+ test &= false;
+ if (obj.key2 != 4589)
+ test &= false;
+ }
+ }
+ catch (...)
+ {
+ j = 0;
+ test &= false;
+ }
+
+ // 3 use standard library
+ using namespace std;
+ try
+ {
+ if (j < 100)
+ throw invalid_argument("gdb.1");
+ }
+ catch (exception& obj)
+ {
+ if (obj.what() != "gdb.1")
+ test &= false;
+ }
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.c++/try_catch.exp b/gdb/testsuite/gdb.c++/try_catch.exp
new file mode 100644
index 00000000000..e024132b99e
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/try_catch.exp
@@ -0,0 +1,84 @@
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Tests for member data
+# 2002-05-27 Benjamin Kosnik <bkoz@redhat.com>
+
+# This file is part of the gdb testsuite
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { [skip_cplus_tests] } { continue }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "try_catch"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# One.
+
+gdb_test "break 61" "Breakpoint \[0-9\]*.*line 61\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:61\r\n.*" "continue to 61"
+
+gdb_test "break 66" "Breakpoint \[0-9\]*.*line 66\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:66\r\n.*" "continue to 66"
+
+gdb_test "break 80" "Breakpoint \[0-9\]*.*line 80\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:80\r\n.*" "continue to 80"
+
+gdb_test "break 83" "Breakpoint \[0-9\]*.*line 83\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:83\r\n.*" "continue to 83"
+
+gdb_test "break 87" "Breakpoint \[0-9\]*.*line 87\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:87\r\n.*" "continue to 87"
+
+gdb_test "break 92" "Breakpoint \[0-9\]*.*line 92\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:92\r\n.*" "continue to 92"
+
+gdb_test "break 118" "Breakpoint \[0-9\]*.*line 118\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:118\r\n.*" "continue to 118"
+
+gdb_test "break 122" "Breakpoint \[0-9\]*.*line 122\\."
+gdb_test "continue" "Continuing\\.\r\n\r\nBreakpoint.*at.*try_catch\\.cc:122\r\n.*" "continue to 122"
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.c++/userdef.cc b/gdb/testsuite/gdb.c++/userdef.cc
new file mode 100644
index 00000000000..95a40552718
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/userdef.cc
@@ -0,0 +1,341 @@
+#include <iostream>
+
+using namespace std;
+
+void marker1()
+{
+ return;
+}
+
+class A1 {
+ int x;
+ int y;
+
+friend ostream& operator<<(ostream& outs, A1 one);
+
+public:
+
+ A1(int a, int b)
+ {
+ x=a;
+ y=b;
+ }
+
+A1 operator+=(int value);
+A1 operator+(const A1&);
+A1 operator-(const A1&);
+A1 operator%(const A1&);
+int operator==(const A1&);
+int operator!=(const A1&);
+int operator&&(const A1&);
+int operator||(const A1&);
+A1 operator<<(int);
+A1 operator>>(int);
+A1 operator|(const A1&);
+A1 operator^(const A1&);
+A1 operator&(const A1&);
+int operator<(const A1&);
+int operator<=(const A1&);
+int operator>=(const A1&);
+int operator>(const A1&);
+A1 operator*(const A1&);
+A1 operator/(const A1&);
+A1 operator=(const A1&);
+
+A1 operator~();
+A1 operator-();
+int operator!();
+A1 operator++();
+A1 operator++(int);
+A1 operator--();
+A1 operator--(int);
+
+};
+
+
+A1 A1::operator+(const A1& second)
+{
+ A1 sum(0,0);
+ sum.x = x + second.x;
+ sum.y = y + second.y;
+
+ return (sum);
+}
+
+A1 A1::operator*(const A1& second)
+{
+ A1 product(0,0);
+ product.x = this->x * second.x;
+ product.y = this->y * second.y;
+
+ return product;
+}
+
+A1 A1::operator-(const A1& second)
+{
+ A1 diff(0,0);
+ diff.x = x - second.x;
+ diff.y = y - second.y;
+
+ return diff;
+}
+
+A1 A1::operator/(const A1& second)
+{
+ A1 div(0,0);
+ div.x = x / second.x;
+ div.y = y / second.y;
+
+ return div;
+}
+
+A1 A1::operator%(const A1& second)
+{
+ A1 rem(0,0);
+ rem.x = x % second.x;
+ rem.y = y % second.y;
+
+ return rem;
+}
+
+int A1::operator==(const A1& second)
+{
+ int a = (x == second.x);
+ int b = (y == second.y);
+
+ return (a && b);
+}
+
+int A1::operator!=(const A1& second)
+{
+ int a = (x != second.x);
+ int b = (y != second.y);
+
+ return (a || b);
+}
+
+int A1::operator&&(const A1& second)
+{
+ return ( x && second.x);
+}
+
+int A1::operator||(const A1& second)
+{
+ return ( x || second.x);
+}
+
+A1 A1::operator<<(int value)
+{
+ A1 lshft(0,0);
+ lshft.x = x << value;
+ lshft.y = y << value;
+
+ return lshft;
+}
+
+A1 A1::operator>>(int value)
+{
+ A1 rshft(0,0);
+ rshft.x = x >> value;
+ rshft.y = y >> value;
+
+ return rshft;
+}
+
+A1 A1::operator|(const A1& second)
+{
+ A1 abitor(0,0);
+ abitor.x = x | second.x;
+ abitor.y = y | second.y;
+
+ return abitor;
+}
+
+A1 A1::operator^(const A1& second)
+{
+ A1 axor(0,0);
+ axor.x = x ^ second.x;
+ axor.y = y ^ second.y;
+
+ return axor;
+}
+
+A1 A1::operator&(const A1& second)
+{
+ A1 abitand(0,0);
+ abitand.x = x & second.x;
+ abitand.y = y & second.y;
+
+ return abitand;
+}
+
+int A1::operator<(const A1& second)
+{
+ A1 b(0,0);
+ b.x = 3;
+ return (x < second.x);
+}
+
+int A1::operator<=(const A1& second)
+{
+ return (x <= second.x);
+}
+
+int A1::operator>=(const A1& second)
+{
+ return (x >= second.x);
+}
+
+int A1::operator>(const A1& second)
+{
+ return (x > second.x);
+}
+
+int A1::operator!(void)
+{
+ return (!x);
+}
+
+A1 A1::operator-(void)
+{
+ A1 neg(0,0);
+ neg.x = -x;
+ neg.y = -y;
+
+ return (neg);
+}
+
+A1 A1::operator~(void)
+{
+ A1 acompl(0,0);
+ acompl.x = ~x;
+ acompl.y = ~y;
+
+ return (acompl);
+}
+
+A1 A1::operator++() // pre increment
+{
+ x = x +1;
+
+ return (*this);
+}
+
+A1 A1::operator++(int) // post increment
+{
+ y = y +1;
+
+ return (*this);
+}
+
+A1 A1::operator--() // pre decrement
+{
+ x = x -1;
+
+ return (*this);
+}
+
+A1 A1::operator--(int) // post decrement
+{
+ y = y -1;
+
+ return (*this);
+}
+
+
+A1 A1::operator=(const A1& second)
+{
+
+ x = second.x;
+ y = second.y;
+
+ return (*this);
+}
+
+A1 A1::operator+=(int value)
+{
+
+ x += value;
+ y += value;
+
+ return (*this);
+}
+
+ostream& operator<<(ostream& outs, A1 one)
+{
+ return (outs << endl << "x = " << one.x << endl << "y = " << one.y << endl << "-------" << endl);
+}
+
+int main (void)
+{
+ A1 one(2,3);
+ A1 two(4,5);
+ A1 three(0,0);
+ int val;
+
+ marker1();
+ cout << one;
+ cout << two;
+ three = one + two;
+ cout << "+ " << three;
+ three = one - two;
+ cout << "- " << three;
+ three = one * two;
+ cout <<"* " << three;
+ three = one / two;
+ cout << "/ " << three;
+ three = one % two;
+ cout << "% " << three;
+ three = one | two;
+ cout << "| " <<three;
+ three = one ^ two;
+ cout << "^ " <<three;
+ three = one & two;
+ cout << "& "<< three;
+
+ val = one && two;
+ cout << "&& " << val << endl << "-----"<<endl;
+ val = one || two;
+ cout << "|| " << val << endl << "-----"<<endl;
+ val = one == two;
+ cout << " == " << val << endl << "-----"<<endl;
+ val = one != two;
+ cout << "!= " << val << endl << "-----"<<endl;
+ val = one >= two;
+ cout << ">= " << val << endl << "-----"<<endl;
+ val = one <= two;
+ cout << "<= " << val << endl << "-----"<<endl;
+ val = one < two;
+ cout << "< " << val << endl << "-----"<<endl;
+ val = one > two;
+ cout << "> " << val << endl << "-----"<<endl;
+
+ three = one << 2;
+ cout << "lsh " << three;
+ three = one >> 2;
+ cout << "rsh " << three;
+
+ three = one;
+ cout << " = "<< three;
+ three += 5;
+ cout << " += "<< three;
+
+ val = (!one);
+ cout << "! " << val << endl << "-----"<<endl;
+ three = (-one);
+ cout << "- " << three;
+ three = (~one);
+ cout << " ~" << three;
+ three++;
+ cout << "postinc " << three;
+ three--;
+ cout << "postdec " << three;
+
+ --three;
+ cout << "predec " << three;
+ ++three;
+ cout << "preinc " << three;
+
+ return 0;
+
+}
diff --git a/gdb/testsuite/gdb.c++/userdef.exp b/gdb/testsuite/gdb.c++/userdef.exp
new file mode 100644
index 00000000000..a46aba60564
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/userdef.exp
@@ -0,0 +1,131 @@
+# Tests of overloaded operators resolution.
+# Copyright 1998, 1999, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# written by Elena Zannoni (ezannoni@cygnus.com)
+#
+# source file "userdef.cc"
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "userdef"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+send_gdb "break marker1\n" ; gdb_expect -re ".*$gdb_prompt $"
+ send_gdb "cont\n"
+ gdb_expect {
+ -re "Break.* marker1(\\(\\)|) \\(\\) at .*:$decimal.*$gdb_prompt $" {
+ send_gdb "up\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" { pass "up from marker1" }
+ timeout { fail "up from marker1" }
+ }
+ }
+ -re "$gdb_prompt $" { fail "continue to marker1" }
+ timeout { fail "(timeout) continue to marker1" }
+ }
+
+
+gdb_test "print one + two" "\\\$\[0-9\]* = {x = 6, y = 8}"
+
+gdb_test "print one - two" "\\\$\[0-9\]* = {x = -2, y = -2}"
+
+gdb_test "print one * two" "\\\$\[0-9\]* = {x = 8, y = 15}"
+
+gdb_test "print one / two" "\\\$\[0-9\]* = {x = 0, y = 0}"
+
+gdb_test "print one % two" "\\\$\[0-9\]* = {x = 2, y = 3}"
+
+gdb_test "print one && two" "\\\$\[0-9\]* = 1\[\r\n\]"
+
+gdb_test "print one || two" "\\\$\[0-9\]* = 1\[\r\n\]"
+
+gdb_test "print one & two" "\\\$\[0-9\]* = {x = 0, y = 1}"
+
+gdb_test "print one | two" "\\\$\[0-9\]* = {x = 6, y = 7}"
+
+gdb_test "print one ^ two" "\\\$\[0-9\]* = {x = 6, y = 6}"
+
+gdb_test "print one < two" "\\\$\[0-9\]* = 1\[\r\n\]"
+
+gdb_test "print one <= two" "\\\$\[0-9\]* = 1\[\r\n\]"
+
+gdb_test "print one > two" "\\\$\[0-9\]* = 0\[\r\n\]"
+
+gdb_test "print one >= two" "\\\$\[0-9\]* = 0\[\r\n\]"
+
+gdb_test "print one == two" "\\\$\[0-9\]* = 0\[\r\n\]"
+
+gdb_test "print one != two" "\\\$\[0-9\]* = 1\[\r\n\]"
+
+# Can't really check the output of this one without knowing
+# target integer width. Make sure we don't try to call
+# the iostreams operator instead, though.
+gdb_test "print one << 31" "\\\$\[0-9\]* = {x = -?\[0-9\]*, y = -?\[0-9\]*}"
+
+# Should be fine even on < 32-bit targets.
+gdb_test "print one >> 31" "\\\$\[0-9\]* = {x = 0, y = 0}"
+
+gdb_test "print !one" "\\\$\[0-9\]* = 0\[\r\n\]"
+
+# Assumes 2's complement. So does everything...
+gdb_test "print ~one" "\\\$\[0-9\]* = {x = -3, y = -4}"
+
+gdb_test "print -one" "\\\$\[0-9\]* = {x = -2, y = -3}"
+
+gdb_test "print one++" "\\\$\[0-9\]* = {x = 2, y = 4}"
+
+gdb_test "print ++one" "\\\$\[0-9\]* = {x = 3, y = 4}"
+
+gdb_test "print one--" "\\\$\[0-9\]* = {x = 3, y = 3}"
+
+gdb_test "print --one" "\\\$\[0-9\]* = {x = 2, y = 3}"
+
+gdb_test "print one += 7" "\\\$\[0-9\]* = {x = 9, y = 10}"
+
+gdb_test "print two = one" "\\\$\[0-9\]* = {x = 9, y = 10}"
+
+# Check that GDB tolerates whitespace in operator names.
+gdb_test "break A1::'operator+'" ".*Breakpoint $decimal at.*"
+gdb_test "break A1::'operator +'" ".*Breakpoint $decimal at.*"
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.c++/virtfunc.cc b/gdb/testsuite/gdb.c++/virtfunc.cc
new file mode 100644
index 00000000000..005de9d0ea6
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/virtfunc.cc
@@ -0,0 +1,201 @@
+// Pls try the following program on virtual functions and try to do print on
+// most of the code in main(). Almost none of them works !
+
+//
+// The inheritance structure is:
+//
+// V : VA VB
+// A : (V)
+// B : A
+// D : AD (V)
+// C : (V)
+// E : B (V) D C
+//
+
+class VA
+{
+public:
+ int va;
+};
+
+class VB
+{
+public:
+ int vb;
+ int fvb();
+ virtual int vvb();
+};
+
+class V : public VA, public VB
+{
+public:
+ int f();
+ virtual int vv();
+ int w;
+};
+
+class A : virtual public V
+{
+public:
+ virtual int f();
+private:
+ int a;
+};
+
+class B : public A
+{
+public:
+ int f();
+private:
+ int b;
+};
+
+class C : public virtual V
+{
+public:
+ int c;
+};
+
+class AD
+{
+public:
+ virtual int vg() = 0;
+};
+
+class D : public AD, virtual public V
+{
+public:
+ static void s();
+ virtual int vg();
+ virtual int vd();
+ int fd();
+ int d;
+};
+
+class E : public B, virtual public V, public D, public C
+{
+public:
+ int f();
+ int vg();
+ int vv();
+ int e;
+};
+
+D dd;
+D* ppd = &dd;
+AD* pAd = &dd;
+
+A a;
+B b;
+C c;
+D d;
+E e;
+V v;
+VB vb;
+
+
+A* pAa = &a;
+A* pAe = &e;
+
+B* pBe = &e;
+
+D* pDd = &d;
+D* pDe = &e;
+
+V* pVa = &a;
+V* pVv = &v;
+V* pVe = &e;
+V* pVd = &d;
+
+AD* pADe = &e;
+
+E* pEe = &e;
+
+VB* pVB = &vb;
+
+void init()
+{
+ a.vb = 1;
+ b.vb = 2;
+ c.vb = 3;
+ d.vb = 4;
+ e.vb = 5;
+ v.vb = 6;
+ vb.vb = 7;
+
+ d.d = 1;
+ e.d = 2;
+}
+
+extern "C" int printf(const char *, ...);
+
+int all_count = 0;
+int failed_count = 0;
+
+#define TEST(EXPR, EXPECTED) \
+ ret = EXPR; \
+ if (ret != EXPECTED) {\
+ printf("Failed %s is %d, should be %d!\n", #EXPR, ret, EXPECTED); \
+ failed_count++; } \
+ all_count++;
+
+int ret;
+
+void test_calls()
+{
+ TEST(pAe->f(), 20);
+ TEST(pAa->f(), 1);
+
+ TEST(pDe->vg(), 202);
+ TEST(pADe->vg(), 202);
+ TEST(pDd->vg(), 101);
+
+ TEST(pEe->vvb(), 411);
+
+ TEST(pVB->vvb(), 407);
+
+ TEST(pBe->vvb(), 411);
+ TEST(pDe->vvb(), 411);
+
+ TEST(pEe->vd(), 282);
+ TEST(pEe->fvb(), 311);
+
+ TEST(pEe->D::vg(), 102);
+ printf("Did %d tests, of which %d failed.\n", all_count, failed_count);
+}
+#ifdef usestubs
+extern "C" {
+ void set_debug_traps();
+ void breakpoint();
+};
+#endif
+
+int main()
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ init();
+
+ e.w = 7;
+ e.vb = 11;
+
+ test_calls();
+ return 0;
+
+}
+
+int A::f() {return 1;}
+int B::f() {return 2;}
+void D::s() {}
+int E::f() {return 20;}
+int D::vg() {return 100+d;}
+int E::vg() {return 200+d;}
+int V::f() {return 600+w;}
+int V::vv() {return 400+w;}
+int E::vv() {return 450+w;}
+int D::fd() {return 250+d;}
+int D::vd() {return 280+d;}
+int VB::fvb() {return 300+vb;}
+int VB::vvb() {return 400+vb;}
diff --git a/gdb/testsuite/gdb.c++/virtfunc.exp b/gdb/testsuite/gdb.c++/virtfunc.exp
new file mode 100644
index 00000000000..e2befd35a98
--- /dev/null
+++ b/gdb/testsuite/gdb.c++/virtfunc.exp
@@ -0,0 +1,967 @@
+# Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+set ws "\[\r\n\t \]+"
+set nl "\[\r\n\]+"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "virtfunc"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1
+}
+
+source ${binfile}.ci
+
+set src "${srcdir}/${subdir}/${srcfile}"
+if { [gdb_compile "${src}" "${binfile}" executable {c++ debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc gdb_virtfunc_init {} {
+ global srcdir subdir binfile
+ global gdb_prompt
+
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ send_gdb "set language c++\n"
+ gdb_expect -re "$gdb_prompt $"
+ send_gdb "set width 0\n"
+ gdb_expect -re "$gdb_prompt $"
+}
+
+proc gdb_virtfunc_restart {} {
+ gdb_exit;
+ gdb_start;
+ gdb_virtfunc_init;
+ runto 'test_calls';
+}
+
+#
+# Test printing of the types of various classes.
+#
+
+proc test_ptype_of_classes {} {
+ global gdb_prompt
+ global ws
+ global nl
+
+ # This used to be a fail if it printed "struct" not "class". But
+ # since this struct doesn't use any special C++ features, it is
+ # considered right for GDB to print it as "struct".
+ send_gdb "ptype VA\n"
+ gdb_expect {
+ -re "type = (struct|class) VA \{(${ws}public:|)${ws}int va;${ws}VA & operator=\\(VA const ?&\\);${ws}VA\\((VA const|const VA) ?&\\);${ws}VA\\((void|)\\);${ws}\}.*$gdb_prompt $" {
+ pass "ptype VA"
+ }
+ -re "type = (struct|class) VA \{(${ws}public:|)${ws}int va;((${ws}VA & operator=\\(VA const ?&\\);)|(${ws}VA\\(VA const ?&\\);)|(${ws}VA\\((void|)\\);))*${ws}\}.*$gdb_prompt $" {
+ pass "ptype VA (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype VA"
+ }
+ timeout {
+ fail "ptype VA (timeout)"
+ }
+ }
+
+ send_gdb "ptype VB\n"
+ gdb_expect {
+ -re "type = class VB \{${ws}public:${ws}int vb;${ws}VB & operator=\\(VB const ?&\\);${ws}VB\\((VB const|const VB) ?&\\);${ws}VB\\((void|)\\);${ws}int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);${ws}\}.*$gdb_prompt $" {
+ pass "ptype VB"
+ }
+ -re "type = class VB \{${ws}public:${ws}int vb;${ws}int fvb \\((void|)\\);${ws}virtual int vvb \\((void|)\\);${ws}\}.*$gdb_prompt $" {
+ pass "ptype VB (aCC)"
+ }
+ -re "type = class VB \{${ws}public:${ws}int vb;((${ws}VB & operator=\\(VB const ?&\\);)|(${ws}VB\\(VB const ?&\\);)|(${ws}VB\\((void|)\\);)|(${ws}int fvb\\((void|)\\);)|(${ws}virtual int vvb\\((void|)\\);))*${ws}\}.*$gdb_prompt $" {
+ pass "ptype VB (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype VB"
+ }
+ timeout {
+ fail "ptype VB (timeout)"
+ }
+ }
+
+ send_gdb "ptype V\n"
+ gdb_expect {
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}V & operator=\\(V const ?&\\);${ws}V\\((V const|const V) ?&\\);${ws}V\\((void|)\\);${ws}int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype V"
+ }
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}int f \\((void|)\\);${ws}virtual int vv \\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype V (aCC)"
+ }
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;((${ws}V & operator=\\(V const ?&\\);)|(${ws}V\\(V const ?&\\);)|(${ws}V\\((void|)\\);)|(${ws}int f\\((void|)\\);)|(${ws}virtual int vv\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype V (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype V"
+ }
+ timeout {
+ fail "ptype V (timeout)"
+ }
+ }
+
+ # The format of a g++ virtual base pointer.
+ set vbptr "(_vb\[$.\]|__vb_)\[0-9\]?"
+
+ send_gdb "ptype A\n"
+ gdb_expect {
+ -re "type = class A : public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}int a;${ws}public:${ws}A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);${ws}virtual int f\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype A"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}int a;${ws}public:${ws}A & operator=\\(A const ?&\\);${ws}A\\((A const|const A) ?&\\);${ws}A\\((void|)\\);${ws}virtual int f\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype A"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}int a;${ws}public:${ws}virtual int f\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype A (aCC)"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}int a;${ws}public:((${ws}A & operator=\\(A const ?&\\);)|(${ws}A\\(int, A const ?&\\);)|(${ws}A\\(int\\);)|(${ws}virtual int f\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype A (obsolescent gcc or gdb)"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}V \\*${vbptr}FOO;${ws}int a;${ws}public:${ws}virtual int f.void.;${ws}\}$nl$gdb_prompt $" {
+ # This happens because the type is defined only after it is
+ # too late.
+ fail "ptype A (known failure with gcc cygnus-2.4.5-930417)"
+ # Many of the rest of these tests have the same problem.
+ return 0
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype A"
+ }
+ timeout {
+ fail "ptype A (timeout)"
+ }
+ }
+
+ send_gdb "ptype B\n"
+ gdb_expect {
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);${ws}virtual int f\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype B"
+ }
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}B & operator=\\(B const ?&\\);${ws}B\\((B const|const B) ?&\\);${ws}B\\((void|)\\);${ws}virtual int f\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype B"
+ }
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}virtual int f \\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype B (aCC)"
+ }
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:((${ws}B & operator=\\(B const ?&\\);)|(${ws}B\\(int, B const ?&\\);)|(${ws}B\\(int\\);)|(${ws}virtual int f\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype B (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype B"
+ }
+ timeout {
+ fail "ptype B (timeout)"
+ }
+ }
+
+ send_gdb "ptype C\n"
+ gdb_expect {
+ -re "type = class C : public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int c;${ws}C & operator=\\(C const ?&\\);${ws}C\\(int, C const ?&\\);${ws}C\\(int\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype C"
+ }
+ -re "type = class C : public virtual V \{${ws}public:${ws}int c;${ws}C & operator=\\(C const ?&\\);${ws}C\\((C const|const C) ?&\\);${ws}C\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype C"
+ }
+ -re "type = class C : public virtual V \{${ws}public:${ws}int c;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype C (aCC)"
+ }
+ -re "type = class C : public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int c;((${ws}C & operator=\\(C const ?&\\);)|(${ws}C\\(int, C const ?&\\);)|(${ws}C\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype C (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype C"
+ }
+ timeout {
+ fail "ptype C (timeout)"
+ }
+ }
+
+ send_gdb "ptype AD\n"
+ gdb_expect {
+ -re "type = class AD \{${ws}public:${ws}AD & operator=\\(AD const ?&\\);${ws}AD\\((AD const|const AD) ?&\\);${ws}AD\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype AD"
+ }
+ -re "type = class AD \{${ws}public:${ws}virtual int vg \\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype AD (aCC)"
+ }
+ -re "type = class AD \{${ws}public:((${ws}AD & operator=\\(AD const ?&\\);)|(${ws}AD\\(AD const ?&\\);)|(${ws}AD\\((void|)\\);)|(${ws}virtual int vg\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype AD (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype AD"
+ }
+ timeout {
+ fail "ptype AD (timeout)"
+ }
+ }
+
+ send_gdb "ptype D\n"
+ gdb_expect {
+ -re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int d;${ws}D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype D"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}D & operator=\\(D const ?&\\);${ws}D\\((D const|const D) ?&\\);${ws}D\\((void|)\\);${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype D"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype D (aCC)"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int d;((${ws}D & operator=\\(D const ?&\\);)|(${ws}D\\(int, D const ?&\\);)|(${ws}D\\(int\\);)|(${ws}static void s\\((void|)\\);)|(${ws}virtual int vg\\((void|)\\);)|(${ws}virtual int vd\\((void|)\\);)|(${ws}int fd\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype D (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype D"
+ }
+ timeout {
+ fail "ptype D (timeout)"
+ }
+ }
+
+ send_gdb "ptype E\n"
+ gdb_expect {
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);${ws}virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype E"
+ }
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}E & operator=\\(E const ?&\\);${ws}E\\((E const|const E) ?&\\);${ws}E\\((void|)\\);${ws}virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype E"
+ }
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}virtual int f \\((void|)\\);${ws}virtual int vg \\((void|)\\);${ws}virtual int vv \\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype E (aCC)"
+ }
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;((${ws}E & operator=\\(E const ?&\\);)|(${ws}E\\(int, E const ?&\\);)|(${ws}E\\(int\\);)|(${ws}virtual int f\\((void|)\\);)|(${ws}virtual int vg\\((void|)\\);)|(${ws}virtual int vv\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype E (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype E"
+ }
+ timeout {
+ fail "ptype E (timeout)"
+ }
+ }
+
+ send_gdb "ptype dd\n"
+ gdb_expect {
+ -re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int d;${ws}D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype dd"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}D & operator=\\(D const ?&\\);${ws}D\\((D const|const D) ?&\\);${ws}D\\((void|)\\);${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype dd"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype dd (aCC)"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int d;((${ws}D & operator=\\(D const ?&\\);)|(${ws}D\\(int, D const ?&\\);)|(${ws}D\\(int\\);)|(${ws}static void s\\((void|)\\);)|(${ws}virtual int vg\\((void|)\\);)|(${ws}virtual int vd\\((void|)\\);)|(${ws}int fd\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype dd (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype dd"
+ }
+ timeout {
+ fail "ptype dd (timeout)"
+ }
+ }
+
+ send_gdb "ptype ppd\n"
+ gdb_expect {
+ -re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int d;${ws}D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype ppd"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}D & operator=\\(D const ?&\\);${ws}D\\((D const|const D) ?&\\);${ws}D\\((void|)\\);${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype ppd"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype ppd (aCC)"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int d;((${ws}D & operator=\\(D const ?&\\);)|(${ws}D\\(int, D const ?&\\);)|(${ws}D\\(int\\);)|(${ws}static void s\\((void|)\\);)|(${ws}virtual int vg\\((void|)\\);)|(${ws}virtual int vd\\((void|)\\);)|(${ws}int fd\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype ppd (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype ppd"
+ }
+ timeout {
+ fail "ptype ppd (timeout)"
+ }
+ }
+
+ send_gdb "ptype pAd\n"
+ gdb_expect {
+ -re "type = class AD \{${ws}public:${ws}AD & operator=\\(AD const ?&\\);${ws}AD\\((AD const|const AD) ?&\\);${ws}AD\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAd"
+ }
+ -re "type = class AD \{${ws}public:${ws}virtual int vg \\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAd (aCC)"
+ }
+ -re "type = class AD \{${ws}public:((${ws}AD & operator=\\(AD const ?&\\);)|(${ws}AD\\(AD const ?&\\);)|(${ws}AD\\((void|)\\);)|(${ws}virtual int vg\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAd (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pAd"
+ }
+ timeout {
+ fail "ptype pAd (timeout)"
+ }
+ }
+
+ send_gdb "ptype a\n"
+ gdb_expect {
+ -re "type = class A : public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}int a;${ws}public:${ws}A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);${ws}virtual int f\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype a"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}int a;${ws}public:${ws}A & operator=\\(A const ?&\\);${ws}A\\((A const|const A) ?&\\);${ws}A\\((void|)\\);${ws}virtual int f\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype a"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}int a;${ws}public:${ws}virtual int f\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype a (aCC)"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}int a;${ws}public:((${ws}A & operator=\\(A const ?&\\);)|(${ws}A\\(int, A const ?&\\);)|(${ws}A\\(int\\);)|(${ws}virtual int f\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype a (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype a"
+ }
+ timeout {
+ fail "ptype a (timeout)"
+ }
+ }
+
+ send_gdb "ptype b\n"
+ gdb_expect {
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);${ws}virtual int f\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype b"
+ }
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}B & operator=\\(B const ?&\\);${ws}B\\((B const|const B) ?&\\);${ws}B\\((void|)\\);${ws}virtual int f\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype b"
+ }
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}virtual int f \\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype b (aCC)"
+ }
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:((${ws}B & operator=\\(B const ?&\\);)|(${ws}B\\(int, B const ?&\\);)|(${ws}B\\(int\\);)|(${ws}virtual int f\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype b (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype b"
+ }
+ timeout {
+ fail "ptype b (timeout)"
+ }
+ }
+
+ send_gdb "ptype c\n"
+ gdb_expect {
+ -re "type = class C : public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int c;${ws}C & operator=\\(C const ?&\\);${ws}C\\(int, C const ?&\\);${ws}C\\(int\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype c"
+ }
+ -re "type = class C : public virtual V \{${ws}public:${ws}int c;${ws}C & operator=\\(C const ?&\\);${ws}C\\((C const|const C) ?&\\);${ws}C\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype c"
+ }
+ -re "type = class C : public virtual V \{${ws}public:${ws}int c;${ws}\}$nl$gdb_prompt $" {
+ pass "ptype c (aCC)"
+ }
+ -re "type = class C : public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int c;((${ws}C & operator=\\(C const ?&\\);)|(${ws}C\\(int, C const ?&\\);)|(${ws}C\\(int\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype c (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype c"
+ }
+ timeout {
+ fail "ptype c (timeout)"
+ }
+ }
+
+ send_gdb "ptype d\n"
+ gdb_expect {
+ -re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int d;${ws}D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype d"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}D & operator=\\(D const ?&\\);${ws}D\\((D const|const D) ?&\\);${ws}D\\((void|)\\);${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype d"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype d (aCC)"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int d;((${ws}D & operator=\\(D const ?&\\);)|(${ws}D\\(int, D const ?&\\);)|(${ws}D\\(int\\);)|(${ws}static void s\\((void|)\\);)|(${ws}virtual int vg\\((void|)\\);)|(${ws}virtual int vd\\((void|)\\);)|(${ws}int fd\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype d (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype d"
+ }
+ timeout {
+ fail "ptype d (timeout)"
+ }
+ }
+
+ send_gdb "ptype e\n"
+ gdb_expect {
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);${ws}virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype e"
+ }
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}E & operator=\\(E const ?&\\);${ws}E\\((E const|const E) ?&\\);${ws}E\\((void|)\\);${ws}virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype e"
+ }
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}virtual int f \\((void|)\\);${ws}virtual int vg \\((void|)\\);${ws}virtual int vv \\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype e (aCC)"
+ }
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;((${ws}E & operator=\\(E const ?&\\);)|(${ws}E\\(int, E const ?&\\);)|(${ws}E\\(int\\);)|(${ws}virtual int f\\((void|)\\);)|(${ws}virtual int vg\\((void|)\\);)|(${ws}virtual int vv\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype e (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype e"
+ }
+ timeout {
+ fail "ptype e (timeout)"
+ }
+ }
+
+ send_gdb "ptype v\n"
+ gdb_expect {
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}V & operator=\\(V const ?&\\);${ws}V\\((V const|const V) ?&\\);${ws}V\\((void|)\\);${ws}int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype v"
+ }
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}int f \\((void|)\\);${ws}virtual int vv \\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype v (aCC)"
+ }
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;((${ws}V & operator=\\(V const ?&\\);)|(${ws}V\\(V const ?&\\);)|(${ws}V\\((void|)\\);)|(${ws}int f\\((void|)\\);)|(${ws}virtual int vv\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype v (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype v"
+ }
+ timeout {
+ fail "ptype v (timeout)"
+ }
+ }
+
+ send_gdb "ptype vb\n"
+ gdb_expect {
+ -re "type = class VB \{${ws}public:${ws}int vb;${ws}VB & operator=\\(VB const ?&\\);${ws}VB\\((VB const|const VB) ?&\\);${ws}VB\\((void|)\\);${ws}int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype vb"
+ }
+ -re "type = class VB \{${ws}public:${ws}int vb;${ws}int fvb \\((void|)\\);${ws}virtual int vvb \\((void|)\\);${ws}\}$nl$gdb_prompt $" {
+ pass "ptype vb (aCC)"
+ }
+ -re "type = class VB \{${ws}public:${ws}int vb;((${ws}VB & operator=\\(VB const ?&\\);)|(${ws}VB\\(VB const ?&\\);)|(${ws}VB\\((void|)\\);)|(${ws}int fvb\\((void|)\\);)|(${ws}virtual int vvb\\((void|)\\);))*${ws}\}$nl$gdb_prompt $" {
+ pass "ptype vb (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype vb"
+ }
+ timeout {
+ fail "ptype vb (timeout)"
+ }
+ }
+
+ send_gdb "ptype pAa\n"
+ gdb_expect {
+ -re "type = class A : public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}int a;${ws}public:${ws}A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);${ws}virtual int f\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAa"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}int a;${ws}public:${ws}A & operator=\\(A const ?&\\);${ws}A\\((A const|const A) ?&\\);${ws}A\\((void|)\\);${ws}virtual int f\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAa"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}int a;${ws}public:${ws}virtual int f\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAa (aCC)"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}int a;${ws}public:((${ws}A & operator=\\(A const ?&\\);)|(${ws}A\\(int, A const ?&\\);)|(${ws}A\\(int\\);)|(${ws}virtual int f\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAa (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pAa"
+ }
+ timeout {
+ fail "ptype pAa (timeout)"
+ }
+ }
+
+ send_gdb "ptype pAe\n"
+ gdb_expect {
+ -re "type = class A : public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}int a;${ws}public:${ws}A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);${ws}virtual int f\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAe"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}int a;${ws}public:${ws}A & operator=\\(A const ?&\\);${ws}A\\((A const|const A) ?&\\);${ws}A\\((void|)\\);${ws}virtual int f\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAe"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}int a;${ws}public:${ws}virtual int f\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAe (aCC)"
+ }
+ -re "type = class A : public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}int a;${ws}public:((${ws}A & operator=\\(A const ?&\\);)|(${ws}A\\(int, A const ?&\\);)|(${ws}A\\(int\\);)|(${ws}virtual int f\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pAe (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pAe"
+ }
+ timeout {
+ fail "ptype pAe (timeout)"
+ }
+ }
+
+ send_gdb "ptype pBe\n"
+ gdb_expect {
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);${ws}virtual int f\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pBe"
+ }
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}B & operator=\\(B const ?&\\);${ws}B\\((B const|const B) ?&\\);${ws}B\\((void|)\\);${ws}virtual int f\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pBe"
+ }
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:${ws}virtual int f \\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pBe (aCC)"
+ }
+ -re "type = class B : public A \{${ws}private:${ws}int b;${ws}public:((${ws}B & operator=\\(B const ?&\\);)|(${ws}B\\(int, B const ?&\\);)|(${ws}B\\(int\\);)|(${ws}virtual int f\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pBe (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pBe"
+ }
+ timeout {
+ fail "ptype pBe (timeout)"
+ }
+ }
+
+ send_gdb "ptype pDd\n"
+ gdb_expect {
+ -re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int d;${ws}D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pDd"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}D & operator=\\(D const ?&\\);${ws}D\\((D const|const D) ?&\\);${ws}D\\((void|)\\);${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pDd"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pDd (aCC)"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int d;((${ws}D & operator=\\(D const ?&\\);)|(${ws}D\\(int, D const ?&\\);)|(${ws}D\\(int\\);)|(${ws}static void s\\((void|)\\);)|(${ws}virtual int vg\\((void|)\\);)|(${ws}virtual int vd\\((void|)\\);)|(${ws}int fd\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pDd (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pDd"
+ }
+ timeout {
+ fail "ptype pDd (timeout)"
+ }
+ }
+
+ send_gdb "ptype pDe\n"
+ gdb_expect {
+ -re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int d;${ws}D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pDe"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}D & operator=\\(D const ?&\\);${ws}D\\((D const|const D) ?&\\);${ws}D\\((void|)\\);${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pDe"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}public:${ws}int d;${ws}static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pDe (aCC)"
+ }
+ -re "type = class D : public AD, public virtual V \{${ws}private:${ws}V \\*${vbptr}V;${ws}public:${ws}int d;((${ws}D & operator=\\(D const ?&\\);)|(${ws}D\\(int, D const ?&\\);)|(${ws}D\\(int\\);)|(${ws}static void s\\((void|)\\);)|(${ws}virtual int vg\\((void|)\\);)|(${ws}virtual int vd\\((void|)\\);)|(${ws}int fd\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pDe (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pDe"
+ }
+ timeout {
+ fail "ptype pDe (timeout)"
+ }
+ }
+
+ send_gdb "ptype pVa\n"
+ gdb_expect {
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}V & operator=\\(V const ?&\\);${ws}V\\((V const|const V) ?&\\);${ws}V\\((void|)\\);${ws}int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVa"
+ }
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}int f \\((void|)\\);${ws}virtual int vv \\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVa (aCC)"
+ }
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;((${ws}V & operator=\\(V const ?&\\);)|(${ws}V\\(V const ?&\\);)|(${ws}V\\((void|)\\);)|(${ws}int f\\((void|)\\);)|(${ws}virtual int vv\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVa (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pVa"
+ }
+ timeout {
+ fail "ptype pVa (timeout)"
+ }
+ }
+
+ send_gdb "ptype pVv\n"
+ gdb_expect {
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}V & operator=\\(V const ?&\\);${ws}V\\((V const|const V) ?&\\);${ws}V\\((void|)\\);${ws}int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVv"
+ }
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}int f \\((void|)\\);${ws}virtual int vv \\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVv (aCC)"
+ }
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;((${ws}V & operator=\\(V const ?&\\);)|(${ws}V\\(V const ?&\\);)|(${ws}V\\((void|)\\);)|(${ws}int f\\((void|)\\);)|(${ws}virtual int vv\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVv (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pVv"
+ }
+ timeout {
+ fail "ptype pVv (timeout)"
+ }
+ }
+
+ send_gdb "ptype pVe\n"
+ gdb_expect {
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}V & operator=\\(V const ?&\\);${ws}V\\((V const|const V) ?&\\);${ws}V\\((void|)\\);${ws}int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVe"
+ }
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}int f \\((void|)\\);${ws}virtual int vv \\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVe (aCC)"
+ }
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;((${ws}V & operator=\\(V const ?&\\);)|(${ws}V\\(V const ?&\\);)|(${ws}V\\((void|)\\);)|(${ws}int f\\((void|)\\);)|(${ws}virtual int vv\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVe (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pVe"
+ }
+ timeout {
+ fail "ptype pVe (timeout)"
+ }
+ }
+
+ send_gdb "ptype pVd\n"
+ gdb_expect {
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}V & operator=\\(V const ?&\\);${ws}V\\((V const|const V) ?&\\);${ws}V\\((void|)\\);${ws}int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVd"
+ }
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;${ws}int f \\((void|)\\);${ws}virtual int vv \\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVd (aCC)"
+ }
+ -re "type = class V : public VA, public VB \{${ws}public:${ws}int w;((${ws}V & operator=\\(V const ?&\\);)|(${ws}V\\(V const ?&\\);)|(${ws}V\\((void|)\\);)|(${ws}int f\\((void|)\\);)|(${ws}virtual int vv\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVd (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pVd"
+ }
+ timeout {
+ fail "ptype pVd (timeout)"
+ }
+ }
+
+ send_gdb "ptype pADe\n"
+ gdb_expect {
+ -re "type = class AD \{${ws}public:${ws}AD & operator=\\(AD const ?&\\);${ws}AD\\((AD const|const AD) ?&\\);${ws}AD\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pADe"
+ }
+ -re "type = class AD \{${ws}public:${ws}virtual int vg \\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pADe (aCC)"
+ }
+ -re "type = class AD \{${ws}public:((${ws}AD & operator=\\(AD const ?&\\);)|(${ws}AD\\(AD const ?&\\);)|(${ws}AD\\((void|)\\);)|(${ws}virtual int vg\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pADe (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pADe"
+ }
+ timeout {
+ fail "ptype pADe (timeout)"
+ }
+ }
+
+ send_gdb "ptype pEe\n"
+ gdb_expect {
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);${ws}virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pEe"
+ }
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}E & operator=\\(E const ?&\\);${ws}E\\((E const|const E) ?&\\);${ws}E\\((void|)\\);${ws}virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pEe"
+ }
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;${ws}virtual int f \\((void|)\\);${ws}virtual int vg \\((void|)\\);${ws}virtual int vv \\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pEe (aCC)"
+ }
+ -re "type = class E : public B, public virtual V, public D, public C \{${ws}public:${ws}int e;((${ws}E & operator=\\(E const ?&\\);)|(${ws}E\\(int, E const ?&\\);)|(${ws}E\\(int\\);)|(${ws}virtual int f\\((void|)\\);)|(${ws}virtual int vg\\((void|)\\);)|(${ws}virtual int vv\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pEe (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pEe"
+ }
+ timeout {
+ fail "ptype pEe (timeout)"
+ }
+ }
+
+ send_gdb "ptype pVB\n"
+ gdb_expect {
+ -re "type = class VB \{${ws}public:${ws}int vb;${ws}VB & operator=\\(VB const ?&\\);${ws}VB\\((VB const|const VB) ?&\\);${ws}VB\\((void|)\\);${ws}int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVB"
+ }
+ -re "type = class VB \{${ws}public:${ws}int vb;${ws}int fvb \\((void|)\\);${ws}virtual int vvb \\((void|)\\);${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVB (aCC)"
+ }
+ -re "type = class VB \{${ws}public:${ws}int vb;((${ws}VB & operator=\\(VB const ?&\\);)|(${ws}VB\\(VB const ?&\\);)|(${ws}VB\\((void|)\\);)|(${ws}int fvb\\((void|)\\);)|(${ws}virtual int vvb\\((void|)\\);))*${ws}\} \[*\]+$nl$gdb_prompt $" {
+ pass "ptype pVB (obsolescent gcc or gdb)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "ptype pVB"
+ }
+ timeout {
+ fail "ptype pVB (timeout)"
+ }
+ }
+}
+
+#
+# Test calling of virtual functions.
+#
+
+proc test_virtual_calls {} {
+ global gdb_prompt
+ global GDB
+ global nl
+ global gcc_compiled
+
+ if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ return 0
+ }
+
+ send_gdb "print pAe->f()\n"
+ gdb_expect {
+ -re ".* = 20$nl$gdb_prompt $" { pass "print pAe->f()" }
+ -re "Cannot invoke functions on this machine.*$gdb_prompt $" {
+ fail "print pAe->f() (cannot invoke functions, skipping virtual calls)"
+ return 0
+ }
+ -re ".*Cannot access memory at address 0x8.*$gdb_prompt $" {
+ fail "print pAe->f() \
+(known failure with gcc cygnus-2.4.5-930417, skipping virtual calls)"
+ return 0
+ }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pAe->f()"
+ }
+ -re ".*$gdb_prompt $" { fail "print pAe->f()" }
+ timeout { fail "print pAe->f() (timeout)" }
+ eof { fail "print pAe->f() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
+ }
+
+ send_gdb "print pAa->f()\n"
+ gdb_expect {
+ -re ".* = 1$nl$gdb_prompt $" { pass "print pAa->f()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pAa->f()"
+ }
+ -re ".*$gdb_prompt $" { fail "print pAa->f()" }
+ timeout { fail "print pAa->f() (timeout)" }
+ eof { fail "print pAa->f() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
+ }
+
+ send_gdb "print pDe->vg()\n"
+ gdb_expect {
+ -re ".* = 202$nl$gdb_prompt $" { pass "print pDe->vg()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pDe->vg()"
+ }
+ -re ".*$gdb_prompt $" { fail "print pDe->vg()" }
+ timeout { fail "print pDe->vg() (timeout)" }
+ eof { fail "print pDe->vg() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
+ }
+
+ send_gdb "print pADe->vg()\n"
+ gdb_expect {
+ -re ".* = 202$nl$gdb_prompt $" { pass "print pADe->vg()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pADe->vg()"
+ }
+ -re ".*$gdb_prompt $" { fail "print pADe->vg()" }
+ timeout { fail "print pADe->vg() (timeout)" }
+ eof { fail "print pADe->vg() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
+ }
+
+ send_gdb "print pDd->vg()\n"
+ gdb_expect {
+ -re ".* = 101$nl$gdb_prompt $" { pass "print pDd->vg()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pDd->vg()"
+ }
+ -re ".*$gdb_prompt $" { fail "print pDd->vg()" }
+ timeout { fail "print pDd->vg() (timeout)" }
+ eof { fail "print pDd->vg() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
+ }
+
+ send_gdb "print pEe->vvb()\n"
+ gdb_expect {
+ -re ".* = 411$nl$gdb_prompt $" { pass "print pEe->vvb()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pEe->vvb()"
+ }
+ -re ".*$gdb_prompt $" { fail "print pEe->vvb()" }
+ timeout { fail "print pEe->vvb() (timeout)" }
+ eof { fail "print pEe->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
+ }
+
+ send_gdb "print pVB->vvb()\n"
+ gdb_expect {
+ -re ".* = 407$nl$gdb_prompt $" { pass "print pVB->vvb()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pVB->vvb()"
+ }
+ -re ".*$gdb_prompt $" { fail "print pVB->vvb()" }
+ timeout { fail "print pVB->vvb() (timeout)" }
+ eof { fail "print pVB->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
+ }
+
+ # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
+ # gdb=HEAD%2002-02-16, gcc=2.95.3, goption=-gdwarf-2.
+ # -- chastain 2002-02-20
+
+ if {$gcc_compiled} then { setup_xfail "*-*-*" }
+
+ send_gdb "print pBe->vvb()\n"
+ gdb_expect {
+ -re ".* = 411$nl$gdb_prompt $" { pass "print pBe->vvb()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pBe->vvb()"
+ }
+ -re ".*$gdb_prompt $" { fail "print pBe->vvb()" }
+ timeout { fail "print pBe->vvb() (timeout)" }
+ eof { fail "print pBe->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
+ }
+
+ send_gdb "print pDe->vvb()\n"
+ gdb_expect {
+ -re ".* = 411$nl$gdb_prompt $" { pass "print pDe->vvb()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pDe->vvb()"
+ }
+ -re ".*$gdb_prompt $" { fail "print pDe->vvb()" }
+ timeout { fail "print pDe->vvb() (timeout)" }
+ eof { fail "print pDe->vvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
+ }
+
+ send_gdb "print pEe->vd()\n"
+ gdb_expect {
+ -re ".* = 282$nl$gdb_prompt $" { pass "print pEe->vd()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pEe->vd()"
+ }
+ -re ".*$gdb_prompt $" { fail "print pEe->vd()" }
+ timeout { fail "print pEe->vd() (timeout)" }
+ eof { fail "print pEe->vd() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
+ }
+
+ send_gdb "print pEe->fvb()\n"
+ gdb_expect {
+ -re ".* = 311$nl$gdb_prompt $" { pass "print pEe->fvb()" }
+ -re "Cannot resolve .* to any overloaded instance.*$gdb_prompt $" {
+ setup_xfail hppa*-*-* CLLbs16899
+ fail "print pEe->fvb()"
+ }
+ -re ".*$gdb_prompt $" { fail "print pEe->fvb()" }
+ timeout { fail "print pEe->fvb() (timeout)" }
+ eof { fail "print pEe->fvb() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
+ }
+
+ # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
+ # gdb=HEAD%2002-02-16, gcc=2.95.3, goption=-gdwarf-2.
+ #
+ # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
+ # gdb=HEAD%2002-02-16, gcc=2.95.3, goption=-gstabs+.
+ #
+ # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
+ # gdb=HEAD%2002-02-16, gcc=3.0.3, goption=-gdwarf-2.
+ #
+ # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
+ # gdb=HEAD%2002-02-16, gcc=3.0.3, goption=-gstabs+.
+ #
+ # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
+ # gdb=HEAD%2002-02-16, gcc=3.0.4-20020215, goption=-gdwarf-2.
+ #
+ # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
+ # gdb=HEAD%2002-02-16, gcc=3.0.4-20020215, goption=-gstabs+.
+ #
+ # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
+ # gdb=HEAD%2002-02-16, gcc=gcc-3_0-branch%2002-02-16, goption=-gdwarf-2.
+ #
+ # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
+ # gdb=HEAD%2002-02-16, gcc=gcc-3_0-branch%2002-02-16, goption=-gstabs+.
+ #
+ # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
+ # gdb=HEAD%2002-02-16, gcc=HEAD%2002-02-16, goption=-gdwarf-2.
+ #
+ # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
+ # gdb=HEAD%2002-02-16, gcc=HEAD%2002-02-16, goption=-gstabs+.
+ #
+ # -- chastain 2002-02-20
+
+ if {$gcc_compiled} then { setup_xfail "*-*-*" }
+
+ send_gdb "print pEe->D::vg()\n"
+ setup_xfail "*-*-*"
+ gdb_expect {
+ -re ".* = 102$nl$gdb_prompt $" { pass "print pEe->D::vg()" }
+ -re ".*$gdb_prompt $" { fail "print pEe->D::vg()" }
+ timeout { fail "print pEe->D::vg() (timeout)" }
+ eof { fail "print pEe->D::vg() ($GDB dumped core) (FIXME)" ; gdb_virtfunc_restart; return }
+ }
+}
+
+proc do_tests {} {
+ global prms_id
+ global bug_id
+
+ set prms_id 0
+ set bug_id 0
+
+ gdb_start;
+ gdb_virtfunc_init;
+
+ # Get the debug format for the compiled test case. If that
+ # format is DWARF 1 then just skip all the tests since none of
+ # them will pass.
+
+ if [ runto_main ] then {
+ get_debug_format
+ if [ setup_xfail_format "DWARF 1" ] then {
+ fail "C++ tests skipped due to limited C++ support in DWARF 1 debug format"
+ return
+ }
+ clear_xfail "*-*-*"
+ }
+
+ test_ptype_of_classes
+
+ if [ runto 'test_calls' ] then {
+ test_virtual_calls
+ }
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/ChangeLog b/gdb/testsuite/gdb.chill/ChangeLog
new file mode 100644
index 00000000000..51a24df26a8
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/ChangeLog
@@ -0,0 +1,331 @@
+2001-03-06 Kevin Buettner <kevinb@redhat.com>
+
+ * builtins.exp, callch.exp, chexp.exp, chillvars.exp,
+ enum.exp, gch1041.exp, gch1272.exp, gch1280.exp, gch922.exp,
+ gch981.exp, misc.exp, powerset.exp, pr-4975.exp, pr-5016.exp,
+ pr-5020.exp, pr-5022.exp, pr-5646.exp, pr-5984.exp,
+ pr-6292.exp, pr-6632.exp, pr-8134.exp, pr-8136.exp,
+ pr-8405.exp, pr-8742.exp, pr-8894.exp, pr-9095.exp,
+ pr-9946.exp, result.exp, string.exp, tests1.ch, tests1.exp,
+ tests2.ch, tests2.exp, tuples.exp, xstruct.exp: Update/correct
+ copyright notices.
+
+1999-06-25 Stan Shebs <shebs@andros.cygnus.com>
+
+ From Jimmy Guo <guo@cup.hp.com>:
+ * xstruct-grt.ch, xstruct.ch, xstruct.exp: Rename to mollify
+ doschk.
+
+Thu May 21 02:45:18 1998 Felix Lee <flee@zog.cygnus.com>
+
+ * chexp.exp: fix tests that assume >16-bit ints.
+
+Wed Sep 10 15:01:55 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * *.exp: The end-all be-all of quoting fixes. Ha.
+
+Thu Aug 21 10:31:23 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * enum.exp: More quoting fixes.
+ * pr-9946.exp: Ditto.
+ * gch1280.exp: Ditto.
+ * gch1272.exp: Ditto.
+
+Tue Aug 12 21:48:08 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * tests2.exp: Fix quoting.
+ * tests1.exp: Ditto.
+ * pr-9946.exp: Ditto.
+ * enum.exp: Ditto.
+ * builtins.exp: Ditto.
+ * powerset.exp: Ditto.
+ * misc.exp: Ditto.
+ * gch981.exp: Ditto.
+ * gch922.exp: Ditto.
+ * gch1280.exp: Ditto.
+ * gch1272.exp: Ditto.
+ * gch1041.exp: Ditto.
+
+Sat Nov 23 14:00:59 1996 Fred Fish <fnf@cygnus.com>
+
+ * misc.exp: Change x86 linux setup_xfails to use new
+ i*86-pc-linux*-gnu quads.
+ * tuples.exp: Ditto.
+ * tests2.exp: Ditto.
+ * pr-5016.exp: Ditto.
+
+ * tuples.exp: Add i*86-pc-linux-gnu setup_fail to existing
+ xfails for 'set var vs1 := [ "bar", 42, m_ps[ a ] ]',
+ 'set var $i := m_s1["foo", 44, m_ps[a ]]', and
+ 'set var vs2 := [ 10+3, m_s1[ "foo" , 42, m_ps[ b ]]]'.
+
+Mon Nov 11 10:27:32 1996 Fred Fish <fnf@cygnus.com>
+
+ * callch.exp: Add mips*-sgi-irix* xfail for
+ "call king(a, otto[[10, 15], [20, 25]])".
+ * pr-8742.exp: Add mips*-sgi-irix* xfails for
+ "pass int powerset tuple"
+ "pass set powerset tuple"
+ "pass modeless int powerset tuple" and
+ "pass modeless set powerset tuple".
+ * tuples.exp: Add sparc-*-solaris* and sparc-*-sunos*
+ xfails for several "set var" commands that are failing.
+ Convert most of the set commands into gdb_test_exact
+ commands.
+
+Fri Oct 11 16:48:56 1996 Fred Fish <fnf@cygnus.com>
+
+ * expstruct.exp (objfile2): Set and use, like other chill tests.
+ * pr-4975.exp: Ditto.
+ * pr-5646.exp: Ditto.
+ * pr-8134.exp: Ditto.
+
+Thu Sep 5 01:54:42 1996 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
+
+ * gch1280.exp: Enhance test case.
+
+Wed Sep 4 07:30:44 1996 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
+
+ * gch1272.{ch,exp}, gch1280.{ch,exp}, pr-9946.{ch,exp}:
+ New test cases.
+
+Sun Aug 18 13:29:48 1996 Fred Fish <fnf@cygnus.com>
+
+ * tests2.exp: Remove mips-sgi-irix* setup_xfail for
+ "real write 4" and "real write 8".
+
+Mon Jun 10 14:04:05 1996 Fred Fish <fnf@cygnus.com>
+
+ * tests1.exp (test_modes): Remove *-*-* setup_sfail for
+ "print unnumbered set range mode" and
+ "print numbered set range mode".
+
+Wed Apr 17 01:23:06 1996 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
+
+ * tests1.{ch,exp}: Tets case modified and enhanced.
+
+Tue Apr 9 01:18:04 1996 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
+
+ * gch981.{ch,exp}, gch1041.{ch,exp}: New test cases.
+
+Wed Mar 6 00:29:35 1996 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
+
+ * powerset.exp: Add test.
+
+Tue Mar 5 23:41:39 1996 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
+
+ * gch922.{ch,exp}, powerset.{ch,exp}: New test cases.
+
+ * builtins.exp, chillvars.exp, misc.exp, tests1.exp: Updated
+ due to new format of nonprintable characters (control sequence
+ instead of C'xx').
+
+Tue Mar 5 00:09:17 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * string.ch, string.exp: Add tests (from Cygnus PR chill/9078).
+
+ * pr-9095.ch, pr-9095.exp: New test case.
+
+Fri Feb 9 08:22:16 1996 Fred Fish <fnf@cygnus.com>
+
+ * Makefile.in (clean): Add missing '{'.
+
+Tue Feb 6 21:52:26 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * pr-8894.exp, pr-8894.ch, pr-8894-grt.ch: New test case.
+
+Mon Jan 29 00:05:01 1996 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
+
+ * builtins.ch, builtins.exp: Enhance test case.
+
+ * extstruct.ch, extstruct-grt.ch, extstruct.exp: New test case.
+
+Tue Jan 23 16:57:13 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * enum.ch, enum.exp: New test case (covers PRs 8869 and 8870).
+
+Thu Jan 11 17:34:01 1996 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * Makefile.in (PROGS): Removed.
+ (clean mostlyclean): Remove *.exe rather than ${PROGS}.
+
+ * pr-8742.ch, pr-8742.exp: New test case.
+
+Tue Jan 9 04:47:27 1996 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
+
+ * misc.ch, misc.exp: Enhance test case.
+
+Sat Dec 30 15:31:59 1995 Fred Fish <fnf@cygnus.com>
+
+ * tests2.exp: Setup_xfail "i*86-*-linux" and
+ "mips-sgi-irix*" for "real write 4" and "real write 8".
+ Conditionalize both tests for system specific value
+ of "infinity" string.
+
+Fri Dec 29 10:46:09 1995 Fred Fish <fnf@cygnus.com>
+
+ * builtins.exp (test_size): Alpha seems to have long builtins.
+ * tests1.exp: Setup xfail "*-*-*" for "ptype r2".
+ * tests2.exp: Add check to skip chill tests.
+
+Mon Dec 11 16:53:40 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * tuples.ch, tuples.exp: Exhance test cases (from PR 8643).
+
+Mon Dec 11 06:57:07 1995 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
+
+ * builtins.exp, pr-5016.{ch,exp}, result.{ch,exp},
+ tests1.{ch,exp}: Enhance test cases.
+
+Thu Dec 7 05:16:34 1995 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
+
+ * builtins.ch, builtins.exp, Makefile.in: New test case.
+
+Tue Dec 5 01:51:45 1995 Wilfried Moser (Alcatel) <moser@rtl.cygnus.com>
+
+ * tests2.exp: Add compiling of the test case.
+
+Fri Dec 1 00:08:37 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * pr-8405.ch, pr-8405.exp, Makefile.in: New test case.
+
+ * tests1.exp, tests2.exp (test_print_reject): Remove; causes
+ conflicts with later tests using test_print_reject in ../lib/gdb.exp.
+ (passcount): Remove.
+ * tests2.exp (test_print_accept): Removed.
+ (test_write): Re-write to use gdb_test rather than test_print_accept.
+ * tests1.exp (test_print_accept_exact): Removed.
+ (tests_locations): Rewrite to use gdb_test and not above proc.
+
+ * tests1.ch, tests1.exp, tests2.ch, tests2.exp, Makefile.in:
+ New (extensive) test cases.
+ * chexp.exp: Fix relations to return TRUE or FALSE.
+
+Wed Nov 29 19:28:13 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * Makefile.in: Add .exp.check rule.
+ * callch.ch: Add missing "%." to format strings.
+ * callch.exp: Fix argument to gdb_load.
+ * chexp.exp: Add specific error messages to test_print_reject calls.
+ * misc.exp: Add a test for PR 8496.
+ * pr-6632.exp, pr-8136.exp: Link executables from two .o files.
+
+Sat Nov 25 20:49:27 1995 Fred Fish <fnf@phydeaux.cygnus.com>
+
+ * pr-5016.exp: xfail "whatis i" for alpha-osf-dec-osf2*, same as linux.
+
+Sun Oct 29 17:58:01 1995 Fred Fish <fnf@cygnus.com>
+
+ * pr-5016.exp: xfail "whatis i" for sparc-sun-sunos4*, same as linux.
+
+Wed Oct 4 18:20:53 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * pr-8136.{ch,exp}, pr-8134.exp, func1.ch, Makefile.in: New test cases.
+
+Wed Sep 27 11:51:50 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * tuples.ch. tuples.exp: Add new test for setting a variant record
+ using a tuple, and access the fields.
+
+Thu Aug 3 10:45:37 1995 Fred Fish <fnf@cygnus.com>
+
+ * Update all FSF addresses except those in COPYING* files.
+
+Thu Jul 27 20:36:30 1995 Fred Fish (fnf@cygnus.com)
+
+ * pr-5016.exp: xfail "i*86-*-linux*" for "whatis int-range"
+ test. Thinks it is "_cint" rather than "m_index".
+ * misc.exp: xfail "i*86-*-linux*" for "info line" test.
+ Line number is off by one.
+
+Wed Jun 14 13:07:45 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * chillvars.exp, string.exp: New tests for LOWER/UPPER/LENGTH.
+
+Wed Jun 7 17:52:38 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * chillvars.ch (xptr): Declare new variable.
+ * chillvars.exp (test_ptr): New function to test EXPR->MODENAME.
+
+Tue Mar 28 17:13:13 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * pr-6632.ch, pr-6632-grt.ch, pr-6632.exp, Makefile.in: New test case.
+
+Tue Mar 21 12:10:06 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * tuples.exp (do_tests): Make names of "print v_ps" test unique.
+
+Wed Mar 8 13:26:36 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * *.exp: Skip all tests silently if skip_chill_tests returns true.
+
+ * misc.exp: Remove reference to non-existent variable passcount.
+
+Tue Mar 7 19:30:05 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * string.ch, string.exp, Makefile.in: New test case.
+
+Mon Mar 6 14:11:01 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * tuples.ch (setnmode); New module.
+ * tuples.exp: Add some extra tests.
+
+Sat Mar 4 15:16:17 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * callch.ch, callch.exp, Makefile.in: New test case.
+
+Thu Mar 2 06:17:41 1995 Jim Kingdon (kingdon@lioth.cygnus.com)
+
+ * misc.exp: If executable does not exist, issue warning and skip
+ remaining tests, like other chill tests.
+
+Wed Mar 1 20:28:42 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * misc.ch, misc.exp, Makefile.in: New test case.
+
+Mon Feb 20 16:19:58 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * chillvars.ch: Add missing INIT's.
+ * chillvars.exp: Allow builtin types as either case. E.g. (BOOL|bool).
+ * pr-5016.exp: Likewise.
+
+Sun Feb 12 11:26:08 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * pr-6292.ch, pr-6292.exp, Makefile.in: New test case.
+
+Wed Feb 1 13:09:48 1995 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * tuples.ch, tuples.exp, Makefile.in: New test case.
+
+Mon Nov 28 18:39:08 1994 Per Bothner <bothner@kalessin.cygnus.com>
+
+ * pr-5984.ch, pr-5984.exp, Makefile.in: New test case.
+
+Fri Sep 16 16:55:03 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * pr-5646.ch, pr-5646-grt.ch, pr-5646.exp, Makefile.in: New testcase.
+
+Tue Sep 6 13:21:27 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * pr-5016.ch, pr-5016.exp, Makefile.in: New testcase.
+ * Makefile.in (.exe.check): New rule, to run just one test.
+
+Tue Jun 14 16:20:18 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * result.ch, result.exp, Makefile.in: New test case.
+ * pr-4975.ch, pr-4975-grt.ch, pr-4975.exp, Makefile.in: Ditto.
+
+Thu Jun 9 15:20:43 1994 Per Bothner (bothner@kalessin.cygnus.com)
+
+ * pr-5022.ch, pr-5022.exp: New testcase.
+ * chillvars.exp: Remove spurious newline.
+
+ * Makefile.in: Bunch of fixes so it actually works in this
+ directory. (E.g. add extra ../ where needed.)
+ Also, add .exe to executables, so we can use suffix rules.
+ * chexp.exp (test_print_reject): Update syntax error message.
+ * chillvars.ch (module PR_5020): Moved from here ...
+ * pr-5022.ch: ... to this new file.
+ * chillvars.exp, pr-5020.exp (binfile): Add .exe extension.
+ * chillvars.exp, pr-5020.exp: Don't check all_flag.
+ * pr-5020.exp: Add more tests; fix "print y pretty" output.
diff --git a/gdb/testsuite/gdb.chill/Makefile.in b/gdb/testsuite/gdb.chill/Makefile.in
new file mode 100644
index 00000000000..a965b578d74
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/Makefile.in
@@ -0,0 +1,26 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+all:
+ @echo "Nothing to be done for all..."
+
+#### host, target, and site specific Makefile frags come in here.
+
+.SUFFIXES: .ch .o .exe .exp .check
+
+# Do 'make chillvars.check' to run just the chillvars.{ch,exp} test.
+
+.exp.check:
+ rootme=`pwd`/; export rootme; \
+ cd .. ; \
+ $(MAKE) just-check RUNTESTFLAGS="${RUNTESTFLAGS} $*.exp" \
+ EXPECT=${EXPECT}
+
+clean mostlyclean:
+ -rm -f *.o ${OBJS} *.exe *~ core
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+
+Makefile: $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.chill/builtins.ch b/gdb/testsuite/gdb.chill/builtins.ch
new file mode 100644
index 00000000000..ef12c839b90
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/builtins.ch
@@ -0,0 +1,83 @@
+xx: MODULE
+
+DCL v_bool BOOL INIT := FALSE;
+DCL v_char CHAR INIT := 'X';
+DCL v_byte BYTE INIT := -30;
+DCL v_ubyte UBYTE INIT := 30;
+DCL v_int INT INIT := -333;
+DCL v_uint UINT INIT := 333;
+DCL v_long LONG INIT := -4444;
+DCL v_ulong ULONG INIT := 4444;
+DCL v_ptr PTR;
+
+SYNMODE m_set = SET (e1, e2, e3, e4, e5, e6);
+DCL v_set m_set INIT := e3;
+
+SYNMODE m_set_range = m_set(e2:e5);
+DCL v_set_range m_set_range INIT := e3;
+
+SYNMODE m_numbered_set = SET (n1 = 25, n2 = 22, n3 = 35, n4 = 33,
+ n5 = 45, n6 = 43);
+DCL v_numbered_set m_numbered_set INIT := n3;
+
+SYNMODE m_char_range = CHAR('A':'Z');
+DCL v_char_range m_char_range INIT := 'G';
+
+SYNMODE m_bool_range = BOOL(FALSE:FALSE);
+DCL v_bool_range m_bool_range;
+
+SYNMODE m_long_range = LONG(255:3211);
+DCL v_long_range m_long_range INIT := 1000;
+
+SYNMODE m_range = RANGE(12:28);
+DCL v_range m_range INIT := 23;
+
+SYNMODE m_chars = CHARS(20);
+SYNMODE m_chars_v = CHARS(20) VARYING;
+DCL v_chars CHARS(20);
+DCL v_chars_v CHARS(20) VARYING INIT := "foo bar";
+
+SYNMODE m_bits = BOOLS(10);
+DCL v_bits BOOLS(10);
+
+SYNMODE m_arr = ARRAY(1:10) BYTE;
+DCL v_arr ARRAY(1:10) BYTE;
+
+SYNMODE m_char_arr = ARRAY (CHAR) BYTE;
+DCL v_char_arr ARRAY(CHAR) BYTE;
+
+SYNMODE m_bool_arr = ARRAY (BOOL) BYTE;
+DCL v_bool_arr ARRAY (BOOL) BYTE;
+
+SYNMODE m_int_arr = ARRAY (INT) BYTE;
+DCL v_int_arr ARRAY (INT) BYTE;
+
+SYNMODE m_set_arr = ARRAY (m_set) BYTE;
+DCL v_set_arr ARRAY (m_set) BYTE;
+
+SYNMODE m_numbered_set_arr = ARRAY (m_numbered_set) BYTE;
+DCL v_numbered_set_arr ARRAY (m_numbered_set) BYTE;
+
+SYNMODE m_char_range_arr = ARRAY (m_char_range) BYTE;
+DCL v_char_range_arr ARRAY (m_char_range) BYTE;
+
+SYNMODE m_set_range_arr = ARRAY (m_set_range) BYTE;
+DCL v_set_range_arr ARRAY (m_set_range) BYTE;
+
+SYNMODE m_bool_range_arr = ARRAY (m_bool_range) BYTE;
+DCL v_bool_range_arr ARRAY (m_bool_range) BYTE;
+
+SYNMODE m_long_range_arr = ARRAY (m_long_range) BYTE;
+DCL v_long_range_arr ARRAY (m_long_range) BYTE;
+
+SYNMODE m_range_arr = ARRAY (m_range) BYTE;
+DCL v_range_arr ARRAY (m_range) BYTE;
+
+SYNMODE m_struct = STRUCT (i LONG,
+ c CHAR,
+ s CHARS(30));
+DCL v_struct m_struct;
+
+v_bool := TRUE;
+
+END xx;
diff --git a/gdb/testsuite/gdb.chill/builtins.exp b/gdb/testsuite/gdb.chill/builtins.exp
new file mode 100644
index 00000000000..87fe3af1f94
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/builtins.exp
@@ -0,0 +1,441 @@
+# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file tests various Chill values, expressions, and types.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "builtins"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_chill {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"chill\".*$gdb_prompt $" {
+ pass "set language to \"chill\""
+ send_gdb "break xx_\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ send_gdb "run\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+ return 1
+ }
+ timeout {
+ fail "can't set breakpoint (timeout)"
+ return 0
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "setting language to \"chill\""
+ return 0
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return 0
+ }
+ }
+}
+
+# Testing printing of a specific value. Increment passcount for
+# success or issue fail message for failure. In both cases, return
+# a 1 to indicate that more tests can proceed. However a timeout
+# is a serious error, generates a special fail message, and causes
+# a 0 to be returned to indicate that more tests are likely to fail
+# as well.
+#
+# Args are:
+#
+# First one is string to send_gdb to gdb
+# Second one is string to match gdb result to
+# Third one is an optional message to be printed
+
+proc test_print_accept { args } {
+ global gdb_prompt
+ global passcount
+ global verbose
+
+ if [llength $args]==3 then {
+ set message [lindex $args 2]
+ } else {
+ set message [lindex $args 0]
+ }
+ set sendthis [lindex $args 0]
+ set expectthis [lindex $args 1]
+ set result [gdb_test $sendthis ".* = ${expectthis}" $message]
+ if $result==0 {incr passcount}
+ return $result
+}
+
+proc test_lower {} {
+ global passcount
+
+ verbose "testing builtin LOWER"
+ set passcount 0
+
+ # discrete mode names
+ test_print_accept "print lower(bool)" "FALSE"
+ test_print_accept "print lower(char)" {'\^[(]0[)]'}
+ test_print_accept "print lower(byte)" "-128"
+ test_print_accept "print lower(ubyte)" "0"
+ if [istarget "alpha-*-*"] then {
+ test_print_accept "print lower(int)" "-2147483648"
+ } else {
+ test_print_accept "print lower(int)" "-32768"
+ }
+ test_print_accept "print lower(uint)" "0"
+ setup_xfail "alpha-*-*"
+ test_print_accept "print lower(long)" "-2147483648"
+ test_print_accept "print lower(ulong)" "0"
+ test_print_accept "print lower(m_set)" "e1"
+ test_print_accept "print lower(m_set_range)" "e2"
+ test_print_accept "print lower(m_numbered_set)" "n2"
+ test_print_accept "print lower(m_char_range)" "'A'"
+ test_print_accept "print lower(m_bool_range)" "FALSE"
+ test_print_accept "print lower(m_long_range)" "255"
+ test_print_accept "print lower(m_range)" "12"
+
+ # discrete locations
+ test_print_accept "print lower(v_bool)" "FALSE"
+ test_print_accept "print lower(v_char)" {'\^[(]0[)]'}
+ test_print_accept "print lower(v_byte)" "-128"
+ test_print_accept "print lower(v_ubyte)" "0"
+ if [istarget "alpha-*-*"] then {
+ test_print_accept "print lower(v_int)" "-2147483648"
+ } else {
+ test_print_accept "print lower(v_int)" "-32768"
+ }
+ test_print_accept "print lower(v_uint)" "0"
+ setup_xfail "alpha-*-*"
+ test_print_accept "print lower(v_long)" "-2147483648"
+ test_print_accept "print lower(v_ulong)" "0"
+ test_print_accept "print lower(v_set)" "e1"
+ test_print_accept "print lower(v_set_range)" "e2"
+ test_print_accept "print lower(v_numbered_set)" "n2"
+ test_print_accept "print lower(v_char_range)" "'A'"
+ test_print_accept "print lower(v_bool_range)" "FALSE"
+ test_print_accept "print lower(v_long_range)" "255"
+ test_print_accept "print lower(v_range)" "12"
+
+ # string mode names
+ test_print_accept "print lower(m_chars)" "0"
+ test_print_accept "print lower(m_chars_v)" "0"
+ test_print_accept "print lower(m_bits)" "0"
+
+ # string locations
+ test_print_accept "print lower(v_chars)" "0"
+ test_print_accept "print lower(v_chars_v)" "0"
+ test_print_accept "print lower(v_bits)" "0"
+
+ # string expressions
+ test_print_accept "print lower(\"abcd\")" "0"
+ test_print_accept "print lower(B'010101')" "0"
+
+ # array mode name
+ test_print_accept "print lower(m_arr)" "1";
+ test_print_accept "print lower(m_char_arr)" {'\^[(]0[)]'}
+ test_print_accept "print lower(m_bool_arr)" "FALSE"
+ if [istarget "alpha-*-*"] then {
+ test_print_accept "print lower(m_int_arr)" "-2147483648"
+ } else {
+ test_print_accept "print lower(m_int_arr)" "-32768"
+ }
+ test_print_accept "print lower(m_set_arr)" "e1"
+ test_print_accept "print lower(m_set_range_arr)" "e2"
+ test_print_accept "print lower(m_numbered_set_arr)" "n2"
+ test_print_accept "print lower(m_char_range_arr)" "'A'"
+ test_print_accept "print lower(m_bool_range_arr)" "FALSE"
+ test_print_accept "print lower(m_long_range_arr)" "255"
+ test_print_accept "print lower(m_range_arr)" "12"
+
+ # array locations
+ test_print_accept "print lower(v_arr)" "1";
+ test_print_accept "print lower(v_char_arr)" {'\^[(]0[)]'}
+ test_print_accept "print lower(v_bool_arr)" "FALSE"
+ if [istarget "alpha-*-*"] then {
+ test_print_accept "print lower(v_int_arr)" "-2147483648"
+ } else {
+ test_print_accept "print lower(v_int_arr)" "-32768"
+ }
+ test_print_accept "print lower(v_set_arr)" "e1"
+ test_print_accept "print lower(v_set_range_arr)" "e2"
+ test_print_accept "print lower(v_numbered_set_arr)" "n2"
+ test_print_accept "print lower(v_char_range_arr)" "'A'"
+ test_print_accept "print lower(v_bool_range_arr)" "FALSE"
+ test_print_accept "print lower(v_long_range_arr)" "255"
+ test_print_accept "print lower(v_range_arr)" "12"
+}
+
+proc test_upper {} {
+ global passcount
+
+ verbose "testing builtin UPPER"
+ set passcount 0
+
+ # discrete mode names
+ test_print_accept "print upper(bool)" "TRUE"
+ test_print_accept "print upper(char)" {'\^[(]255[)]'}
+ test_print_accept "print upper(byte)" "127"
+ test_print_accept "print upper(ubyte)" "255"
+ if [istarget "alpha-*-*"] then {
+ test_print_accept "print upper(int)" "2147483647"
+ test_print_accept "print upper(uint)" "4294967295"
+ setup_xfail "alpha-*-*"
+ test_print_accept "print upper(long)" "4294967295"
+ test_print_accept "print upper(ulong)" "18446744073709551615"
+ } else {
+ test_print_accept "print upper(int)" "32767"
+ test_print_accept "print upper(uint)" "65535"
+ test_print_accept "print upper(long)" "2147483647"
+ test_print_accept "print upper(ulong)" "4294967295"
+ }
+ test_print_accept "print upper(m_set)" "e6"
+ test_print_accept "print upper(m_set_range)" "e5"
+ test_print_accept "print upper(m_numbered_set)" "n5"
+ test_print_accept "print upper(m_char_range)" "'Z'"
+ test_print_accept "print upper(m_bool_range)" "FALSE"
+ test_print_accept "print upper(m_long_range)" "3211"
+ test_print_accept "print upper(m_range)" "28"
+
+ # discrete locations
+ test_print_accept "print upper(v_bool)" "TRUE"
+ test_print_accept "print upper(v_char)" {'\^[(]255[)]'}
+ test_print_accept "print upper(v_byte)" "127"
+ test_print_accept "print upper(v_ubyte)" "255"
+ if [istarget "alpha-*-*"] then {
+ test_print_accept "print upper(v_int)" "2147483647"
+ test_print_accept "print upper(v_uint)" "4294967295"
+ setup_xfail "alpha-*-*"
+ test_print_accept "print upper(v_long)" "4294967295"
+ test_print_accept "print upper(v_ulong)" "18446744073709551615"
+ } else {
+ test_print_accept "print upper(v_int)" "32767"
+ test_print_accept "print upper(v_uint)" "65535"
+ test_print_accept "print upper(v_long)" "2147483647"
+ test_print_accept "print upper(v_ulong)" "4294967295"
+ }
+ test_print_accept "print upper(v_set)" "e6"
+ test_print_accept "print upper(v_set_range)" "e5"
+ test_print_accept "print upper(v_numbered_set)" "n5"
+ test_print_accept "print upper(v_char_range)" "'Z'"
+ test_print_accept "print upper(v_bool_range)" "FALSE"
+ test_print_accept "print upper(v_long_range)" "3211"
+ test_print_accept "print upper(v_range)" "28"
+
+ # string mode names
+ test_print_accept "print upper(m_chars)" "19"
+ test_print_accept "print upper(m_chars_v)" "19"
+ test_print_accept "print upper(m_bits)" "9"
+
+ # string locations
+ test_print_accept "print upper(v_chars)" "19"
+ test_print_accept "print upper(v_chars_v)" "19"
+ test_print_accept "print upper(v_bits)" "9"
+
+ # string expressions
+ test_print_accept "print upper(\"abcd\")" "3"
+ test_print_accept "print upper(B'010101')" "5"
+
+ # array mode name
+ test_print_accept "print upper(m_arr)" "10";
+ test_print_accept "print upper(m_char_arr)" {'\^[(]255[)]'}
+ test_print_accept "print upper(m_bool_arr)" "TRUE"
+ if [istarget "alpha-*-*"] then {
+ test_print_accept "print upper(m_int_arr)" "2147483647"
+ } else {
+ test_print_accept "print upper(m_int_arr)" "32767"
+ }
+ test_print_accept "print upper(m_set_arr)" "e6"
+ test_print_accept "print upper(m_set_range_arr)" "e5"
+ test_print_accept "print upper(m_numbered_set_arr)" "n5"
+ test_print_accept "print upper(m_char_range_arr)" "'Z'"
+ test_print_accept "print upper(m_bool_range_arr)" "FALSE"
+ test_print_accept "print upper(m_long_range_arr)" "3211"
+ test_print_accept "print upper(m_range_arr)" "28"
+
+ # array locations
+ test_print_accept "print upper(v_arr)" "10";
+ test_print_accept "print upper(v_char_arr)" {'\^[(]255[)]'}
+ test_print_accept "print upper(v_bool_arr)" "TRUE"
+ if [istarget "alpha-*-*"] then {
+ test_print_accept "print upper(v_int_arr)" "2147483647"
+ } else {
+ test_print_accept "print upper(v_int_arr)" "32767"
+ }
+ test_print_accept "print upper(v_set_arr)" "e6"
+ test_print_accept "print upper(v_set_range_arr)" "e5"
+ test_print_accept "print upper(v_numbered_set_arr)" "n5"
+ test_print_accept "print upper(v_char_range_arr)" "'Z'"
+ test_print_accept "print upper(v_bool_range_arr)" "FALSE"
+ test_print_accept "print upper(v_long_range_arr)" "3211"
+ test_print_accept "print upper(v_range_arr)" "28"
+}
+
+proc test_length {} {
+ global passcount
+
+ verbose "testing builtin LENGTH"
+ set passcount 0
+
+ # string locations
+ test_print_accept "print length(v_chars)" "20"
+ test_print_accept "print length(v_chars_v)" "7";
+ test_print_accept "print length(v_bits)" "10";
+
+ # string expressions
+ test_print_accept "print length(\"the quick brown fox ...\")" "23"
+ test_print_accept "print length(B'010101010101')" "12"
+ test_print_accept "print length(\"foo \" // \"bar\")" "7"
+
+ # check some failures
+ setup_xfail "*-*-*"
+ test_print_accept "print length(m_chars)" "typename in invalid context"
+ setup_xfail "*-*-*"
+ test_print_accept "print length(v_byte)" "bad argument to LENGTH builtin"
+ setup_xfail "*-*-*"
+ test_print_accept "print length(b'000000' // b'111111')" "12"
+}
+
+proc test_size {} {
+ global passcount
+
+ verbose "testing builtin SIZE"
+ set passcount 0
+
+ # modes
+ test_print_accept "print size(bool)" "1"
+ test_print_accept "print size(char)" "1"
+ test_print_accept "print size(byte)" "1"
+ if [istarget "alpha-*-*"] then {
+ test_print_accept "print size(int)" "4"
+ test_print_accept "print size(ulong)" "8"
+ test_print_accept "print size(ptr)" "8"
+ test_print_accept "print size(m_chars_v)" "24"
+ test_print_accept "print size(m_struct)" "40"
+ } else {
+ test_print_accept "print size(int)" "2"
+ test_print_accept "print size(ulong)" "4"
+ test_print_accept "print size(ptr)" "4"
+ test_print_accept "print size(m_chars_v)" "22"
+ test_print_accept "print size(m_struct)" "36"
+ }
+ test_print_accept "print size(m_set)" "1"
+ test_print_accept "print size(m_numbered_set)" "1"
+ test_print_accept "print size(m_char_range)" "1"
+ test_print_accept "print size(m_range_arr)" "17"
+ test_print_accept "print size(m_chars)" "20"
+ test_print_accept "print size(m_bits)" "2"
+
+ # locations
+ test_print_accept "print size(v_bool)" "1"
+ test_print_accept "print size(v_char)" "1"
+ test_print_accept "print size(v_byte)" "1"
+ if [istarget "alpha-*-*"] then {
+ test_print_accept "print size(v_int)" "4"
+ test_print_accept "print size(v_ulong)" "8"
+ test_print_accept "print size(v_ptr)" "8"
+ test_print_accept "print size(v_chars_v)" "24"
+ test_print_accept "print size(v_struct)" "40"
+ } else {
+ test_print_accept "print size(v_int)" "2"
+ test_print_accept "print size(v_ulong)" "4"
+ test_print_accept "print size(v_ptr)" "4"
+ test_print_accept "print size(v_chars_v)" "22"
+ test_print_accept "print size(v_struct)" "36"
+ }
+ test_print_accept "print size(v_set)" "1"
+ test_print_accept "print size(v_numbered_set)" "1"
+ test_print_accept "print size(v_char_range)" "1"
+ test_print_accept "print size(v_range_arr)" "17"
+ test_print_accept "print size(v_chars)" "20"
+ test_print_accept "print size(v_bits)" "2"
+}
+
+proc test_num {} {
+ global passcount
+
+ verbose "testing builtin NUM"
+ set passcount 0
+
+ # constants
+ test_print_accept "print num(false)" "0"
+ test_print_accept "print num(true)" "1"
+ test_print_accept "print num(10)" "10"
+ test_print_accept "print num(33-34)" "-1"
+ test_print_accept "print num('X')" "88"
+ test_print_accept "print num(e5)" "4"
+
+ # locations
+ test_print_accept "print num(v_bool)" "0"
+ test_print_accept "print num(v_char)" "88"
+ test_print_accept "print num(v_byte)" "-30"
+ test_print_accept "print num(v_ubyte)" "30"
+ test_print_accept "print num(v_int)" "-333"
+ test_print_accept "print num(v_uint)" "333"
+ test_print_accept "print num(v_long)" "-4444"
+ test_print_accept "print num(v_ulong)" "4444"
+ test_print_accept "print num(v_set)" "2"
+ test_print_accept "print num(v_set_range)" "2"
+ test_print_accept "print num(v_numbered_set)" "35"
+ test_print_accept "print num(v_char_range)" "71"
+ test_print_accept "print num(v_long_range)" "1000"
+ test_print_accept "print num(v_range)" "23"
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if [set_lang_chill] then {
+ # test builtins as described in chapter 6.20.3 Z.200
+ test_num
+ test_size
+ test_lower
+ test_upper
+ test_length
+} else {
+ warning "$test_name tests suppressed."
+}
diff --git a/gdb/testsuite/gdb.chill/callch.ch b/gdb/testsuite/gdb.chill/callch.ch
new file mode 100644
index 00000000000..6001d92443b
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/callch.ch
@@ -0,0 +1,50 @@
+hack : module
+
+dcl i int;
+newmode otto = array (bool, bool) byte;
+newmode str1 = struct (f1 int, f2 bool);
+newmode str2 = struct (f1 otto);
+
+dcl a otto := [[1,1],[1,1]];
+dcl b str1 := [10, false];
+dcl c str2;
+
+fred : proc (a int in, b int loc);
+ writetext(stdout, "a is '%C'; b is '%C'.%/", a, b);
+end fred;
+
+klaus : proc ();
+ writetext(stdout, "here's klaus calling.%/");
+end klaus;
+
+king : proc (p otto loc, x otto in);
+ dcl i, j bool;
+ p := [[h'ff,h'ff],[h'ff,h'ff]];
+ do for i:= lower(bool) to upper(bool);
+ do for j:= lower(bool) to upper(bool);
+ writetext(stdout, "x(%C, %C) = %C%..%/", i, j, x(i, j));
+ writetext(stdout, "p(%C, %C) = %C%..%/", i, j, p(i, j));
+ od;
+ od;
+end king;
+
+ralph : proc (x str1 in);
+ writetext(stdout, "x.f1 = %C, x.f2 = %C%..%/", x.f1, x.f2);
+end ralph;
+
+whitney : proc (x str2 in);
+ dcl i, j bool;
+
+ do for i:= lower(bool) to upper(bool);
+ do for j:= lower(bool) to upper(bool);
+ writetext(stdout, "x.f1(%C, %C) = %C%..%/", i, j, x.f1(i, j));
+ od;
+ od;
+
+end whitney;
+
+c := [a];
+i:=12;
+writetext(stdout, "done.%/");
+
+end hack;
diff --git a/gdb/testsuite/gdb.chill/callch.exp b/gdb/testsuite/gdb.chill/callch.exp
new file mode 100644
index 00000000000..78cf0b7e088
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/callch.exp
@@ -0,0 +1,69 @@
+# Copyright 1995, 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file tests that gdb can call functions in a Chill inferior.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "callch"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ send_gdb "set language chill\n" ;
+
+ gdb_test "break callch.ch:48" ""
+ send_gdb "run\n"; gdb_expect -re "Breakpoint .*callch.ch:48.*$gdb_prompt $"
+ gdb_test {set fred(10, i)} {a is '10'; b is '12'.}
+ gdb_test_exact "call klaus()" {here's klaus calling.}
+ gdb_test_exact "call fred()" {too few arguments in function call}
+ # Too many arguments are allowed
+ gdb_test_exact "call klaus(10, 20, 30)" {here's klaus calling.}
+ gdb_test "print a" { = \[\(FALSE:TRUE\): \[\(FALSE:TRUE\): 1\]\]}\
+ "print a before king"
+ # Current gdb prints 255 for the results that are expected to be -1.
+ setup_xfail "mips*-sgi-irix*"
+ gdb_test {call king(a, otto[[10, 15], [20, 25]])} "x\\(FALSE, FALSE\\) = 10.*p\\(FALSE, FALSE\\) = -1.*x\\(FALSE, TRUE\\) = 15.*p\\(FALSE, TRUE\\) = -1.*x\\(TRUE, FALSE\\) = 20.*p\\(TRUE, FALSE\\) = -1.*x\\(TRUE, TRUE\\) = 25.*p\\(TRUE, TRUE\\) = -1.*"
+ gdb_test "print a" { = \[\(FALSE:TRUE\): \[\(FALSE:TRUE\): -1\]\]}\
+ "print a after king"
+ gdb_test_exact "call ralph(b)" {x.f1 = 10, x.f2 = FALSE.}
+ gdb_test "call whitney(c)" "x.f1\\(FALSE, FALSE\\) = 1.*x.f1\\(FALSE, TRUE\\) = 1.*x.f1\\(TRUE, FALSE\\) = 1.*x.f1\\(TRUE, TRUE\\) = 1.*"
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/chexp.exp b/gdb/testsuite/gdb.chill/chexp.exp
new file mode 100644
index 00000000000..820ef8334b8
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/chexp.exp
@@ -0,0 +1,450 @@
+# Copyright 1992, 1994, 1995, 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_chill {} {
+ global gdb_prompt
+
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"chill\".*$gdb_prompt $" {
+ pass "set language to \"chill\""
+ return 1
+ }
+ -re ".*$gdb_prompt $" {
+ fail "setting language to \"chill\""
+ return 0
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return 0
+ }
+ }
+}
+
+proc test_integer_literals_accepted {} {
+ global gdb_prompt
+
+ # Test various decimal values.
+
+ gdb_test "p 123" " = 123"
+ gdb_test "p -123" " = -123"
+ gdb_test "p D'123" " = 123"
+ gdb_test "p d'123" " = 123"
+ gdb_test "p -D'123" " = -123"
+ gdb_test "p -d'123" " = -123"
+ gdb_test "p 12_345" " = 12345"
+ gdb_test "p __1_2_3__" " = 123"
+ gdb_test "p/d 123" " = D'123"
+
+ # Test various binary values.
+
+ gdb_test "p B'111" " = 7"
+ gdb_test "p b'111" " = 7"
+ gdb_test "p -B'111" " = -7"
+ gdb_test "p B'0111" " = 7"
+ gdb_test "p b'0111" " = 7"
+ gdb_test "p -b'0111" " = -7"
+ gdb_test "p B'_0_1_1_1_" " = 7"
+ gdb_test "p b'_0_1_1_1_" " = 7"
+ gdb_test "p -b'_0_1_1_1_" " = -7"
+ gdb_test "p/t B'111" " = B'111"
+
+ # Test various octal values.
+
+ gdb_test "p O'123" " = 83"
+ gdb_test "p o'123" " = 83"
+ gdb_test "p -o'0123" " = -83"
+ gdb_test "p O'0123" " = 83"
+ gdb_test "p o'0123" " = 83"
+ gdb_test "p -o'123" " = -83"
+ gdb_test "p O'_1_2_3_" " = 83"
+ gdb_test "p o'_1_2_3_" " = 83"
+ gdb_test "p -o'_1_2_3_" " = -83"
+ gdb_test "p/o O'123" " = O'123"
+
+ # Test various hexadecimal values.
+
+ gdb_test "p H'123" " = 291"
+ gdb_test "p h'123" " = 291"
+ gdb_test "p -h'123" " = -291"
+ gdb_test "p H'0123" " = 291"
+ gdb_test "p h'0123" " = 291"
+ gdb_test "p -h'0123" " = -291"
+ gdb_test "p H'_1_2_3_" " = 291"
+ gdb_test "p h'_1_2_3_" " = 291"
+ gdb_test "p -h'_1_2_3_" " = -291"
+ gdb_test "p H'ABC" " = 2748"
+ gdb_test "p H'abc" " = 2748"
+ gdb_test "p H'AbC" " = 2748"
+ gdb_test "p H'_A_b_C_" " = 2748"
+ gdb_test "p H'_D_e_F_" " = 3567"
+ gdb_test "p H'_d_E_f_" " = 3567"
+ gdb_test "p/x H'123" " = H'123"
+}
+
+proc test_character_literals_accepted {} {
+ global gdb_prompt
+
+ # Test various decimal values.
+
+ gdb_test "p 'a'" " = 'a'"
+ gdb_test "p/x 'a'" " = H'61"
+ gdb_test "p/d 'a'" " = D'97"
+ gdb_test "p/t 'a'" " = B'1100001"
+ # gdb_test "p '^(97)'" " = 'a'" (not in GNU Chill)
+ gdb_test "p C'61'" " = 'a'"
+ gdb_test "p c'61'" " = 'a'"
+ gdb_test "p/x C'FF'" " = H'ff"
+ # gdb_test "p/x '^(H'FF)'" " = H'ff" (not in GNU Chill)
+ # gdb_test "p/x '^(D'255)'" " = H'ff" (not in GNU Chill)
+}
+
+proc test_integer_literals_rejected {} {
+ global gdb_prompt
+
+ # These are valid integer literals in Z.200, but not GNU-Chill.
+
+ test_print_reject "p _"
+ test_print_reject "p __"
+
+ test_print_reject "p D'"
+ test_print_reject "p D'_"
+ test_print_reject "p D'__"
+
+ test_print_reject "p B'"
+ test_print_reject "p B'_"
+ test_print_reject "p B'__"
+
+ test_print_reject "p O'"
+ test_print_reject "p O'_"
+ test_print_reject "p O'__"
+
+ test_print_reject "p H'"
+ test_print_reject "p H'_"
+ test_print_reject "p H'__"
+
+ # Test various decimal values.
+
+ test_print_reject "p D'DEADBEEF"
+ test_print_reject "p D'123DEADBEEF"
+
+ # Test various binary values.
+
+ test_print_reject "p B'2" "Too-large digit in bitstring or integer."
+ test_print_reject "p B'12" "Too-large digit in bitstring or integer."
+
+ # Test various octal values.
+
+ test_print_reject "p O'9" "Too-large digit in bitstring or integer."
+ test_print_reject "p O'79" "Too-large digit in bitstring or integer."
+
+ # Test various hexadecimal values.
+
+ test_print_reject "p H'G" "Invalid character in bitstring or integer."
+ test_print_reject "p H'AG" "Invalid character in bitstring or integer."
+}
+
+proc test_boolean_literals_accepted {} {
+ global gdb_prompt
+
+ # Test the only possible values for a boolean, TRUE and FALSE.
+
+ gdb_test "p TRUE" " = TRUE"
+ gdb_test "p FALSE" " = FALSE"
+}
+
+proc test_float_literals_accepted {} {
+ global gdb_prompt
+
+ # Test various floating point formats
+
+ gdb_test "p .44 < .45" " = TRUE"
+ gdb_test "p .44 > .45" " = FALSE"
+ gdb_test "p 0.44 < 0.45" " = TRUE"
+ gdb_test "p 0.44 > 0.45" " = FALSE"
+ gdb_test "p 44. < 45." " = TRUE"
+ gdb_test "p 44. > 45." " = FALSE"
+ gdb_test "p 44.0 < 45.0" " = TRUE"
+ gdb_test "p 44.0 > 45.0" " = FALSE"
+ gdb_test "p 10D20 < 10D21" " = TRUE"
+ gdb_test "p 10D20 > 10D21" " = FALSE"
+ gdb_test "p 10d20 < 10d21" " = TRUE"
+ gdb_test "p 10d20 > 10d21" " = FALSE"
+ gdb_test "p 10E20 < 10E21" " = TRUE"
+ gdb_test "p 10E20 > 10E21" " = FALSE"
+ gdb_test "p 10e20 < 10e21" " = TRUE"
+ gdb_test "p 10e20 > 10e21" " = FALSE"
+ gdb_test "p 10.D20 < 10.D21" " = TRUE"
+ gdb_test "p 10.D20 > 10.D21" " = FALSE"
+ gdb_test "p 10.d20 < 10.d21" " = TRUE"
+ gdb_test "p 10.d20 > 10.d21" " = FALSE"
+ gdb_test "p 10.E20 < 10.E21" " = TRUE"
+ gdb_test "p 10.E20 > 10.E21" " = FALSE"
+ gdb_test "p 10.e20 < 10.e21" " = TRUE"
+ gdb_test "p 10.e20 > 10.e21" " = FALSE"
+ gdb_test "p 10.0D20 < 10.0D21" " = TRUE"
+ gdb_test "p 10.0D20 > 10.0D21" " = FALSE"
+ gdb_test "p 10.0d20 < 10.0d21" " = TRUE"
+ gdb_test "p 10.0d20 > 10.0d21" " = FALSE"
+ gdb_test "p 10.0E20 < 10.0E21" " = TRUE"
+ gdb_test "p 10.0E20 > 10.0E21" " = FALSE"
+ gdb_test "p 10.0e20 < 10.0e21" " = TRUE"
+ gdb_test "p 10.0e20 > 10.0e21" " = FALSE"
+ gdb_test "p 10.0D+20 < 10.0D+21" " = TRUE"
+ gdb_test "p 10.0D+20 > 10.0D+21" " = FALSE"
+ gdb_test "p 10.0d+20 < 10.0d+21" " = TRUE"
+ gdb_test "p 10.0d+20 > 10.0d+21" " = FALSE"
+ gdb_test "p 10.0E+20 < 10.0E+21" " = TRUE"
+ gdb_test "p 10.0E+20 > 10.0E+21" " = FALSE"
+ gdb_test "p 10.0e+20 < 10.0e+21" " = TRUE"
+ gdb_test "p 10.0e+20 > 10.0e+21" " = FALSE"
+ gdb_test "p 10.0D-11 < 10.0D-10" " = TRUE"
+ gdb_test "p 10.0D-11 > 10.0D-10" " = FALSE"
+ gdb_test "p 10.0d-11 < 10.0d-10" " = TRUE"
+ gdb_test "p 10.0d-11 > 10.0d-10" " = FALSE"
+ gdb_test "p 10.0E-11 < 10.0E-10" " = TRUE"
+ gdb_test "p 10.0E-11 > 10.0E-10" " = FALSE"
+ gdb_test "p 10.0e-11 < 10.0e-10" " = TRUE"
+ gdb_test "p 10.0e-11 > 10.0e-10" " = FALSE"
+ # looks funny, but apparently legal
+ gdb_test "p _.1e+10 < _.1e+11" " = TRUE"
+ gdb_test "p _.1e+10 > _.1e+11" " = FALSE"
+ gdb_test "p __.1e-12 < __.1e-11" " = TRUE"
+ gdb_test "p __.1e-12 > __.1e-11" " = FALSE"
+}
+
+proc test_convenience_variables {} {
+ global gdb_prompt
+
+ gdb_test "set \$foo := 101" " := 101\[\r\]*" \
+ "Set a new convenience variable"
+
+ gdb_test "print \$foo" " = 101" \
+ "Print contents of new convenience variable"
+
+ gdb_test "set \$foo := 301" " := 301\[\r\]*" \
+ "Set convenience variable to a new value"
+
+ gdb_test "print \$foo" " = 301" \
+ "Print new contents of convenience variable"
+
+ gdb_test "set \$_ := 11" " := 11\[\r\]*" \
+ "Set convenience variable \$_"
+
+ gdb_test "print \$_" " = 11" \
+ "Print contents of convenience variable \$_"
+
+ gdb_test "print \$foo + 10" " = 311" \
+ "Use convenience variable in arithmetic expression"
+
+ gdb_test "print (\$foo := 32) + 4" " = 36" \
+ "Use convenience variable assignment in arithmetic expression"
+
+ gdb_test "print \$bar" " = void" \
+ "Print contents of uninitialized convenience variable"
+}
+
+proc test_value_history {} {
+ global gdb_prompt
+
+ gdb_test "print 101" "\\\$1 = 101" \
+ "Set value-history\[1\] using \$1"
+
+ gdb_test "print 102" "\\\$2 = 102" \
+ "Set value-history\[2\] using \$2"
+
+ gdb_test "print 103" "\\\$3 = 103" \
+ "Set value-history\[3\] using \$3"
+
+ gdb_test "print \$\$" "\\\$4 = 102" \
+ "Print value-history\[MAX-1\] using inplicit index \$\$"
+
+ gdb_test "print \$\$" "\\\$5 = 103" \
+ "Print value-history\[MAX-1\] again using implicit index \$\$"
+
+ gdb_test "print \$" "\\\$6 = 103" \
+ "Print value-history\[MAX\] using implicit index \$"
+
+ gdb_test "print \$\$2" "\\\$7 = 102" \
+ "Print value-history\[MAX-2\] using explicit index \$\$2"
+
+ gdb_test "print \$0" "\\\$8 = 102" \
+ "Print value-history\[MAX\] using explicit index \$0"
+
+ gdb_test "print 108" "\\\$9 = 108" ""
+
+ gdb_test "print \$\$0" "\\\$10 = 108" \
+ "Print value-history\[MAX\] using explicit index \$\$0"
+
+ gdb_test "print \$1" "\\\$11 = 101" \
+ "Print value-history\[1\] using explicit index \$1"
+
+ gdb_test "print \$2" "\\\$12 = 102" \
+ "Print value-history\[2\] using explicit index \$2"
+
+ gdb_test "print \$3" "\\\$13 = 103" \
+ "Print value-history\[3\] using explicit index \$3"
+
+ gdb_test "print \$-3" "\\\$14 = 100" \
+ "Print (value-history\[MAX\] - 3) using implicit index \$"
+
+ gdb_test "print \$1 + 3" "\\\$15 = 104" \
+ "Use value-history element in arithmetic expression"
+}
+
+proc test_arithmetic_expressions {} {
+ global gdb_prompt
+
+ # Test unary minus with various operands
+
+# gdb_test "p -(TRUE)" " = -1" "unary minus applied to bool"
+# gdb_test "p -('a')" " = xxx" "unary minus applied to char"
+ gdb_test "p -(1)" " = -1" "unary minus applied to int"
+ gdb_test "p -(1.0)" " = -1" "unary minus applied to real"
+
+ # Test addition with various operands
+
+ gdb_test "p TRUE + 1" " = 2" "bool plus int"
+ gdb_test "p 'a' + 1" " = 98" "char plus int"
+ gdb_test "p 1 + 1" " = 2" "int plus int"
+ gdb_test "p 1.0 + 1" " = 2" "real plus int"
+ gdb_test "p 1.0 + 2.0" " = 3" "real plus real"
+
+ # Test subtraction with various operands
+
+ gdb_test "p TRUE - 1" " = 0" "bool minus int"
+ gdb_test "p 'b' - 1" " = 97" "char minus int"
+ gdb_test "p 3 - 1" " = 2" "int minus int"
+ gdb_test "p 3.0 - 1" " = 2" "real minus int"
+ gdb_test "p 5.0 - 2.0" " = 3" "real minus real"
+
+ # Test multiplication with various operands
+
+ gdb_test "p TRUE * 1" " = 1" "bool times int"
+ gdb_test "p 'a' * 2" " = 194" "char times int"
+ gdb_test "p 2 * 3" " = 6" "int times int"
+ gdb_test "p 2.0 * 3" " = 6" "real times int"
+ gdb_test "p 2.0 * 3.0" " = 6" "real times real"
+
+ # Test division with various operands
+
+ gdb_test "p TRUE / 1" " = 1" "bool divided by int"
+ gdb_test "p 'a' / 2" " = 48" "char divided by int"
+ gdb_test "p 6 / 3" " = 2" "int divided by int"
+ gdb_test "p 6.0 / 3" " = 2" "real divided by int"
+ gdb_test "p 6.0 / 3.0" " = 2" "real divided by real"
+
+ # Test modulo with various operands
+
+ gdb_test "p TRUE MOD 1" " = 0" "bool modulo int"
+ gdb_test "p 'a' MOD 2" " = 1" "char modulo int"
+ gdb_test "p -5 MOD 3" " = 1" "negative int modulo int"
+ gdb_test "p 5 MOD 1" " = 0" "int modulo int"
+ gdb_test "p 5 MOD 2" " = 1" "int modulo int"
+ gdb_test "p 5 MOD 3" " = 2" "int modulo int"
+ gdb_test "p 5 MOD 4" " = 1" "int modulo int"
+ gdb_test "p 5 MOD 5" " = 0" "int modulo int"
+ gdb_test "p 0 MOD 1" " = 0" "int modulo int"
+ gdb_test "p 0 MOD 2" " = 0" "int modulo int"
+ gdb_test "p 0 MOD 3" " = 0" "int modulo int"
+ gdb_test "p 0 MOD 4" " = 0" "int modulo int"
+ gdb_test "p -5 MOD 1" " = 0" "int modulo int"
+ gdb_test "p -5 MOD 2" " = 1" "int modulo int"
+ gdb_test "p -5 MOD 3" " = 1" "int modulo int"
+ gdb_test "p -5 MOD 4" " = 3" "int modulo int"
+ gdb_test "p -5 MOD 5" " = 0" "int modulo int"
+ gdb_test "p -5 MOD 5" " = 0" "int modulo int"
+ test_print_reject "p 6.0 MOD 3" \
+ "Integer-only operation on floating point number.*"
+ test_print_reject "p 6.0 MOD 3.0" \
+ "Integer-only operation on floating point number.*"
+ test_print_reject "p -5 MOD -1" \
+ "Second operand of MOD must be greater than zero.*"
+ test_print_reject "p -5 MOD 0" \
+ "Second operand of MOD must be greater than zero.*"
+
+ # Test remainder with various operands
+
+ gdb_test "p TRUE REM 1" " = 0" "bool remainder int"
+ gdb_test "p 'a' REM 2" " = 1" "char remainder int"
+ gdb_test "p 5 REM 5" " = 0" "int remainder int"
+ gdb_test "p 5 REM 4" " = 1" "int remainder int"
+ gdb_test "p 5 REM 3" " = 2" "int remainder int"
+ gdb_test "p 5 REM 2" " = 1" "int remainder int"
+ gdb_test "p 5 REM 1" " = 0" "int remainder int"
+ gdb_test "p 5 REM -1" " = 0" "int remainder int"
+ gdb_test "p 5 REM -2" " = 1" "int remainder int"
+ gdb_test "p 5 REM -3" " = 2" "int remainder int"
+ gdb_test "p 5 REM -4" " = 1" "int remainder int"
+ gdb_test "p 5 REM -5" " = 0" "int remainder int"
+ gdb_test "p -5 REM 5" " = 0" "int remainder int"
+ gdb_test "p -5 REM 4" " = -1" "int remainder int"
+ gdb_test "p -5 REM 3" " = -2" "int remainder int"
+ gdb_test "p -5 REM 2" " = -1" "int remainder int"
+ gdb_test "p -5 REM 1" " = 0" "int remainder int"
+ gdb_test "p -5 REM -1" " = 0" "int remainder int"
+ gdb_test "p -5 REM -2" " = -1" "int remainder int"
+ gdb_test "p -5 REM -3" " = -2" "int remainder int"
+ gdb_test "p -5 REM -4" " = -1" "int remainder int"
+ gdb_test "p -5 REM -5" " = 0" "int remainder int"
+ gdb_test "p 6 REM 3" " = 0" "int remainder int"
+ test_print_reject "p 6.0 REM 3" \
+ "Integer-only operation on floating point number.*"
+ test_print_reject "p 6.0 REM 3.0" \
+ "Integer-only operation on floating point number.*"
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ""
+
+if [set_lang_chill] then {
+ test_value_history
+ test_convenience_variables
+ test_integer_literals_accepted
+ test_integer_literals_rejected
+ test_boolean_literals_accepted
+ test_character_literals_accepted
+ test_float_literals_accepted
+ test_arithmetic_expressions
+} else {
+ warning "$test_name tests suppressed." 0
+}
diff --git a/gdb/testsuite/gdb.chill/chillvars.ch b/gdb/testsuite/gdb.chill/chillvars.ch
new file mode 100644
index 00000000000..21dfcba5486
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/chillvars.ch
@@ -0,0 +1,204 @@
+testvars: MODULE
+
+DCL bool_true BOOL INIT := TRUE;
+DCL bool_false BOOL INIT := FALSE;
+DCL booltable1 ARRAY (0:3) BOOL INIT := [ TRUE, FALSE, FALSE, TRUE ];
+DCL booltable2 ARRAY (4:7) BOOL INIT := [ TRUE, FALSE, FALSE, TRUE ];
+
+DCL control_char CHAR INIT := C'07';
+DCL printable_char CHAR INIT := 'a';
+DCL chartable1 ARRAY (0:2) CHAR INIT := [ C'00', C'01', C'02' ];
+DCL chartable2 ARRAY (3:5) CHAR INIT := [ C'00', C'01', C'02' ];
+
+DCL string1 CHARS (4) INIT := 'abcd';
+DCL string2 CHARS (5) INIT := 'ef' // C'00' // 'gh';
+DCL string3 CHARS (6) INIT := 'ef' // 'gh' // 'ij';
+DCL string4 CHARS (7) INIT := (6) 'z' // C'00';
+
+DCL byte_low BYTE INIT := -128;
+DCL byte_high BYTE INIT := 127;
+DCL bytetable1 ARRAY (0:4) BYTE INIT := [ -2, -1, 0, 1, 2 ];
+DCL bytetable2 ARRAY (5:9) BYTE INIT := [ -2, -1, 0, 1, 2 ];
+DCL bytetable3 ARRAY (1:2,'c':'d',FALSE:TRUE) BYTE
+ INIT := [ [ [ 0, 1 ], [ 2, 3 ] ], [ [ 4, 5 ], [ 6, 7 ] ] ];
+DCL bytetable4 ARRAY (1:2) ARRAY ('c':'d') ARRAY (FALSE:TRUE) BYTE
+ INIT := [ [ [ 0, 1 ], [ 2, 3 ] ], [ [ 4, 5 ], [ 6, 7 ] ] ];
+
+DCL ubyte_low UBYTE INIT := 0;
+DCL ubyte_high UBYTE INIT := 255;
+DCL ubytetable1 ARRAY (0:4) UBYTE INIT := [ 0, 1, 2, 3, 4 ];
+DCL ubytetable2 ARRAY (5:9) UBYTE INIT := [ 0, 1, 2, 3, 4 ];
+
+DCL int_low INT INIT := -32_768;
+DCL int_high INT INIT := 32_767;
+DCL inttable1 ARRAY (0:4) INT INIT := [ -2, -1, 0, 1, 2 ];
+DCL inttable2 ARRAY (5:9) INT INIT := [ -2, -1, 0, 1, 2 ];
+
+DCL uint_low UINT INIT := 0;
+DCL uint_high UINT INIT := 65_535;
+DCL uinttable1 ARRAY (0:4) UINT INIT := [ 0, 1, 2, 3, 4 ];
+DCL uinttable2 ARRAY (5:9) UINT INIT := [ 0, 1, 2, 3, 4 ];
+
+DCL long_low LONG INIT := -2_147_483_648;
+DCL long_high LONG INIT := 2_147_483_647;
+DCL longtable1 ARRAY (0:4) LONG INIT := [ -2, -1, 0, 1, 2 ];
+DCL longtable2 ARRAY (5:9) LONG INIT := [ -2, -1, 0, 1, 2 ];
+
+DCL ulong_low ULONG INIT := 0;
+DCL ulong_high ULONG INIT := 4_294_967_295;
+DCL ulongtable1 ARRAY (0:4) ULONG INIT := [ 0, 1, 2, 3, 4 ];
+DCL ulongtable2 ARRAY (5:9) ULONG INIT := [ 0, 1, 2, 3, 4 ];
+
+DCL real1 FLOAT INIT := 3.14159265358;
+DCL real2 FLOAT INIT := -3.14159265358;
+DCL realtable1 ARRAY (0:4) FLOAT INIT := [ -2.0, -1.0, 0.0, 1.0, 2.0 ];
+DCL realtable2 ARRAY (5:9) FLOAT INIT := [ -2.0, -1.0, 0.0, 1.0, 2.0 ];
+
+DCL long_real1 DOUBLE INIT := 3.14e300;
+DCL long_real2 DOUBLE INIT := -3.14e-300;
+DCL longrealtable1 ARRAY (0:4) DOUBLE INIT := [ -2.0, -1.0, 0.0, 1.0, 2.0 ];
+DCL longrealtable2 ARRAY (5:9) DOUBLE INIT := [ -2.0, -1.0, 0.0, 1.0, 2.0 ];
+
+/* DCL powerset1 POWERSET INT(0:7);*/
+/* DCL chars1 CHAR (16) INIT := (16)'b'; */
+/* DCL bits1 BIT(20) := B'11111111000010101011'; */
+
+NEWMODE simple_struct = STRUCT (abool BOOL, aint INT, astring CHARS (8));
+DCL struct1 simple_struct := [ TRUE, 123, "a string" ];
+
+NEWMODE nested_struct = STRUCT (abool BOOL, nstruct simple_struct, aint INT);
+DCL struct2 nested_struct := [ TRUE, [ FALSE, 456, "deadbeef" ], 789 ];
+
+/* This table is used as a source for every ascii character. */
+
+DCL asciitable ARRAY (0:255) CHAR INIT := [
+ C'00', C'01', C'02', C'03', C'04', C'05', C'06', C'07',
+ C'08', C'09', C'0a', C'0b', C'0c', C'0d', C'0e', C'0f',
+ C'10', C'11', C'12', C'13', C'14', C'15', C'16', C'17',
+ C'18', C'19', C'1a', C'1b', C'1c', C'1d', C'1e', C'1f',
+ C'20', C'21', C'22', C'23', C'24', C'25', C'26', C'27',
+ C'28', C'29', C'2a', C'2b', C'2c', C'2d', C'2e', C'2f',
+ C'30', C'31', C'32', C'33', C'34', C'35', C'36', C'37',
+ C'38', C'39', C'3a', C'3b', C'3c', C'3d', C'3e', C'3f',
+ C'40', C'41', C'42', C'43', C'44', C'45', C'46', C'47',
+ C'48', C'49', C'4a', C'4b', C'4c', C'4d', C'4e', C'4f',
+ C'50', C'51', C'52', C'53', C'54', C'55', C'56', C'57',
+ C'58', C'59', C'5a', C'5b', C'5c', C'5d', C'5e', C'5f',
+ C'60', C'61', C'62', C'63', C'64', C'65', C'66', C'67',
+ C'68', C'69', C'6a', C'6b', C'6c', C'6d', C'6e', C'6f',
+ C'70', C'71', C'72', C'73', C'74', C'75', C'76', C'77',
+ C'78', C'79', C'7a', C'7b', C'7c', C'7d', C'7e', C'7f',
+ C'80', C'81', C'82', C'83', C'84', C'85', C'86', C'87',
+ C'88', C'89', C'8a', C'8b', C'8c', C'8d', C'8e', C'8f',
+ C'90', C'91', C'92', C'93', C'94', C'95', C'96', C'97',
+ C'98', C'99', C'9a', C'9b', C'9c', C'9d', C'9e', C'9f',
+ C'a0', C'a1', C'a2', C'a3', C'a4', C'a5', C'a6', C'a7',
+ C'a8', C'a9', C'aa', C'ab', C'ac', C'ad', C'ae', C'af',
+ C'b0', C'b1', C'b2', C'b3', C'b4', C'b5', C'b6', C'b7',
+ C'b8', C'b9', C'ba', C'bb', C'bc', C'bd', C'be', C'bf',
+ C'c0', C'c1', C'c2', C'c3', C'c4', C'c5', C'c6', C'c7',
+ C'c8', C'c9', C'ca', C'cb', C'cc', C'cd', C'ce', C'cf',
+ C'd0', C'd1', C'd2', C'd3', C'd4', C'd5', C'd6', C'd7',
+ C'd8', C'd9', C'da', C'db', C'dc', C'dd', C'de', C'df',
+ C'e0', C'e1', C'e2', C'e3', C'e4', C'e5', C'e6', C'e7',
+ C'e8', C'e9', C'ea', C'eb', C'ec', C'ed', C'ee', C'ef',
+ C'f0', C'f1', C'f2', C'f3', C'f4', C'f5', C'f6', C'f7',
+ C'f8', C'f9', C'fa', C'fb', C'fc', C'fd', C'fe', C'ff'
+];
+
+DCL charmatrix ARRAY (0:255) CHAR INIT := [
+ 'a','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X',
+ 'a','a','X','X','X','X','X','X','X','X','X','X','X','X','X','X',
+ 'a','a','a','X','X','X','X','X','X','X','X','X','X','X','X','X',
+ 'a','a','a','a','X','X','X','X','X','X','X','X','X','X','X','X',
+ 'a','a','a','a','a','X','X','X','X','X','X','X','X','X','X','X',
+ 'a','a','a','a','a','a','X','X','X','X','X','X','X','X','X','X',
+ 'a','a','a','a','a','a','a','X','X','X','X','X','X','X','X','X',
+ 'a','a','a','a','a','a','a','a','X','X','X','X','X','X','X','X',
+ 'a','a','a','a','a','a','a','a','a','X','X','X','X','X','X','X',
+ 'a','a','a','a','a','a','a','a','a','a','X','X','X','X','X','X',
+ 'a','a','a','a','a','a','a','a','a','a','a','X','X','X','X','X',
+ 'a','a','a','a','a','a','a','a','a','a','a','a','X','X','X','X',
+ 'a','a','a','a','a','a','a','a','a','a','a','a','a','X','X','X',
+ 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','X','X',
+ 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','X',
+ 'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a'
+];
+
+DCL xptr PTR INIT := ->int_high;
+
+booleans: PROC ();
+
+ DCL val1 BOOL := TRUE;
+ DCL val2 BOOL := FALSE;
+ DCL val3 BOOL := TRUE;
+
+ val1 := TRUE XOR TRUE;
+ val1 := TRUE XOR FALSE;
+ val1 := FALSE XOR TRUE;
+ val1 := FALSE XOR FALSE;
+ val1 := val2 XOR val3;
+
+ val1 := TRUE AND TRUE;
+ val1 := TRUE AND FALSE;
+ val1 := FALSE AND TRUE;
+ val1 := FALSE AND FALSE;
+ val1 := val2 AND val3;
+
+ val1 := TRUE ANDIF TRUE;
+ val1 := TRUE ANDIF FALSE;
+ val1 := FALSE ANDIF TRUE;
+ val1 := FALSE ANDIF FALSE;
+ val1 := val2 ANDIF val3;
+
+ val1 := TRUE OR TRUE;
+ val1 := TRUE OR FALSE;
+ val1 := FALSE OR TRUE;
+ val1 := FALSE OR FALSE;
+ val1 := val2 OR val3;
+
+-- val1 := NOT TRUE;
+-- val1 := NOT FALSE;
+-- val1 := NOT val2;
+-- val1 := NOT val3;
+
+END booleans;
+
+scalar_arithmetic: PROC ();
+
+ DCL val1 INT := 1;
+ DCL val2 INT := 2;
+ DCL val3 INT := 3;
+
+ val1 := -val2;
+ val1 := val2 + val3;
+ val1 := val2 - val3;
+ val1 := val2 * val3;
+ val1 := val2 / val3;
+ val1 := val2 MOD val3;
+ val1 := val2 REM val3;
+
+END scalar_arithmetic;
+
+write_arrays: PROC ();
+
+ inttable1(0) := 0;
+ inttable1(1) := 1;
+ inttable1(2) := 2;
+ inttable1(3) := 3;
+ inttable1(4) := 4;
+ inttable2(5) := 5;
+ inttable2(6) := 6;
+ inttable2(7) := 7;
+ inttable2(8) := 8;
+ inttable2(9) := 9;
+
+END write_arrays;
+
+uint_low := 0;
+
+scalar_arithmetic ();
+write_arrays ();
+booleans ();
+
+END;
diff --git a/gdb/testsuite/gdb.chill/chillvars.exp b/gdb/testsuite/gdb.chill/chillvars.exp
new file mode 100644
index 00000000000..386bf432bd1
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/chillvars.exp
@@ -0,0 +1,316 @@
+# Copyright 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "chillvars"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ # This is needed (at least on SunOS4) to make sure the
+ # the symbol table is read.
+ gdb_test "break chillvars.ch:3" ""
+ gdb_test "delete 1" ""
+
+ gdb_test "set width 0" ""
+ gdb_test "set print sevenbit-strings" ""
+ gdb_test "set print address off" ""
+
+ test_BOOL
+ test_CHAR
+ test_BYTE
+ test_UBYTE
+ test_INT
+ test_UINT
+ test_LONG
+ test_ULONG
+ test_REAL
+ test_LONG_REAL
+ test_POWERSET
+ test_arrays
+ test_strings
+ test_structs
+
+ test_ptr
+}
+
+proc test_BOOL {} {
+
+ gdb_test "ptype bool_true" "type = (BOOL|bool)"
+ gdb_test "ptype bool_false" "type = (BOOL|bool)"
+ gdb_test "whatis bool_true" "type = (BOOL|bool)"
+ gdb_test "whatis bool_false" "type = (BOOL|bool)"
+ gdb_test "print bool_false" " = FALSE"
+ gdb_test "print bool_true" " = TRUE"
+
+}
+
+proc test_CHAR {} {
+ gdb_test "ptype control_char" "type = (CHAR|char)"
+ gdb_test "whatis control_char" "type = (CHAR|char)"
+ gdb_test "print control_char" { = '\^[(]7[)]'}
+ gdb_test "ptype printable_char" "type = (CHAR|char)"
+ gdb_test "whatis printable_char" "type = (CHAR|char)"
+ gdb_test "print printable_char" " = 'a'"
+
+ gdb_test "print lower(char)" { = '\^[(]0[)]'}
+ gdb_test "print upper(char)" { = '\^[(]255[)]'}
+}
+
+proc test_BYTE {} {
+ gdb_test "ptype byte_low" "type = (BYTE|byte)"
+ gdb_test "whatis byte_low" "type = (BYTE|byte)"
+ gdb_test "print byte_low" " = -128"
+ gdb_test "ptype byte_high" "type = (BYTE|byte)"
+ gdb_test "whatis byte_high" "type = (BYTE|byte)"
+ gdb_test "print byte_high" " = 127"
+
+ gdb_test "print lower(byte)" " = -128"
+ gdb_test "print upper(byte)" " = 127"
+ gdb_test "print lower(byte_high)" " = -128"
+ gdb_test "print upper(byte_high)" " = 127"
+}
+
+proc test_UBYTE {} {
+ gdb_test "ptype ubyte_low" "type = (UBYTE|ubyte)"
+ gdb_test "whatis ubyte_low" "type = (UBYTE|ubyte)"
+ gdb_test "print ubyte_low" " = 0"
+ gdb_test "ptype ubyte_high" "type = (UBYTE|ubyte)"
+ gdb_test "whatis ubyte_high" "type = (UBYTE|ubyte)"
+ gdb_test "print ubyte_high" " = 255"
+}
+
+proc test_INT {} {
+ gdb_test "ptype int_low" "type = (INT|int)"
+ gdb_test "whatis int_low" "type = (INT|int)"
+ gdb_test "print int_low" " = -32768"
+ gdb_test "ptype int_high" "type = (INT|int)"
+ gdb_test "whatis int_high" "type = (INT|int)"
+ gdb_test "print int_high" " = 32767"
+}
+
+proc test_UINT {} {
+ gdb_test "ptype uint_low" "type = (UINT|uint)"
+ gdb_test "whatis uint_low" "type = (UINT|uint)"
+ gdb_test "print uint_low" " = 0"
+ gdb_test "ptype uint_high" "type = (UINT|uint)"
+ gdb_test "whatis uint_high" "type = (UINT|uint)"
+ gdb_test "print uint_high" " = 65535"
+}
+
+proc test_LONG {} {
+ gdb_test "ptype long_low" "type = (LONG|long)"
+ gdb_test "whatis long_low" "type = (LONG|long)"
+ gdb_test "print long_low" " = -2147483648"
+ gdb_test "ptype long_high" "type = (LONG|long)"
+ gdb_test "whatis long_high" "type = (LONG|long)"
+ gdb_test "print long_high" " = 2147483647"
+}
+
+proc test_ULONG {} {
+ gdb_test "ptype ulong_low" "type = (ULONG|ulong)"
+ gdb_test "whatis ulong_low" "type = (ULONG|ulong)"
+ gdb_test "print ulong_low" " = 0"
+ gdb_test "ptype ulong_high" "type = (ULONG|ulong)"
+ gdb_test "whatis ulong_high" "type = (ULONG|ulong)"
+ gdb_test "print ulong_high" " = 4294967295"
+}
+
+proc test_REAL {} {
+ gdb_test "ptype real1" "type = (FLOAT|float)"
+ gdb_test "whatis real1" "type = (FLOAT|float)"
+ gdb_test "print real1" " = 3.14159274"
+}
+
+proc test_LONG_REAL {} {
+ gdb_test "ptype long_real1" "type = (DOUBLE|double)"
+ gdb_test "whatis long_real1" "type = (DOUBLE|double)"
+ gdb_test "print long_real1" " = 3\\.1400000000000001e\\+300"
+}
+
+proc test_POWERSET {} {
+}
+
+proc test_arrays {} {
+ gdb_test "ptype booltable1" "type = ARRAY \\(+0:3\\)+ (BOOL|bool)"
+ gdb_test_exact "print booltable1" \
+ { = [(0): TRUE, (1:2): FALSE, (3): TRUE]}
+
+ gdb_test "ptype booltable2" "type = ARRAY \\(+4:7\\)+ (BOOL|bool)"
+ gdb_test_exact "print booltable2" { = [(4): TRUE, (5:6): FALSE, (7): TRUE]}
+
+ gdb_test "ptype chartable1" "type = ARRAY \\(+0:2\\)+ (CHAR|char)"
+ gdb_test_exact "print chartable1" {= [(0): '^(0)', (1): '^(1)', (2): '^(2)']}
+
+ gdb_test "ptype chartable2" "type = ARRAY \\(+3:5\\)+ (CHAR|char)"
+ gdb_test_exact "print chartable2" \
+ {= [(3): '^(0)', (4): '^(1)', (5): '^(2)']}
+
+ gdb_test "ptype bytetable1" "type = ARRAY \\(+0:4\\)+ (BYTE|byte)"
+ gdb_test_exact "print bytetable1" \
+ {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
+
+ gdb_test "ptype bytetable2" "type = ARRAY \\(+5:9\\)+ (BYTE|byte)"
+ gdb_test_exact "print bytetable2" \
+ {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
+
+ gdb_test "ptype bytetable3" \
+ "type = ARRAY \\(1:2\\) ARRAY \\('c':'d'\\) ARRAY \\(FALSE:TRUE\\) (BYTE|byte)"
+ gdb_test_exact "print bytetable3" \
+ {= [(1): [('c'): [(FALSE): 0, (TRUE): 1], ('d'): [(FALSE): 2, (TRUE): 3]], (2): [('c'): [(FALSE): 4, (TRUE): 5], ('d'): [(FALSE): 6, (TRUE): 7]]]}
+ gdb_test "ptype bytetable4" \
+ "type = ARRAY \\(1:2\\) ARRAY \\('c':'d'\\) ARRAY \\(FALSE:TRUE\\) (BYTE|byte)"
+ gdb_test_exact "print bytetable4" \
+ {= [(1): [('c'): [(FALSE): 0, (TRUE): 1], ('d'): [(FALSE): 2, (TRUE): 3]], (2): [('c'): [(FALSE): 4, (TRUE): 5], ('d'): [(FALSE): 6, (TRUE): 7]]]}
+
+ gdb_test "ptype ubytetable1" "type = ARRAY \\(+0:4\\)+ (UBYTE|ubyte)"
+ gdb_test_exact "print ubytetable1" \
+ {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
+
+ gdb_test "ptype ubytetable2" "type = ARRAY \\(+5:9\\)+ (UBYTE|ubyte)"
+ gdb_test_exact "print ubytetable2" \
+ {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
+
+ gdb_test "ptype inttable1" "type = ARRAY \\(+0:4\\)+ (INT|int)"
+ gdb_test_exact "print inttable1" \
+ {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
+
+ gdb_test "ptype inttable2" "type = ARRAY \\(+5:9\\)+ (INT|int)"
+ gdb_test_exact "print inttable2" \
+ {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
+
+ gdb_test "ptype uinttable1" "type = ARRAY \\(+0:4\\)+ (UINT|uint)"
+ gdb_test_exact "print uinttable1" \
+ {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
+
+ gdb_test "ptype uinttable2" "type = ARRAY \\(+5:9\\)+ (UINT|uint)"
+ gdb_test_exact "print uinttable2" \
+ {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
+
+ gdb_test "ptype longtable1" "type = ARRAY \\(+0:4\\)+ (LONG|long)"
+ gdb_test_exact "print longtable1" \
+ {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
+
+ gdb_test "ptype longtable2" "type = ARRAY \\(+5:9\\)+ (LONG|long)"
+ gdb_test_exact "print longtable2" \
+ {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
+
+ gdb_test "ptype ulongtable1" "type = ARRAY \\(+0:4\\)+ (ULONG|ulong)"
+ gdb_test_exact "print ulongtable1" \
+ {= [(0): 0, (1): 1, (2): 2, (3): 3, (4): 4]}
+
+ gdb_test "ptype ulongtable2" "type = ARRAY \\(+5:9\\)+ (ULONG|ulong)"
+ gdb_test_exact "print ulongtable2" \
+ {= [(5): 0, (6): 1, (7): 2, (8): 3, (9): 4]}
+
+ gdb_test "ptype realtable1" "type = ARRAY \\(+0:4\\)+ (FLOAT|float)"
+ gdb_test_exact "print realtable1" \
+ {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
+
+ gdb_test "ptype realtable2" "type = ARRAY \\(+5:9\\)+ (FLOAT|float)"
+ gdb_test_exact "print realtable2" \
+ {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
+
+ gdb_test "ptype longrealtable1" "type = ARRAY \\(+0:4\\)+ (DOUBLE|double)"
+ gdb_test_exact "print longrealtable1" \
+ {= [(0): -2, (1): -1, (2): 0, (3): 1, (4): 2]}
+
+ gdb_test "ptype longrealtable2" "type = ARRAY \\(+5:9\\)+ (DOUBLE|double)"
+ gdb_test_exact "print longrealtable2" \
+ {= [(5): -2, (6): -1, (7): 0, (8): 1, (9): 2]}
+
+ gdb_test "print length(longrealtable2)" {= 5}
+ gdb_test "print lower(longrealtable2)" {= 5}
+ gdb_test "print upper(longrealtable2)" {= 9}
+}
+
+proc test_strings {} {
+
+ gdb_test "ptype string1" "type = CHARS \[(\]4\[)\]+"
+ gdb_test "print string1" " = \"abcd\""
+
+ gdb_test "ptype string2" "type = CHARS \[(\]+5\[)\]+"
+ gdb_test "print string2" { = \"ef\^\(0\)gh\"}
+
+ gdb_test "ptype string3" "type = CHARS \[(\]+6\[)\]+"
+ gdb_test "print string3" " = \"efghij\""
+
+ gdb_test "ptype string4" "type = CHARS \[(\]+7\[)\]+"
+ gdb_test "print string4" { = \"zzzzzz\^\(0\)\"}
+
+ # These tests require a running process, so run to one of the procs
+ # and then do the tests.
+
+ if [runto scalar_arithmetic] then {
+ gdb_test "ptype string1//string2" "type = CHARS \\(9\\)"
+ gdb_test "print string1//string2" { = \"abcdef\^\(0\)gh\"}
+ gdb_test_exact {ptype "a chill string"} {type = CHARS (14)}
+ gdb_test "print 'a chill string'" " = \"a chill string\""
+ gdb_test "print \"ef\"//c'00'//\"gh\"" { = \"ef\^\(0\)gh\"}
+ gdb_test "print string1 // \"efgh\"" " = \"abcdefgh\""
+ gdb_test "print (6) 'z'" " = \"zzzzzz\""
+ gdb_test "ptype (6) 'z'" "type = CHARS \[(\]+6\[)\]+"
+ gdb_test "print (1+2*3) 'x'" " = \"xxxxxxx\""
+ gdb_test "ptype (1+2*3) 'x'" "type = CHARS \[(\]+7\[)\]+"
+ }
+
+}
+
+proc test_structs {} {
+ gdb_test "ptype struct1" \
+ "type = STRUCT \\(+.*abool (BOOL|bool),.*aint (INT|int),.*astring CHARS \\(+8\\)+.*\\)+"
+ gdb_test "print struct1" \
+ ".* = \\\[\.abool: TRUE, \.aint: 123, \.astring: \"a string\"\\\]"
+ gdb_test "ptype struct2" \
+ "type = STRUCT \\(+.*abool (BOOL|bool),.*nstruct simple_struct,.*aint (INT|int).*\\)+"
+ gdb_test "print struct2" \
+ ".* = \\\[.abool: TRUE, \.nstruct: \\\[\.abool: FALSE, \.aint: 456, \.astring: \"deadbeef\"\\\], \.aint: 789\\\]"
+}
+
+proc test_ptr {} {
+ # This is to test Cygnus PR 6932
+ gdb_test "print xptr->int" ".* = 32767"
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/configure b/gdb/testsuite/gdb.chill/configure
new file mode 100755
index 00000000000..24e429d9ce5
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/configure
@@ -0,0 +1,899 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=chexp.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:573: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:594: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:612: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.chill/configure.in b/gdb/testsuite/gdb.chill/configure.in
new file mode 100644
index 00000000000..3eed026de42
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/configure.in
@@ -0,0 +1,11 @@
+dnl Process this file file with autoconf to produce a configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(chexp.exp)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.chill/enum.ch b/gdb/testsuite/gdb.chill/enum.ch
new file mode 100644
index 00000000000..971fc9421a5
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/enum.ch
@@ -0,0 +1,9 @@
+hugo: module
+
+ synmode m_set = set (a, b, c, d, e, f, g, h, i);
+ dcl x long;
+ dcl y m_set;
+
+ writetext (stdout, "done.%/");
+
+end hugo;
diff --git a/gdb/testsuite/gdb.chill/enum.exp b/gdb/testsuite/gdb.chill/enum.exp
new file mode 100644
index 00000000000..78152722bcf
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/enum.exp
@@ -0,0 +1,85 @@
+# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Wilfried Moser (moser@aut.alcatel.at
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "enum"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_chill {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ return [gdb_test "show language" ".* source language is \"chill\".*" \
+ "set language to \"chill\""]
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if ![set_lang_chill] then {
+ runto hugo_
+
+ send_gdb "set var \$i := d\n"
+ gdb_expect -re ".*$gdb_prompt $"
+ gdb_test "print \$i" { = d}
+ gdb_test "print size (\$i)" { = 1}
+ gdb_test "print b+c" { = 3}
+ gdb_test "print c*d" { = 6}
+ gdb_test "print a<b" { = TRUE}
+ gdb_test "print a=b" { = FALSE}
+ gdb_test "print a=a" { = TRUE}
+ gdb_test "print a/=\$i" { = TRUE}
+
+# This is PR 8870
+ gdb_test "break malloc" ".*"
+ gdb_test {set var $j := m_set[b]} ".*invalid.*tuple.*"
+}
diff --git a/gdb/testsuite/gdb.chill/func1.ch b/gdb/testsuite/gdb.chill/func1.ch
new file mode 100644
index 00000000000..d0d28ce9fae
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/func1.ch
@@ -0,0 +1,9 @@
+func1: MODULE
+
+SYNMODE m_set = SET (e1, e2, e3, e4, e5, e6, e7, e8, e9, e10);
+SYNMODE m_setrange = RANGE (e3:e8);
+SYNMODE m_ps = POWERSET m_set;
+SYNMODE m_rangeps = POWERSET RANGE(0:31);
+GRANT ALL;
+
+END func1;
diff --git a/gdb/testsuite/gdb.chill/gch1041.ch b/gdb/testsuite/gdb.chill/gch1041.ch
new file mode 100644
index 00000000000..a9ce80b75ed
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/gch1041.ch
@@ -0,0 +1,17 @@
+arr: MODULE
+
+SYNMODE m_chars = CHARS(30) VARYING;
+SYNMODE m_s = STRUCT (l LONG, c m_chars, b BOOL);
+
+DCL a1 ARRAY (1:1000) LONG INIT := [(5:100): 33, (1:4): 44, (ELSE): 55 ];
+DCL a2 ARRAY (1:10) m_s INIT := [(*): [ 22, "mowi", TRUE ] ];
+DCL a3 ARRAY (CHAR) CHAR INIT := [(*): 'X'];
+
+SYNMODE m_set = SET (e1, e2, e3, e4, e5, e6, e7, e9, e10);
+DCL a4 ARRAY (m_set) BOOL INIT := [(*): TRUE];
+
+a1 := [(5:100): 33, (1:4): 44, (ELSE): 55 ];
+a1 := [ (*): 22 ];
+a2 := [(*): [ 22, "mowi", TRUE ] ];
+
+END arr;
diff --git a/gdb/testsuite/gdb.chill/gch1041.exp b/gdb/testsuite/gdb.chill/gch1041.exp
new file mode 100644
index 00000000000..ec80ddf4629
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/gch1041.exp
@@ -0,0 +1,76 @@
+# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+# Martin Pottendorfer (pottendo@aut.alcatel.at)
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "gch1041"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_chill {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ return [gdb_test "show language" ".* source language is \"chill\".*" \
+ "set language to \"chill\""]
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if ![set_lang_chill] then {
+ runto arr_
+ # check if array slices print correct index
+ gdb_test {print a1(10:30)} { = \[\(10:30\): 33\]}
+ gdb_test {print a2(3:5)} { = \[\(3:5\): \[.l: 22, .c: "mowi", .b: TRUE\]\]}
+ gdb_test {print a3('a':'c')} { = \[\('a':'c'\): 'X'\]}
+ gdb_test {print a4(e2:e5)} { = \[\(e2:e5\): TRUE\]}
+}
diff --git a/gdb/testsuite/gdb.chill/gch1272.ch b/gdb/testsuite/gdb.chill/gch1272.ch
new file mode 100644
index 00000000000..6112d4ba60a
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/gch1272.ch
@@ -0,0 +1,21 @@
+gch1272: MODULE
+
+SYNMODE m_array = ARRAY (0:99) INT;
+DCL foo m_array;
+
+SYNMODE m_xxx = ARRAY (1:10) LONG;
+
+SYNMODE m_struct = STRUCT (i LONG, b BOOL);
+SYNMODE m_bar = ARRAY (-10:20) m_struct;
+DCL bar m_bar;
+
+SYNMODE m_ps = POWERSET LONG (0:20);
+
+brrr: PROC ()
+END;
+
+foo := [ (*): 222 ];
+
+brrr ();
+
+END gch1272;
diff --git a/gdb/testsuite/gdb.chill/gch1272.exp b/gdb/testsuite/gdb.chill/gch1272.exp
new file mode 100644
index 00000000000..544a5ecb6bf
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/gch1272.exp
@@ -0,0 +1,86 @@
+# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Wilfried Moser (moser@aut.alcatel.at)
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "gch1272"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_chill {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ return [gdb_test "show language" ".* source language is \"chill\".*" \
+ "set language to \"chill\""]
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if ![set_lang_chill] then {
+ runto brrr
+
+ # check foo
+ gdb_test {print foo} { = \[\(0:99\): 222\]}
+ gdb_test "set var foo := m_array\[\(\*\):44\]" ".*"
+ gdb_test {print foo} { = \[\(0:99\): 44\]}
+
+ # check bar
+ gdb_test {print bar} { = \[\(-10:20\): \[.i: 0, .b: FALSE\]\]}
+ gdb_test "set var bar := m_bar\[\(\*\): \[42, TRUE\]\]" ".*"
+ gdb_test {print bar} { = \[\(-10:20\): \[.i: 42, .b: TRUE\]\]}
+
+ # some failues
+ gdb_test "set var foo := \[\(\*\):44\]" {\(\*\) only possible with modename in front of tuple \(mode\[\.\.\]\)}
+ gdb_test "set var foo := m_xxx\[\(\*\):44\]" {Invalid cast\.}
+ gdb_test "set var foo := m_struct\[\(\*\):44\]" {\(\*\) in invalid context}
+ gdb_test "set var foo := m_ps\[\(\*\):44\]" {\(\*\) in invalid context}
+}
diff --git a/gdb/testsuite/gdb.chill/gch1280.ch b/gdb/testsuite/gdb.chill/gch1280.ch
new file mode 100644
index 00000000000..3fba71f9111
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/gch1280.ch
@@ -0,0 +1,13 @@
+gch1280: MODULE
+
+SYNMODE m_x = ARRAY (1:3) LONG;
+DCL v_x m_x;
+DCL v_xx m_x;
+
+doit: PROC ()
+END doit;
+
+v_x := [ 11, 12, 13 ];
+doit ();
+
+END gch1280;
diff --git a/gdb/testsuite/gdb.chill/gch1280.exp b/gdb/testsuite/gdb.chill/gch1280.exp
new file mode 100644
index 00000000000..c05f84547ea
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/gch1280.exp
@@ -0,0 +1,76 @@
+# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Wilfried Moser (moser@aut.alcatel.at)
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "gch1280"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_chill {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ return [gdb_test "show language" ".* source language is \"chill\".*" \
+ "set language to \"chill\""]
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if ![set_lang_chill] then {
+ runto doit
+ gdb_test "next" ""
+ # check too many array elements
+ gdb_test {set var v_x := [1,2,3,4,5]} {Too many array elements}
+ gdb_test {set var $i := m_x[(3): 22, 25]} {Too many array elements}
+ gdb_test "set var \$i := m_x\[\(2\): 22, 25\]" ""
+ gdb_test {print $i} { = \[\(1\): 0, \(2\): 22, \(3\): 25\]}
+}
diff --git a/gdb/testsuite/gdb.chill/gch922.ch b/gdb/testsuite/gdb.chill/gch922.ch
new file mode 100644
index 00000000000..b3e8a239512
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/gch922.ch
@@ -0,0 +1,23 @@
+xx : module
+
+dcl a chars(200) varying init := (70)'^(0)' // "Jason""^(0,5)""Hugo^(10)" // (70)'^(1)';
+dcl b chars(20) varying init := "Jason""^(0,5)""Hugo^(10)";
+dcl c chars(256) varying init := (70)'a' // "^(0,5)Jason" // (70)'b';
+dcl d char init := '^(11)';
+
+bulk: PROC ();
+END bulk;
+
+a := (50) '^(255,0,222,127)';
+b := (1)'^(200)';
+d := 'a';
+
+c:= (256)" ";
+
+DO FOR i:= 0 BY 1 TO 255;
+ c (255-i) := char (i);
+OD;
+
+bulk ();
+
+end xx; \ No newline at end of file
diff --git a/gdb/testsuite/gdb.chill/gch922.exp b/gdb/testsuite/gdb.chill/gch922.exp
new file mode 100644
index 00000000000..104b6224338
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/gch922.exp
@@ -0,0 +1,183 @@
+# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file tests various Chill values, expressions, and types.
+
+# This file was written by Wilfried Moser (moser@aut.alcatel.at)
+# Kurt Fuchs (fuchs_k@aut.alcatel.at)
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "gch922"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_chill {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"chill\".*$gdb_prompt $" {
+ pass "set language to \"chill\""
+ send_gdb "break xx_\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ send_gdb "run\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+ return 1
+ }
+ timeout {
+ fail "can't set breakpoint (timeout)"
+ return 0
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "setting language to \"chill\""
+ return 0
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return 0
+ }
+ }
+}
+
+# Testing printing of a specific value. Increment passcount for
+# success or issue fail message for failure. In both cases, return
+# a 1 to indicate that more tests can proceed. However a timeout
+# is a serious error, generates a special fail message, and causes
+# a 0 to be returned to indicate that more tests are likely to fail
+# as well.
+#
+# Args are:
+#
+# First one is string to send_gdb to gdb
+# Second one is string to match gdb result to
+# Third one is an optional message to be printed
+
+proc test_print_accept { args } {
+ global gdb_prompt
+ global passcount
+ global verbose
+
+ if [llength $args]==3 then {
+ set message [lindex $args 2]
+ } else {
+ set message [lindex $args 0]
+ }
+ set sendthis [lindex $args 0]
+ set expectthis [lindex $args 1]
+ set result [gdb_test $sendthis ".* = ${expectthis}" $message]
+ if $result==0 {incr passcount}
+ return $result
+}
+
+
+proc test_chars {} {
+ global passcount gdb_prompt
+
+ verbose "Testing Chars"
+ set passcount 0
+
+ test_print_accept "print a" {'\^\(0\)'<repeats 70 times>//"Jason""\^\(0,5\)""Hugo\^\(10\)"//'\^\(1\)'<repeats 70 times>}
+ test_print_accept "print b" {"Jason""\^\(0,5\)""Hugo\^\(10\)"}
+ test_print_accept "print c" {'a'<repeats 70 times>//"\^\(0,5\)Jason"//'b'<repeats 70 times>}
+ test_print_accept "print d" {'\^\(11\)'}
+
+ gdb_test "set var a := (100)'\^(0,255)'" ""
+ test_print_accept "print a" {"\^\(0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255\)"}
+
+ send_gdb "set var a := (10)'\^(1)'//(26)\"\^(66,67)\"//\" \"//'I'//' '//'a'//'m'//\" Hugo\" \n" ; gdb_expect -re "$gdb_prompt $"
+ test_print_accept "print a" {"\^\(1,1,1,1,1,1,1,1,1,1\)BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC I am Hugo"}
+ send_gdb "set var b := \"Hugo \"\"\^(3,4)\"\"Otto\^(17)\" \n" ; gdb_expect -re "$gdb_prompt $"
+ test_print_accept "print b" {"Hugo ""\^\(3,4\)""Otto\^\(17\)"}
+ send_gdb "set var c := (70)'b' // \"\^(2,3)Hugo \" // (70)'c' \n" ; gdb_expect -re "$gdb_prompt $"
+ test_print_accept "print c" {'b'<repeats 70 times>//"\^\(2,3\)Hugo "//'c'<repeats 70 times>}
+ gdb_test "set var d := '\^(199)'" ""
+ test_print_accept "print d" {'\^\(199\)'}
+
+ test_print_accept "print (10)'\^(0)'//(26)\"\^(66,67)\"//\" \"//'I'//' '//'a'//'m'//\" Hugo\"" {"\^\(0,0,0,0,0,0,0,0,0,0\)BCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCBC I am Hugo"}
+ test_print_accept "print \"Jason\"\"\^(0,5)\"\"Hugo\^(10)\"" {"Jason""\^\(0,5\)""Hugo\^\(10\)"}
+
+ send_gdb "set var a := \"\" \n" ; gdb_expect -re "$gdb_prompt $"
+ test_print_accept "print a" {""}
+ send_gdb "set var a := \"\"\"\" \n" ; gdb_expect -re "$gdb_prompt $"
+ test_print_accept "print a" {""""}
+ send_gdb "set var a := \" \"\"\" \n" ; gdb_expect -re "$gdb_prompt $"
+ test_print_accept "print a" {" """}
+ send_gdb "set var a := \"\^\^\" \n" ; gdb_expect -re "$gdb_prompt $"
+ test_print_accept "print a" {"\^\^"}
+ send_gdb "set var a := \"'\" \n" ; gdb_expect -re "$gdb_prompt $"
+ test_print_accept "print a" {"'"}
+}
+
+
+proc test_code {} {
+ global passcount gdb_prompt
+
+ verbose "Testing Chars"
+ set passcount 0
+
+ runto bulk
+ test_print_accept "print a" {"\^\(255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127,255,0,222,127\)"}
+ test_print_accept "print b" {"\^\(200\)"}
+# test_print_accept "print c" {'a'<repeats 70 times>//"\^\(0,5\)Jason"//'b'<repeats 70 times>}
+ test_print_accept "print d" {'a'}
+}
+
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+
+if [set_lang_chill] then {
+ # test builtins as described in chapter 6.20.3 Z.200
+
+ test_chars
+# test_code
+} else {
+ warning "$test_name tests suppressed."
+}
diff --git a/gdb/testsuite/gdb.chill/gch981.ch b/gdb/testsuite/gdb.chill/gch981.ch
new file mode 100644
index 00000000000..e8f0474729e
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/gch981.ch
@@ -0,0 +1,60 @@
+xx: MODULE
+
+SYNMODE m_set1 = SET (e1, e2, e3, e4, e5);
+DCL v_set1 m_set1 INIT := e3;
+
+SYNMODE m_set2 = SET (a1=1, a2=2, a3=17, a4=9, a5=8, a6=0, a7=14, a8=33, a9=12);
+DCL v1_set2 m_set2 INIT := a1;
+DCL v2_set2 m_set2 INIT := a2;
+DCL v3_set2 m_set2 INIT := a3;
+DCL v4_set2 m_set2 INIT := a4;
+DCL v5_set2 m_set2 INIT := a5;
+DCL v6_set2 m_set2 INIT := a6;
+DCL v7_set2 m_set2 INIT := a7;
+DCL v8_set2 m_set2 INIT := a8;
+DCL v9_set2 m_set2 INIT := a9;
+
+SYNMODE m_set3 = SET (b1, b2, b3, b4, b5 = 4711, b6, b7 = 4713);
+DCL v_set3 m_set3 INIT := b7;
+
+SYNMODE m_set4 = SET(s1=111111, s2, s3, s4);
+DCL v1_set4 m_set4 INIT := s1;
+
+SYNMODE m_set_range = m_set1(e2:e5);
+DCL v_set_range m_set_range INIT := e3;
+
+SYNMODE m_set_range_arr = ARRAY (m_set_range) BYTE;
+DCL v_set_range_arr ARRAY (m_set_range) BYTE;
+
+SYNMODE m_set_arr = ARRAY (m_set1) BYTE;
+DCL v_set_arr ARRAY (m_set1) BYTE;
+
+NEWMODE m_power1 = POWERSET m_set1;
+DCL v1_power1 READ m_power1 INIT := [e1,e2,e3,e4,e5];
+DCL v2_power1 m_power1 INIT := [];
+
+NEWMODE m_power2 = POWERSET m_set2;
+DCL v_power2 m_power2 INIT := [];
+
+NEWMODE m_power3 = POWERSET m_set3;
+DCL v_power3 m_power3 INIT := [b1:b2];
+
+NEWMODE m_power4 = POWERSET CHAR;
+DCL v_power4 m_power4 INIT := ['b':'x'];
+
+NEWMODE m_power5 = POWERSET INT (2:400);
+DCL v_power5 m_power5 INIT := [2:100];
+
+NEWMODE m_power6 = POWERSET INT;
+DCL v_power6 m_power6;
+
+NEWMODE m_power7 = POWERSET LONG;
+DCL v_power7 m_power7;
+
+
+v_set1:= e2;
+v2_power1:= [e1];
+
+v_set1:= e1;
+
+END xx;
diff --git a/gdb/testsuite/gdb.chill/gch981.exp b/gdb/testsuite/gdb.chill/gch981.exp
new file mode 100644
index 00000000000..5651bb0a56d
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/gch981.exp
@@ -0,0 +1,249 @@
+# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file tests various Chill values, expressions, and types.
+
+# This file was written by Wilfried Moser (moser@aut.alcatel.at)
+# Kurt Fuchs (fuchs_k@aut.alcatel.at)
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "gch981"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_chill {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"chill\".*$gdb_prompt $" {
+ pass "set language to \"chill\""
+ send_gdb "break xx_\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ send_gdb "run\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+ return 1
+ }
+ timeout {
+ fail "can't set breakpoint (timeout)"
+ return 0
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "setting language to \"chill\""
+ return 0
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return 0
+ }
+ }
+}
+
+# Testing printing of a specific value. Increment passcount for
+# success or issue fail message for failure. In both cases, return
+# a 1 to indicate that more tests can proceed. However a timeout
+# is a serious error, generates a special fail message, and causes
+# a 0 to be returned to indicate that more tests are likely to fail
+# as well.
+#
+# Args are:
+#
+# First one is string to send_gdb to gdb
+# Second one is string to match gdb result to
+# Third one is an optional message to be printed
+
+proc test_print_accept { args } {
+ global gdb_prompt
+ global passcount
+ global verbose
+
+ if [llength $args]==3 then {
+ set message [lindex $args 2]
+ } else {
+ set message [lindex $args 0]
+ }
+ set sendthis [lindex $args 0]
+ set expectthis [lindex $args 1]
+ set result [gdb_test $sendthis ".* = ${expectthis}" $message]
+ if $result==0 {incr passcount}
+ return $result
+}
+
+proc test_power {} {
+ global passcount gdb_prompt
+
+ verbose "Testing some POWERSET Stuff"
+ set passcount 0
+
+ test_print_accept "print v1_power1" {\[e1:e5\]}
+ test_print_accept "print v2_power1" {\[\]}
+ test_print_accept "print SIZE(v1_power1)" "1"
+
+ gdb_test "set v1_power1 := \[b1\]" ""
+# if GDB has rejected the improper values, we have to gdb_expect the same!
+ test_print_accept "print v1_power1" {\[e1:e5\]}
+
+ gdb_test "set v1_power1 := \[a1,a2\]" ""
+ test_print_accept "print v1_power1" {\[e1:e5\]}
+ gdb_test "set v1_power1 := \[b1,b2,b3,e4\]" ""
+ test_print_accept "print v1_power1" {\[e1:e5\]}
+ gdb_test "set v1_power1 := \[e4:e5\]" ""
+ test_print_accept "print v1_power1" {\[e4:e5\]}
+ gdb_test "set v1_power1 := \[e1, e2:e3, e5\]" ""
+ test_print_accept "print v1_power1" {\[e1:e3, e5\]}
+ gdb_test "set v1_power1 := \[e1, e2:e4, e4:e5\]" ""
+ test_print_accept "print v1_power1" {\[e1:e5\]}
+ gdb_test "set v1_power1 := \[e1, e1:e3, e1:e2, e2:e3\]" ""
+ test_print_accept "print v1_power1" {\[e1:e3\]}
+
+ gdb_test "set v_power2 := \[e2\]" ""
+ test_print_accept "print v_power2" {\[\]}
+ gdb_test "set v_power2 := \[1,2,3\]" ""
+ test_print_accept "print v_power2" {\[\]}
+ gdb_test "set v_power2 := \[e2, b2, b1\]" ""
+ test_print_accept "print v_power2" {\[\]}
+
+# Note, that this is a numbered SET, so a1:a3 contains all elements (exept a6)
+ gdb_test "set v_power2 := \[a1:a3, a6:a4, a7:a9\]" ""
+ test_print_accept "print v_power2" {\[a6:a3\]}
+ gdb_test "set v_power2 := \[a1, a4:a6, a9\]" ""
+ test_print_accept "print v_power2" {\[a1, a9\]}
+ gdb_test "set v_power2 := \[a1:a2, a6, a9\]" ""
+ test_print_accept "print v_power2" {\[a6:a2, a9\]}
+ gdb_test "set v_power2 := \[a1, a4, a7:a8, a9:a3\]" ""
+ test_print_accept "print v_power2" {\[a1, a4, a9:a8\]}
+ gdb_test "set v_power2 := \[a1, a4:a8\]" ""
+ test_print_accept "print v_power2" {\[a1, a4:a8\]}
+ gdb_test "set v_power2 := \[a8,a3,a7,a9,a5,a6\]" ""
+ test_print_accept "print v_power2" {\[a6, a5, a9, a7, a3, a8\]}
+
+ gdb_test "set v_power3 := \[b1:b2,e1\]" ""
+ test_print_accept "print v_power3" {\[b1:b2\]}
+ gdb_test "set v_power3 := \[b1, b3, b6:b7\]" ""
+ test_print_accept "print v_power3" {\[b1, b3, b6:b7\]}
+ gdb_test "set v_power3 := \[b1, b3:b4, b7\]" ""
+ test_print_accept "print v_power3" {\[b1, b3:b4, b7\]}
+ gdb_test "set v_power3 := \[b1, b4:b6, b7\]" ""
+ test_print_accept "print v_power3" {\[b1, b4:b7\]}
+ gdb_test "set v_power3 := \[b1:b7\]" ""
+ test_print_accept "print v_power3" {\[b1:b7\]}
+ gdb_test "set v_power3 := \[b5:b7, b1\]" ""
+ test_print_accept "print v_power3" {\[b1, b5:b7\]}
+
+ gdb_test "set v_power4 := \[\"b\"\]" ""
+ test_print_accept "print v_power4" {\['b':'x'\]}
+ gdb_test "set v_power4 := \[5\]" ""
+ test_print_accept "print v_power4" {\['b':'x'\]}
+ gdb_test "set v_power4 := \['c':'f','g':'h','o':'t'\]" ""
+ test_print_accept "print v_power4" {\['c':'h', 'o':'t'\]}
+ gdb_test "set v_power4 := \['a','b','c','d','e','f'\]" ""
+ test_print_accept "print v_power4" {\['a':'f'\]}
+ gdb_test "set v_power4 := \['\^(0)':'\^(200)'\]" ""
+ test_print_accept "print v_power4" {\['\^\(0\)':'\^\(200\)'\]}
+
+ gdb_test "set v_power5 := \[a8\]" ""
+ test_print_accept "print v_power5" {\[2:100\]}
+ gdb_test "set v_power5 := \[4\]" ""
+ test_print_accept "print v_power5" {\[4\]}
+ gdb_test "set v_power5 := \[3:95,9:100,10:107,200:250\]" ""
+ test_print_accept "print v_power5" {\[3:107, 200:250\]}
+ gdb_test "set v_power5 := \[2, 100:120, 350:400\]" ""
+ test_print_accept "print v_power5" {\[2, 100:120, 350:400\]}
+ gdb_test "set v_power5 := \[2:64,65:127,128:256,256:399,400\]" ""
+ test_print_accept "print v_power5" {\[2:400\]}
+ gdb_test "set v_power5 := \[3:95, 99:100, 101:107, 200:250\]" ""
+ test_print_accept "print v_power5" {\[3:95, 99:107, 200:250\]}
+
+ gdb_test "set v_power6 := \[a8\]" ""
+ test_print_accept "print v_power6" {\[\]}
+ gdb_test "set v_power6 := \[4\]" ""
+ test_print_accept "print v_power6" {\[4\]}
+ gdb_test "set v_power6 := \[3:95, 99:100, 101:107, 200:250\]" ""
+ test_print_accept "print v_power6" {\[3:95, 99:107, 200:250\]}
+ gdb_test "set v_power6 := \[-111:0, 1:112, 11111:22222\]" ""
+ test_print_accept "print v_power6" {\[-111:112, 11111:22222\]}
+ gdb_test "set v_power6 := \[0, 200:4000, 6666:9999\]" ""
+ test_print_accept "print v_power6" {\[0, 200:4000, 6666:9999\]}
+
+# gdb_test "set v_power7 := \[a8\]" ""
+# test_print_accept "print v_power7" {\[2:100\]}
+# gdb_test "set v_power7 := \[4\]" ""
+# test_print_accept "print v_power7" {\[4\]}
+# gdb_test "set v_power7 := \[3:95, 99:100, 101:107, 200:250\]" ""
+# test_print_accept "print v_power7" {\[3:95, 99:107, 200:250\]}
+# gdb_test "set v_power7 := \[0, 1000, 1000000, 10000000000\]" ""
+# test_print_accept "print v_power7" {\[0, 1000, 1000000, 1000000000\]}
+# gdb_test "set v_power7 := \[-20000:100000, 111111:2222222\]" ""
+# test_print_accept "print v_power7" {\[-20000:100000, 111111:2222222\]}
+# gdb_test "set v_power7 := \[\]" ""
+# test_print_accept "print v_power7" {\[3:95, 99:107, 200:250\]}
+# gdb_test "set v_power7 := \[2:-500, -501:1, 20:370, -888:-920, 1000:2000, 1800:2500\]\ " ""
+# test_print_accept "print v_power7" {\[-920:-888, -501:2, 20:370, 1000:2500\]}
+# test_print_accept "print SIZE(v_power7)" ""
+
+
+ runto 58
+ test_print_accept "print v_set1 IN v1_power1" "TRUE"
+ test_print_accept "print v_set1 IN v2_power1" "FALSE"
+
+}
+
+
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+
+if [set_lang_chill] then {
+ # test builtins as described in chapter 6.20.3 Z.200
+
+ test_power
+} else {
+ warning "$test_name tests suppressed."
+}
diff --git a/gdb/testsuite/gdb.chill/misc.ch b/gdb/testsuite/gdb.chill/misc.ch
new file mode 100644
index 00000000000..20f12c81405
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/misc.ch
@@ -0,0 +1,12 @@
+misc_tests : MODULE;
+
+DCL otto INT := 42;
+
+DCL foo STRUCT (l LONG, c CHAR, b BOOL, s CHARS(3));
+
+dummyfunc: PROC();
+END dummyfunc;
+
+dummyfunc();
+
+END misc_tests;
diff --git a/gdb/testsuite/gdb.chill/misc.exp b/gdb/testsuite/gdb.chill/misc.exp
new file mode 100644
index 00000000000..e58ba798103
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/misc.exp
@@ -0,0 +1,100 @@
+# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+# Martin Pottendorfer (pottendo@aut.alcatel.at)
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "misc"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_chill {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ return [gdb_test "show language" ".* source language is \"chill\".*" \
+ "set language to \"chill\""]
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if ![set_lang_chill] then {
+ runto dummyfunc
+ # check upper/lower case
+ gdb_test "ptype BOOL" " = (bool|BOOL)"
+ gdb_test "ptype bool" " = (bool|BOOL)"
+ gdb_test "print otto" " = 42"
+ gdb_test "print OTTO" " = 42"
+ gdb_test "print otTO" " = 42"
+ gdb_test "print OTto" " = 42"
+ gdb_test "print NULL" " = NULL" "print emptiness literal"
+
+ # This tests PR 8496.
+ gdb_test {printf "%d %d.", 3+4,2} "7 2." "printf with 2 arguments"
+
+ # This tests GCH/924
+ gdb_test {print (h'23)} { = 35} "print parantised integer literal"
+
+ # Linux thinks this is at line 6, but is otherwise ok.
+ setup_xfail "i*86-pc-linux*-gnu"
+ gdb_test "info line" \
+ {Line 7 of .*misc.ch.* at address H'[0-9a-fA-F]+.*}\
+ "info about current line"
+
+ # check array () type (expr)
+ setup_xfail "m68*-*-hpux*"
+ gdb_test "print array () ubyte (foo)" { = \[\(0:11\): 0\]}
+
+ send_gdb "set var \$i := foo\n"
+ gdb_expect -re ".*$gdb_prompt $"
+ setup_xfail "m68*-*-hpux*"
+ gdb_test "print/x array () byte (\$i)" { = \[\(0:11\): H'0\]}
+}
diff --git a/gdb/testsuite/gdb.chill/powerset.ch b/gdb/testsuite/gdb.chill/powerset.ch
new file mode 100644
index 00000000000..dd3172d3640
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/powerset.ch
@@ -0,0 +1,33 @@
+--
+-- check powerset operators and built-ins
+--
+
+ps: MODULE
+
+SYNMODE m_ps1 = POWERSET ULONG (0:8);
+DCL v_ps1 m_ps1 INIT := [1,3,5,7];
+
+SYNMODE m_ps2 = POWERSET LONG (-100:100);
+DCL v_ps2 m_ps2 INIT := [ -100:-95, -1:1, 95:100];
+
+SYNMODE m_set = SET (aa, bb, cc, dd, ee, ff, gg, hh, ii, jj);
+SYNMODE m_ps3 = POWERSET m_set;
+DCL v_ps3 m_ps3 INIT := [bb, dd, ff, ii];
+
+SYNMODE m_ps4 = POWERSET CHAR(' ':'z');
+DCL v_ps4 m_ps4 INIT := [ '.', ',', 'A':'F', 'x':'z' ];
+
+SYNMODE m_ps5 = POWERSET BOOL;
+DCL v_ps5 m_ps5 INIT := [ FALSE ];
+DCL v_ps51 m_ps5 INIT := [ ];
+
+SYNMODE m_int_range = INT(-100:100);
+SYNMODE m_int_subrange = m_int_range(-50:50);
+SYNMODE m_ps6 = POWERSET m_int_subrange;
+DCL v_ps6 m_ps6 INIT := [ LOWER(m_int_subrange):UPPER(m_int_subrange) ];
+
+DCL x INT;
+
+x := 25;
+
+END ps;
diff --git a/gdb/testsuite/gdb.chill/powerset.exp b/gdb/testsuite/gdb.chill/powerset.exp
new file mode 100644
index 00000000000..c41276c0c13
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/powerset.exp
@@ -0,0 +1,187 @@
+# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file tests various Chill values, expressions, and types.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "powerset"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_chill {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"chill\".*$gdb_prompt $" {
+ pass "set language to \"chill\""
+ send_gdb "break xx_\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ send_gdb "run\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+ return 1
+ }
+ timeout {
+ fail "can't set breakpoint (timeout)"
+ return 0
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "setting language to \"chill\""
+ return 0
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return 0
+ }
+ }
+}
+
+# Testing printing of a specific value. Increment passcount for
+# success or issue fail message for failure. In both cases, return
+# a 1 to indicate that more tests can proceed. However a timeout
+# is a serious error, generates a special fail message, and causes
+# a 0 to be returned to indicate that more tests are likely to fail
+# as well.
+#
+# Args are:
+#
+# First one is string to send_gdb to gdb
+# Second one is string to match gdb result to
+# Third one is an optional message to be printed
+
+proc test_print_accept { args } {
+ global gdb_prompt
+ global passcount
+ global verbose
+
+ if [llength $args]==3 then {
+ set message [lindex $args 2]
+ } else {
+ set message [lindex $args 0]
+ }
+ set sendthis [lindex $args 0]
+ set expectthis [lindex $args 1]
+ set result [gdb_test $sendthis ".* = ${expectthis}" $message]
+ if $result==0 {incr passcount}
+ return $result
+}
+
+proc test_card {} {
+ global passcount
+
+ verbose "testing builtin CARD"
+ set passcount 0
+
+ # discrete mode names
+ test_print_accept "print card(v_ps1)" "4"
+ test_print_accept "print card(v_ps2)" "15"
+ test_print_accept "print card(v_ps3)" "4"
+ test_print_accept "print card(v_ps4)" "11"
+ test_print_accept "print card(v_ps5)" "1"
+ test_print_accept "print card(v_ps51)" "0"
+ test_print_accept "print card(v_ps6)" "101"
+
+ # a failure
+ setup_xfail "*-*-*"
+ test_print_accept "print card(m_ps1)" "typename in invalid context"
+}
+
+proc test_min {} {
+ global passcount
+
+ verbose "testing builtin MIN"
+ set passcount 0
+
+ # discrete mode names
+ test_print_accept "print min(v_ps1)" "1"
+ test_print_accept "print min(v_ps2)" "-100"
+ test_print_accept "print min(v_ps3)" "bb"
+ test_print_accept "print min(v_ps4)" "','"
+ test_print_accept "print min(v_ps5)" "FALSE"
+ test_print_accept "print min(v_ps6)" "-50"
+
+ # a failure
+ setup_xfail "*-*-*"
+ test_print_accept "print min(v_ps51)" "MIN for empty powerset"
+ setup_xfail "*-*-*"
+ test_print_accept "print min(m_ps1)" "typename in invalid context"
+}
+
+proc test_max {} {
+ global passcount
+
+ verbose "testing builtin MIN"
+ set passcount 0
+
+ # discrete mode names
+ test_print_accept "print max(v_ps1)" "7"
+ test_print_accept "print max(v_ps2)" "100"
+ test_print_accept "print max(v_ps3)" "ii"
+ test_print_accept "print max(v_ps4)" "'z'"
+ test_print_accept "print max(v_ps5)" "FALSE"
+ test_print_accept "print max(v_ps6)" "50"
+
+ # test an IN
+ test_print_accept "print 0 in v_ps6" "TRUE"
+
+ # a failure
+ setup_xfail "*-*-*"
+ test_print_accept "print max(v_ps51)" "MAX for empty powerset"
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if [set_lang_chill] then {
+ # test builtins as described in chapter 6.20.3 Z.200
+ test_card
+ test_min
+ test_max
+} else {
+ warning "$test_name tests suppressed."
+}
diff --git a/gdb/testsuite/gdb.chill/pr-4975-grt.ch b/gdb/testsuite/gdb.chill/pr-4975-grt.ch
new file mode 100644
index 00000000000..77963628086
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-4975-grt.ch
@@ -0,0 +1,13 @@
+gdb_bug_grt: MODULE
+NEWMODE is_channel_type = SET (chan_1,
+ chan_2,
+ chan_3,
+ chan_4,
+ chan_5,
+ chan_6,
+ chan_7,
+ chan_8,
+ chan_9,
+ chan_10);
+GRANT is_channel_type;
+END;
diff --git a/gdb/testsuite/gdb.chill/pr-4975.ch b/gdb/testsuite/gdb.chill/pr-4975.ch
new file mode 100644
index 00000000000..dbba064a728
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-4975.ch
@@ -0,0 +1,43 @@
+/*
+>Number: 4975
+>Category: chill
+>Synopsis: Segmentation fault of gdb 4.12.1
+>Description:
+
+ Problem: gdb 4.12.1 segment faults with following chill program.
+*/
+
+gdb_bug: MODULE
+
+<> USE_SEIZE_FILE "pr-4975-grt.grt" <>
+SEIZE is_channel_type;
+
+ SYNMODE chan_type = POWERSET is_channel_type;
+ SYN hugo chan_type = [chan_1, chan_3];
+
+DCL otto is_channel_type := chan_2;
+
+x: PROC ();
+
+ IF otto IN hugo THEN
+ WRITETEXT (STDOUT, "otto IN hugo%/");
+ ELSE
+ WRITETEXT (STDOUT, "You loose%/");
+ FI;
+END x;
+
+x ();
+
+END gdb_bug;
+/*
+Compiled with:
+
+ chill -S -fgrant-only pr-315-grt.ch
+ chill -g -o pr-315 pr-315.ch
+
+Run gdb with
+
+ gdb pr-315 --readnow
+
+will result in a sigsegv in file gdbtypes.c function force_to_range_type.
+*/
diff --git a/gdb/testsuite/gdb.chill/pr-4975.exp b/gdb/testsuite/gdb.chill/pr-4975.exp
new file mode 100644
index 00000000000..cef9ef528bd
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-4975.exp
@@ -0,0 +1,67 @@
+# Copyright 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile2 "pr-4975-grt"
+set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
+set objfile2 ${objdir}/$subdir/${testfile2}.o
+if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
+ perror "Couldn't compile ${srcfile2}"
+ return -1
+}
+
+set testfile "pr-4975"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ # This is needed (at least on SunOS4) to make sure the
+ # the symbol table is read.
+ runto "x"
+ # "You loose"? Why, thank you. (But I suspect "You lose" might have
+ # been what was intended).
+ gdb_test "finish" "You loose.*" "Runs and reads symbols OK"
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-5016.ch b/gdb/testsuite/gdb.chill/pr-5016.ch
new file mode 100644
index 00000000000..16f49e8f5f5
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-5016.ch
@@ -0,0 +1,24 @@
+vector: MODULE
+
+SYNMODE m_index = RANGE(1:10);
+NEWMODE vector = ARRAY (m_index) INT;
+
+DCL a, b, c vector;
+
+dump: PROC( a vector LOC, c CHAR );
+ DCL i m_index := 5;
+ DO FOR i IN m_index;
+ WRITETEXT( STDOUT, "%C(%C)=%C ", c, i, a(i) );
+ OD;
+ WRITETEXT( STDOUT, "%/" );
+END dump;
+
+a := vector [ 1, -1, 2, -2, 3, -3, 4, -4, 5, -5 ];
+b := a;
+b(4) := 4;
+b(7) := 7;
+c := vector [(*): 0];
+
+dump(a,'a');
+
+END vector;
diff --git a/gdb/testsuite/gdb.chill/pr-5016.exp b/gdb/testsuite/gdb.chill/pr-5016.exp
new file mode 100644
index 00000000000..760b514ae9c
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-5016.exp
@@ -0,0 +1,62 @@
+# Copyright 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "pr-5016"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ runto dump
+ # Linux thinks type is "_cint" (and so does sparc-sun-sunos4, alpha-dec-osf2.0)
+ #setup_xfail "i*86-pc-linux*-gnu" "sparc-sun-sunos4*" "alpha-dec-osf2*"
+ gdb_test "whatis i" "type = m_index" "whatis int-range"
+ gdb_test_exact "ptype m_index" "type = RANGE (1:10)" "ptype m_index"
+ gdb_test_exact "whatis a" "type = /*LOC*/ vector"
+ gdb_test "ptype a" "type = /\\*LOC\\*/ ARRAY \\(1:10\\) (INT|int)"
+ gdb_test "step" ""
+ gdb_test_exact "whatis i" "type = long" "whatis loop counter i"
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-5020.ch b/gdb/testsuite/gdb.chill/pr-5020.ch
new file mode 100644
index 00000000000..6aba793d0d0
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-5020.ch
@@ -0,0 +1,19 @@
+
+PR_5020: MODULE
+ dummy_pr_5020: PROC ();
+ END;
+ NEWMODE x = STRUCT (l LONG, b BOOL);
+ NEWMODE aset = SET (aa, bb);
+
+ DCL y ARRAY ('a':'b') x;
+ DCL setarr ARRAY (aset) x;
+ DCL intarr ARRAY(10:11) x;
+ DCL boolarr ARRAY (BOOL) x;
+
+ y('a').l, setarr(aa).l, intarr(10).l, boolarr(FALSE).l := 10;
+ y('a').b, setarr(aa).b, intarr(10).b, boolarr(FALSE).b := TRUE;
+ y('b').l, setarr(bb).l, intarr(11).l, boolarr(TRUE).l := 111;
+ y('b').b, setarr(bb).b, intarr(11).b, boolarr(TRUE).b := FALSE;
+
+ dummy_pr_5020 ();
+END;
diff --git a/gdb/testsuite/gdb.chill/pr-5020.exp b/gdb/testsuite/gdb.chill/pr-5020.exp
new file mode 100644
index 00000000000..993d373ee59
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-5020.exp
@@ -0,0 +1,85 @@
+# Copyright 1992, 1994, 1995 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "pr-5020"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ # This is needed (at least on SunOS4) to make sure the
+ # the symbol table is read.
+ gdb_test "break chillvars.ch:3" ""
+ gdb_test "delete 1" ""
+
+ gdb_test "set width 0" ""
+ gdb_test "set print sevenbit-strings" ""
+ gdb_test "set print address off" ""
+
+ test_pr_5020
+}
+
+proc test_pr_5020 {} {
+ global gdb_prompt
+ runto dummy_pr_5020
+ gdb_test_exact "print y" \
+ {= [('a'): [.l: 10, .b: TRUE], ('b'): [.l: 111, .b: FALSE]]}
+ gdb_test_exact "print boolarr" \
+ {= [(FALSE): [.l: 10, .b: TRUE], (TRUE): [.l: 111, .b: FALSE]]}
+ gdb_test_exact "print intarr" \
+ {= [(10): [.l: 10, .b: TRUE], (11): [.l: 111, .b: FALSE]]}
+ gdb_test_exact "print setarr" \
+ {= [(aa): [.l: 10, .b: TRUE], (bb): [.l: 111, .b: FALSE]]}
+ gdb_test "set print pretty" ""
+ gdb_test_exact "print y" \
+{= [('a'): [
+ .l: 10,
+ .b: TRUE
+ ], ('b'): [
+ .l: 111,
+ .b: FALSE
+ ]]} "print y pretty"
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-5022.ch b/gdb/testsuite/gdb.chill/pr-5022.ch
new file mode 100644
index 00000000000..aeaad4e8f17
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-5022.ch
@@ -0,0 +1,12 @@
+PR_5022: MODULE
+ dummy_pr_5022: PROC ();
+ END;
+ DCL p PTR;
+ DCL i INT;
+
+ p := NULL;
+ dummy_pr_5022 ();
+ i := 13;
+ p := ->i;
+ dummy_pr_5022 ();
+END;
diff --git a/gdb/testsuite/gdb.chill/pr-5022.exp b/gdb/testsuite/gdb.chill/pr-5022.exp
new file mode 100644
index 00000000000..43e2dc27710
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-5022.exp
@@ -0,0 +1,70 @@
+# Copyright 1992, 1994, 1995 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "pr-5022"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ # This is needed (at least on SunOS4) to make sure the
+ # the symbol table is read.
+ gdb_test "break gdbme.ch:3" ""
+ gdb_test "delete 1" ""
+
+ gdb_test "set width 0" ""
+ gdb_test "set print sevenbit-strings" ""
+
+ test_pr_5022
+}
+
+proc test_pr_5022 {} {
+ global gdb_prompt
+ runto dummy_pr_5022
+ gdb_test "p p" " = NULL" "print NULL pointer"
+ gdb_test "continue" ""
+ gdb_test "p p" {= PTR\(H'[0-9a-fA-F]+\)} "print non-NULL pointer"
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-5646-grt.ch b/gdb/testsuite/gdb.chill/pr-5646-grt.ch
new file mode 100644
index 00000000000..b7a90023585
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-5646-grt.ch
@@ -0,0 +1,5 @@
+x: MODULE
+NEWMODE a_set = SET (a, b, c, d);
+NEWMODE a_ps = POWERSET a_set;
+GRANT a_ps;
+END;
diff --git a/gdb/testsuite/gdb.chill/pr-5646.ch b/gdb/testsuite/gdb.chill/pr-5646.ch
new file mode 100644
index 00000000000..8c14cb86b4f
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-5646.ch
@@ -0,0 +1,15 @@
+y: MODULE
+
+<> USE_SEIZE_FILE "pr-5646-grt.grt" <>
+SEIZE a_ps;
+
+p: PROC ();
+
+ DCL xx a_ps;
+
+ xx := [a, b];
+END p;
+
+p();
+
+END y;
diff --git a/gdb/testsuite/gdb.chill/pr-5646.exp b/gdb/testsuite/gdb.chill/pr-5646.exp
new file mode 100644
index 00000000000..3a8aad3830b
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-5646.exp
@@ -0,0 +1,64 @@
+# Copyright 1992, 1994, 1995, 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile2 "pr-5646-grt"
+set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
+set objfile2 ${objdir}/$subdir/${testfile2}.o
+if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
+ perror "Couldn't compile ${srcfile2}"
+ return -1
+}
+
+set testfile "pr-5646"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ runto p
+ gdb_test "next" ""
+ gdb_test_exact "print xx" {= [a:b]}
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-5984.ch b/gdb/testsuite/gdb.chill/pr-5984.ch
new file mode 100644
index 00000000000..3e74a5660ce
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-5984.ch
@@ -0,0 +1,8 @@
+x: module -- line 1
+ p:proc (t char (20) varying); -- 2
+ writetext(stdout, t); -- 3
+ end p; -- 4
+ -- 5
+ p("Jason Dark.%/"); -- 6
+ p("Hello World.%/"); -- 7
+end x;
diff --git a/gdb/testsuite/gdb.chill/pr-5984.exp b/gdb/testsuite/gdb.chill/pr-5984.exp
new file mode 100644
index 00000000000..cd45aa36a51
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-5984.exp
@@ -0,0 +1,57 @@
+# Copyright 1992, 1994, 1995 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "pr-5984"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ send_gdb "set language chill\n" ;
+
+ gdb_test "break pr-5984.ch:6" ""
+ send_gdb "run\n"; gdb_expect -re "Breakpoint .*pr-5984.ch:6"
+ gdb_expect -re "$gdb_prompt $"
+ gdb_test "next" "Jason Dark.*" "next over Jason Dark"
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-6292.ch b/gdb/testsuite/gdb.chill/pr-6292.ch
new file mode 100644
index 00000000000..c2ed95361c6
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-6292.ch
@@ -0,0 +1,17 @@
+hack : module
+
+dcl i int;
+
+fred : proc (a int in, b int loc);
+ writetext(stdout, "a was '%C'; b was '%C'.%/", a, b);
+ b + := 1;
+end fred;
+
+klaus : proc ();
+ writetext(stdout, "here's klaus calling.%/");
+end klaus;
+
+i:=12;
+writetext(stdout, "done.%/");
+
+end hack;
diff --git a/gdb/testsuite/gdb.chill/pr-6292.exp b/gdb/testsuite/gdb.chill/pr-6292.exp
new file mode 100644
index 00000000000..d57f4819046
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-6292.exp
@@ -0,0 +1,58 @@
+# Copyright 1995 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "pr-6292"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ send_gdb "set language chill\n" ;
+
+ gdb_test "break pr-6292.ch:15" ""
+ send_gdb "run\n"; gdb_expect -re "Breakpoint .*pr-6292.ch:15.*$gdb_prompt $"
+ gdb_test_exact "call klaus()" {here's klaus calling.}
+ gdb_test {set fred(10, i)} {a was '10'; b was '12'.}
+ gdb_test "print i" { = 13} "print i after call"
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-6632-grt.ch b/gdb/testsuite/gdb.chill/pr-6632-grt.ch
new file mode 100644
index 00000000000..e9434f1bb48
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-6632-grt.ch
@@ -0,0 +1,34 @@
+markus1: MODULE
+
+SYNMODE m_dummy = SET (dummy_1,
+ dummy_2,
+ dummy_3,
+ dummy_4,
+ dummy_5,
+ dummy_6,
+ dummy_7,
+ dummy_8,
+ dummy_9,
+ dummy_10,
+ dummy_11,
+ dummy_12,
+ dummy_13,
+ dummy_14,
+ dummy_15,
+ dummy_16,
+ dummy_17,
+ dummy_18,
+ dummy_19,
+ dummy_20,
+ dummy_21,
+ dummy_22,
+ dummy_23,
+ dummy_24,
+ dummy_25,
+ dummy_26);
+
+SYNMODE m_dummy_range = m_dummy(dummy_6 : dummy_22);
+
+GRANT m_dummy, m_dummy_range;
+
+END markus1;
diff --git a/gdb/testsuite/gdb.chill/pr-6632.ch b/gdb/testsuite/gdb.chill/pr-6632.ch
new file mode 100644
index 00000000000..b82c7ae1c88
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-6632.ch
@@ -0,0 +1,31 @@
+markus: MODULE
+
+<> USE_SEIZE_FILE "pr-6632-grt.grt" <>
+SEIZE m_dummy, m_dummy_range;
+
+DCL v m_dummy_range;
+
+NEWMODE is_str_descr = STRUCT (p PTR,
+ l INT,
+ flag STRUCT (x UBYTE,
+ y SET (aa, bb, cc, dd, ee, ff)));
+DCL des is_str_descr;
+
+NEWMODE is_cb_debug = STRUCT (i INT,
+ channel m_dummy_range,
+ p PTR);
+NEWMODE is_cb_debug_array = ARRAY (0:20) is_cb_debug;
+DCL cb_debug is_cb_debug_array;
+DCL cb_debug_index INT := 0;
+
+p: PROC (pp is_str_descr IN, x m_dummy_range IN)
+ DO WITH cb_debug(cb_debug_index);
+ channel := x;
+ OD;
+END p;
+
+p (des, dummy_10);
+WRITETEXT (stdout, "cb_debug(%C).channel := %C%/",
+ cb_debug_index, cb_debug(cb_debug_index).channel);
+
+END markus;
diff --git a/gdb/testsuite/gdb.chill/pr-6632.exp b/gdb/testsuite/gdb.chill/pr-6632.exp
new file mode 100644
index 00000000000..1bec3c7041c
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-6632.exp
@@ -0,0 +1,66 @@
+# Copyright 1995 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+
+if [skip_chill_tests] then { continue }
+
+set testfile2 "pr-6632-grt"
+set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
+set objfile2 ${objdir}/$subdir/${testfile2}.o
+if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
+ perror "Couldn't compile ${srcfile2}"
+ return -1
+}
+
+set testfile "pr-6632"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} ${objfile2} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ runto p
+ gdb_test "whatis x" {type = m_dummy_range}
+ gdb_test_exact "ptype x" {type = m_dummy (dummy_6:dummy_22)}
+ gdb_test "print x" { = dummy_10}
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-8134.exp b/gdb/testsuite/gdb.chill/pr-8134.exp
new file mode 100644
index 00000000000..0e81ca770e4
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-8134.exp
@@ -0,0 +1,65 @@
+# Copyright 1995, 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+# Note we use pr-8136.ch for pr-8134.exp as well as pr-8136.exp.
+set testfile2 "func1"
+set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
+set objfile2 ${objdir}/$subdir/${testfile2}.o
+if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
+ perror "Couldn't compile ${srcfile2}"
+ return -1
+}
+
+set testfile "pr-8134"
+set srcfile ${srcdir}/$subdir/pr-8136.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ runto p1
+ gdb_test "print first" "= 1"
+ gdb_test "print last" "= 10"
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-8136.ch b/gdb/testsuite/gdb.chill/pr-8136.ch
new file mode 100644
index 00000000000..b380110eb18
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-8136.ch
@@ -0,0 +1,34 @@
+-- NOTE: This test is used for pr-3134.exp as well as pr-8136.
+func: MODULE
+
+<> USE_SEIZE_FILE "func1.grt" <>
+SEIZE ALL;
+
+NEWMODE m_struct = STRUCT (i LONG, str CHARS(50) VARYING);
+DCL insarr ARRAY (1:10) INT;
+
+DCL setrange m_setrange := e5;
+
+DCL ps m_ps := [ e3, e7:e9 ];
+DCL range_ps m_rangeps := [ 2, 3, 4, 28 ];
+
+p1: PROC (first INT IN, last INT IN, s m_struct IN);
+
+ DCL foo LONG := 3;
+
+ startall: PROC ()
+ DO FOR i := first to last;
+ insarr(i) := i;
+ OD;
+ DO FOR i := first TO last;
+ WRITETEXT (stdout, "insarr(%C) := %C%/", i, insarr(i));
+ OD;
+ END startall;
+
+ startall ();
+
+END p1;
+
+p1 (LOWER (insarr), UPPER (insarr), [ 10, "This is a string." ]);
+
+END func;
diff --git a/gdb/testsuite/gdb.chill/pr-8136.exp b/gdb/testsuite/gdb.chill/pr-8136.exp
new file mode 100644
index 00000000000..3fee7ec3c79
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-8136.exp
@@ -0,0 +1,63 @@
+# Copyright 1995 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile2 "func1"
+set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
+set objfile2 ${objdir}/$subdir/${testfile2}.o
+if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
+ perror "Couldn't compile ${srcfile2}"
+ return -1
+}
+
+set testfile "pr-8136"
+set srcfile ${srcdir}/$subdir/pr-8136.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ runto p1
+ gdb_test "print ps" {= \[e3, e7:e9\]}
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-8405.ch b/gdb/testsuite/gdb.chill/pr-8405.ch
new file mode 100644
index 00000000000..a9b25312d6e
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-8405.ch
@@ -0,0 +1,19 @@
+emptybit: MODULE
+
+SYNMODE b8 = BOOLS(8);
+SYN bit8 b8 = B'00000000';
+
+SYNMODE char_m = CHARS(40) VARYING;
+
+SYNMODE stru_m = STRUCT (c char_m, b b8, boo BOOL);
+DCL xx stru_m;
+
+SYNMODE m_stru = STRUCT (c char_m, i LONG, boo BOOL);
+DCL yy m_stru;
+
+SYNMODE m_arr = ARRAY (1:10) LONG;
+DCL zz m_arr;
+
+WRITETEXT (stdout, "%C%/", bit8);
+
+END emptybit;
diff --git a/gdb/testsuite/gdb.chill/pr-8405.exp b/gdb/testsuite/gdb.chill/pr-8405.exp
new file mode 100644
index 00000000000..826ac6b6e4b
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-8405.exp
@@ -0,0 +1,61 @@
+# Copyright 1995, 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+ gdb_test "set var \$i:=xx" ""
+ gdb_test "print \$i" {= \[.c: "", .b: B'00000000', .boo: FALSE\]}
+}
+
+if [skip_chill_tests] then { continue }
+
+# Check to see if we have an executable to test. If not, then either we
+# haven't tried to compile one, or the compilation failed for some reason.
+# In either case, just notify the user and skip the tests in this file.
+
+set testfile "pr-8405"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+if ![file exists $binfile] then {
+ warning "$binfile does not exist; tests suppressed." 0
+} else {
+ do_tests
+}
diff --git a/gdb/testsuite/gdb.chill/pr-8742.ch b/gdb/testsuite/gdb.chill/pr-8742.ch
new file mode 100644
index 00000000000..0541149978e
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-8742.ch
@@ -0,0 +1,32 @@
+hugo : module
+
+ synmode a = range(1:10);
+ synmode p = powerset a;
+
+ synmode s = set (sa, sb, sc);
+ synmode s_ps = powerset s;
+
+ x: proc (ps p);
+ dcl i a;
+ do for i in ps;
+ writetext (stdout, "%C ", i);
+ od;
+ writetext(stdout, "%/");
+ end x;
+
+ y : proc (ps s_ps);
+ dcl i s;
+ do for i in ps;
+ writetext (stdout, "%C ", i);
+ od;
+ writetext(stdout, "%/");
+ end y;
+
+ dummy: proc ();
+ end dummy;
+
+ x([1,2,3]);
+ y([sa, sc]);
+ dummy ();
+
+end hugo;
diff --git a/gdb/testsuite/gdb.chill/pr-8742.exp b/gdb/testsuite/gdb.chill/pr-8742.exp
new file mode 100644
index 00000000000..7fc05be4bdd
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-8742.exp
@@ -0,0 +1,64 @@
+# Copyright 1992, 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "pr-8742"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ runto dummy
+
+ # Haven't investigated why these fail on mips-sgi-irix*
+ setup_xfail "m68*-*-hpux*" "mips*-sgi-irix*"
+ gdb_test {call x(p [1, 3, 5])} "1 3 5 " "pass int powerset tuple"
+ setup_xfail "mips*-sgi-irix*"
+ gdb_test {call y(s_ps [sc])} "sc " "pass set powerset tuple"
+ setup_xfail "m68*-*-hpux*" "mips*-sgi-irix*"
+ gdb_test {call x([1, 3, 5])} "1 3 5 " "pass modeless int powerset tuple"
+ setup_xfail "mips*-sgi-irix*"
+ gdb_test {call y([sc])} "sc " "pass modeless set powerset tuple"
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-8894-grt.ch b/gdb/testsuite/gdb.chill/pr-8894-grt.ch
new file mode 100644
index 00000000000..572017053d0
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-8894-grt.ch
@@ -0,0 +1,6 @@
+yy: MODULE
+
+SYNMODE m_byte = INT (0:255);
+GRANT ALL;
+
+END yy;
diff --git a/gdb/testsuite/gdb.chill/pr-8894.ch b/gdb/testsuite/gdb.chill/pr-8894.ch
new file mode 100644
index 00000000000..391d56b2fc0
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-8894.ch
@@ -0,0 +1,12 @@
+xx: MODULE
+
+<> USE_SEIZE_FILE "pr-8894-grt.grt" <>
+SEIZE m_byte;
+
+SYNMODE m_struct = STRUCT (a, b, c m_byte);
+
+DCL v m_struct;
+
+v.a := 100;
+
+END xx;
diff --git a/gdb/testsuite/gdb.chill/pr-8894.exp b/gdb/testsuite/gdb.chill/pr-8894.exp
new file mode 100644
index 00000000000..777570aa255
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-8894.exp
@@ -0,0 +1,61 @@
+# Copyright 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile2 "pr-8894-grt"
+set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
+set objfile2 ${objdir}/$subdir/${testfile2}.o
+if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
+ perror "Couldn't compile ${srcfile2}"
+ return -1
+}
+
+set testfile "pr-8894"
+set srcfile ${srcdir}/$subdir/$testfile.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ gdb_test "print size(m_byte)" { = 2}
+ gdb_test "print size(m_struct)" { = 6}
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/pr-9095.ch b/gdb/testsuite/gdb.chill/pr-9095.ch
new file mode 100644
index 00000000000..61ffb700fbe
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-9095.ch
@@ -0,0 +1,13 @@
+gdb1: MODULE
+
+SYNMODE m_arr1 = ARRAY (1:10) UBYTE;
+SYNMODE m_struct = STRUCT ( i LONG,
+ p REF m_arr1);
+SYNMODE m_arr2 = ARRAY (0:10) REF m_struct;
+
+DCL v_arr1 m_arr1 INIT := [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ];
+DCL v_struct m_struct INIT := [ 10, ->v_arr1 ];
+DCL v_arr2 m_arr2 INIT := [ (5): ->v_struct, (ELSE): NULL ];
+
+WRITETEXT (stdout, "v_arr2(5)->.p->(5) = %C%/", v_arr2(5)->.p->(5));
+END gdb1;
diff --git a/gdb/testsuite/gdb.chill/pr-9095.exp b/gdb/testsuite/gdb.chill/pr-9095.exp
new file mode 100644
index 00000000000..d5c72b62686
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-9095.exp
@@ -0,0 +1,62 @@
+# Copyright 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+ runto pr-9095.ch:12
+ gdb_test {p v_arr2(5)->.p(5)} "reference value used as function" \
+ "bad call using pointer"
+}
+
+if [skip_chill_tests] then { continue }
+
+# Check to see if we have an executable to test. If not, then either we
+# haven't tried to compile one, or the compilation failed for some reason.
+# In either case, just notify the user and skip the tests in this file.
+
+set testfile "pr-9095"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+if ![file exists $binfile] then {
+ warning "$binfile does not exist; tests suppressed." 0
+} else {
+ do_tests
+}
diff --git a/gdb/testsuite/gdb.chill/pr-9946.ch b/gdb/testsuite/gdb.chill/pr-9946.ch
new file mode 100644
index 00000000000..3d9210a5b8d
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-9946.ch
@@ -0,0 +1,10 @@
+x: module
+
+synmode aset = SET (stopped, moving);
+
+DCL xyz aset;
+
+xyz := moving;
+xyz := SUCC (xyz);
+
+END x;
diff --git a/gdb/testsuite/gdb.chill/pr-9946.exp b/gdb/testsuite/gdb.chill/pr-9946.exp
new file mode 100644
index 00000000000..7e8b7184a92
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/pr-9946.exp
@@ -0,0 +1,79 @@
+# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+# Martin Pottendorfer (pottendo@aut.alcatel.at)
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "pr-9946"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_chill {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ return [gdb_test "show language" ".* source language is \"chill\".*" \
+ "set language to \"chill\""]
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if ![set_lang_chill] then {
+ runto x_
+ gdb_test "next" ""
+ # check comparison of SET's
+ gdb_test {print xyz=moving} { = TRUE}
+ gdb_test {print xyz/=moving} { = FALSE}
+ gdb_test {print xyz<moving} { = FALSE}
+ gdb_test {print xyz<=moving} { = TRUE}
+ gdb_test {print xyz>moving} { = FALSE}
+ gdb_test {print xyz>=moving} { = TRUE}
+}
diff --git a/gdb/testsuite/gdb.chill/result.ch b/gdb/testsuite/gdb.chill/result.ch
new file mode 100644
index 00000000000..b8c65e7d085
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/result.ch
@@ -0,0 +1,29 @@
+test_result: MODULE
+
+ DCL i INT := 5;
+
+ SYNMODE m_struct = STRUCT (l LONG, b BOOL);
+ DCL v_struct m_struct := [ 20, TRUE ];
+
+ simple_func: PROC () RETURNS (INT);
+ DCL j INT := i;
+ RESULT 10;
+ i + := 2;
+ RESULT j + 2;
+ i + := 2;
+ END simple_func;
+
+ ret_struct: PROC () RETURNS (m_struct)
+ DCL v m_struct := [ 33, FALSE ];
+ RESULT v;
+ v.l := 18;
+ END ret_struct;
+
+ i := simple_func ();
+ i := simple_func ();
+ i * := 10;
+
+ v_struct := ret_struct ();
+
+ i := 33; -- for gdb
+END test_result;
diff --git a/gdb/testsuite/gdb.chill/result.exp b/gdb/testsuite/gdb.chill/result.exp
new file mode 100644
index 00000000000..e9dce152b8d
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/result.exp
@@ -0,0 +1,77 @@
+# Copyright 1994, 1995 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "result"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ gdb_test "set width 0" ""
+ gdb_test "set print sevenbit-strings" ""
+ gdb_test "set print address off" ""
+
+ # simple function
+ runto simple_func
+ gdb_test "step 2" ""
+ gdb_test "print j" "= 5"
+ gdb_test "p RESULT" "= 10"
+ gdb_test "continue" ""
+ gdb_test "print i" "= 7"
+ gdb_test "step 4" ""
+ gdb_test "set RESULT := 50" ""
+ gdb_test "finish" ""
+ gdb_test "step" ""
+ gdb_test "print i" "= 50"
+
+ # returning a structure
+ runto ret_struct
+ gdb_test "step 2" ""
+ gdb_test "p result" {\[.l: 33, .b: FALSE\]}
+ gdb_test "set var result := \[383, TRUE\]" ""
+ gdb_test "finish" ""
+ gdb_test "p v_struct" {\[.l: 383, .b: TRUE\]}
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/string.ch b/gdb/testsuite/gdb.chill/string.ch
new file mode 100644
index 00000000000..3503c462eae
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/string.ch
@@ -0,0 +1,24 @@
+ss: MODULE
+
+/* These declarations are from Cygnus PR chill/9078. */
+ SYNMODE m_char20 = CHARS(20) VARYING;
+
+ DCL foo m_char20 INIT := "Moser ";
+ DCL bar m_char20 INIT := "Wilfried";
+
+ DCL foo1 CHARS(5) INIT := "12345";
+ DCL bar1 CHARS(5) INIT := "abcde";
+
+/* This is Cynus PR chill/5696. */
+
+DCL s20 CHARS(20) VARYING;
+
+DCL s10 CHARS(10);
+
+
+s20 := "Moser Wilfried";
+S10 := "1234567890";
+
+WRITETEXT (stdout, "s20 := ""%C"", s10 := ""%C""%/", s20, s10);
+
+END ss;
diff --git a/gdb/testsuite/gdb.chill/string.exp b/gdb/testsuite/gdb.chill/string.exp
new file mode 100644
index 00000000000..acaea8ff181
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/string.exp
@@ -0,0 +1,73 @@
+# Copyright 1995, 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "string"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ # These tests based on Cygnus PR chill/5696.
+ runto string.ch:22
+ gdb_test "p s20" { = "Moser Wilfried"} "print simple vstring"
+ gdb_test "p s20(1)" { = 'o'} "print vstring element"
+ gdb_test "p s20(1:3)" { = "ose"} "print vstring slice (:)"
+ gdb_test "p s20(2 up 3)" { = "ser"} "print vstring slice (up)"
+ gdb_test "p s10" { = "1234567890"} "print simple string"
+ gdb_test "p s10(1)" { = '2'} "print string element"
+ gdb_test "p s10(1:3)" { = "234"} "print string slice (:)"
+ gdb_test "p s10(2 up 3)" { = "345"} "print string slice (up)"
+
+ gdb_test "p length(s10)" { = 10} "print string length"
+ gdb_test "p length(s20)" { = 14} "print varying string length"
+ gdb_test "p lower(s10)" { = 0} "print string lower"
+ gdb_test "p upper(s10)" { = 9} "print string upper"
+ gdb_test "p lower(s20)" { = 0} "print varying string lower"
+ gdb_test "p upper(s20)" { = 19} "print varying string upper"
+
+ # These tests are based on Cygnus PR chill/9078.
+ gdb_test "print foo // bar" { = "Moser Wilfried"}
+ gdb_test "print foo // bar1" { = "Moser abcde"}
+ gdb_test "print foo1 // bar1" { = "12345abcde"}
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/tests1.ch b/gdb/testsuite/gdb.chill/tests1.ch
new file mode 100644
index 00000000000..3afdd90a50e
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/tests1.ch
@@ -0,0 +1,240 @@
+-- Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
+
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 2 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+-- Please email any bugs, comments, and/or additions to this file to:
+-- bug-gdb@prep.ai.mit.edu
+
+--
+-- test program 1 (refer to tests1.exp)
+--
+
+/* These functions are defined in libchill.a */
+
+runtime: SPEC MODULE
+DCL chill_argc long;
+DCL chill_argv REF ARRAY (0:1000) REF CHARS (1000) VARYING;
+__print_event: PROC (arg0 ptr,
+ arg1 ptr) END;
+__print_buffer: PROC (arg0 ptr,
+ arg1 ptr) END;
+GRANT ALL;
+END;
+
+tests1: module;
+
+seize __print_event,
+ __print_buffer;
+
+newmode set1 = set(aaa, bbb, ccc);
+newmode nset1 = set(na = 1, nb = 34, nc = 20);
+newmode r11 = range (0 : upper(ubyte));
+newmode r12 = range (0 : upper(uint));
+--newmode r13 = range (0 : upper(ulong)); -- bug in gnuchill
+newmode r14 = range (lower(byte) : upper(byte));
+newmode r15 = range (lower(int) : upper(int));
+newmode r16 = range (lower(long): upper(long));
+newmode r2 = set1(bbb : ccc);
+newmode r3 = nset1(na : na);
+newmode r4 = nset1(nc : nb);
+newmode r5 = nset1(lower(nset1) : upper(nset1));
+
+newmode pm1 = powerset set(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10);
+newmode pm2 = powerset byte (1:8);
+newmode pm3 = powerset int (-32768:32767);
+newmode pm4 = powerset long (-32768:32768);
+newmode pm5 = powerset long (lower(long):upper(long));
+newmode ref1 = ref pm1;
+newmode ref2 = ref byte;
+newmode ref3 = ptr;
+synmode ref4 = ptr;
+synmode syn_int = int;
+
+newmode prm1 = proc ();
+newmode prm2 = proc (bool in, int out, long inout) returns (char);
+newmode prm3 = proc (pm1, ref1 loc) returns (ref3);
+newmode prm4 = proc () exceptions(ex1, ex2, ex3);
+newmode prm5 = proc (r11, r16 inout, r5 out) returns (r2) exceptions (ex1);
+
+newmode ev1m = event;
+newmode ev2m = event (42);
+
+newmode bu1m = buffer ref1;
+newmode bu2m = buffer (42) ubyte;
+
+newmode strm1 = char (5);
+synmode strm2 = char (7) varying;
+
+synmode bstr1 = bit(20);
+--newmode bstr2 = bit(10) varying;
+
+newmode arr1m = array(1:100) set1;
+newmode arr2m = array(1:100, 1:100) set1;
+newmode arr3m = array(r11, r12, r14) set1;
+newmode arr4m = array(r2) array (r3) array (r4, r5) pm1;
+newmode arr5m = array(1:10) int;
+newmode arr6m = array(1:5, 1:3, 1:2) long;
+
+newmode stru1m = struct (a, b long,
+ case b of
+ (42): ch1 chars(20),
+ (52): ch2 chars(10)
+ else ch3 chars(1)
+ esac);
+
+newmode stru2m = struct (f set1,
+ case f of
+ (aaa): ch1 char(20),
+ (bbb): ch2 char(10) varying
+ else ch3 char(0) varying
+ esac);
+newmode stru3m = struct (f r3,
+ case f of
+ (na): ch1 char(20)
+ esac);
+newmode stru4m = struct (i long,
+ case of
+ : i1, i11 int,
+ b1 bool,
+ c1 char,
+ : i2, i22 long,
+ bs2 bools (10),
+ :
+ s3 struct (i3 int,
+ case of
+ : foo long
+ else bar char
+ esac)
+ else
+ x stru2m
+ esac,
+ y stru3m);
+
+synmode m_xyzmode = struct (next ref m_xyzmode,
+ i long);
+
+-- set mode locations
+dcl s1l set1 := ccc;
+dcl s2l nset1 := nb;
+
+-- range mode locations
+dcl rl1 r11 := 3;
+dcl rl2 r11 := lower(r11);
+dcl rl3 r11 := upper(r11);
+
+dcl rl5 r12 := 65530;
+dcl rl6 r12 := lower(r12);
+dcl rl7 r12 := upper(r12);
+
+--dcl rl9 r13 := 128;
+--dcl rl10 r13 := lower(r13);
+--dcl rl11 r13 := upper(r13);
+
+dcl rl13 r14 := -121;
+dcl rl14 r14 := lower(r14);
+dcl rl15 r14 := upper(r14);
+
+dcl rl17 r15 := -32720;
+dcl rl18 r15 := lower(r15);
+dcl rl19 r15 := upper(r15);
+
+dcl rl21 r16 := 2147483643;
+dcl rl22 r16 := lower(r16);
+dcl rl23 r16 := upper(r16);
+
+-- powerset mode locations
+dcl pl1 pm1 := [p1:p10];
+dcl pl2 pm1 := [];
+dcl pl3 pm1 := [p1, p10];
+dcl pl4 pm1 := [p1:p2, p4:p6, p8:p10];
+dcl pl5 pm1 := [p1:p4, p6, p8:p10];
+dcl pl6 pm1 := [p1, p3:p8, p10];
+
+dcl pl7 pm2 := [1:8];
+dcl pl8 pm3 := [-32768:32767];
+--dcl pl9 pm5 := [-2147483648:2147483647];
+
+-- reference mode locations
+dcl ref3l ref3;
+dcl ref4l ref4;
+dcl ref5l, ref6l, ref7l, ref8l ptr;
+dcl syn_intl1 syn_int := 42;
+dcl intl1 int := -42;
+
+-- synchronization mode locations
+dcl ev1l ev1m;
+dcl ev2l ev2m;
+dcl bu1l bu1m;
+dcl bu2l bu2m;
+
+-- timing mode locations
+dcl til1 time;
+
+-- string mode locations
+dcl strl1, strl2 strm2;
+dcl bstrl1 bstr1 := B'10101010101010101010';
+
+-- array mode locations
+dcl arrl1 arr1m;
+dcl arrl2 arr5m := [1, -1, 32767, -32768, 0, 10, 11, 12, 13, 42];
+dcl arrl3 arr6m := [(1:5): [(1:3): [(1:2): -2147483648]]];
+dcl arrl4 arr6m := [(1:2): [(1:3): [(1:2): -2147483648]],
+ (3): [(1:3): [(1:2): 100]],
+ (4:5): [(1:3): [(1:2): -2147483648]]];
+dcl arrl5 array(1:10) nset1;
+
+-- structure mode locations
+dcl strul1 stru1m := [-2147483648, 42, "12345678900987654321"];
+
+dummyfunc: proc();
+end dummyfunc;
+
+ref3l:=->pl1; -- newmode ref
+ref4l:=->pl1; -- synmode ref
+ref5l:=->pl1; -- ptr
+
+ref6l:=->syn_intl1; -- ref to synmode
+ref7l:=->intl1; -- ref to predefined mode
+ref8l:=->pl1; -- ref to newmode
+
+strl1 := "ha" // C'6e' // "s" // "i" // C'00';
+strl2 := C'00' // "ope";
+
+__print_event(addr(ev1l), addr("ev1l"));
+__print_event(addr(ev2l), addr("ev2l"));
+__print_buffer(addr(bu1l), addr("bu1m"));
+__print_buffer(addr(bu2l), addr("bu2m"));
+
+til1 := abstime(1970, 3, 12, 10, 43, 0);
+writetext(stdout, "lower(pm3) = %C; upper(pm3) = %C%..%/",
+ lower(pm3), upper(pm3));
+writetext(stdout, "lower(pm5) = %C; upper(pm5) = %C%..%/",
+ lower(pm5), upper(pm5));
+--writetext(stdout, "lower(pl9) = %C; upper(pl9) = %C%..%/",
+-- lower(pl9), upper(pl9));
+writetext(stdout, "date = %C%..%/", til1);
+
+writetext(stdout, "slice1 = %C%..%/", strl1(3 : 5));
+writetext(stdout, "slice2 = %C%..%/", strl2(0 : 3));
+--writetext(stdout, "slice3 = %C%..%/", strl1(0 up 20));
+writetext(stdout, "slice4 = %C%..%/", bstrl1(0));
+--writetext(stdout, "slice5 = %C%..%/", arrl3(1:5));
+
+
+writetext(stdout, "done.%/");
+
+dummyfunc();
+
+end tests1;
diff --git a/gdb/testsuite/gdb.chill/tests1.exp b/gdb/testsuite/gdb.chill/tests1.exp
new file mode 100644
index 00000000000..7aa882507f3
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/tests1.exp
@@ -0,0 +1,822 @@
+# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file tests various Chill values, expressions, and types.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "tests1"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_chill {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"chill\".*$gdb_prompt $" {
+ pass "set language to \"chill\""
+ send_gdb "break dummyfunc\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ send_gdb "run\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+ return 1
+ }
+ timeout {
+ fail "can't set breakpoint (timeout)"
+ return 0
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "setting language to \"chill\""
+ return 0
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return 0
+ }
+ }
+}
+
+# Testing printing of a specific value. Increment passcount for
+# success or issue fail message for failure. In both cases, return
+# a 1 to indicate that more tests can proceed. However a timeout
+# is a serious error, generates a special fail message, and causes
+# a 0 to be returned to indicate that more tests are likely to fail
+# as well.
+#
+# Args are:
+#
+# First one is string to send_gdb to gdb
+# Second one is string to match gdb result to
+# Third one is an optional message to be printed
+
+proc test_print_accept { args } {
+ global gdb_prompt
+ global passcount
+ global verbose
+
+ if [llength $args]==3 then {
+ set message [lindex $args 2]
+ } else {
+ set message [lindex $args 0]
+ }
+ set sendthis [lindex $args 0]
+ set expectthis [lindex $args 1]
+ set result [gdb_test $sendthis ".* = ${expectthis}" $message]
+ if $result==0 {incr passcount}
+ return $result
+}
+
+# Testing printing of a specific value. Increment passcount for
+# success or issue fail message for failure. In both cases, return
+# a 1 to indicate that more tests can proceed. However a timeout
+# is a serious error, generates a special fail message, and causes
+# a 0 to be returned to indicate that more tests are likely to fail
+# as well.
+
+# various tests if modes are treated correctly
+# using ptype
+proc test_modes {} {
+ global passcount
+
+ verbose "testing chill modes"
+ set passcount 0
+
+ # discrete modes
+ test_print_accept "ptype BYTE" "byte"
+ test_print_accept "ptype UBYTE" "ubyte"
+ test_print_accept "ptype INT" "int"
+ test_print_accept "ptype UINT" "uint"
+ test_print_accept "ptype LONG" "long"
+ test_print_accept "ptype ULONG" "ulong"
+ test_print_accept "ptype BOOL" "bool"
+ test_print_accept "ptype CHAR" "char"
+
+ test_print_accept "ptype set1" "SET \[(\]aaa, bbb, ccc\[)\]" \
+ "print unnumbered set mode"
+ test_print_accept "ptype nset1" "SET \[(\]na = 1, nb = 34, nc = 20\[)\]" \
+ "print numbered set mode"
+
+ # mp:
+ # display maybe in hex values ?
+ #
+ test_print_accept "ptype r11" "ubyte \\(0:255\\)" \
+ "print ubyte range mode"
+ test_print_accept "ptype r12" "uint \\(0:65535\\)" \
+ "print uint range mode"
+# test_print_accept "ptype r13" "ulong \\(0:4294967295\\)" \
+# "print ulong range mode"
+ test_print_accept "ptype r14" "byte \\(-128:127\\)" \
+ "print byte range mode"
+ test_print_accept "ptype r15" "int \\(-32768:32767\\)" \
+ "print int range mode"
+ test_print_accept "ptype r16" "long \\(-2147483648:2147483647\\)" \
+ "print long range mode"
+
+ test_print_accept "ptype r2" "set1 \\(bbb:ccc\\)" \
+ "print unnumbered set range mode"
+ test_print_accept "ptype r3" "nset1 \\(na:na\\)" \
+ "print numbered set range mode"
+ # really this order ?
+ # I'm not sure what should happen for the next two tests.
+ setup_xfail "*-*-*"
+ test_print_accept "ptype r4" "nset1 \\(nb = 34:nc = 20\\)" \
+ "print numbered set range mode"
+ setup_xfail "*-*-*"
+ test_print_accept "ptype r5" "nset1 \\(na = 1, nb = 34, nc = 20\\)" \
+ "print numbered set range mode"
+
+ # powerset modes
+ test_print_accept "ptype pm1" \
+ "POWERSET SET \[(\]p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\[)\]" \
+ "print powerset mode 1"
+ test_print_accept "ptype pm2" "POWERSET byte \\(1:8\\)" \
+ "print powerset mode 2"
+ test_print_accept "ptype pm3" "POWERSET int \\(-32768:32767\\)" \
+ "print powerset mode 3"
+ test_print_accept "ptype pm4" "POWERSET long \\(-32768:32768\\)" \
+ "print powerset mode 4"
+ test_print_accept "ptype pm5" \
+ "POWERSET long \\(-2147483648:2147483647\\)" \
+ "print powerset mode 5"
+
+ # reference modes
+ test_print_accept "ptype ref1" "REF pm1" \
+ "print reference to powerset mode"
+ test_print_accept "ptype ref2" "REF byte" \
+ "print reference to byte"
+ test_print_accept "ptype ref3" "PTR" \
+ "print free reference type"
+
+ # procedure modes
+ # FIXME: we have to talk about this ...
+ test_print_accept "ptype prm1" \
+ "REF PROC \[(\]\[)\]" \
+ "print procedure mode 1"
+ setup_xfail "*-*-*"
+ test_print_accept "ptype prm2" \
+ "REF PROC \[(\]bool in, int out long inout\[)\] RETURNS \[(\]char\[)\]" \
+ "print procedure mode 2"
+ setup_xfail "*-*-*"
+ test_print_accept "ptype prm3" \
+ "REF PROC \[(\]pm1, ref loc\[)\] RETURNS \[(\]ref3\[)\]" \
+ "print procedure mode 3"
+ setup_xfail "*-*-*"
+ test_print_accept "ptype prm4" \
+ "\[(\] \[)\] EXCEPTIONS \[(\]ex1, ex2, ex3\[)\]" \
+ "print procedure mode 4"
+ setup_xfail "*-*-*"
+ test_print_accept "ptype prm5" \
+ "REF PROC \[(\]r11, r16 inout, r5 out\[)\] RETURNS \[(\]r2\[)\] EXCEPTIONS \[(\]ex1\[)\]" \
+ "print procedure mode 5"
+
+ # synchronization modes
+ # FIXME: since gdb doesn't process events & buffers so far, this has be
+ # filled later...
+ xfail "synchronization mode handling"
+
+ # timing modes
+ test_print_accept "ptype DURATION" "duration"
+ test_print_accept "ptype TIME" "time"
+
+ # string modes
+ # some tests are done in chillvars.exp
+ test_print_accept "ptype strm1" "CHARS \\(5\\)" "print char string mode"
+ test_print_accept "ptype strm2" "CHARS \[(\]7\[)\] VARYING" \
+ "print varying char string mode"
+ test_print_accept "ptype bstr1" "BOOLS \\(20\\)" "print bit string mode"
+
+ test_print_accept "ptype B'000'" "BOOLS \\(3\\)" "bit string literal"
+ test_print_accept "ptype B'11110000'" "BOOLS \\(8\\)" "bit string literal"
+ # FIXME: adjust error message
+ gdb_test "ptype B'00110211'" {.*Too-large digit.*[.]} \
+ "reject invalid bitstring"
+
+ # array modes
+ # some tests are done in chillvars.exp
+ test_print_accept "ptype arr1m" "ARRAY \\(1:100\\) set1" \
+ "print array mode 1"
+ test_print_accept "ptype arr2m" "ARRAY \\(1:100\\) ARRAY \\(1:100\\) set1"\
+ "print array mode 2"
+ test_print_accept "ptype arr3m" "ARRAY \\(0:255\\) ARRAY \\(0:65535\\) ARRAY \\(-128:127\\) set1" \
+ "print array mode 3"
+ setup_xfail "*-*-*"
+ test_print_accept "ptype arr4m" "ARRAY \\(b:c\\) ARRAY \\(na = 1:na = 1\\) ARRAY \\(nc:nb\\) ARRAY \\(na = 1:nc = 20\\) POWERSET SET \[(\]p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\[)\]" \
+ "print array mode 4"
+
+ # structure modes
+ # some checks are in chillvars.exp
+ # setup_xfail "*-*-*"
+ test_print_accept "ptype stru1m" "STRUCT \\(.*a long,.*b long,.*CASE OF.*:.*ch1 CHARS \\(20\\).*:.*ch2 CHARS \\(10\\).*ELSE.*ch3 CHARS \\(1\\).*ESAC.*\\)" \
+ "print structure mode 1"
+ #setup_xfail "*-*-*"
+ test_print_accept "ptype stru2m" "STRUCT \\(.*f set1,.*CASE OF.*:.*ch1 CHARS \\(20\\).*:.*ch2 CHARS \\(10\\) VARYING.*ELSE.*ch3 CHARS \\(0\\) VARYING.*ESAC.*\\)" \
+ "print structure mode 2"
+ #setup_xfail "*-*-*"
+ test_print_accept "ptype stru3m" "STRUCT \\(.*f r3,.*CASE OF.*:.*ch1 CHARS \\(20\\).*ESAC.*\\)" \
+ "print structure mode 3"
+ # setup_xfail "*-*-*"
+ test_print_accept "ptype stru4m" "STRUCT \\(.*i long,.*CASE OF.*:.*i1 int,.*i11 int,.*b1 bool,.*c1 char.*:.*i2 long,.*i22 long,.*bs2 BOOLS \\(10\\).*:.*s3 STRUCT \\(.*i3 int,.*CASE OF.*:.*foo long.*ELSE.*bar char.*ESAC.*\\).*ELSE.*x stru2m.*ESAC,.*y stru3m.*\\)" \
+ "print structure mode 4"
+
+
+ if $passcount then {
+ pass "$passcount correct modes printed"
+ }
+}
+
+# various tests if locations are treated correctly
+# read access using ptype, print, whatis
+proc test_locations {} {
+ global passcount
+
+ set passcount 0
+ verbose "testing read access to locations"
+ # various location tests can be found in chillvars.exp
+
+ # set locations
+ test_print_accept "ptype s1l" "SET \\(aaa, bbb, ccc\\)" \
+ "print mode of set location"
+ test_print_accept "whatis s1l" "set1" \
+ "print modename of set location"
+ test_print_accept "print s1l" "ccc" "print set location"
+ test_print_accept "ptype s2l" "SET \\(na = 1, nb = 34, nc = 20\\)" \
+ "print mode of numbered set location"
+ test_print_accept "whatis s2l" "nset1" \
+ "print mode name of numbered set location"
+ test_print_accept "print s2l" "nb" "print numberes set location"
+
+ # range modes
+ test_print_accept "ptype rl1" "ubyte \\(0:255\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl1" "r11" \
+ "print mode name of range location"
+ test_print_accept "print rl1" "3" \
+ "print range location"
+
+ test_print_accept "ptype rl2" "ubyte \\(0:255\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl2" "r11" \
+ "print mode name of range location"
+ test_print_accept "print rl2" "0" \
+ "print range location"
+
+ test_print_accept "ptype rl3" "ubyte \\(0:255\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl3" "r11" \
+ "print mode name of range location"
+ test_print_accept "print rl3" "255" \
+ "print range location"
+
+ test_print_accept "ptype rl5" "uint \\(0:65535\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl5" "r12" \
+ "print mode name of range location"
+ test_print_accept "print rl5" "65530" \
+ "print range location"
+
+ test_print_accept "ptype rl6" "uint \\(0:65535\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl6" "r12" \
+ "print mode name of range location"
+ test_print_accept "print rl6" "0" \
+ "print range location"
+
+ test_print_accept "ptype rl7" "uint \\(0:65535\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl7" "r12" \
+ "print mode name of range location"
+ test_print_accept "print rl7" "65535" \
+ "print range location"
+
+# test_print_accept "ptype rl9" "ulong \\(0:4294967295\\)" \
+# "print mode of range location"
+# test_print_accept "whatis rl9" "r13" \
+# "print mode name of range location"
+# test_print_accept "print rl9" "128" \
+# "print range location"
+
+# test_print_accept "ptype rl10" "ulong \\(0:4294967295\\)" \
+# "print mode of range location"
+# test_print_accept "whatis rl10" "r13" \
+# "print mode name of range location"
+# test_print_accept "print rl10" "0" \
+# "print range location"
+
+# test_print_accept "ptype rl11" "ulong \\(0:4294967295\\)" \
+# "print mode of range location"
+# test_print_accept "whatis rl11" "r13" \
+# "print mode name of range location"
+# test_print_accept "print rl11" "4294967295" \
+# "print range location"
+
+ test_print_accept "ptype rl13" "byte \\(-128:127\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl13" "r14" \
+ "print mode name of range location"
+ test_print_accept "print rl13" "-121" \
+ "print range location"
+
+ test_print_accept "ptype rl14" "byte \\(-128:127\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl14" "r14" \
+ "print mode name of range location"
+ test_print_accept "print rl14" "-128" \
+ "print range location"
+
+ test_print_accept "ptype rl15" "byte \\(-128:127\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl15" "r14" \
+ "print mode name of range location"
+ test_print_accept "print rl15" "127" \
+ "print range location"
+
+ test_print_accept "ptype rl17" "int \\(-32768:32767\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl17" "r15" \
+ "print mode name of range location"
+ test_print_accept "print rl17" "-32720" \
+ "print range location"
+
+ test_print_accept "ptype rl18" "int \\(-32768:32767\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl18" "r15" \
+ "print mode name of range location"
+ test_print_accept "print rl18" "-32768" \
+ "print range location"
+
+ test_print_accept "ptype rl19" "int \\(-32768:32767\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl19" "r15" \
+ "print mode name of range location"
+ test_print_accept "print rl19" "32767" \
+ "print range location"
+
+ test_print_accept "ptype rl21" "long \\(-2147483648:2147483647\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl21" "r16" \
+ "print mode name of range location"
+ test_print_accept "print rl21" "2147483643" \
+ "print range location"
+
+ test_print_accept "ptype rl22" "long \\(-2147483648:2147483647\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl22" "r16" \
+ "print mode name of range location"
+ test_print_accept "print rl22" "-2147483648" \
+ "print range location"
+
+ test_print_accept "ptype rl23" "long \\(-2147483648:2147483647\\)" \
+ "print mode of range location"
+ test_print_accept "whatis rl23" "r16" \
+ "print mode name of range location"
+ test_print_accept "print rl23" "2147483647" \
+ "print range location"
+
+ # powerset locations
+ test_print_accept "ptype pl1" \
+ "POWERSET SET \\(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10\\)" \
+ "print mode of powerset location 1"
+ test_print_accept "whatis pl1" "pm1" \
+ "print mode mode name of powerset location"
+ test_print_accept "print pl1" \
+ "\[\[\]p1:p10\[\]\]" \
+ "print powerset location 1"
+ test_print_accept "print pl2" {\[\]} \
+ "print powerset location 2"
+ test_print_accept "print pl3" "\[\[\]p1, p10\[\]\]" \
+ "print powerset location 3"
+ test_print_accept "print pl4" {\[p1:p2, p4:p6, p8:p10\]} \
+ "print powerset location 4"
+ test_print_accept "print pl5" {\[p1:p4, p6, p8:p10\]} \
+ "print powerset location 5"
+ test_print_accept "print pl6" {\[p1, p3:p8, p10\]} \
+ "print powerset location 6"
+
+ test_print_accept "ptype pl7" \
+ "POWERSET byte \\(1:8\\)" \
+ "print mode of byte powerset location"
+ test_print_accept "whatis pl7" "pm2" \
+ "print modename of byte powerset location"
+ test_print_accept "print pl7" {\[1:8\]} \
+ "print powerset location 7"
+
+ test_print_accept "ptype pl8" \
+ "POWERSET int \\(-32768:32767\\)" \
+ "print mode of int powerset location"
+ test_print_accept "whatis pl8" "pm3" \
+ "print modename of int powerset location"
+ test_print_accept "print pl8" {\[-32768:32767\]} \
+ "print powerset location 8"
+
+# test_print_accept "ptype pl9" \
+# "POWERSET long \\(-2147483648:2147483647\\)" \
+# "print mode of long powerset location"
+# test_print_accept "whatis pl9" "pm5" \
+# "print modename of long powerset location"
+# test_print_accept "print pl9" {\[-2147483648:2147483647\]} \
+# "print powerset location 9"
+
+ # reference modes
+ test_print_accept "ptype ref3l" "PTR" "print mode of reference location"
+ # setup_xfail "*-*-*"
+ test_print_accept "whatis ref3l" "ref3" \
+ "print modename of reference location"
+ # setup_xfail "*-*-*"
+ test_print_accept "print ref3l" "ref3\\(H'.*\\)" \
+ "print reference location"
+ test_print_accept "ptype ref4l" "PTR" "print mode of reference location"
+ # setup_xfail "*-*-*"
+ test_print_accept "whatis ref4l" "ref4" \
+ "print modename of reference location"
+ # setup_xfail "*-*-*"
+ test_print_accept "print ref4l" "ref4\\(H'.*\\)" \
+ "print reference location"
+ test_print_accept "ptype ref5l" "PTR" "print mode of reference location"
+ test_print_accept "whatis ref5l" "PTR" \
+ "print modename of reference location"
+ test_print_accept "print ref5l" "PTR\\(H'.*\\)" \
+ "print reference location"
+
+ # dereference a little bit..
+ test_print_accept "print ref6l->syn_int" "42" \
+ "dereference reference to synmode location"
+ test_print_accept "print ref7l->int" "-42" \
+ "dereference reference to predefined mode location"
+ test_print_accept "print ref8l->pm1" \
+ "\[\[\]p1:p10\[\]\]" \
+ "dereference reference to newmode location"
+
+ # synchronization mode locations
+ # FIXME: synchronization modes are not supported so far...
+ xfail "no synchronization mode location support, not implemented yet"
+
+ # timing mode locations
+ # FIXME: callbacks to abstime, inttime not implemented
+ xfail "timing modes not implemented properly yet"
+
+ # char string locations
+ # some tests are don in chillvars.exp
+ test_print_accept "ptype strl1" \
+ "CHARS \\(7\\) VARYING" \
+ "print varying string location"
+ test_print_accept "whatis strl1" "strm2" \
+ "print string locationa mode name"
+ test_print_accept "print strl1" \
+ {\"hansi\^\(0\)\"} \
+ "print string location"
+ # string elements
+ test_print_accept "print strl1(0)" "\'h\'" \
+ "print string element 1"
+ test_print_accept "print strl1(5)" {'\^[(]0[)]'} \
+ "print string element 2"
+ test_print_accept "print strl1(3)" "\'s\'" \
+ "print string element 3"
+ test_print_accept "ptype strl1(0)" "char" \
+ "print mode of string element"
+ # slices
+ test_print_accept "print strl1(3:4)" "\"si\"" \
+ "print string slice 1"
+ test_print_accept "print strl1(0:5)" \
+ {\"hansi\^\(0\)\"} \
+ "print string slice 2"
+ test_print_accept "print strl1(0:0)" "\"h\"" \
+ "print string slice 3"
+ test_print_accept "print strl1(0 up 6)" \
+ {\"hansi\^\(0\)\"} \
+ "print string slice 4"
+ # FIXME: adjust error message, when implented
+ gdb_test "print strl1(6 up 1)" \
+ ".*slice.*out of range.*" \
+ "print invalid string slice length"
+ gdb_test "print strl1(-1 up 5)" \
+ ".*slice.*out of range.*" \
+ "print invalid string slice length"
+ gdb_test "print strl1(-1:5)" \
+ ".*slice.*out of range.*" \
+ "print invalid string slice"
+ gdb_test "print strl1(-1:7)" \
+ ".*slice.*out of range.*" \
+ "print invalid string slice"
+ gdb_test "print strl1(0 up -1)" \
+ ".*slice.*out of range.*" \
+ "print invalid string slice length"
+ gdb_test "print strl1(0 up 0)" {""}
+
+ # bitstring locations
+ test_print_accept "ptype bstr1" \
+ "BOOLS \\(20\\)" \
+ "print mode of bitstring location"
+ test_print_accept "whatis bstrl1" "bstr1" \
+ "print mode name of bitstring location"
+ test_print_accept "print bstrl1" \
+ "B'10101010101010101010'" \
+ "print bitstring location"
+
+ test_print_accept "ptype bstrl1(0)" "bool|BOOL" \
+ "print mode of bitstring element"
+ test_print_accept "print bstrl1(0)" "TRUE" \
+ "print bitstring element 1"
+ test_print_accept "print bstrl1(19)" "FALSE" \
+ "print bitstring element 2"
+ test_print_accept "print bstrl1(10)" "TRUE" \
+ "print bitstring element 3"
+
+ test_print_accept "print bstrl1(0:19)" \
+ "B'10101010101010101010'" \
+ "print bitstring location slice 1"
+ test_print_accept "print bstrl1(0:0)" \
+ "B'1'" \
+ "print bitstring location slice 2"
+ test_print_accept "print bstrl1(3:9)" \
+ "B'0101010'" \
+ "print bitstring location slice 3"
+ test_print_accept "print bstrl1(0 up 20)" \
+ "B'10101010101010101010'" \
+ "print bitstring location slice 4"
+ test_print_accept "print bstrl1(19 up 1)" \
+ "B'0'" \
+ "print bitstring location slice 5"
+ gdb_test "print bstrl1(20 up 1)" \
+ ".*slice out of range.*" \
+ "print invalid bitstring slice (20 up 1)"
+ gdb_test "print bstrl1(-4:5)" \
+ ".*slice out of range.*" \
+ "print invalid bitstring slice (-4:5)"
+ gdb_test "print bstrl1(-1:up 1)" \
+ ".*invalid expression syntax.*" \
+ "print invalid bitstring slice (-1:ip 1)"
+ gdb_test "print bstrl1(-1:20)" \
+ ".*slice out of range.*" \
+ "print invalid bitstring slice (-1:20)"
+ gdb_test "print bstrl1(0 up -1)" \
+ ".*slice out of range.*" \
+ "print invalid bitstring slice (0 up -1)"
+ test_print_accept "print bstrl1(4 up 0)" "B''"
+
+ # array mode locations
+ gdb_test_exact "ptype arrl1" \
+ "ARRAY (1:100) set1" \
+ "print mode of array location"
+ gdb_test "whatis arrl1" "arr1m" \
+ "print mode name of array location"
+ gdb_test_exact "print arrl1" {[(1:100): aaa]} \
+ "print array location"
+ test_print_accept "ptype arrl1(1)" \
+ "SET \\(aaa, bbb, ccc\\)" \
+ "print mode of array element"
+ gdb_test_exact "print arrl3" \
+ {[(1:5): [(1:3): [(1:2): -2147483648]]]} \
+ "print array location 2"
+ gdb_test_exact "print arrl3(1)" \
+ {[(1:3): [(1:2): -2147483648]]} \
+ "print array location 3"
+ gdb_test_exact "ptype arrl3(1)" \
+ {ARRAY (1:3) ARRAY (1:2) long} \
+ "print mode of array element"
+ test_print_accept "print arrl3(5)" \
+ {\[\(1:3\): \[\(1:2\): -2147483648\]\]} \
+ "print array location 4"
+ test_print_accept "print arrl3(1,1)" \
+ {\[\(1:2\): -2147483648\]} \
+ "print array location 5"
+ test_print_accept "ptype arrl3(1,1)" \
+ {ARRAY \(1:2\) long} \
+ "print mode of array element"
+ test_print_accept "print arrl3(5,3)" \
+ {\[\(1:2\): -2147483648\]} \
+ "print array location 6"
+ test_print_accept "print arrl3(1,1,1)" \
+ "-2147483648" \
+ "print array location 7"
+ test_print_accept "print arrl3(5,3,2)" \
+ "-2147483648" \
+ "print array location 8"
+ test_print_accept "print arrl3(1)(3)(2)" \
+ "-2147483648" \
+ "print array location 9"
+
+ # reject the following range fails
+ # FIXME: adjust error messages
+ gdb_test "print arrl3(-1)" \
+ ".*out of range.*" \
+ "check invalid array indices 1"
+ gdb_test "print arrl3(6)" \
+ ".*out of range.*" \
+ "check invalid array indices 2"
+ gdb_test "print arrl3(0,0)" \
+ ".*out of range.*" \
+ "check invalid array indices 3"
+ gdb_test "print arrl3(1,0)" \
+ ".*out of range.*" \
+ "check invalid array indices 4"
+ gdb_test "print arrl3(1,4)" \
+ ".*out of range.*" \
+ "check invalid array indices 5"
+ gdb_test "print arrl3(6,4)" \
+ ".*out of range.*" \
+ "check invalid array indices 6"
+ gdb_test "print arrl3(1,1,0)" \
+ ".*out of range.*" \
+ "check invalid array indices 7"
+ gdb_test "print arrl3(6,4,0)" \
+ ".*out of range.*" \
+ "check invalid array indices 8"
+ gdb_test "print arrl3(1,1,3)" \
+ ".*out of range.*" \
+ "check invalid array indices 9"
+
+ gdb_test "print arrl3(0)(0)" \
+ ".* array or string index out of range.*" \
+ "check invalid array indices 10"
+ gdb_test "print arrl3(1)(0)" \
+ ".* array or string index out of range.*" \
+ "check invalid array indices 11"
+ gdb_test "print arrl3(1)(4)" \
+ ".* array or string index out of range.*" \
+ "check invalid array indices 12"
+ gdb_test "print arrl3(6)(4)" \
+ ".* array or string index out of range.*" \
+ "check invalid array indices 13"
+ gdb_test "print arrl3(1)(1)(0)" \
+ ".* array or string index out of range.*" \
+ "check invalid array indices 14"
+ gdb_test "print arrl3(6)(4)(0)" \
+ ".* array or string index out of range.*" \
+ "check invalid array indices 15"
+ gdb_test "print arrl3(1)(1)(3)" \
+ ".* array or string index out of range.*" \
+ "check invalid array indices 16"
+
+ # slices
+ test_print_accept "print arrl4(1:3)" \
+ {\[\(1:2\): \[\(1:3\): \[\(1:2\): -2147483648\]\], \(3\): \[\(1:3\): \[\(1:2\): 100\]\]\]} \
+ "print array slice 1"
+ test_print_accept "ptype arrl4(1:3)" \
+ {ARRAY \(1:3\) ARRAY \(1:3\) ARRAY \(1:2\) long} \
+ "print mode of array slice"
+# The next one is bogus:
+# test_print_accept "print arrl4(5, 2:3, 1)" \
+# # FIXME: maybe the '(1): ' in the inner tupel should be omitted ? \
+# {\[(2): \[\(1\): 100\], \(3\):\[\(1\): 100\]\]} \
+# "print array slice 2"
+ test_print_accept "print arrl4(1 up 4)" \
+ {\[\(1:2\): \[\(1:3\): \[\(1:2\): -2147483648\]\], \(3\): \[\(1:3\): \[\(1:2\): 100\]\], \(4\): \[\(1:3\): \[\(1:2\): -2147483648\]\]\]} \
+ "print array slice 3"
+# The next two are bogus:
+# test_print_accept "print arrl4(3, 2 up 1)" \
+# {\[\(2:3\): \[\(1:2\): 100\]\]} \
+# "print array slice 4"
+# test_print_accept "print arrl4(1:2, 1 up 1, 2)" \
+# {\[\(1\): \[\(1\): \[\(2\): -2147483648\], \(2\): \[\(2\): -2147483648\]\], \(2\): \[\(1\): \[\(2\): -2147483648\], \(2\): \[\(2\): -2147483648\]\]\]} \
+# "print array slice 4"
+ # reject invalid slices
+ # FIXME: adjust error messages
+ gdb_test "print arrl4(5:6)" \
+ ".*slice out of range.*" \
+ "check invalid range 1"
+ gdb_test "print arrl4(0:1)" \
+ ".*slice out of range.*" \
+ "check invalid range 2"
+ gdb_test "print arrl4(0:6)" \
+ ".*slice out of range.*" \
+ "check invalid range 3"
+ gdb_test "print arrl4(3:2)" \
+ ".*slice out of range.*" \
+ "check invalid range 4"
+ gdb_test "print arrl4(1,3:4)" \
+ ".*syntax error.*" \
+ "check invalid range 5"
+ gdb_test "print arrl4(1,0:1)" \
+ ".*syntax error.*" \
+ "check invalid range 6"
+ gdb_test "print arrl4(1,0:4)" \
+ ".*syntax error.*" \
+ "check invalid range 7"
+ gdb_test "print arrl4(1,3:2)" \
+ ".*syntax error.*" \
+ "check invalid range 8"
+ gdb_test "print arrl4(5 up 2)" \
+ ".*slice out of range.*" \
+ "check invalid range 9"
+ gdb_test "print arrl4(-1 up 1)" \
+ ".*slice out of range.*" \
+ "check invalid range 10"
+ gdb_test "print arrl4(-1 up 7)" \
+ ".*slice out of range.*" \
+ "check invalid range 11"
+ gdb_test "print arrl4(1 up 0)" \
+ ".*slice out of range.*" \
+ "check invalid range 12"
+ gdb_test "print arrl4(1,3 up 1)" \
+ ".*syntax error.*" \
+ "check invalid range 13"
+ gdb_test "print arrl4(1,-1 up 1)" \
+ ".*syntax error.*" \
+ "check invalid range 14"
+ gdb_test "print arrl4(1,-1 up 5)" \
+ ".*syntax error.*" \
+ "check invalid range 15"
+ gdb_test "print arrl4(1,2 up 0)" \
+ ".*syntax error.*" \
+ "check invalid range 16"
+
+ # structure modes
+ # some tests are in chillvars.exp
+ # FIXME: no tag processing implemented do maybe adjust these tests
+ setup_xfail "*-*-*"
+ test_print_accept "ptype stru1m" \
+ "STRUCT \\(.*a long,.*b long,.*CASE b OF.*\\(42\\):.*ch1 CHARS\\(20\\),.*\\(52\\):.*ch2 CHARS\\(10\\).*ELSE.*ch3 CHARS\\(1\\).*ESAC.*\\)" \
+ "print mode of structure location 1"
+ test_print_accept "whatis strul1" "stru1m" \
+ "print mode name of structure location 1"
+ setup_xfail "*-*-*"
+ test_print_accept "print strul1" \
+ {\[\.a: -2147483648, \.b: 42, \.\(b\): \{\(42\) = \[\.ch1: \"12345678900987654321\"\], \(52\) = \[\.ch2: \"1234567890\"\], (else) = \[\.ch3: \"1\"\]\}\]} \
+ "print structure location 1"
+ test_print_accept "print strul1.a" \
+ "-2147483648" \
+ "print field of structure location 1"
+ test_print_accept "print strul1.b" "42" \
+ "print field of structure location 1"
+ test_print_accept "print strul1.ch1" \
+ "\"12345678900987654321\"" \
+ "print field of structure location 1"
+ # setup_xfail "*-*-*"
+ test_print_accept "print strul1.ch2" \
+ "\"1234567890\"" \
+ "print field of structure location 1"
+ # setup_xfail "*-*-*"
+ test_print_accept "print strul1.ch3" \
+ "\"1\"" \
+ "print field of structure location 1"
+
+ if $passcount then {
+ pass "$passcount correct locations printed"
+ }
+}
+
+# This is chill/9434
+
+proc test_9434 {} {
+ global passcount
+
+ verbose "testing pr-9434"
+
+ test_print_accept "ptype m_xyzmode" "STRUCT \\(.*next REF m_xyzmode,.*i long.*\\)"
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if [set_lang_chill] then {
+ test_modes
+ test_locations
+ test_9434
+} else {
+ warning "$test_name tests suppressed."
+}
diff --git a/gdb/testsuite/gdb.chill/tests2.ch b/gdb/testsuite/gdb.chill/tests2.ch
new file mode 100644
index 00000000000..cf29866d905
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/tests2.ch
@@ -0,0 +1,193 @@
+-- Copyright 1992, 1995 Free Software Foundation, Inc.
+
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 2 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+-- Please email any bugs, comments, and/or additions to this file to:
+-- bug-gdb@prep.ai.mit.edu
+
+--
+-- test program 2 (refer to tests2.exp)
+--
+
+tests2: module;
+
+-- testpattern
+syn pat1 ulong = H'aaaaaaaa;
+syn pat2 ulong = H'55555555;
+
+-- discrete modes
+newmode bytem = struct (
+ p1 ulong,
+ m byte,
+ p2 ulong);
+newmode ubytem = struct (
+ p1 ulong,
+ m ubyte,
+ p2 ulong);
+newmode intm = struct (
+ p1 ulong,
+ m int,
+ p2 ulong);
+newmode uintm = struct (
+ p1 ulong,
+ m uint,
+ p2 ulong);
+newmode longm = struct (
+ p1 ulong,
+ m long,
+ p2 ulong);
+newmode ulongm = struct (
+ p1 ulong,
+ m ulong,
+ p2 ulong);
+newmode boolm = struct (
+ p1 ulong,
+ m bool,
+ p2 ulong);
+newmode charm1 = struct (
+ p1 ulong,
+ m char(4),
+ p2 ulong);
+newmode charm2 = struct (
+ p1 ulong,
+ m char(7),
+ p2 ulong);
+newmode charm3 = struct (
+ p1 ulong,
+ m char(8) varying,
+ p2 ulong);
+newmode charm4 = struct (
+ p1 ulong,
+ m char,
+ p2 ulong);
+newmode bitm1 = struct (
+ p1 ulong,
+ m bit(8),
+ p2 ulong);
+newmode bitm2 = struct (
+ p1 ulong,
+ m bit(10),
+ p2 ulong);
+newmode setm1 = struct (
+ p1 ulong,
+ m set (a, b, c, d, e, f, g, h),
+ p2 ulong);
+newmode nset1 = struct (
+ p1 ulong,
+ m set (na = 2147483648, nb = 1024, nc = 4294967295),
+ p2 ulong);
+newmode rm1 = struct (
+ p1 ulong,
+ m range (lower(byte):upper(byte)),
+ p2 ulong);
+newmode rm2 = struct (
+ p1 ulong,
+ m range (lower(int):upper(int)),
+ p2 ulong);
+newmode rm3 = struct (
+ p1 ulong,
+ m range (lower(long):upper(long)),
+ p2 ulong);
+newmode pm1 = struct (
+ p1 ulong,
+ m powerset set (pa, pb, pc, pd, pe, pf, pg, ph),
+ p2 ulong);
+newmode pm2 = struct (
+ p1 ulong,
+ m powerset int (1:32),
+ p2 ulong);
+-- this should be rejected by the gnuchill compiler !
+newmode pm3 = struct (
+ p1 ulong,
+-- m powerset long (lower(long): upper(long)),
+ p2 ulong);
+newmode refm1 = struct (
+ p1 ulong,
+ m ptr,
+ p2 ulong);
+newmode refm2 = struct (
+ p1 ulong,
+ m ref bytem,
+ p2 ulong);
+newmode prm1 = struct (
+ p1 ulong,
+ m proc (),
+ p2 ulong);
+newmode tim1 = struct (
+ p1 ulong,
+ m time,
+ p2 ulong);
+newmode tim2 = struct (
+ p1 ulong,
+ m duration,
+ p2 ulong);
+newmode rem1 = struct (
+ p1 ulong,
+ m real,
+ p2 ulong);
+newmode rem2 = struct (
+ p1 ulong,
+ m long_real,
+ p2 ulong);
+newmode arrm1 = struct (
+ p1 ulong,
+ m array(1:3, 1:2) int,
+ p2 ulong);
+newmode strum1 = struct (
+ p1 ulong,
+ m struct (a, b int, ch char(4)),
+ p2 ulong);
+
+
+-- dummyfunction for breakpoints
+dummyfunc: proc();
+end dummyfunc;
+
+
+dcl b1 bytem init := [pat1, -128, pat2];
+dcl ub1 ubytem init := [pat1, 0, pat2];
+dcl i1 intm init := [pat1, -32768, pat2];
+dcl ui1 uintm init := [pat1, 0, pat2];
+dcl l1 longm init := [pat1, -2147483648, pat2];
+dcl ul1 ulongm init := [pat1, 0, pat2];
+dcl bo1 boolm init := [pat1, true, pat2];
+dcl c1 charm1 init := [pat1, "1234", pat2];
+dcl c2 charm2 init := [pat1, "1234567", pat2];
+dcl c3 charm3 init := [pat1, "12345678", pat2];
+dcl c4 charm4 init := [pat1, C'00', pat2];
+dcl bi1 bitm1 init := [pat1, B'01011010', pat2];
+dcl bi2 bitm2 init := [pat1, B'1010110101', pat2];
+dcl se1 setm1 init := [pat1, a, pat2];
+dcl nse1 nset1 init := [pat1, na, pat2];
+dcl r1 rm1 init := [pat1, -128, pat2];
+dcl r2 rm2 init := [pat1, -32768, pat2];
+dcl r3 rm3 init := [pat1, -2147483648, pat2];
+dcl p1 pm1 init := [pat1, [pa], pat2];
+dcl p2 pm2 init := [pat1, [1], pat2];
+-- dcl p3 pm3 init := [pat1, [-1], pat2]; -- FIXME: bug in gnuchill
+dcl ref1 refm1 init := [pat1, null, pat2];
+dcl ref2 refm2 init := [pat1, null, pat2];
+dcl pr1 prm1;
+dcl ti1 tim1 init := [pat1, 0, pat2];
+dcl ti2 tim2 init := [pat1, 0, pat2];
+dcl re1 rem1 init := [pat1, 0.0, pat2];
+dcl re2 rem2 init := [pat1, 0.0, pat2];
+dcl arrl1 arrm1 init:=[pat1, [(1:3): [0,0]], pat2];
+dcl strul1 strum1 init := [pat1, [.a: 0, .b: 0, .ch: "0000"], pat2];
+
+pr1 := [pat1, dummyfunc, pat2];
+dummyfunc();
+
+end tests2;
diff --git a/gdb/testsuite/gdb.chill/tests2.exp b/gdb/testsuite/gdb.chill/tests2.exp
new file mode 100644
index 00000000000..1e47e811ca9
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/tests2.exp
@@ -0,0 +1,271 @@
+# Copyright 1992, 1995, 1996, 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set prms_id 0
+set bug_id 0
+
+# Set the current language to chill. This counts as a test. If it
+# fails, then we skip the other tests.
+
+set testfile "tests2"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -w -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+global infinity
+if [istarget "i*86-*-sysv4*"] then {
+ set infinity "inf"
+} else {
+ set infinity "Infinity"
+}
+
+proc set_lang_chill {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ if ![file exists $objdir/$subdir/$binfile] then {
+ return 0
+ }
+ verbose "loading file '$objdir/$subdir/$binfile'"
+ gdb_load $objdir/$subdir/$binfile
+
+ send_gdb "set language chill\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language chill (timeout)" ; return 0 }
+ }
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"chill\".*$gdb_prompt $" {
+ pass "set language to \"chill\""
+ send_gdb "break dummyfunc\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {
+ send_gdb "run\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+ return 1
+ }
+ timeout {
+ fail "can't set breakpoint (timeout)"
+ return 0
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ fail "setting language to \"chill\""
+ return 0
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return 0
+ }
+ }
+}
+
+# checks if structure was accessed correctly
+proc test_write { args } {
+ global gdb_prompt
+
+ if [llength $args]==5 then {
+ set message [lindex $args 4]
+ set extended [lindex $args 3]
+ set matchval [lindex $args 2]
+ } elseif [llength $args]==4 then {
+ set message [lindex $args 3]
+ set matchval [lindex $args 2]
+ set extended ""
+ } elseif [llength $args]==3 then {
+ set message [lindex $args 2]
+ set extended ""
+ } else {
+ warning "test ($args) write called with wrong number of arguments"
+ return
+ }
+
+ set location [lindex $args 0]
+ set value [lindex $args 1]
+ if ![info exists matchval] then {
+ set matchval $value
+ }
+ verbose "loc: $location, val: $value, msg: $message, ext: $extended, match: $matchval"
+
+ verbose "setting var $value..."
+ send_gdb "set var $location.m$extended := $value\n"
+ gdb_expect -re ".*$gdb_prompt $" {}
+ gdb_test "print $location" \
+ ".*= \[\[\]\\.p1: 2863311530, \\.m: $matchval, \\.p2: 1431655765\[\]\]"\
+ "$message"
+}
+
+# test write access from gdb (setvar x:=y) from gdb
+proc write_access { } {
+ global infinity
+
+ verbose "testing write access to locations"
+
+ # discrete modes
+ test_write b1 127 "byte write 1"
+ test_write b1 -128 "byte write 2"
+ test_write b1 0 "byte write 3"
+ test_write ub1 255 "ubyte write 1"
+ test_write ub1 0 "ubyte write 2"
+ test_write ub1 42 "ubyte write 3"
+ test_write i1 32767 "int write 1"
+ test_write i1 -32768 "int write 2"
+ test_write i1 0 "int write 3"
+ test_write ui1 65535 "uint write 1"
+ test_write ui1 0 "uint write 2"
+ test_write ui1 123 "uint write 3"
+ test_write l1 2147483647 "long write 1"
+ test_write l1 -2147483648 "long write 2"
+ test_write l1 0 "long write 3"
+ test_write ul1 4294967295 "ulong write 1"
+ test_write ul1 0 "ulong write 2"
+ test_write ul1 1000000 "ulong write 3"
+ test_write bo1 FALSE "bool write 1"
+ test_write bo1 TRUE "bool write 2"
+ test_write c1 \"1234\" "char write 1"
+ test_write c2 \"1234567\" "char write 2"
+ test_write c3 \"654321\" "char write 3"
+ test_write c4 C'65' 'e' "char write 4"
+ test_write bi1 B'10100101' "bitstring write 1"
+ test_write bi2 B'0101001010' "bitstring write 2"
+ test_write se1 a "set write 1"
+ test_write se1 h "set write 2"
+ # The following two use numbered sets with too-large values.
+ setup_xfail "*-*-*"
+ test_write nse1 nb "numbered set write 1"
+ setup_xfail "*-*-*"
+ test_write nse1 nc "numbered set write 2"
+ test_write r1 127 "range write 1"
+ test_write r2 32767 "range write 2"
+ test_write r3 2147483647 "range write 3"
+
+ # powerset modes
+ test_write p1 {[pa:ph]} {\[pa:ph\]} "powerset write 1"
+ test_write p1 {[pa, pc:pf, ph]} {\[pa, pc:pf, ph\]} "powerset write 2"
+ test_write p1 {[pa, pc, pe, pg]} {\[pa, pc, pe, pg\]} "powerset write 3"
+ test_write p1 {[]} {\[\]} "powerset write 4"
+ test_write p2 {[1:32]} {\[1:32\]} "powerset write 5"
+ test_write p2 {[1, 3:30, 32]} {\[1, 3:30, 32\]} "powerset write 6"
+ test_write p2 {[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31]} {\[1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31\]} \
+ "powerset write 7"
+ test_write p2 {[]} {\[\]} "powerset write 8"
+
+# Fixme: this should be rejected by gnuchill
+# test_write p3 {[-2147483648:2147483647]} {\[-2147483648:2147483647\]} \
+# "powerset write 9"
+# test_write p3 {[-2147483648, -1000000:1000000, 2147483647]} \
+# {\[-2147483648, -1000000:1000000, 2147483647\]} \
+# "powerset write 10"
+# test_write p3 {[-99, -97, -95, 1001, 1003, 1005]} \
+# {\[-99, -97, -95, 1001, 1003, 1005\]} "powerset write 11"
+# test_write p3 {[]} {\[\]} "powerset write 12"
+
+ # reference modes
+ test_write ref1 ->ref1 {H'[0-9a-fA-F]+} "reference write 1"
+ test_write ref2 ->b1 {H'[0-9a-fA-F]+} "reference write 2"
+ test_write ref1 NULL "reference write 3"
+ test_write ref2 NULL "reference write 4"
+
+ # procedure modes
+ test_write pr1 NULL "procefure write 1"
+ # FIXME: remove when NULL is understood
+ test_write pr1 0 NULL "procefure write 2"
+ test_write pr1 dummyfunc {H'[0-9a-fA-F]+ <dummyfunc>} "procedure write 3"
+
+ # timing modes, FIXME when callbacks to timefunctions are implemented
+ #test_write ti1 abstime(1970, 3, 12, 10, 43, 0) {} "time write 1"
+ #test_write ti2 <set somehow a duration>
+ xfail "timing modes not implemented yet"
+
+ # real modes
+ # This ones
+ test_write re1 42.03 {42.0[0-9]*} "real write 1"
+ test_write re1 0 "real write 2"
+ test_write re1 "1e+38" {1e\+38|1\.0[0-9]*e\+38|9\.9[0-9]*e\+37} \
+ "real write 3"
+ setup_xfail "i*86-pc-linux-gnu" "m68*-*-hpux*"
+ test_write re1 "1e+39" $infinity "real write 4"
+ test_write re2 42.03 {42.0[0-9]*} "real write 5"
+ test_write re2 0 "real write 6"
+ test_write re2 "1e+308" {1e\+308} "real write 7"
+ setup_xfail "i*86-pc-linux-gnu" "m68*-*-hpux*"
+ test_write re2 "1e+309" $infinity "real write 8"
+ # array modes
+ test_write arrl1 {[(1:3): [(1:2): -128]]} {\[\(1:3\): \[\(1:2\): -128\]\]}\
+ "array write 1"
+ test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\
+ "array write 2"
+ test_write arrl1 {[(1): [(1:2): 127], (2): [(1:2): -128], (3): [(1:2): 127]]} {\[\(1\): \[\(1:2\): 127\], \(2\): \[\(1:2\): -128\], \(3\): \[\(1:2\): 127\]\]}\
+ "array write 3"
+ test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\
+ "array write 4"
+ setup_xfail "*-*-*"
+ # Bogus test case - type mismatch?
+ test_write arrl1 {[(1): 127, (2): -128]} "array write 5"
+ test_write arrl1 {[(1:3): [(1:2): 0]]} {\[\(1:3\): \[\(1:2\): 0\]\]}\
+ "array write 6"
+
+ # structure modes
+ test_write strul1 {[.a: -32768, .b: 32767, .ch: "ZZZZ"]} \
+ {\[\.a: -32768, \.b: 32767, \.ch: \"ZZZZ\"\]} \
+ "structure write 1"
+ test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \
+ {\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \
+ "structure write 2"
+ test_write strul1 -32768 {\[\.a: -32768, \.b: 0, \.ch: \"0000\"\]} \
+ {.a} "structure write 3"
+ test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \
+ {\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \
+ "structure write 4"
+ test_write strul1 -32768 {\[\.a: 0, \.b: -32768, \.ch: \"0000\"\]} \
+ {.b} "structure write 5"
+ test_write strul1 {[.a: 0, .b: 0, .ch: "0000"]} \
+ {\[\.a: 0, \.b: 0, \.ch: \"0000\"\]} \
+ "structure write 6"
+ test_write strul1 \"HUGO\" {\[\.a: 0, \.b: 0, \.ch: \"HUGO\"\]} \
+ {.ch} "structure write 7"
+}
+
+# Start with a fresh gdb.
+
+set binfile "tests2.exe"
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if [set_lang_chill] then {
+ write_access
+} else {
+ warning "$test_name tests suppressed."
+}
diff --git a/gdb/testsuite/gdb.chill/tuples.ch b/gdb/testsuite/gdb.chill/tuples.ch
new file mode 100644
index 00000000000..24709f8fe05
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/tuples.ch
@@ -0,0 +1,86 @@
+x: MODULE
+
+SYNMODE m_arri = ARRAY(1:5) INT;
+DCL v_arri m_arri := [ -1, -2, -3, -4, -5 ];
+
+SYNMODE m_arrui = ARRAY(1:5) UINT;
+DCL v_arrui m_arrui := [ 1, 2, 3, 4, 5 ];
+
+SYNMODE r1 = RANGE (1:5);
+SYNMODE m_arrb = ARRAY(r1) BYTE;
+DCL v_arrb m_arrb := [ -3, -4, -5, -6, -7 ];
+
+SYNMODE m_arrub = ARRAY(r1) UBYTE;
+DCL v_arrub m_arrub := [ 3, 4, 5, 6, 7 ];
+
+SYNMODE m_arrc = ARRAY (1:5) CHAR;
+DCL v_arrc m_arrc := [ '1', '2', '3', '4', '5' ];
+
+SYNMODE m_ps = POWERSET r1;
+DCL v_ps m_ps := [ 1, 3, 5 ];
+
+DCL v_cv CHARS(20) VARYING := "foo";
+
+SYNMODE m_arrbool = ARRAY(r1) BOOL;
+DCL v_arrbool m_arrbool := [ true, false, true, false, true ];
+
+DCL j r1 := 4;
+
+DCL i INT;
+
+newmode vstruct = struct (a, b long,
+ case b of
+ (42): ch8 chars(20),
+ (52): i long
+ else ch1 char
+ esac);
+
+DCL vstr vstruct := [ .a: 10, .b: 52, .i: 100 ];
+
+i := 0;
+
+END x;
+
+setmode: MODULE /* This is from Cygnus PR chill/5024. */
+
+NEWMODE day = SET( monday, tuesday, wednesday, thursday, friday, saturday, sunday );
+NEWMODE dow = POWERSET day;
+
+DCL d day;
+DCL w dow;
+
+printdow: PROC( w dow );
+ DCL d day;
+ DO FOR d in w;
+ WRITETEXT( stdout, "%C ", d );
+ OD;
+END;
+
+d := monday;
+w := dow[monday : friday];
+printdow( w );
+
+printdow( dow[LOWER(dow) : UPPER(dow)] );
+
+END setmode;
+
+PR8643: MODULE
+
+SYNMODE m_set = SET (a, b, c, d);
+SYNMODE m_ps = POWERSET m_set;
+
+SYNMODE m_s1 = STRUCT (str CHARS(40) VARYING, i INT, ps m_ps);
+DCL vs1 m_s1;
+
+SYNMODE m_s2 = STRUCT (i LONG, s m_s1);
+DCL vs2 m_s2;
+
+SYNMODE m_arr = ARRAY (1:3) BYTE;
+SYNMODE m_s3 = STRUCT (i LONG, a m_arr);
+DCL vs3 m_s3;
+
+DCL i LONG;
+
+i := 24;
+
+END PR8643;
diff --git a/gdb/testsuite/gdb.chill/tuples.exp b/gdb/testsuite/gdb.chill/tuples.exp
new file mode 100644
index 00000000000..0efea79eaa9
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/tuples.exp
@@ -0,0 +1,161 @@
+# Copyright 1995, 1996 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile "tuples"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ runto tuples.ch:40
+
+ gdb_test_exact "print v_arri" {= [(1): -1, (2): -2, (3): -3, (4): -4, (5): -5]}
+ gdb_test_exact "set v_arri := \[ 33, 44, 55, 66, 77 \]" {}
+ gdb_test_exact "print v_arri" {= [(1): 33, (2): 44, (3): 55, (4): 66, (5): 77]} "after assignment 1 to v_arri"
+ gdb_test_exact "set v_arri := \[-33, -44, -55, -66, -77\]" {}
+ gdb_test_exact "print v_arri" {= [(1): -33, (2): -44, (3): -55, (4): -66, (5): -77]} {after assignment 2 to v_arri}
+
+ gdb_test_exact "print v_arrui" {= [(1): 1, (2): 2, (3): 3, (4): 4, (5): 5]}
+ gdb_test_exact "set v_arrui := \[ 11, 11, 11, 11, 11 \]" {}
+ gdb_test_exact "print v_arrui" {= [(1:5): 11]} "after assignment to v_arrui"
+
+ gdb_test_exact "print v_arrb" {= [(1): -3, (2): -4, (3): -5, (4): -6, (5): -7]}
+
+ gdb_test_exact "set v_arrb := \[ -9, -8, -7, -6, -5 \]" {}
+ gdb_test_exact "print v_arrb" {= [(1): -9, (2): -8, (3): -7, (4): -6, (5): -5]} "after assignment to v_arrb"
+
+ gdb_test_exact "print v_arrub" {= [(1): 3, (2): 4, (3): 5, (4): 6, (5): 7]}
+ gdb_test_exact "set v_arrub := \[ 77, 77, 77, 77, 77 \]" {}
+ gdb_test_exact "print v_arrub" {= [(1:5): 77]} "v_arrub after assignment"
+
+ gdb_test_exact "print j" {= 4}
+ gdb_test_exact "print j := 3+4" {= 7}
+ gdb_test_exact "print j := r1(3)" {= 3}
+
+ gdb_test_exact "print v_arrc" {= [(1): '1', (2): '2', (3): '3', (4): '4', (5): '5']}
+ gdb_test_exact "set v_arrc := \[ 'a', 'b', 'c', 'd', 'e' \]" {}
+ gdb_test_exact "print v_arrc" {= [(1): 'a', (2): 'b', (3): 'c', (4): 'd', (5): 'e']} "v_arrc after assignment"
+
+ gdb_test_exact "print v_ps" {= [1, 3, 5]}
+ gdb_test_exact "set v_ps := \[ 2, 4 \]" {}
+ gdb_test_exact "print v_ps" {= [2, 4]} {v_ps after assignment}
+ gdb_test_exact "print v_ps := \[\]" {= []} {assign [] to v_ps}
+
+ gdb_test_exact "print m_arri\[1, 2, 3, 4, 5\]" {= [(1): 1, (2): 2, (3): 3, (4): 4, (5): 5]}
+ gdb_test_exact "print m_arrub\[45, 46, 47, 48, 49\]" {= [(1): 45, (2): 46, (3): 47, (4): 48, (5): 49]}
+
+ gdb_test_exact "print v_cv" {= "foo"}
+ gdb_test_exact "set v_cv := \"foo-bar\"" {}
+ gdb_test_exact "print v_cv" {= "foo-bar"} "v_cv after assignment"
+ gdb_test_exact "set v_cv(3) := ' '" {}
+ gdb_test_exact "print v_cv" {= "foo bar"} "v_cv after element assignment"
+
+ gdb_test_exact "print v_arrbool" {= [(1): TRUE, (2): FALSE, (3): TRUE, (4): FALSE, (5): TRUE]}
+ gdb_test_exact "set v_arrbool := \[ false, false, false, false, false \]" {}
+ gdb_test_exact "print v_arrbool" {= [(1:5): FALSE]} "v_arrbool after assignment 1"
+ gdb_test_exact "set v_arrbool := \[true, true, true, true, true\]" {}
+ gdb_test_exact "print v_arrbool" {= [(1:5): TRUE]} "v_arrbool after assignment 2"
+ gdb_test_exact "set v_arrbool(3) := false" {}
+ gdb_test_exact "print v_arrbool" {= [(1:2): TRUE, (3): FALSE, (4:5): TRUE]} "v_arrbool after element assignment"
+
+ gdb_test_exact "set v_arrbool(1 up 2) := \[ false, true \]" {}
+ gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2): TRUE, (3): FALSE, (4:5): TRUE]} "v_arrbool after slice assignment 1"
+ gdb_test_exact "set v_arrbool(3 : 5) := \[ true, true, false \]" {}
+ gdb_test_exact "print v_arrbool" {= [(1): FALSE, (2:4): TRUE, (5): FALSE]} "v_arrbool after slice assignment 2"
+
+ gdb_test_exact "set vstr := \[ .a: 2+3, .b: 12, .ch1: 'x' \]" {}
+ gdb_test_exact "print vstr.a" {= 5} "vstr.a after assignment"
+ gdb_test_exact "print vstr.ch1" {= 'x'} "vstr.ch1 after assignment"
+
+# These tests are from Cygnus PR chill/5024:
+ gdb_test "break printdow" ""
+ gdb_test "continue" ""
+ gdb_test_exact "set var w:= dow\[monday\]" {}
+ gdb_test "print w" " = \\\[monday\\\]" \
+ "print bitstring after assignment"
+ gdb_test_exact "set var w:=\[\]" {}
+ gdb_test "print w" " = \\\[\\\]" \
+ "print bitstring after assignment of \[\]"
+
+# These tests are from Cygnus PR chill/8643:
+ runto tuples.ch:40
+ gdb_test_exact "set var vs1 := \[ \"foo\", 41, \[ b \] \]" {}
+ gdb_test_exact "print vs1" { = [.str: "foo", .i: 41, .ps: [b]]} \
+ "print vs1 after tuple assign 1"
+ setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
+ gdb_test_exact "set var vs1 := \[ \"bar\", 42, m_ps\[ a \] \]" {}
+ setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
+ gdb_test_exact "print vs1" { = [.str: "bar", .i: 42, .ps: [a]]} \
+ "print vs1 after tuple assign 2"
+
+ gdb_test_exact "set var \$i := m_s1\[\"foo\", 42, \[a \]\]" {}
+ gdb_test_exact {print $i} { = [.str: "foo", .i: 42, .ps: [a]]} \
+ "print \$i after tuple assign 1"
+ setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
+ gdb_test_exact "set var \$i := m_s1\[\"foo\", 44, m_ps\[a \]\]" {}
+ setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
+ gdb_test_exact {print $i} { = [.str: "foo", .i: 44, .ps: [a]]} \
+ "print \$i after tuple assign 2"
+
+ gdb_test_exact "set var vs2 := \[ 10, \[ \"foo\" , 42, \[ b \] \] \]" {}
+ gdb_test_exact "print vs2" \
+ { = [.i: 10, .s: [.str: "foo", .i: 42, .ps: [b]]]} \
+ "print vs2 after tuple assign 1"
+ setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
+ gdb_test_exact "set var vs2 := \[ 10+3, m_s1\[ \"foo\" , 42, m_ps\[ b \] \] \]" {}
+ setup_xfail "i*86-pc-linux*-gnu" "sparc-*-solaris*" "sparc-*-sunos*"
+ gdb_test_exact "print vs2" \
+ { = [.i: 13, .s: [.str: "foo", .i: 42, .ps: [b]]]} \
+ "print vs2 after tuple assign 2"
+
+ gdb_test_exact "set var vs3 := \[ 33, \[ -1, -2, -3 \] \]" {}
+ gdb_test_exact "print vs3" {[.i: 33, .a: [(1): -1, (2): -2, (3): -3]]} \
+ "print vs3 after tuple assign"
+ gdb_test_exact "set var \$k := m_s3\[ 33, m_arr\[ 4, 3, 2 \] \]" {}
+ gdb_test_exact {print $k} { = [.i: 33, .a: [(1): 4, (2): 3, (3): 2]]} \
+ "print \$k after tuple assign"
+
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.chill/xstruct-grt.ch b/gdb/testsuite/gdb.chill/xstruct-grt.ch
new file mode 100644
index 00000000000..abd0d5ee3e4
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/xstruct-grt.ch
@@ -0,0 +1,12 @@
+pot1: MODULE
+
+SYNMODE m_array1 = ARRAY (2:3) ulong;
+SYNMODE m_struct = STRUCT (f1 int,
+ f2 REF m_array1,
+ f3 m_array1);
+SYNMODE m_array3 = ARRAY (5:6) m_struct;
+SYNMODE m_array4 = ARRAY (7:8) ARRAY (9:10) m_struct;
+
+GRANT all;
+
+END pot1;
diff --git a/gdb/testsuite/gdb.chill/xstruct.ch b/gdb/testsuite/gdb.chill/xstruct.ch
new file mode 100644
index 00000000000..d8471c849aa
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/xstruct.ch
@@ -0,0 +1,16 @@
+pottendo: MODULE
+
+<> USE_SEIZE_FILE "xstruct-grt.grt" <>
+SEIZE m_array3;
+SEIZE m_array4;
+
+SYNMODE m_x = STRUCT (i long,
+ ar m_array3);
+SYNMODE m_y = STRUCT (i long,
+ ar m_array4);
+
+DCL x LONG;
+
+x := 10;
+
+END pottendo;
diff --git a/gdb/testsuite/gdb.chill/xstruct.exp b/gdb/testsuite/gdb.chill/xstruct.exp
new file mode 100644
index 00000000000..e64fcea3005
--- /dev/null
+++ b/gdb/testsuite/gdb.chill/xstruct.exp
@@ -0,0 +1,66 @@
+# Copyright 1992, 1994, 1997, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Per Bothner. (bothner@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if [skip_chill_tests] then { continue }
+
+set testfile2 "xstruct-grt"
+set srcfile2 ${srcdir}/$subdir/${testfile2}.ch
+set objfile2 ${objdir}/$subdir/${testfile2}.o
+if { [compile "${srcfile2} -g -c -o ${objfile2}"] != "" } {
+ perror "Couldn't compile ${srcfile2}"
+ return -1
+}
+
+set testfile "xstruct"
+set srcfile ${srcdir}/$subdir/${testfile}.ch
+set binfile ${objdir}/${subdir}/${testfile}.exe
+if { [compile "${srcfile} -g ${objfile2} -o ${binfile} ${CHILL_RT0} ${CHILL_LIB}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+proc do_tests {} {
+ global prms_id bug_id subdir objdir srcdir binfile gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $binfile
+
+ gdb_test "set language chill" ""
+
+ gdb_test "set var \$i := m_x\[\]" ""
+ gdb_test "print \$i" { = \[.i: 0, .ar: \[\(5:6\): \[.f1: 0, .f2: NULL, .f3: \[\(2:3\): 0\]\]\]\]}
+
+ gdb_test "set var \$j := m_y\[\]" ""
+ gdb_test "print \$j" { = \[.i: 0, .ar: \[\(7:8\): \[\(9:10\): \[.f1: 0, .f2: NULL, .f3: \[\(2:3\): 0\]\]\]\]\]}
+}
+
+do_tests
diff --git a/gdb/testsuite/gdb.disasm/Makefile.in b/gdb/testsuite/gdb.disasm/Makefile.in
new file mode 100644
index 00000000000..7bb5eef69c4
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/Makefile.in
@@ -0,0 +1,18 @@
+#### host, target, and site specific Makefile frags come in here.
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+.PHONY: all clean mostlyclean distclean realclean
+
+all:
+ @echo "Nothing to be done for all..."
+
+clean mostlyclean:
+ -rm -f *.o *.diff *~ *.bad core h8300s hppa mn10200 mn10300 sh3
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+
+Makefile: $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.disasm/am33.exp b/gdb/testsuite/gdb.disasm/am33.exp
new file mode 100644
index 00000000000..c020fac88fe
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/am33.exp
@@ -0,0 +1,838 @@
+
+# Copyright 1997, 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Jeff Law. (law@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if ![istarget "mn10300*-*-*"] {
+ verbose "Tests ignored for all but mn10300 based targets."
+ return
+}
+
+global exec_output
+set prms_id 0
+set bug_id 0
+
+set testfile "am33"
+set srcfile ${srcdir}/${subdir}/${testfile}.s
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcfile}" "${binfile}" object ""] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc call_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/8i call_tests\n"
+ gdb_expect {
+ -re "
+.*call .*,.a2,a3,exreg0.,9.*
+.*call .*,.a2,a3,exreg1.,9.*
+.*call .*,.a2,a3,exother.,9.*
+.*call .*,.d2,d3,a2,a3,other,exreg0,exreg1,exother.,9.*
+.*call .*,.a2,a3,exreg0.,9.*
+.*call .*,.a2,a3,exreg1.,9.*
+.*call .*,.a2,a3,exother.,9.*
+.*call .*,.d2,d3,a2,a3,other,exreg0,exreg1,exother.,9.*
+.*$gdb_prompt $" { pass "call tests" }
+ -re "$gdb_prompt $" { fail "call tests" }
+ timeout { fail "(timeout) call tests" }
+ }
+}
+
+proc movm_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/16i movm_tests\n"
+ gdb_expect {
+ -re "
+.*movm \\(sp\\),.a2,a3,exreg0.*
+.*movm \\(sp\\),.a2,a3,exreg1.*
+.*movm \\(sp\\),.a2,a3,exother.*
+.*movm \\(sp\\),.d2,d3,a2,a3,other,exreg0,exreg1,exother.*
+.*movm .a2,a3,exreg0.,\\(sp\\).*
+.*movm .a2,a3,exreg1.,\\(sp\\).*
+.*movm .a2,a3,exother.,\\(sp\\).*
+.*movm .d2,d3,a2,a3,other,exreg0,exreg1,exother.,\\(sp\\).*
+.*movm \\(usp\\),.a2,a3,exreg0.*
+.*movm \\(usp\\),.a2,a3,exreg1.*
+.*movm \\(usp\\),.a2,a3,exother.*
+.*movm \\(usp\\),.d2,d3,a2,a3,other,exreg0,exreg1,exother.*
+.*movm .a2,a3,exreg0.,\\(usp\\).*
+.*movm .a2,a3,exreg1.,\\(usp\\).*
+.*movm .a2,a3,exother.,\\(usp\\).*
+.*movm .d2,d3,a2,a3,other,exreg0,exreg1,exother.,\\(usp\\).*
+.*$gdb_prompt $" { pass "movm tests" }
+ -re "$gdb_prompt $" { fail "movm tests" }
+ timeout { fail "(timeout) movm tests" }
+ }
+}
+
+proc misc_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/11i misc_tests\n"
+ gdb_expect {
+ -re "
+.*syscall 4.*
+.*mcst9 d0.*
+.*mcst48 d1.*
+.*getchx d0.*
+.*getclx d1.*
+.*clr a1.*
+.*sat16 a1,a0.*
+.*mcste r7,r6.*
+.*swap r5,r4.*
+.*swaph r3,r2.*
+.*swhw r1,r0.*
+.*$gdb_prompt $" { pass "misc tests" }
+ -re "$gdb_prompt $" { fail "misc tests" }
+ timeout { fail "(timeout) misc tests" }
+ }
+}
+
+proc mov_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/45i mov_tests\n"
+ gdb_expect {
+ -re "
+.*mov r0,r1.*
+.*mov sp,r1.*
+.*mov r1,xr2.*
+.*mov \\(r1\\),r2.*
+.*mov r3,\\(r4\\).*
+.*mov \\(sp\\),r5.*
+.*mov r6,\\(sp\\).*
+.*mov 16,r1.*
+.*mov 16,xr1.*
+.*mov \\(16,r1\\),r2.*
+.*mov r2,\\(16,r1\\).*
+.*mov \\(16,sp\\),r2.*
+.*mov r2,\\(16,sp\\).*
+.*mov 2096895,r2.*
+.*mov 2096895,xr2.*
+.*mov \\(2096895,r1\\),r2.*
+.*mov r2,\\(2096895,r1\\).*
+.*mov \\(2096895,sp\\),r2.*
+.*mov r2,\\(2096895,sp\\).*
+.*mov \\(0x1ffeff\\),r2.*
+.*mov r2,\\(0x1ffeff\\).*
+.*mov 2147417596,r2.*
+.*mov 2147417596,xr2.*
+.*mov \\(2147417596,r1\\),r2.*
+.*mov r2,\\(2147417596,r1\\).*
+.*mov \\(2147417596,sp\\),r2.*
+.*mov r2,\\(2147417596,sp\\).*
+.*mov \\(0x7ffefdfc\\),r2.*
+.*mov r2,\\(0x7ffefdfc\\).*
+.*movu 16,r1.*
+.*movu 2096895,r2.*
+.*movu 2147417596,r2.*
+.*mov usp,a0.*
+.*mov ssp,a1.*
+.*mov msp,a2.*
+.*mov pc,a3.*
+.*mov a0,usp.*
+.*mov a1,ssp.*
+.*mov a2,msp.*
+.*mov epsw,d0.*
+.*mov d1,epsw.*
+.*mov a0,r1.*
+.*mov d2,r3.*
+.*mov r5,a1.*
+.*mov r7,d3.*
+.*$gdb_prompt $" { pass "mov tests" }
+ -re "$gdb_prompt $" { fail "mov tests" }
+ timeout { fail "(timeout) mov tests" }
+ }
+}
+
+proc ext_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/5i ext_tests\n"
+ gdb_expect {
+ -re "
+.*ext r2.*
+.*extb r3,r4.*
+.*extbu r4,r5.*
+.*exth r6,r7.*
+.*exthu r7,a0.*
+.*$gdb_prompt $" { pass "ext tests" }
+ -re "$gdb_prompt $" { fail "ext tests" }
+ timeout { fail "(timeout) ext tests" }
+ }
+}
+
+proc add_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/11i add_tests\n"
+ gdb_expect {
+ -re "
+.*add a2,a3.*
+.*add 16,r1.*
+.*add 2096895,r2.*
+.*add 2147417596,r2.*
+.*add r1,r2,r3.*
+.*addc d0,d1.*
+.*addc 16,r1.*
+.*addc 2096895,r2.*
+.*addc 2147417596,r2.*
+.*inc d1.*
+.*inc4 d0.*
+.*$gdb_prompt $" { pass "add tests" }
+ -re "$gdb_prompt $" { fail "add tests" }
+ timeout { fail "(timeout) add tests" }
+ }
+}
+
+proc sub_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/8i sub_tests\n"
+ gdb_expect {
+ -re "
+.*sub d2,d3.*
+.*sub 16,r1.*
+.*sub 2096895,r2.*
+.*sub 2147417596,r2.*
+.*subc d3,d2.*
+.*subc 16,r1.*
+.*subc 2096895,r2.*
+.*subc 2147417596,r2.*
+.*$gdb_prompt $" { pass "sub tests" }
+ -re "$gdb_prompt $" { fail "sub tests" }
+ timeout { fail "(timeout) sub tests" }
+ }
+}
+
+proc cmp_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/4i cmp_tests\n"
+ gdb_expect {
+ -re "
+.*cmp a3,a2.*
+.*cmp 16,r1.*
+.*cmp 2096895,r2.*
+.*cmp 2147417596,r2.*
+.*$gdb_prompt $" { pass "cmp tests" }
+ -re "$gdb_prompt $" { fail "cmp tests" }
+ timeout { fail "(timeout) cmp tests" }
+ }
+}
+
+proc logical_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/15i logical_tests\n"
+ gdb_expect {
+ -re "
+.*and r0,r1.*
+.*or r2,r3.*
+.*xor r4,r5.*
+.*not r6.*
+.*and 16,r1.*
+.*or 16,r1.*
+.*xor 16,r1.*
+.*and 2096895,r2.*
+.*or 2096895,r2.*
+.*xor 2096895,r2.*
+.*and 2147417596,r2.*
+.*or 2147417596,r2.*
+.*xor 2147417596,r2.*
+.*and 131072,epsw.*
+.*or 65535,epsw.*
+.*$gdb_prompt $" { pass "logical tests" }
+ -re "$gdb_prompt $" { fail "logical tests" }
+ timeout { fail "(timeout) logical tests" }
+ }
+}
+
+proc shift_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/15i shift_tests\n"
+ gdb_expect {
+ -re "
+.*asr r7,a0.*
+.*lsr a1,a2.*
+.*asl a3,d0.*
+.*asl2 d1.*
+.*ror d2.*
+.*rol d3.*
+.*asr 16,r1.*
+.*lsr 16,r1.*
+.*asl 16,r1.*
+.*asr 2096895,r2.*
+.*lsr 2096895,r2.*
+.*asl 2096895,r2.*
+.*asr 2147417596,r2.*
+.*lsr 2147417596,r2.*
+.*asl 2147417596,r2.*
+.*$gdb_prompt $" { pass "shift tests" }
+ -re "$gdb_prompt $" { fail "shift tests" }
+ timeout { fail "(timeout) shift tests" }
+ }
+}
+
+proc muldiv_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/16i muldiv_tests\n"
+ gdb_expect {
+ -re "
+.*mul r1,r2.*
+.*mulu r3,r4.*
+.*mul 16,r1.*
+.*mulu 16,r1.*
+.*mul 2096895,r2.*
+.*mulu 2096895,r2.*
+.*mul 2147417596,r2.*
+.*mulu 2147417596,r2.*
+.*div r5,r6.*
+.*divu r7,a0.*
+.*dmulh d1,d0.*
+.*dmulhu a3,a2.*
+.*dmulh 2147417596,r2.*
+.*dmulhu 2147417596,r2.*
+.*mul r1,r2,r3,r4.*
+.*mulu r1,r2,r3,r4.*
+.*$gdb_prompt $" { pass "muldiv tests" }
+ -re "$gdb_prompt $" { fail "muldiv tests" }
+ timeout { fail "(timeout) muldiv tests" }
+ }
+}
+
+proc movbu_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/20i movbu_tests\n"
+ gdb_expect {
+ -re "
+.*movbu \\(r5\\),r6.*
+.*movbu r7,\\(a0\\).*
+.*movbu \\(sp\\),r7.*
+.*movbu a0,\\(sp\\).*
+.*movbu \\(16,r1\\),r2.*
+.*movbu r2,\\(16,r1\\).*
+.*movbu \\(16,sp\\),r2.*
+.*movbu r2,\\(16,sp\\).*
+.*movbu \\(2096895,r1\\),r2.*
+.*movbu r2,\\(2096895,r1\\).*
+.*movbu \\(2096895,sp\\),r2.*
+.*movbu r2,\\(2096895,sp\\).*
+.*movbu \\(0x1ffeff\\),r2.*
+.*movbu r2,\\(0x1ffeff\\).*
+.*movbu \\(2147417596,r1\\),r2.*
+.*movbu r2,\\(2147417596,r1\\).*
+.*movbu \\(2147417596,sp\\),r2.*
+.*movbu r2,\\(2147417596,sp\\).*
+.*movbu \\(0x7ffefdfc\\),r2.*
+.*movbu r2,\\(0x7ffefdfc\\).*
+.*$gdb_prompt $" { pass "movbu tests" }
+ -re "$gdb_prompt $" { fail "movbu tests" }
+ timeout { fail "(timeout) movbu tests" }
+ }
+}
+
+proc movhu_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/20i movhu_tests\n"
+ gdb_expect {
+ -re "
+.*movhu \\(a1\\),a2.*
+.*movhu a3,\\(d0\\).*
+.*movhu \\(sp\\),a1.*
+.*movhu a2,\\(sp\\).*
+.*movhu \\(16,r1\\),r2.*
+.*movhu r2,\\(16,r1\\).*
+.*movhu \\(16,sp\\),r2.*
+.*movhu r2,\\(16,sp\\).*
+.*movhu \\(2096895,r1\\),r2.*
+.*movhu r2,\\(2096895,r1\\).*
+.*movhu \\(2096895,sp\\),r2.*
+.*movhu r2,\\(2096895,sp\\).*
+.*movhu \\(0x1ffeff\\),r2.*
+.*movhu r2,\\(0x1ffeff\\).*
+.*movhu \\(2147417596,r1\\),r2.*
+.*movhu r2,\\(2147417596,r1\\).*
+.*movhu \\(2147417596,sp\\),r2.*
+.*movhu r2,\\(2147417596,sp\\).*
+.*movhu \\(0x7ffefdfc\\),r2.*
+.*movhu r2,\\(0x7ffefdfc\\).*
+.*$gdb_prompt $" { pass "movhu tests" }
+ -re "$gdb_prompt $" { fail "movhu tests" }
+ timeout { fail "(timeout) movhu tests" }
+ }
+}
+
+proc mac_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/28i mac_tests\n"
+ gdb_expect {
+ -re "
+.*mac r1,r2.*
+.*macu r3,r4.*
+.*macb r5,r6.*
+.*macbu r7,a0.*
+.*mach a1,a2.*
+.*machu a3,d0.*
+.*dmach d1,d2.*
+.*dmachu d3,d2.*
+.*mac 16,r1.*
+.*macu 16,r1.*
+.*macb 16,r1.*
+.*macbu 16,r1.*
+.*mach 16,r1.*
+.*machu 16,r1.*
+.*mac 2096895,r2.*
+.*macu 2096895,r2.*
+.*macb 2096895,r2.*
+.*macbu 2096895,r2.*
+.*mach 2096895,r2.*
+.*machu 2096895,r2.*
+.*mac 2147417596,r2.*
+.*macu 2147417596,r2.*
+.*macb 2147417596,r2.*
+.*macbu 2147417596,r2.*
+.*mach 2147417596,r2.*
+.*machu 2147417596,r2.*
+.*dmach 2147417596,r2.*
+.*dmachu 2147417596,r2.*
+.*$gdb_prompt $" { pass "mac tests" }
+ -re "$gdb_prompt $" { fail "mac tests" }
+ timeout { fail "(timeout) mac tests" }
+ }
+}
+
+proc bit_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/4i bit_tests\n"
+ gdb_expect {
+ -re "
+.*bsch r1,r2.*
+.*btst 16,r1.*
+.*btst 2096895,r2.*
+.*btst 2147417596,r2.*
+.*$gdb_prompt $" { pass "bit tests" }
+ -re "$gdb_prompt $" { fail "bit tests" }
+ timeout { fail "(timeout) bit tests" }
+ }
+}
+
+proc dsp_add_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/28i dsp_add_tests\n"
+ gdb_expect {
+ -re "
+.*add_add r4,r1,r2,r3.*
+.*add_add r4,r1,2,r3.*
+.*add_sub r4,r1,r2,r3.*
+.*add_sub r4,r1,2,r3.*
+.*add_cmp r4,r1,r2,r3.*
+.*add_cmp r4,r1,2,r3.*
+.*add_mov r4,r1,r2,r3.*
+.*add_mov r4,r1,2,r3.*
+.*add_asr r4,r1,r2,r3.*
+.*add_asr r4,r1,2,r3.*
+.*add_lsr r4,r1,r2,r3.*
+.*add_lsr r4,r1,2,r3.*
+.*add_asl r4,r1,r2,r3.*
+.*add_asl r4,r1,2,r3.*
+.*add_add 4,r1,r2,r3.*
+.*add_add 4,r1,2,r3.*
+.*add_sub 4,r1,r2,r3.*
+.*add_sub 4,r1,2,r3.*
+.*add_cmp 4,r1,r2,r3.*
+.*add_cmp 4,r1,2,r3.*
+.*add_mov 4,r1,r2,r3.*
+.*add_mov 4,r1,2,r3.*
+.*add_asr 4,r1,r2,r3.*
+.*add_asr 4,r1,2,r3.*
+.*add_lsr 4,r1,r2,r3.*
+.*add_lsr 4,r1,2,r3.*
+.*add_asl 4,r1,r2,r3.*
+.*add_asl 4,r1,2,r3.*
+.*$gdb_prompt $" { pass "dsp_add tests" }
+ -re "$gdb_prompt $" { fail "dsp_add tests" }
+ timeout { fail "(timeout) dsp_add tests" }
+ }
+}
+
+proc dsp_cmp_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/24i dsp_cmp_tests\n"
+ gdb_expect {
+ -re "
+.*cmp_add r4,r1,r2,r3.*
+.*cmp_add r4,r1,2,r3.*
+.*cmp_sub r4,r1,r2,r3.*
+.*cmp_sub r4,r1,2,r3.*
+.*cmp_mov r4,r1,r2,r3.*
+.*cmp_mov r4,r1,2,r3.*
+.*cmp_asr r4,r1,r2,r3.*
+.*cmp_asr r4,r1,2,r3.*
+.*cmp_lsr r4,r1,r2,r3.*
+.*cmp_lsr r4,r1,2,r3.*
+.*cmp_asl r4,r1,r2,r3.*
+.*cmp_asl r4,r1,2,r3.*
+.*cmp_add 4,r1,r2,r3.*
+.*cmp_add 4,r1,2,r3.*
+.*cmp_sub 4,r1,r2,r3.*
+.*cmp_sub 4,r1,2,r3.*
+.*cmp_mov 4,r1,r2,r3.*
+.*cmp_mov 4,r1,2,r3.*
+.*cmp_asr 4,r1,r2,r3.*
+.*cmp_asr 4,r1,2,r3.*
+.*cmp_lsr 4,r1,r2,r3.*
+.*cmp_lsr 4,r1,2,r3.*
+.*cmp_asl 4,r1,r2,r3.*
+.*cmp_asl 4,r1,2,r3.*
+.*$gdb_prompt $" { pass "dsp_cmp tests" }
+ -re "$gdb_prompt $" { fail "dsp_cmp tests" }
+ timeout { fail "(timeout) dsp_cmp tests" }
+ }
+}
+
+proc dsp_sub_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/28i dsp_sub_tests\n"
+ gdb_expect {
+ -re "
+.*sub_add r4,r1,r2,r3.*
+.*sub_add r4,r1,2,r3.*
+.*sub_sub r4,r1,r2,r3.*
+.*sub_sub r4,r1,2,r3.*
+.*sub_cmp r4,r1,r2,r3.*
+.*sub_cmp r4,r1,2,r3.*
+.*sub_mov r4,r1,r2,r3.*
+.*sub_mov r4,r1,2,r3.*
+.*sub_asr r4,r1,r2,r3.*
+.*sub_asr r4,r1,2,r3.*
+.*sub_lsr r4,r1,r2,r3.*
+.*sub_lsr r4,r1,2,r3.*
+.*sub_asl r4,r1,r2,r3.*
+.*sub_asl r4,r1,2,r3.*
+.*sub_add 4,r1,r2,r3.*
+.*sub_add 4,r1,2,r3.*
+.*sub_sub 4,r1,r2,r3.*
+.*sub_sub 4,r1,2,r3.*
+.*sub_cmp 4,r1,r2,r3.*
+.*sub_cmp 4,r1,2,r3.*
+.*sub_mov 4,r1,r2,r3.*
+.*sub_mov 4,r1,2,r3.*
+.*sub_asr 4,r1,r2,r3.*
+.*sub_asr 4,r1,2,r3.*
+.*sub_lsr 4,r1,r2,r3.*
+.*sub_lsr 4,r1,2,r3.*
+.*sub_asl 4,r1,r2,r3.*
+.*sub_asl 4,r1,2,r3.*
+.*$gdb_prompt $" { pass "dsp_sub tests" }
+ -re "$gdb_prompt $" { fail "dsp_sub tests" }
+ timeout { fail "(timeout) dsp_sub tests" }
+ }
+}
+
+proc dsp_mov_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/28i dsp_mov_tests\n"
+ gdb_expect {
+ -re "
+.*mov_add r4,r1,r2,r3.*
+.*mov_add r4,r1,2,r3.*
+.*mov_sub r4,r1,r2,r3.*
+.*mov_sub r4,r1,2,r3.*
+.*mov_cmp r4,r1,r2,r3.*
+.*mov_cmp r4,r1,2,r3.*
+.*mov_mov r4,r1,r2,r3.*
+.*mov_mov r4,r1,2,r3.*
+.*mov_asr r4,r1,r2,r3.*
+.*mov_asr r4,r1,2,r3.*
+.*mov_lsr r4,r1,r2,r3.*
+.*mov_lsr r4,r1,2,r3.*
+.*mov_asl r4,r1,r2,r3.*
+.*mov_asl r4,r1,2,r3.*
+.*mov_add 4,r1,r2,r3.*
+.*mov_add 4,r1,2,r3.*
+.*mov_sub 4,r1,r2,r3.*
+.*mov_sub 4,r1,2,r3.*
+.*mov_cmp 4,r1,r2,r3.*
+.*mov_cmp 4,r1,2,r3.*
+.*mov_mov 4,r1,r2,r3.*
+.*mov_mov 4,r1,2,r3.*
+.*mov_asr 4,r1,r2,r3.*
+.*mov_asr 4,r1,2,r3.*
+.*mov_lsr 4,r1,r2,r3.*
+.*mov_lsr 4,r1,2,r3.*
+.*mov_asl 4,r1,r2,r3.*
+.*mov_asl 4,r1,2,r3.*
+.*$gdb_prompt $" { pass "dsp_mov tests" }
+ -re "$gdb_prompt $" { fail "dsp_mov tests" }
+ timeout { fail "(timeout) dsp_mov tests" }
+ }
+}
+
+proc dsp_logical_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/42i dsp_logical_tests\n"
+ gdb_expect {
+ -re "
+.*and_add r4,r1,r2,r3.*
+.*and_add r4,r1,2,r3.*
+.*and_sub r4,r1,r2,r3.*
+.*and_sub r4,r1,2,r3.*
+.*and_cmp r4,r1,r2,r3.*
+.*and_cmp r4,r1,2,r3.*
+.*and_mov r4,r1,r2,r3.*
+.*and_mov r4,r1,2,r3.*
+.*and_asr r4,r1,r2,r3.*
+.*and_asr r4,r1,2,r3.*
+.*and_lsr r4,r1,r2,r3.*
+.*and_lsr r4,r1,2,r3.*
+.*and_asl r4,r1,r2,r3.*
+.*and_asl r4,r1,2,r3.*
+.*xor_add r4,r1,r2,r3.*
+.*xor_add r4,r1,2,r3.*
+.*xor_sub r4,r1,r2,r3.*
+.*xor_sub r4,r1,2,r3.*
+.*xor_cmp r4,r1,r2,r3.*
+.*xor_cmp r4,r1,2,r3.*
+.*xor_mov r4,r1,r2,r3.*
+.*xor_mov r4,r1,2,r3.*
+.*xor_asr r4,r1,r2,r3.*
+.*xor_asr r4,r1,2,r3.*
+.*xor_lsr r4,r1,r2,r3.*
+.*xor_lsr r4,r1,2,r3.*
+.*xor_asl r4,r1,r2,r3.*
+.*xor_asl r4,r1,2,r3.*
+.*or_add r4,r1,r2,r3.*
+.*or_add r4,r1,2,r3.*
+.*or_sub r4,r1,r2,r3.*
+.*or_sub r4,r1,2,r3.*
+.*or_cmp r4,r1,r2,r3.*
+.*or_cmp r4,r1,2,r3.*
+.*or_mov r4,r1,r2,r3.*
+.*or_mov r4,r1,2,r3.*
+.*or_asr r4,r1,r2,r3.*
+.*or_asr r4,r1,2,r3.*
+.*or_lsr r4,r1,r2,r3.*
+.*or_lsr r4,r1,2,r3.*
+.*or_asl r4,r1,r2,r3.*
+.*or_asl r4,r1,2,r3.*
+.*$gdb_prompt $" { pass "dsp_logical tests" }
+ -re "$gdb_prompt $" { fail "dsp_logical tests" }
+ timeout { fail "(timeout) dsp_logical tests" }
+ }
+}
+
+proc dsp_misc_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/42i dsp_misc_tests\n"
+ gdb_expect {
+ -re "
+.*dmach_add r4,r1,r2,r3.*
+.*dmach_add r4,r1,2,r3.*
+.*dmach_sub r4,r1,r2,r3.*
+.*dmach_sub r4,r1,2,r3.*
+.*dmach_cmp r4,r1,r2,r3.*
+.*dmach_cmp r4,r1,2,r3.*
+.*dmach_mov r4,r1,r2,r3.*
+.*dmach_mov r4,r1,2,r3.*
+.*dmach_asr r4,r1,r2,r3.*
+.*dmach_asr r4,r1,2,r3.*
+.*dmach_lsr r4,r1,r2,r3.*
+.*dmach_lsr r4,r1,2,r3.*
+.*dmach_asl r4,r1,r2,r3.*
+.*dmach_asl r4,r1,2,r3.*
+.*swhw_add r4,r1,r2,r3.*
+.*swhw_add r4,r1,2,r3.*
+.*swhw_sub r4,r1,r2,r3.*
+.*swhw_sub r4,r1,2,r3.*
+.*swhw_cmp r4,r1,r2,r3.*
+.*swhw_cmp r4,r1,2,r3.*
+.*swhw_mov r4,r1,r2,r3.*
+.*swhw_mov r4,r1,2,r3.*
+.*swhw_asr r4,r1,r2,r3.*
+.*swhw_asr r4,r1,2,r3.*
+.*swhw_lsr r4,r1,r2,r3.*
+.*swhw_lsr r4,r1,2,r3.*
+.*swhw_asl r4,r1,r2,r3.*
+.*swhw_asl r4,r1,2,r3.*
+.*sat16_add r4,r1,r2,r3.*
+.*sat16_add r4,r1,2,r3.*
+.*sat16_sub r4,r1,r2,r3.*
+.*sat16_sub r4,r1,2,r3.*
+.*sat16_cmp r4,r1,r2,r3.*
+.*sat16_cmp r4,r1,2,r3.*
+.*sat16_mov r4,r1,r2,r3.*
+.*sat16_mov r4,r1,2,r3.*
+.*sat16_asr r4,r1,r2,r3.*
+.*sat16_asr r4,r1,2,r3.*
+.*sat16_lsr r4,r1,r2,r3.*
+.*sat16_lsr r4,r1,2,r3.*
+.*sat16_asl r4,r1,r2,r3.*
+.*sat16_asl r4,r1,2,r3.*
+.*$gdb_prompt $" { pass "dsp_misc tests" }
+ -re "$gdb_prompt $" { fail "dsp_misc tests" }
+ timeout { fail "(timeout) dsp_misc tests" }
+ }
+}
+
+proc autoincrement_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/16i autoincrement_tests\n"
+ gdb_expect {
+ -re "
+.*mov \\(r1\\+\\),r2.*
+.*mov r3,\\(r4\\+\\).*
+.*movhu \\(r6\\+\\),r7.*
+.*movhu a0,\\(a1\\+\\).*
+.*mov \\(r1\\+,64\\),r2.*
+.*mov r1,\\(r2\\+,64\\).*
+.*movhu \\(r1\\+,64\\),r2.*
+.*movhu r1,\\(r2\\+,64\\).*
+.*mov \\(r1\\+,131055\\),r2.*
+.*mov r1,\\(r2\\+,131055\\).*
+.*movhu \\(r1\\+,131055\\),r2.*
+.*movhu r1,\\(r2\\+,131055\\).*
+.*mov \\(r1\\+,2147417596\\),r2.*
+.*mov r1,\\(r2\\+,2147417596\\).*
+.*movhu \\(r1\\+,2147417596\\),r2.*
+.*movhu r1,\\(r2\\+,2147417596\\).*
+.*$gdb_prompt $" { pass "autoincrement tests" }
+ -re "$gdb_prompt $" { fail "autoincrement tests" }
+ timeout { fail "(timeout) autoincrement tests" }
+ }
+}
+
+proc dsp_autoincrement_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/11i dsp_autoincrement_tests\n"
+ gdb_expect {
+ -re "
+.*mov_llt \\(r1\\+,4\\),r2.*
+.*mov_lgt \\(r1\\+,4\\),r2.*
+.*mov_lge \\(r1\\+,4\\),r2.*
+.*mov_lle \\(r1\\+,4\\),r2.*
+.*mov_lcs \\(r1\\+,4\\),r2.*
+.*mov_lhi \\(r1\\+,4\\),r2.*
+.*mov_lcc \\(r1\\+,4\\),r2.*
+.*mov_lls \\(r1\\+,4\\),r2.*
+.*mov_leq \\(r1\\+,4\\),r2.*
+.*mov_lne \\(r1\\+,4\\),r2.*
+.*mov_lra \\(r1\\+,4\\),r2.*
+.*$gdb_prompt $" { pass "autoincrement tests" }
+ -re "$gdb_prompt $" { fail "autoincrement tests" }
+ timeout { fail "(timeout) autoincrement tests" }
+ }
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+call_tests
+movm_tests
+misc_tests
+mov_tests
+ext_tests
+add_tests
+sub_tests
+cmp_tests
+logical_tests
+shift_tests
+muldiv_tests
+movbu_tests
+movhu_tests
+mac_tests
+bit_tests
+dsp_add_tests
+dsp_cmp_tests
+dsp_sub_tests
+dsp_mov_tests
+dsp_logical_tests
+autoincrement_tests
+dsp_autoincrement_tests
diff --git a/gdb/testsuite/gdb.disasm/am33.s b/gdb/testsuite/gdb.disasm/am33.s
new file mode 100644
index 00000000000..a686cef2f74
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/am33.s
@@ -0,0 +1,524 @@
+
+ .globl _main
+ .globl call_tests
+ .globl movm_tests
+ .globl misc_tests
+ .globl mov_tests
+ .globl ext_tests
+ .globl add_tests
+ .globl sub_tests
+ .globl cmp_tests
+ .globl logical_tests
+ .globl shift_tests
+ .globl muldiv_tests
+ .globl movbu_tests
+ .globl movhu_tests
+ .globl mac_tests
+ .globl bit_tests
+ .globl dsp_add_tests
+ .globl dsp_cmp_tests
+ .globl dsp_sub_tests
+ .globl dsp_mov_tests
+ .globl dsp_logical_tests
+ .globl dsp_misc_tests
+ .globl autoincrement_tests
+ .globl dsp_autoincrement_tests
+
+ .text
+ .am33
+_main:
+call_tests:
+ call 256,[a2,a3,exreg0],9
+ call 256,[a2,a3,exreg1],9
+ call 256,[a2,a3,exother],9
+ call 256,[a2,a3,all],9
+ call 131071,[a2,a3,exreg0],9
+ call 131071,[a2,a3,exreg1],9
+ call 131071,[a2,a3,exother],9
+ call 131071,[a2,a3,all],9
+
+movm_tests:
+ movm (sp),[a2,a3,exreg0]
+ movm (sp),[a2,a3,exreg1]
+ movm (sp),[a2,a3,exother]
+ movm (sp),[a2,a3,all]
+ movm [a2,a3,exreg0],(sp)
+ movm [a2,a3,exreg1],(sp)
+ movm [a2,a3,exother],(sp)
+ movm [a2,a3,all],(sp)
+ movm (usp),[a2,a3,exreg0]
+ movm (usp),[a2,a3,exreg1]
+ movm (usp),[a2,a3,exother]
+ movm (usp),[a2,a3,all]
+ movm [a2,a3,exreg0],(usp)
+ movm [a2,a3,exreg1],(usp)
+ movm [a2,a3,exother],(usp)
+ movm [a2,a3,all],(usp)
+
+misc_tests:
+ syscall 0x4
+ mcst9 d0
+ mcst48 d1
+ getchx d0
+ getclx d1
+ clr r9
+ sat16 r9,r8
+ mcste r7,r6
+ swap r5,r4
+ swaph r3,r2
+ swhw r1,r0
+
+
+mov_tests:
+ mov r0,r1
+ mov xr0, r1
+ mov r1, xr2
+ mov (r1),r2
+ mov r3,(r4)
+ mov (sp),r5
+ mov r6,(sp)
+ mov 16,r1
+ mov 16,xr1
+ mov (16,r1),r2
+ mov r2,(16,r1)
+ mov (16,sp),r2
+ mov r2,(16,sp)
+ mov 0x1ffeff,r2
+ mov 0x1ffeff,xr2
+ mov (0x1ffeff,r1),r2
+ mov r2,(0x1ffeff,r1)
+ mov (0x1ffeff,sp),r2
+ mov r2,(0x1ffeff,sp)
+ mov (0x1ffeff),r2
+ mov r2,(0x1ffeff)
+ mov 0x7ffefdfc,r2
+ mov 0x7ffefdfc,xr2
+ mov (0x7ffefdfc,r1),r2
+ mov r2,(0x7ffefdfc,r1)
+ mov (0x7ffefdfc,sp),r2
+ mov r2,(0x7ffefdfc,sp)
+ mov (0x7ffefdfc),r2
+ mov r2,(0x7ffefdfc)
+ movu 16,r1
+ movu 0x1ffeff,r2
+ movu 0x7ffefdfc,r2
+ mov usp,a0
+ mov ssp,a1
+ mov msp,a2
+ mov pc,a3
+ mov a0,usp
+ mov a1,ssp
+ mov a2,msp
+ mov epsw,d0
+ mov d1,epsw
+ mov a0,r1
+ mov d2,r3
+ mov r5,a1
+ mov r7,d3
+
+ext_tests:
+ ext r2
+ extb r3,r4
+ extbu r4,r5
+ exth r6,r7
+ exthu r7,r8
+
+add_tests:
+ add r10,r11
+ add 16,r1
+ add 0x1ffeff,r2
+ add 0x7ffefdfc,r2
+ add r1,r2,r3
+ addc r12,r13
+ addc 16,r1
+ addc 0x1ffeff,r2
+ addc 0x7ffefdfc,r2
+ inc r13
+ inc4 r12
+
+
+sub_tests:
+ sub r14,r15
+ sub 16,r1
+ sub 0x1ffeff,r2
+ sub 0x7ffefdfc,r2
+ subc r15,r14
+ subc 16,r1
+ subc 0x1ffeff,r2
+ subc 0x7ffefdfc,r2
+
+cmp_tests:
+ cmp r11,r10
+ cmp 16,r1
+ cmp 0x1ffeff,r2
+ cmp 0x7ffefdfc,r2
+
+logical_tests:
+ and r0,r1
+ or r2,r3
+ xor r4,r5
+ not r6
+ and 16,r1
+ or 16,r1
+ xor 16,r1
+ and 0x1ffeff,r2
+ or 0x1ffeff,r2
+ xor 0x1ffeff,r2
+ and 0x7ffefdfc,r2
+ or 0x7ffefdfc,r2
+ xor 0x7ffefdfc,r2
+ and 131072,epsw
+ or 65535,epsw
+
+shift_tests:
+ asr r7,r8
+ lsr r9,r10
+ asl r11,r12
+ asl2 r13
+ ror r14
+ rol r15
+ asr 16,r1
+ lsr 16,r1
+ asl 16,r1
+ asr 0x1ffeff,r2
+ lsr 0x1ffeff,r2
+ asl 0x1ffeff,r2
+ asr 0x7ffefdfc,r2
+ lsr 0x7ffefdfc,r2
+ asl 0x7ffefdfc,r2
+
+muldiv_tests:
+ mul r1,r2
+ mulu r3,r4
+ mul 16,r1
+ mulu 16,r1
+ mul 0x1ffeff,r2
+ mulu 0x1ffeff,r2
+ mul 0x7ffefdfc,r2
+ mulu 0x7ffefdfc,r2
+ div r5,r6
+ divu r7,r8
+ dmulh r13,r12
+ dmulhu r11,r10
+ dmulh 0x7ffefdfc,r2
+ dmulhu 0x7ffefdfc,r2
+ mul r1,r2,r3,r4
+ mulu r1,r2,r3,r4
+
+movbu_tests:
+ movbu (r5),r6
+ movbu r7,(r8)
+ movbu (sp),r7
+ movbu r8,(sp)
+ movbu (16,r1),r2
+ movbu r2,(16,r1)
+ movbu (16,sp),r2
+ movbu r2,(16,sp)
+ movbu (0x1ffeff,r1),r2
+ movbu r2,(0x1ffeff,r1)
+ movbu (0x1ffeff,sp),r2
+ movbu r2,(0x1ffeff,sp)
+ movbu (0x1ffeff),r2
+ movbu r2,(0x1ffeff)
+ movbu (0x7ffefdfc,r1),r2
+ movbu r2,(0x7ffefdfc,r1)
+ movbu (0x7ffefdfc,sp),r2
+ movbu r2,(0x7ffefdfc,sp)
+ movbu (0x7ffefdfc),r2
+ movbu r2,(0x7ffefdfc)
+
+movhu_tests:
+ movhu (r9),r10
+ movhu r11,(r12)
+ movhu (sp),r9
+ movhu r10,(sp)
+ movhu (16,r1),r2
+ movhu r2,(16,r1)
+ movhu (16,sp),r2
+ movhu r2,(16,sp)
+ movhu (0x1ffeff,r1),r2
+ movhu r2,(0x1ffeff,r1)
+ movhu (0x1ffeff,sp),r2
+ movhu r2,(0x1ffeff,sp)
+ movhu (0x1ffeff),r2
+ movhu r2,(0x1ffeff)
+ movhu (0x7ffefdfc,r1),r2
+ movhu r2,(0x7ffefdfc,r1)
+ movhu (0x7ffefdfc,sp),r2
+ movhu r2,(0x7ffefdfc,sp)
+ movhu (0x7ffefdfc),r2
+ movhu r2,(0x7ffefdfc)
+
+
+mac_tests:
+ mac r1,r2
+ macu r3,r4
+ macb r5,r6
+ macbu r7,r8
+ mach r9,r10
+ machu r11,r12
+ dmach r13,r14
+ dmachu r15,r14
+ mac 16,r1
+ macu 16,r1
+ macb 16,r1
+ macbu 16,r1
+ mach 16,r1
+ machu 16,r1
+ mac 0x1ffeff,r2
+ macu 0x1ffeff,r2
+ macb 0x1ffeff,r2
+ macbu 0x1ffeff,r2
+ mach 0x1ffeff,r2
+ machu 0x1ffeff,r2
+ mac 0x7ffefdfc,r2
+ macu 0x7ffefdfc,r2
+ macb 0x7ffefdfc,r2
+ macbu 0x7ffefdfc,r2
+ mach 0x7ffefdfc,r2
+ machu 0x7ffefdfc,r2
+ dmach 0x7ffefdfc,r2
+ dmachu 0x7ffefdfc,r2
+
+bit_tests:
+ bsch r1,r2
+ btst 16,r1
+ btst 0x1ffeff,r2
+ btst 0x7ffefdfc,r2
+
+
+
+dsp_add_tests:
+ add_add r4,r1,r2,r3
+ add_add r4,r1,2,r3
+ add_sub r4,r1,r2,r3
+ add_sub r4,r1,2,r3
+ add_cmp r4,r1,r2,r3
+ add_cmp r4,r1,2,r3
+ add_mov r4,r1,r2,r3
+ add_mov r4,r1,2,r3
+ add_asr r4,r1,r2,r3
+ add_asr r4,r1,2,r3
+ add_lsr r4,r1,r2,r3
+ add_lsr r4,r1,2,r3
+ add_asl r4,r1,r2,r3
+ add_asl r4,r1,2,r3
+ add_add 4,r1,r2,r3
+ add_add 4,r1,2,r3
+ add_sub 4,r1,r2,r3
+ add_sub 4,r1,2,r3
+ add_cmp 4,r1,r2,r3
+ add_cmp 4,r1,2,r3
+ add_mov 4,r1,r2,r3
+ add_mov 4,r1,2,r3
+ add_asr 4,r1,r2,r3
+ add_asr 4,r1,2,r3
+ add_lsr 4,r1,r2,r3
+ add_lsr 4,r1,2,r3
+ add_asl 4,r1,r2,r3
+ add_asl 4,r1,2,r3
+
+dsp_cmp_tests:
+ cmp_add r4,r1,r2,r3
+ cmp_add r4,r1,2,r3
+ cmp_sub r4,r1,r2,r3
+ cmp_sub r4,r1,2,r3
+ cmp_mov r4,r1,r2,r3
+ cmp_mov r4,r1,2,r3
+ cmp_asr r4,r1,r2,r3
+ cmp_asr r4,r1,2,r3
+ cmp_lsr r4,r1,r2,r3
+ cmp_lsr r4,r1,2,r3
+ cmp_asl r4,r1,r2,r3
+ cmp_asl r4,r1,2,r3
+ cmp_add 4,r1,r2,r3
+ cmp_add 4,r1,2,r3
+ cmp_sub 4,r1,r2,r3
+ cmp_sub 4,r1,2,r3
+ cmp_mov 4,r1,r2,r3
+ cmp_mov 4,r1,2,r3
+ cmp_asr 4,r1,r2,r3
+ cmp_asr 4,r1,2,r3
+ cmp_lsr 4,r1,r2,r3
+ cmp_lsr 4,r1,2,r3
+ cmp_asl 4,r1,r2,r3
+ cmp_asl 4,r1,2,r3
+
+dsp_sub_tests:
+ sub_add r4,r1,r2,r3
+ sub_add r4,r1,2,r3
+ sub_sub r4,r1,r2,r3
+ sub_sub r4,r1,2,r3
+ sub_cmp r4,r1,r2,r3
+ sub_cmp r4,r1,2,r3
+ sub_mov r4,r1,r2,r3
+ sub_mov r4,r1,2,r3
+ sub_asr r4,r1,r2,r3
+ sub_asr r4,r1,2,r3
+ sub_lsr r4,r1,r2,r3
+ sub_lsr r4,r1,2,r3
+ sub_asl r4,r1,r2,r3
+ sub_asl r4,r1,2,r3
+ sub_add 4,r1,r2,r3
+ sub_add 4,r1,2,r3
+ sub_sub 4,r1,r2,r3
+ sub_sub 4,r1,2,r3
+ sub_cmp 4,r1,r2,r3
+ sub_cmp 4,r1,2,r3
+ sub_mov 4,r1,r2,r3
+ sub_mov 4,r1,2,r3
+ sub_asr 4,r1,r2,r3
+ sub_asr 4,r1,2,r3
+ sub_lsr 4,r1,r2,r3
+ sub_lsr 4,r1,2,r3
+ sub_asl 4,r1,r2,r3
+ sub_asl 4,r1,2,r3
+
+dsp_mov_tests:
+ mov_add r4,r1,r2,r3
+ mov_add r4,r1,2,r3
+ mov_sub r4,r1,r2,r3
+ mov_sub r4,r1,2,r3
+ mov_cmp r4,r1,r2,r3
+ mov_cmp r4,r1,2,r3
+ mov_mov r4,r1,r2,r3
+ mov_mov r4,r1,2,r3
+ mov_asr r4,r1,r2,r3
+ mov_asr r4,r1,2,r3
+ mov_lsr r4,r1,r2,r3
+ mov_lsr r4,r1,2,r3
+ mov_asl r4,r1,r2,r3
+ mov_asl r4,r1,2,r3
+ mov_add 4,r1,r2,r3
+ mov_add 4,r1,2,r3
+ mov_sub 4,r1,r2,r3
+ mov_sub 4,r1,2,r3
+ mov_cmp 4,r1,r2,r3
+ mov_cmp 4,r1,2,r3
+ mov_mov 4,r1,r2,r3
+ mov_mov 4,r1,2,r3
+ mov_asr 4,r1,r2,r3
+ mov_asr 4,r1,2,r3
+ mov_lsr 4,r1,r2,r3
+ mov_lsr 4,r1,2,r3
+ mov_asl 4,r1,r2,r3
+ mov_asl 4,r1,2,r3
+
+dsp_logical_tests:
+ and_add r4,r1,r2,r3
+ and_add r4,r1,2,r3
+ and_sub r4,r1,r2,r3
+ and_sub r4,r1,2,r3
+ and_cmp r4,r1,r2,r3
+ and_cmp r4,r1,2,r3
+ and_mov r4,r1,r2,r3
+ and_mov r4,r1,2,r3
+ and_asr r4,r1,r2,r3
+ and_asr r4,r1,2,r3
+ and_lsr r4,r1,r2,r3
+ and_lsr r4,r1,2,r3
+ and_asl r4,r1,r2,r3
+ and_asl r4,r1,2,r3
+ xor_add r4,r1,r2,r3
+ xor_add r4,r1,2,r3
+ xor_sub r4,r1,r2,r3
+ xor_sub r4,r1,2,r3
+ xor_cmp r4,r1,r2,r3
+ xor_cmp r4,r1,2,r3
+ xor_mov r4,r1,r2,r3
+ xor_mov r4,r1,2,r3
+ xor_asr r4,r1,r2,r3
+ xor_asr r4,r1,2,r3
+ xor_lsr r4,r1,r2,r3
+ xor_lsr r4,r1,2,r3
+ xor_asl r4,r1,r2,r3
+ xor_asl r4,r1,2,r3
+ or_add r4,r1,r2,r3
+ or_add r4,r1,2,r3
+ or_sub r4,r1,r2,r3
+ or_sub r4,r1,2,r3
+ or_cmp r4,r1,r2,r3
+ or_cmp r4,r1,2,r3
+ or_mov r4,r1,r2,r3
+ or_mov r4,r1,2,r3
+ or_asr r4,r1,r2,r3
+ or_asr r4,r1,2,r3
+ or_lsr r4,r1,r2,r3
+ or_lsr r4,r1,2,r3
+ or_asl r4,r1,r2,r3
+ or_asl r4,r1,2,r3
+
+dsp_misc_tests:
+ dmach_add r4,r1,r2,r3
+ dmach_add r4,r1,2,r3
+ dmach_sub r4,r1,r2,r3
+ dmach_sub r4,r1,2,r3
+ dmach_cmp r4,r1,r2,r3
+ dmach_cmp r4,r1,2,r3
+ dmach_mov r4,r1,r2,r3
+ dmach_mov r4,r1,2,r3
+ dmach_asr r4,r1,r2,r3
+ dmach_asr r4,r1,2,r3
+ dmach_lsr r4,r1,r2,r3
+ dmach_lsr r4,r1,2,r3
+ dmach_asl r4,r1,r2,r3
+ dmach_asl r4,r1,2,r3
+ swhw_add r4,r1,r2,r3
+ swhw_add r4,r1,2,r3
+ swhw_sub r4,r1,r2,r3
+ swhw_sub r4,r1,2,r3
+ swhw_cmp r4,r1,r2,r3
+ swhw_cmp r4,r1,2,r3
+ swhw_mov r4,r1,r2,r3
+ swhw_mov r4,r1,2,r3
+ swhw_asr r4,r1,r2,r3
+ swhw_asr r4,r1,2,r3
+ swhw_lsr r4,r1,r2,r3
+ swhw_lsr r4,r1,2,r3
+ swhw_asl r4,r1,r2,r3
+ swhw_asl r4,r1,2,r3
+ sat16_add r4,r1,r2,r3
+ sat16_add r4,r1,2,r3
+ sat16_sub r4,r1,r2,r3
+ sat16_sub r4,r1,2,r3
+ sat16_cmp r4,r1,r2,r3
+ sat16_cmp r4,r1,2,r3
+ sat16_mov r4,r1,r2,r3
+ sat16_mov r4,r1,2,r3
+ sat16_asr r4,r1,r2,r3
+ sat16_asr r4,r1,2,r3
+ sat16_lsr r4,r1,r2,r3
+ sat16_lsr r4,r1,2,r3
+ sat16_asl r4,r1,r2,r3
+ sat16_asl r4,r1,2,r3
+
+autoincrement_tests:
+ mov (r1+),r2
+ mov r3,(r4+)
+ movhu (r6+),r7
+ movhu r8,(r9+)
+ mov (r1+,64),r2
+ mov r1,(r2+,64)
+ movhu (r1+,64),r2
+ movhu r1,(r2+,64)
+ mov (r1+,0x1ffef),r2
+ mov r1,(r2+,0x1ffef)
+ movhu (r1+,0x1ffef),r2
+ movhu r1,(r2+,0x1ffef)
+ mov (r1+,0x7ffefdfc),r2
+ mov r1,(r2+,0x7ffefdfc)
+ movhu (r1+,0x7ffefdfc),r2
+ movhu r1,(r2+,0x7ffefdfc)
+
+dsp_autoincrement_tests:
+ mov_llt (r1+,4),r2
+ mov_lgt (r1+,4),r2
+ mov_lge (r1+,4),r2
+ mov_lle (r1+,4),r2
+ mov_lcs (r1+,4),r2
+ mov_lhi (r1+,4),r2
+ mov_lcc (r1+,4),r2
+ mov_lls (r1+,4),r2
+ mov_leq (r1+,4),r2
+ mov_lne (r1+,4),r2
+ mov_lra (r1+,4),r2
diff --git a/gdb/testsuite/gdb.disasm/configure b/gdb/testsuite/gdb.disasm/configure
new file mode 100644
index 00000000000..0e6cbf20749
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/configure
@@ -0,0 +1,899 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=sh3.s
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:573: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:594: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:612: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.disasm/configure.in b/gdb/testsuite/gdb.disasm/configure.in
new file mode 100644
index 00000000000..508636ff2c6
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(sh3.s)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.disasm/h8300s.exp b/gdb/testsuite/gdb.disasm/h8300s.exp
new file mode 100644
index 00000000000..eeaf23bfdd0
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/h8300s.exp
@@ -0,0 +1,698 @@
+# Copyright (C) 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Kazu Hirata. (kazu@hxi.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if ![istarget "h8300*-*-*"] {
+ verbose "Tests ignored for all but h8300s based targets."
+ return
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "h8300s"
+set srcfile ${srcdir}/${subdir}/${testfile}.s
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcfile}" "${binfile}" executable {debug additional_flags=-ms}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc all_set_machine_h8300s { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "set machine h8300s\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {}
+ }
+}
+
+proc all_movb_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/9i movb_tests\n"
+ gdb_expect {
+ -re "
+.*mov.b\tr0l,r0h.*
+.*mov.b\t#0x12,r1l.*
+.*mov.b\t@er0,r1h.*
+.*mov.b\t@\\(0x1234:16,er0\\),r2l.*
+.*mov.b\t@\\(0x12345678:32,er0\\),r2h.*
+.*mov.b\t@er0\\+,r3l.*
+.*mov.b\t@0x12:8,r3h.*
+.*mov.b\t@0x1234:16,r4l.*
+.*mov.b\t@0x12345678:32,r4h.*
+.*$gdb_prompt $" { pass "movb_tests" }
+ -re "$gdb_prompt $" { fail "movb_tests" }
+ timeout { fail "(timeout) movb_tests" }
+ }
+}
+
+proc all_movw_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/8i movw_tests\n"
+ gdb_expect {
+ -re "
+.*mov.w\te0,r0.*
+.*mov.w\t#0x1234,r1.*
+.*mov.w\t@er0,r2.*
+.*mov.w\t@\\(0x1234:16,er0\\),r3.*
+.*mov.w\t@\\(0x12345678:32,er0\\),r4.*
+.*mov.w\t@er0\\+,r5.*
+.*mov.w\t@0x1234:16,r6.*
+.*mov.w\t@0x12345678:32,r7.*
+.*$gdb_prompt $" { pass "movw_tests" }
+ -re "$gdb_prompt $" { fail "movw_tests" }
+ timeout { fail "(timeout) movw_tests" }
+ }
+}
+
+proc all_movl_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/8i movl_tests\n"
+ gdb_expect {
+ -re "
+.*mov.l\ter0,er1.*
+.*mov.l\t#0x12345678,er1.*
+.*mov.l\t@er0,er2.*
+.*mov.l\t@\\(0x1234:16,er0\\),er3.*
+.*mov.l\t@\\(0x12345678:32,er0\\),er4.*
+.*mov.l\t@er0\\+,er5.*
+.*mov.l\t@0x1234:16,er6.*
+.*mov.l\t@0x12345678:32,er7.*
+.*$gdb_prompt $" { pass "movl_tests" }
+ -re "$gdb_prompt $" { fail "movl_tests" }
+ timeout { fail "(timeout) movl_tests" }
+ }
+}
+
+proc all_ldm_stm_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/6i ldm_stm_tests\n"
+ gdb_expect {
+ -re "
+.*ldm.l\t@sp\\+,er0-er1.*
+.*ldm.l\t@sp\\+,er0-er2.*
+.*ldm.l\t@sp\\+,er0-er3.*
+.*stm.l\ter0\\-er1,@-sp.*
+.*stm.l\ter0\\-er2,@-sp.*
+.*stm.l\ter0\\-er3,@-sp.*
+.*$gdb_prompt $" { pass "ldm_stm_tests" }
+ -re "$gdb_prompt $" { fail "ldm_stm_tests" }
+ timeout { fail "(timeout) ldm_stm_tests" }
+ }
+}
+
+proc all_movfpe_movtpe_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/2i movfpe_movtpe_tests\n"
+ gdb_expect {
+ -re "
+.*movfpe\t@0x1234:16,r2l.*
+.*movtpe\tr2l,@0x1234:16.*
+.*$gdb_prompt $" { pass "movfpe_movtpe_tests" }
+ -re "$gdb_prompt $" { fail "movfpe_movtpe_tests" }
+ timeout { fail "(timeout) movfpe_movtpe_tests" }
+ }
+}
+
+proc all_add_sub_addx_subx_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/15i add_sub_addx_subx_tests\n"
+ gdb_expect {
+ -re "
+.*add.b\t#0x12,r0l.*
+.*add.b\tr1l,r1h.*
+.*add.w\t#0x1234,r2.*
+.*add.w\tr3,r4.*
+.*add.l\t#0x12345678,er5.*
+.*add.l\ter6,er7.*
+.*sub.b\tr1l,r1h.*
+.*sub.w\t#0x1234,r2.*
+.*sub.w\tr3,r4.*
+.*sub.l\t#0x12345678,er5.*
+.*sub.l\ter6,er7.*
+.*addx\t#0x12,r0l.*
+.*addx\tr1l,r1h.*
+.*subx\t#0x12,r0l.*
+.*subx\tr1l,r1h.*
+.*$gdb_prompt $" { pass "add_sub_addx_subx_tests" }
+ -re "$gdb_prompt $" { fail "add_sub_addx_subx_tests" }
+ timeout { fail "(timeout) add_sub_addx_subx_tests" }
+ }
+}
+
+proc all_inc_dec_adds_subs_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/16i inc_dec_adds_subs_tests\n"
+ gdb_expect {
+ -re "
+.*inc.b\tr0l.*
+.*inc.w\t#0x1,r4.*
+.*inc.w\t#0x2,r3.*
+.*inc.l\t#0x1,er2.*
+.*inc.l\t#0x2,er1.*
+.*dec.b\tr0l.*
+.*dec.w\t#0x1,r4.*
+.*dec.w\t#0x2,r3.*
+.*dec.l\t#0x1,er2.*
+.*dec.l\t#0x2,er1.*
+.*adds\t#0x1,er7.*
+.*adds\t#0x2,er6.*
+.*adds\t#0x4,er5.*
+.*subs\t#0x1,er7.*
+.*subs\t#0x2,er6.*
+.*subs\t#0x4,er5.*
+.*$gdb_prompt $" { pass "inc_dec_adds_subs_tests" }
+ -re "$gdb_prompt $" { fail "inc_dec_adds_subs_tests" }
+ timeout { fail "(timeout) inc_dec_adds_subs_tests" }
+ }
+}
+
+proc all_daa_das_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/2i daa_das_tests\n"
+ gdb_expect {
+ -re "
+.*daa\tr0l.*
+.*das\tr0h.*
+.*$gdb_prompt $" { pass "daa_das_tests" }
+ -re "$gdb_prompt $" { fail "daa_das_tests" }
+ timeout { fail "(timeout) daa_das_tests" }
+ }
+}
+
+proc all_mul_div_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/8i mul_div_tests\n"
+ gdb_expect {
+ -re "
+.*mulxs.b\tr0l,r1.*
+.*mulxs.w\tr2,er3.*
+.*mulxu.b\tr0l,e1.*
+.*mulxu.w\te2,er3.*
+.*divxs.b\tr0l,r1.*
+.*divxs.w\tr2,er3.*
+.*divxu.b\tr0l,e1.*
+.*divxu.w\te2,er3.*
+.*$gdb_prompt $" { pass "mul_div_tests" }
+ -re "$gdb_prompt $" { fail "mul_div_tests" }
+ timeout { fail "(timeout) mul_div_tests" }
+ }
+}
+
+proc all_cmp_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/8i cmp_tests\n"
+ gdb_expect {
+ -re "
+.*cmp.b\t#0x12,r0l.*
+.*cmp.b\tr1l,r1h.*
+.*cmp.w\t#0x1234,r2.*
+.*cmp.w\tr3,e3.*
+.*cmp.l\t#0x12345678,er4.*
+.*cmp.l\ter5,er6.*
+.*$gdb_prompt $" { pass "cmp_tests" }
+ -re "$gdb_prompt $" { fail "cmp_tests" }
+ timeout { fail "(timeout) cmp_tests" }
+ }
+}
+
+proc all_neg_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/3i neg_tests\n"
+ gdb_expect {
+ -re "
+.*neg.b\tr0l.*
+.*neg.w\tr2.*
+.*neg.l\ter3.*
+.*$gdb_prompt $" { pass "neg_tests" }
+ -re "$gdb_prompt $" { fail "neg_tests" }
+ timeout { fail "(timeout) neg_tests" }
+ }
+}
+
+proc all_ext_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/4i ext_tests\n"
+ gdb_expect {
+ -re "
+.*exts.w\tr0.*
+.*exts.l\ter1.*
+.*extu.w\tr2.*
+.*extu.l\ter3.*
+.*$gdb_prompt $" { pass "ext_tests" }
+ -re "$gdb_prompt $" { fail "ext_tests" }
+ timeout { fail "(timeout) ext_tests" }
+ }
+}
+
+proc all_tas_mac_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/7i tas_mac_tests\n"
+ gdb_expect {
+ -re "
+.*tas\t@er0.*
+.*mac\t@er1+,@er2+.*
+.*clrmac.*
+.*ldmac\ter4,mach.*
+.*ldmac\ter5,macl.*
+.*stmac\tmach,er6.*
+.*stmac\tmacl,er7.*
+.*$gdb_prompt $" { pass "tas_mac_tests" }
+ -re "$gdb_prompt $" { fail "tas_mac_tests" }
+ timeout { fail "(timeout) tas_mac_tests" }
+ }
+}
+
+proc all_logic_operations_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/21i logic_operations_tests\n"
+ gdb_expect {
+ -re "
+.*and.b\t#0x12,r0l.*
+.*and.b\tr1l,r2h.*
+.*and.w\t#0x1234,r0.*
+.*and.w\tr1,r2.*
+.*and.l\t#0x12345678,er0.*
+.*and.l\ter1,er2.*
+.*or.b\t#0x12,r0l.*
+.*or.b\tr1l,r2h.*
+.*or.w\t#0x1234,r0.*
+.*or.w\tr1,r2.*
+.*or.l\t#0x12345678,er0.*
+.*or.l\ter1,er2.*
+.*xor.b\t#0x12,r0l.*
+.*xor.b\tr1l,r2h.*
+.*xor.w\t#0x1234,r0.*
+.*xor.w\tr1,r2.*
+.*xor.l\t#0x12345678,er0.*
+.*xor.l\ter1,er2.*
+.*not.b\tr0l.*
+.*not.w\tr1.*
+.*not.l\ter2.*
+.*$gdb_prompt $" { pass "logic_operations_tests" }
+ -re "$gdb_prompt $" { fail "logic_operations_tests" }
+ timeout { fail "(timeout) logic_operations_tests" }
+ }
+}
+
+proc all_sha_shl_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/12i sha_shl_tests\n"
+ gdb_expect {
+ -re "
+.*shal\tr0l.*
+.*shal\tr1.*
+.*shal\ter2.*
+.*shar\tr3l.*
+.*shar\tr4.*
+.*shar\ter5.*
+.*shll\tr0l.*
+.*shll\tr1.*
+.*shll\ter2.*
+.*shlr\tr3l.*
+.*shlr\tr4.*
+.*shlr\ter5.*
+.*$gdb_prompt $" { pass "sha_shl_tests" }
+ -re "$gdb_prompt $" { fail "sha_shl_tests" }
+ timeout { fail "(timeout) sha_shl_tests" }
+ }
+}
+
+proc all_rot_rotx_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/12i rot_rotx_tests\n"
+ gdb_expect {
+ -re "
+.*rotl\tr0l.*
+.*rotl\tr1.*
+.*rotl\ter2.*
+.*rotr\tr3l.*
+.*rotr\tr4.*
+.*rotr\ter5.*
+.*rotxl\tr0l.*
+.*rotxl\tr1.*
+.*rotxl\ter2.*
+.*rotxr\tr3l.*
+.*rotxr\tr4.*
+.*rotxr\ter5.*
+.*$gdb_prompt $" { pass "rot_rotx_tests" }
+ -re "$gdb_prompt $" { fail "rot_rotx_tests" }
+ timeout { fail "(timeout) rot_rotx_tests" }
+ }
+}
+
+proc all_bset_bclr_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/20i bset_bclr_tests\n"
+ gdb_expect {
+ -re "
+.*bset\t#0x7,r0l.*
+.*bset\t#0x6,@er1.*
+.*bset\t#0x5,@0x12:8.*
+.*bset\t#0x4,@0x1234:16.*
+.*bset\t#0x3,@0x12345678:32.*
+.*bset\tr7l,r0h.*
+.*bset\tr6l,@er1.*
+.*bset\tr5l,@0x12:8.*
+.*bset\tr4l,@0x1234:16.*
+.*bset\tr3l,@0x12345678:32.*
+.*bclr\t#0x7,r0l.*
+.*bclr\t#0x6,@er1.*
+.*bclr\t#0x5,@0x12:8.*
+.*bclr\t#0x4,@0x1234:16.*
+.*bclr\t#0x3,@0x12345678:32.*
+.*bclr\tr7h,r0h.*
+.*bclr\tr6h,@er1.*
+.*bclr\tr5h,@0x12:8.*
+.*bclr\tr4h,@0x1234:16.*
+.*bclr\tr3h,@0x12345678:32.*
+.*$gdb_prompt $" { pass "bset_bclr_tests" }
+ -re "$gdb_prompt $" { fail "bset_bclr_tests" }
+ timeout { fail "(timeout) bset_bclr_tests" }
+ }
+}
+
+proc all_bnot_btst_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/20i bnot_btst_tests\n"
+ gdb_expect {
+ -re "
+.*bnot\t#0x7,r0l.*
+.*bnot\t#0x6,@er1.*
+.*bnot\t#0x5,@0x12:8.*
+.*bnot\t#0x4,@0x1234:16.*
+.*bnot\t#0x3,@0x12345678:32.*
+.*bnot\tr7l,r0h.*
+.*bnot\tr6l,@er1.*
+.*bnot\tr5l,@0x12:8.*
+.*bnot\tr4l,@0x1234:16.*
+.*bnot\tr3l,@0x12345678:32.*
+.*btst\t#0x7,r0l.*
+.*btst\t#0x6,@er1.*
+.*btst\t#0x5,@0x12:8.*
+.*btst\t#0x4,@0x1234:16.*
+.*btst\t#0x3,@0x12345678:32.*
+.*btst\tr7h,r0h.*
+.*btst\tr6h,@er1.*
+.*btst\tr5h,@0x12:8.*
+.*btst\tr4h,@0x1234:16.*
+.*btst\tr3h,@0x12345678:32.*
+.*$gdb_prompt $" { pass "bnot_btst_tests" }
+ -re "$gdb_prompt $" { fail "bnot_btst_tests" }
+ timeout { fail "(timeout) bnot_btst_tests" }
+ }
+}
+
+proc all_band_bor_bxor_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/15i band_bor_bxor_tests\n"
+ gdb_expect {
+ -re "
+.*band\t#0x7,r0l.*
+.*band\t#0x6,@er1.*
+.*band\t#0x5,@0x12:8.*
+.*band\t#0x4,@0x1234:16.*
+.*band\t#0x3,@0x12345678:32.*
+.*bor\t#0x7,r0l.*
+.*bor\t#0x6,@er1.*
+.*bor\t#0x5,@0x12:8.*
+.*bor\t#0x4,@0x1234:16.*
+.*bor\t#0x3,@0x12345678:32.*
+.*bxor\t#0x7,r0l.*
+.*bxor\t#0x6,@er1.*
+.*bxor\t#0x5,@0x12:8.*
+.*bxor\t#0x4,@0x1234:16.*
+.*bxor\t#0x3,@0x12345678:32.*
+.*$gdb_prompt $" { pass "band_bor_bxor_tests" }
+ -re "$gdb_prompt $" { fail "band_bor_bxor_tests" }
+ timeout { fail "(timeout) band_bor_bxor_tests" }
+ }
+}
+
+proc all_bld_bst_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/20i bld_bst_tests\n"
+ gdb_expect {
+ -re "
+.*bld\t#0x7,r0l.*
+.*bld\t#0x6,@er1.*
+.*bld\t#0x5,@0x12:8.*
+.*bld\t#0x4,@0x1234:16.*
+.*bld\t#0x3,@0x12345678:32.*
+.*bild\t#0x7,r0l.*
+.*bild\t#0x6,@er1.*
+.*bild\t#0x5,@0x12:8.*
+.*bild\t#0x4,@0x1234:16.*
+.*bild\t#0x3,@0x12345678:32.*
+.*bst\t#0x7,r0l.*
+.*bst\t#0x6,@er1.*
+.*bst\t#0x5,@0x12:8.*
+.*bst\t#0x4,@0x1234:16.*
+.*bst\t#0x3,@0x12345678:32.*
+.*bist\t#0x7,r0l.*
+.*bist\t#0x6,@er1.*
+.*bist\t#0x5,@0x12:8.*
+.*bist\t#0x4,@0x1234:16.*
+.*bist\t#0x3,@0x12345678:32.*
+.*$gdb_prompt $" { pass "bld_bst_tests" }
+ -re "$gdb_prompt $" { fail "bld_bst_tests" }
+ timeout { fail "(timeout) bld_bst_tests" }
+ }
+}
+
+proc all_branch_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/25i branch_tests\n"
+ gdb_expect {
+ -re "
+.*bra\tbranch_tests.*
+.*brn\tbranch_tests.*
+.*bhi\tbranch_tests.*
+.*bls\tbranch_tests.*
+.*bcc\tbranch_tests.*
+.*bcs\tbranch_tests.*
+.*bne\tbranch_tests.*
+.*beq\tbranch_tests.*
+.*bvc\tbranch_tests.*
+.*bvs\tbranch_tests.*
+.*bpl\tbranch_tests.*
+.*bmi\tbranch_tests.*
+.*bge\tbranch_tests.*
+.*blt\tbranch_tests.*
+.*bgt\tbranch_tests.*
+.*ble\tbranch_tests.*
+.*jmp\t@er0.*
+.*jmp\t@branch_tests.*
+.*jmp\t@@0 (0).*
+.*bsr\tbranch_tests.*
+.*bsr\tbranch_tests.*
+.*jsr\t@er0.*
+.*jsr\t@branch_tests.*
+.*jsr\t@@0 (0).*
+.*rts.*
+.*$gdb_prompt $" { pass "branch_tests" }
+ -re "$gdb_prompt $" { fail "branch_tests" }
+ timeout { fail "(timeout) branch_tests" }
+ }
+}
+
+proc all_system_control_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/40i system_control_tests\n"
+ gdb_expect {
+ -re "
+.*trapa\t#0x2.*
+.*rte.*
+.*sleep.*
+.*ldc\t#0x12,ccr*.
+.*ldc\tr3l,ccr.*
+.*ldc\t@er0,ccr.*
+.*ldc\t@\\(0x1234:16,er0\\),ccr.*
+.*ldc\t@\\(0x12345678:32,er0\\),ccr.*
+.*ldc\t@er1\\+,ccr.*
+.*ldc\t@0x1234:16,ccr.*
+.*ldc\t@0x12345678:32,ccr.*
+.*stc\tccr,r3l.*
+.*stc\tccr,@er0.*
+.*stc\tccr,@\\(0x1234:16,er0\\).*
+.*stc\tccr,@\\(0x12345678:32,er0\\).*
+.*stc\tccr,@\\-er1.*
+.*stc\tccr,@0x1234:16.*
+.*stc\tccr,@0x12345678:32.*
+.*andc\t#0x12,ccr.*
+.*orc\t#0x34,ccr.*
+.*xorc\t#0x56,ccr.*
+.*ldc\t#0x12,exr*.
+.*ldc\tr3l,exr.*
+.*ldc\t@er0,exr.*
+.*ldc\t@\\(0x1234:16,er0\\),exr.*
+.*ldc\t@\\(0x12345678:32,er0\\),exr.*
+.*ldc\t@er1\\+,exr.*
+.*ldc\t@0x1234:16,exr.*
+.*ldc\t@0x12345678:32,exr.*
+.*stc\texr,r3l.*
+.*stc\texr,@er0.*
+.*stc\texr,@\\(0x1234:16,er0\\).*
+.*stc\texr,@\\(0x12345678:32,er0\\).*
+.*stc\texr,@\\-er1.*
+.*stc\texr,@0x1234:16.*
+.*stc\texr,@0x12345678:32.*
+.*andc\t#0x12,exr.*
+.*orc\t#0x34,exr.*
+.*xorc\t#0x56,exr.*
+.*nop.*
+.*$gdb_prompt $" { pass "system_control_tests" }
+ -re "$gdb_prompt $" { fail "system_control_tests" }
+ timeout { fail "(timeout) system_control_tests" }
+ }
+}
+
+proc all_block_data_transfer_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/2i block_data_transfer_tests\n"
+ gdb_expect {
+ -re "
+.*eepmov.b.*
+.*eepmov.w.*
+.*$gdb_prompt $" { pass "block_data_transfer_tests" }
+ -re "$gdb_prompt $" { fail "block_data_transfer_tests" }
+ timeout { fail "(timeout) block_data_transfer_tests" }
+ }
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+all_set_machine_h8300s
+gdb_load $binfile
+
+# Data transfer
+all_movb_tests
+all_movw_tests
+all_movl_tests
+all_ldm_stm_tests
+all_movfpe_movtpe_tests
+
+# Arithmetic operations
+all_add_sub_addx_subx_tests
+all_inc_dec_adds_subs_tests
+all_daa_das_tests
+all_mul_div_tests
+all_cmp_tests
+all_neg_tests
+all_ext_tests
+all_tas_mac_tests
+
+# Logic operations
+all_logic_operations_tests
+
+# Shift
+all_sha_shl_tests
+all_rot_rotx_tests
+
+# Bit manipulation
+all_bset_bclr_tests
+all_bnot_btst_tests
+all_band_bor_bxor_tests
+all_bld_bst_tests
+
+# Branch
+all_branch_tests
+
+# System control
+all_system_control_tests
+
+# Block data transfer
+all_block_data_transfer_tests
diff --git a/gdb/testsuite/gdb.disasm/h8300s.s b/gdb/testsuite/gdb.disasm/h8300s.s
new file mode 100644
index 00000000000..ec66a55a002
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/h8300s.s
@@ -0,0 +1,356 @@
+ .h8300s
+ .section .text
+ .align 2
+ .global _main
+ .global movb_tests
+ .global movw_tests
+ .global movl_tests
+ .global ldm_stm_tests
+ .global movfpe_movtpe_tests
+ .global add_sub_addx_subx_tests
+ .global inc_dec_adds_subs_tests
+ .global daa_das_tests
+ .global mul_div_tests
+ .global cmp_tests
+ .global neg_tests
+ .global ext_tests
+ .global tas_mac_tests
+ .global logic_operations_tests
+ .global sha_shl_tests
+ .global rot_rotx_tests
+ .global bset_bclr_tests
+ .global bnot_btst_tests
+ .global band_bor_bxor_tests
+ .global bld_bst_tests
+ .global branch_tests
+ .global system_control_tests
+ .global block_data_transfer_tests
+_main:
+ nop
+
+movb_tests:
+ mov.b r0l,r0h
+ mov.b #0x12,r1l
+ mov.b @er0,r1h
+ mov.b @(0x1234:16,er0),r2l
+ mov.b @(0x12345678:32,er0),r2h
+ mov.b @er0+,r3l
+ mov.b @0x12:8,r3h
+ mov.b @0x1234:16,r4l
+ mov.b @0x12345678:32,r4h
+
+movw_tests:
+ mov.w e0,r0
+ mov.w #0x1234,r1
+ mov.w @er0,r2
+ mov.w @(0x1234:16,er0),r3
+ mov.w @(0x12345678:32,er0),r4
+ mov.w @er0+,r5
+ mov.w @0x1234:16,r6
+ mov.w @0x12345678:32,r7
+
+movl_tests:
+ mov.l er0,er1
+ mov.l #0x12345678,er1
+ mov.l @er0,er2
+ mov.l @(0x1234:16,er0),er3
+ mov.l @(0x12345678:32,er0),er4
+ mov.l @er0+,er5
+ mov.l @0x1234:16,er6
+ mov.l @0x12345678:32,er7
+
+ldm_stm_tests:
+ ldm.l @sp+,er0-er1
+ ldm.l @sp+,er0-er2
+ ldm.l @sp+,er0-er3
+ stm.l er0-er1,@-sp
+ stm.l er0-er2,@-sp
+ stm.l er0-er3,@-sp
+
+movfpe_movtpe_tests:
+ movfpe @0x1234:16,r2l
+ movtpe r2l,@0x1234:16
+
+add_sub_addx_subx_tests:
+ add.b #0x12,r0l
+ add.b r1l,r1h
+ add.w #0x1234,r2
+ add.w r3,r4
+ add.l #0x12345678,er5
+ add.l er6,er7
+ sub.b r1l,r1h
+ sub.w #0x1234,r2
+ sub.w r3,r4
+ sub.l #0x12345678,er5
+ sub.l er6,er7
+ addx #0x12,r0l
+ addx r1l,r1h
+ subx #0x12,r0l
+ subx r1l,r1h
+
+inc_dec_adds_subs_tests:
+ inc.b r0l
+ inc.w #0x1,r4
+ inc.w #0x2,r3
+ inc.l #0x1,er2
+ inc.l #0x2,er1
+ dec.b r0l
+ dec.w #0x1,r4
+ dec.w #0x2,r3
+ dec.l #0x1,er2
+ dec.l #0x2,er1
+ adds #0x1,er7
+ adds #0x2,er6
+ adds #0x4,er5
+ subs #0x1,er7
+ subs #0x2,er6
+ subs #0x4,er5
+
+daa_das_tests:
+ daa r0l
+ das r0h
+
+mul_div_tests:
+ mulxs.b r0l,r1
+ mulxs.w r2,er3
+ mulxu.b r0l,e1
+ mulxu.w e2,er3
+ divxs.b r0l,r1
+ divxs.w r2,er3
+ divxu.b r0l,e1
+ divxu.w e2,er3
+
+cmp_tests:
+ cmp.b #0x12,r0l
+ cmp.b r1l,r1h
+ cmp.w #0x1234,r2
+ cmp.w r3,e3
+ cmp.l #0x12345678,er4
+ cmp.l er5,er6
+
+neg_tests:
+ neg.b r0l
+ neg.w r2
+ neg.l er3
+
+ext_tests:
+ exts.w r0
+ exts.l er1
+ extu.w r2
+ extu.l er3
+
+tas_mac_tests:
+ tas @er0
+ mac @er1+,@er2+
+ clrmac
+ ldmac er4,mach
+ ldmac er5,macl
+ stmac mach,er6
+ stmac macl,er7
+
+logic_operations_tests:
+ and.b #0x12,r0l
+ and.b r1l,r2h
+ and.w #0x1234,r0
+ and.w r1,r2
+ and.l #0x12345678,er0
+ and.l er1,er2
+ or.b #0x12,r0l
+ or.b r1l,r2h
+ or.w #0x1234,r0
+ or.w r1,r2
+ or.l #0x12345678,er0
+ or.l er1,er2
+ xor.b #0x12,r0l
+ xor.b r1l,r2h
+ xor.w #0x1234,r0
+ xor.w r1,r2
+ xor.l #0x12345678,er0
+ xor.l er1,er2
+ not.b r0l
+ not.w r1
+ not.l er2
+
+sha_shl_tests:
+ shal r0l
+ shal r1
+ shal er2
+ shar r3l
+ shar r4
+ shar er5
+ shll r0l
+ shll r1
+ shll er2
+ shlr r3l
+ shlr r4
+ shlr er5
+
+rot_rotx_tests:
+ rotl r0l
+ rotl r1
+ rotl er2
+ rotr r3l
+ rotr r4
+ rotr er5
+ rotxl r0l
+ rotxl r1
+ rotxl er2
+ rotxr r3l
+ rotxr r4
+ rotxr er5
+
+bset_bclr_tests:
+ bset #0x7,r0l
+ bset #0x6,@er1
+ bset #0x5,@0x12:8
+ bset #0x4,@0x1234:16
+ bset #0x3,@0x12345678:32
+ bset r7l,r0h
+ bset r6l,@er1
+ bset r5l,@0x12:8
+ bset r4l,@0x1234:16
+ bset r3l,@0x12345678:32
+ bclr #0x7,r0l
+ bclr #0x6,@er1
+ bclr #0x5,@0x12:8
+ bclr #0x4,@0x1234:16
+ bclr #0x3,@0x12345678:32
+ bclr r7h,r0h
+ bclr r6h,@er1
+ bclr r5h,@0x12:8
+ bclr r4h,@0x1234:16
+ bclr r3h,@0x12345678:32
+
+bnot_btst_tests:
+ bnot #0x7,r0l
+ bnot #0x6,@er1
+ bnot #0x5,@0x12:8
+ bnot #0x4,@0x1234:16
+ bnot #0x3,@0x12345678:32
+ bnot r7l,r0h
+ bnot r6l,@er1
+ bnot r5l,@0x12:8
+ bnot r4l,@0x1234:16
+ bnot r3l,@0x12345678:32
+ btst #0x7,r0l
+ btst #0x6,@er1
+ btst #0x5,@0x12:8
+ btst #0x4,@0x1234:16
+ btst #0x3,@0x12345678:32
+ btst r7h,r0h
+ btst r6h,@er1
+ btst r5h,@0x12:8
+ btst r4h,@0x1234:16
+ btst r3h,@0x12345678:32
+
+band_bor_bxor_tests:
+ band #0x7,r0l
+ band #0x6,@er1
+ band #0x5,@0x12:8
+ band #0x4,@0x1234:16
+ band #0x3,@0x12345678:32
+ bor #0x7,r0l
+ bor #0x6,@er1
+ bor #0x5,@0x12:8
+ bor #0x4,@0x1234:16
+ bor #0x3,@0x12345678:32
+ bxor #0x7,r0l
+ bxor #0x6,@er1
+ bxor #0x5,@0x12:8
+ bxor #0x4,@0x1234:16
+ bxor #0x3,@0x12345678:32
+
+bld_bst_tests:
+ bld #0x7,r0l
+ bld #0x6,@er1
+ bld #0x5,@0x12:8
+ bld #0x4,@0x1234:16
+ bld #0x3,@0x12345678:32
+ bild #0x7,r0l
+ bild #0x6,@er1
+ bild #0x5,@0x12:8
+ bild #0x4,@0x1234:16
+ bild #0x3,@0x12345678:32
+ bst #0x7,r0l
+ bst #0x6,@er1
+ bst #0x5,@0x12:8
+ bst #0x4,@0x1234:16
+ bst #0x3,@0x12345678:32
+ bist #0x7,r0l
+ bist #0x6,@er1
+ bist #0x5,@0x12:8
+ bist #0x4,@0x1234:16
+ bist #0x3,@0x12345678:32
+
+branch_tests:
+ bra branch_tests
+ brn branch_tests
+ bhi branch_tests
+ bls branch_tests
+ bcc branch_tests
+ bcs branch_tests
+ bne branch_tests
+ beq branch_tests
+ bvc branch_tests
+ bvs branch_tests
+ bpl branch_tests
+ bmi branch_tests
+ bge branch_tests
+ blt branch_tests
+ bgt branch_tests
+ ble branch_tests
+ jmp @er0
+ jmp @branch_tests
+ jmp @@0 (0)
+ bsr @branch_tests:8
+ bsr @branch_tests:16
+ jsr @er0
+ jsr @branch_tests
+ jsr @@0 (0)
+ rts
+
+system_control_tests:
+ trapa #0x2
+ rte
+ sleep
+ ldc #0x12,ccr
+ ldc r3l,ccr
+ ldc @er0,ccr
+ ldc @(0x1234:16,er0),ccr
+ ldc @(0x12345678:32,er0),ccr
+ ldc @er1+,ccr
+ ldc @0x1234:16,ccr
+ ldc @0x12345678:32,ccr
+ stc ccr,r3l
+ stc ccr,@er0
+ stc ccr,@(0x1234:16,er0)
+ stc ccr,@(0x12345678:32,er0)
+ stc ccr,@-er1
+ stc ccr,@0x1234:16
+ stc ccr,@0x12345678:32
+ andc #0x12,ccr
+ orc #0x34,ccr
+ xorc #0x56,ccr
+ ldc #0x12,exr
+ ldc r3l,exr
+ ldc @er0,exr
+ ldc @(0x1234:16,er0),exr
+ ldc @(0x12345678:32,er0),exr
+ ldc @er1+,exr
+ ldc @0x1234:16,exr
+ ldc @0x12345678:32,exr
+ stc exr,r3l
+ stc exr,@er0
+ stc exr,@(0x1234:16,er0)
+ stc exr,@(0x12345678:32,er0)
+ stc exr,@-er1
+ stc exr,@0x1234:16
+ stc exr,@0x12345678:32
+ andc #0x12,exr
+ orc #0x34,exr
+ xorc #0x56,exr
+ nop
+
+block_data_transfer_tests:
+ eepmov.b
+ eepmov.w
diff --git a/gdb/testsuite/gdb.disasm/hppa.exp b/gdb/testsuite/gdb.disasm/hppa.exp
new file mode 100644
index 00000000000..122e9097031
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/hppa.exp
@@ -0,0 +1,1404 @@
+
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Jeff Law. (law@cs.utah.edu)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if ![istarget "hppa*-*-*"] {
+ verbose "Tests ignored for all but hppa based targets."
+ return
+}
+
+
+set prms_id 0
+set bug_id 0
+
+set testfile "hppa"
+set srcfile ${srcdir}/${subdir}/${testfile}.s
+set binfile ${objdir}/${subdir}/${testfile}
+set comp_output [gdb_compile "${srcfile}" "${binfile}" executable ""];
+if { $comp_output != "" } {
+ if [ regexp "Opcode not defined - DIAG" $comp_output] {
+ warning "HP assembler in use--skipping disasm tests"
+ return
+ } else {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+ }
+}
+
+proc all_integer_memory_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/8i integer_memory_tests\n"
+ gdb_expect {
+ -re "
+.*ldw 0\\(sr0,r4\\),r26.*
+.*ldh 0\\(sr0,r4\\),r26.*
+.*ldb 0\\(sr0,r4\\),r26.*
+.*stw r26,0\\(sr0,r4\\).*
+.*sth r26,0\\(sr0,r4\\).*
+.*stb r26,0\\(sr0,r4\\).*
+.*ldwm 0\\(sr0,r4\\),r26.*
+.*stwm r26,0\\(sr0,r4\\).*
+.*$gdb_prompt $" { pass "integer_memory_tests" }
+ -re "$gdb_prompt $" { fail "integer_memory_tests" }
+ timeout { fail "(timeout) integer memory_tests" }
+ }
+
+ send_gdb "x/20i integer_indexing_load\n"
+ gdb_expect {
+ -re "
+.*ldwx r5\\(sr0,r4\\),r26.*
+.*ldwx,s r5\\(sr0,r4\\),r26.*
+.*ldwx,m r5\\(sr0,r4\\),r26.*
+.*ldwx,sm r5\\(sr0,r4\\),r26.*
+.*ldhx r5\\(sr0,r4\\),r26.*
+.*ldhx,s r5\\(sr0,r4\\),r26.*
+.*ldhx,m r5\\(sr0,r4\\),r26.*
+.*ldhx,sm r5\\(sr0,r4\\),r26.*
+.*ldbx r5\\(sr0,r4\\),r26.*
+.*ldbx,s r5\\(sr0,r4\\),r26.*
+.*ldbx,m r5\\(sr0,r4\\),r26.*
+.*ldbx,sm r5\\(sr0,r4\\),r26.*
+.*ldwax r5\\(r4\\),r26.*
+.*ldwax,s r5\\(r4\\),r26.*
+.*ldwax,m r5\\(r4\\),r26.*
+.*ldwax,sm r5\\(r4\\),r26.*
+.*ldcwx r5\\(sr0,r4\\),r26.*
+.*ldcwx,s r5\\(sr0,r4\\),r26.*
+.*ldcwx,m r5\\(sr0,r4\\),r26.*
+.*ldcwx,sm r5\\(sr0,r4\\),r26.*
+.*$gdb_prompt $" { pass "integer_indexing_load" }
+ -re "$gdb_prompt $" { fail "integer_indexing_load" }
+ timeout { fail "(timeout) integer_indexing" }
+ }
+
+ send_gdb "x/15i integer_load_short_memory\n"
+ gdb_expect {
+ -re "
+.*ldws 0\\(sr0,r4\\),r26.*
+.*ldws,mb 0\\(sr0,r4\\),r26.*
+.*ldws,ma 0\\(sr0,r4\\),r26.*
+.*ldhs 0\\(sr0,r4\\),r26.*
+.*ldhs,mb 0\\(sr0,r4\\),r26.*
+.*ldhs,ma 0\\(sr0,r4\\),r26.*
+.*ldbs 0\\(sr0,r4\\),r26.*
+.*ldbs,mb 0\\(sr0,r4\\),r26.*
+.*ldbs,ma 0\\(sr0,r4\\),r26.*
+.*ldwas 0\\(r4\\),r26.*
+.*ldwas,mb 0\\(r4\\),r26.*
+.*ldwas,ma 0\\(r4\\),r26.*
+.*ldcws 0\\(sr0,r4\\),r26.*
+.*ldcws,mb 0\\(sr0,r4\\),r26.*
+.*ldcws,ma 0\\(sr0,r4\\),r26.*
+.*$gdb_prompt $" { pass "integer_load_short_memory" }
+ -re "$gdb_prompt $" { fail "integer_load_short_memory" }
+ timeout { fail "(timeout) integer_load_short_memory " }
+ }
+
+
+ send_gdb "x/17i integer_store_short_memory\n"
+ gdb_expect {
+ -re "
+.*stws r26,0\\(sr0,r4\\).*
+.*stws,mb r26,0\\(sr0,r4\\).*
+.*stws,ma r26,0\\(sr0,r4\\).*
+.*sths r26,0\\(sr0,r4\\).*
+.*sths,mb r26,0\\(sr0,r4\\).*
+.*sths,ma r26,0\\(sr0,r4\\).*
+.*stbs r26,0\\(sr0,r4\\).*
+.*stbs,mb r26,0\\(sr0,r4\\).*
+.*stbs,ma r26,0\\(sr0,r4\\).*
+.*stwas r26,0\\(r4\\).*
+.*stwas,mb r26,0\\(r4\\).*
+.*stwas,ma r26,0\\(r4\\).*
+.*stbys r26,0\\(sr0,r4\\).*
+.*stbys r26,0\\(sr0,r4\\).*
+.*stbys,e r26,0\\(sr0,r4\\).*
+.*stbys,b,m r26,0\\(sr0,r4\\).*
+.*stbys,e,m r26,0\\(sr0,r4\\).*
+.*$gdb_prompt $" { pass "integer_store_short_memory" }
+ -re "$gdb_prompt $" { fail "integer_store_short_memory" }
+ timeout { fail "(timeout) integer_short_memory " }
+ }
+}
+
+proc all_immediate_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/3i immediate_tests\n"
+ gdb_expect {
+ -re "
+.*ldo 5\\(r26\\),r26.*
+.*ldil -21524800,r26.*
+.*addil -21524800,r5.*
+.*$gdb_prompt $" { pass "immedate_tests" }
+ -re "$gdb_prompt $" { fail "immedate_tests" }
+ timeout { fail "(timeout) immedate_tests " }
+ }
+}
+
+proc all_branch_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/10i branch_tests_1\n"
+ gdb_expect {
+ -re "
+.*bl.*,rp.*
+.*bl,n.*,rp.*
+.*b.*
+.*b,n.*
+.*gate.*,rp.*
+.*gate,n.*,rp.*
+.*blr r4,rp.*
+.*blr,n r4,rp.*
+.*blr r4,r0.*
+.*blr,n r4,r0.*
+.*$gdb_prompt $" { pass "branch_tests_1" }
+ -re "$gdb_prompt $" { fail "branch_tests_1" }
+ timeout { fail "(timeout) branch_tests_1" }
+ }
+
+ send_gdb "x/6i branch_tests_2\n"
+ gdb_expect {
+ -re "
+.*bv r0\\(rp\\).*
+.*bv,n r0\\(rp\\).*
+.*be 1234\\(sr1,rp\\).*
+.*be,n 1234\\(sr1,rp\\).*
+.*ble 1234\\(sr1,rp\\).*
+.*ble,n 1234\\(sr1,rp\\).*
+.*$gdb_prompt $" { pass "branch_tests_2" }
+ -re "$gdb_prompt $" { fail "branch_tests_2" }
+ timeout { fail "(timeout) branch_tests_2" }
+ }
+
+
+ send_gdb "x/8i movb_tests\n"
+ gdb_expect {
+ -re "
+.*movb r4,r26,.* <movb_tests>.*
+.*movb,= r4,r26,.* <movb_tests>.*
+.*movb,< r4,r26,.* <movb_tests>.*
+.*movb,od r4,r26,.* <movb_tests>.*
+.*movb,tr r4,r26,.* <movb_tests>.*
+.*movb,<> r4,r26,.* <movb_tests>.*
+.*movb,>= r4,r26,.* <movb_tests>.*
+.*movb,ev r4,r26,.* <movb_tests>.*
+.*$gdb_prompt $" { pass "movb_tests" }
+ -re "$gdb_prompt $" { fail "movb_tests" }
+ timeout { fail "(timeout) movb_tests " }
+ }
+
+ send_gdb "x/8i movb_nullified_tests\n"
+ gdb_expect {
+ -re "
+.*movb,n.*r4,r26,.* <movb_tests>.*
+.*movb,=,n.*r4,r26,.* <movb_tests>.*
+.*movb,<,n.*r4,r26,.* <movb_tests>.*
+.*movb,od,n.*r4,r26,.* <movb_tests>.*
+.*movb,tr,n.*r4,r26,.* <movb_tests>.*
+.*movb,<>,n.*r4,r26,.* <movb_tests>.*
+.*movb,>=,n.*r4,r26,.* <movb_tests>.*
+.*movb,ev,n.*r4,r26,.* <movb_tests>.*
+.*$gdb_prompt $" { pass "movb_nullified_tests" }
+ -re "$gdb_prompt $" { fail "movb_nullified_tests" }
+ timeout { fail "(timeout) movb_nullified_tests " }
+ }
+
+ send_gdb "x/8i movib_tests\n"
+ gdb_expect {
+ -re "
+.*movib 5,r26,.* <movib_tests>.*
+.*movib,= 5,r26,.* <movib_tests>.*
+.*movib,< 5,r26,.* <movib_tests>.*
+.*movib,od 5,r26,.* <movib_tests>.*
+.*movib,tr 5,r26,.* <movib_tests>.*
+.*movib,<> 5,r26,.* <movib_tests>.*
+.*movib,>= 5,r26,.* <movib_tests>.*
+.*movib,ev 5,r26,.* <movib_tests>.*
+.*$gdb_prompt $" { pass "movib_tests" }
+ -re "$gdb_prompt $" { fail "movib_tests" }
+ timeout { fail "(timeout) movib_tests " }
+ }
+
+ send_gdb "x/8i movib_nullified_tests\n"
+ gdb_expect {
+ -re "
+.*movib,n.*5,r26,.* <movib_tests>.*
+.*movib,=,n.*5,r26,.* <movib_tests>.*
+.*movib,<,n.*5,r26,.* <movib_tests>.*
+.*movib,od,n.*5,r26,.* <movib_tests>.*
+.*movib,tr,n.*5,r26,.* <movib_tests>.*
+.*movib,<>,n.*5,r26,.* <movib_tests>.*
+.*movib,>=,n.*5,r26,.* <movib_tests>.*
+.*movib,ev,n.*5,r26,.* <movib_tests>.*
+.*$gdb_prompt $" { pass "movib_nullified_tests" }
+ -re "$gdb_prompt $" { fail "movib_nullified_tests" }
+ timeout { fail "(timeout) movib_nullified_tests " }
+ }
+
+ send_gdb "x/8i comb_tests_1\n"
+ gdb_expect {
+ -re "
+.*comb r0,r4,.* <comb_tests_1>.*
+.*comb,= r0,r4,.* <comb_tests_1>.*
+.*comb,< r0,r4,.* <comb_tests_1>.*
+.*comb,<= r0,r4,.* <comb_tests_1>.*
+.*comb,<< r0,r4,.* <comb_tests_1>.*
+.*comb,<<= r0,r4,.* <comb_tests_1>.*
+.*comb,sv r0,r4,.* <comb_tests_1>.*
+.*comb,od r0,r4,.* <comb_tests_1>.*
+.*$gdb_prompt $" { pass "comb_tests_1" }
+ -re "$gdb_prompt $" { fail "comb_tests_1" }
+ timeout { fail "(timeout) comb_tests_1" }
+ }
+
+ send_gdb "x/8i comb_tests_2\n"
+ gdb_expect {
+ -re "
+.*combf r0,r4,.* <comb_tests_2>.*
+.*combf,= r0,r4,.* <comb_tests_2>.*
+.*combf,< r0,r4,.* <comb_tests_2>.*
+.*combf,<= r0,r4,.* <comb_tests_2>.*
+.*combf,<< r0,r4,.* <comb_tests_2>.*
+.*combf,<<= r0,r4,.* <comb_tests_2>.*
+.*combf,sv r0,r4,.* <comb_tests_2>.*
+.*combf,od r0,r4,.* <comb_tests_2>.*
+.*$gdb_prompt $" { pass "comb_tests_2" }
+ -re "$gdb_prompt $" { fail "comb_tests_2" }
+ timeout { fail "(timeout) comb_tests_2" }
+ }
+
+ send_gdb "x/8i comb_nullified_tests_1\n"
+ gdb_expect {
+ -re "
+.*comb,n r0,r4,.* <comb_tests_1>.*
+.*comb,=,n r0,r4,.* <comb_tests_1>.*
+.*comb,<,n r0,r4,.* <comb_tests_1>.*
+.*comb,<=,n r0,r4,.* <comb_tests_1>.*
+.*comb,<<,n r0,r4,.* <comb_tests_1>.*
+.*comb,<<=,n r0,r4,.* <comb_tests_1>.*
+.*comb,sv,n r0,r4,.* <comb_tests_1>.*
+.*comb,od,n r0,r4,.* <comb_tests_1>.*
+.*$gdb_prompt $" { pass "comb_nullified_tests_1" }
+ -re "$gdb_prompt $" { fail "comb_nullified_tests_1" }
+ timeout { fail "(timeout) comb_nullified_tests_1" }
+ }
+
+ send_gdb "x/8i comb_nullified_tests_2\n"
+ gdb_expect {
+ -re "
+.*combf,n r0,r4,.* <comb_tests_2>.*
+.*combf,=,n r0,r4,.* <comb_tests_2>.*
+.*combf,<,n r0,r4,.* <comb_tests_2>.*
+.*combf,<=,n r0,r4,.* <comb_tests_2>.*
+.*combf,<<,n r0,r4,.* <comb_tests_2>.*
+.*combf,<<=,n r0,r4,.* <comb_tests_2>.*
+.*combf,sv,n r0,r4,.* <comb_tests_2>.*
+.*combf,od,n r0,r4,.* <comb_tests_2>.*
+.*$gdb_prompt $" { pass "comb_nullified_tests_2" }
+ -re "$gdb_prompt $" { fail "comb_nullified_tests_2" }
+ timeout { fail "(timeout) comb_nullified_tests_2" }
+ }
+
+ send_gdb "x/8i comib_tests_1\n"
+ gdb_expect {
+ -re "
+.*comib 0,r4,.* <comib_tests_1>.*
+.*comib,= 0,r4,.* <comib_tests_1>.*
+.*comib,< 0,r4,.* <comib_tests_1>.*
+.*comib,<= 0,r4,.* <comib_tests_1>.*
+.*comib,<< 0,r4,.* <comib_tests_1>.*
+.*comib,<<= 0,r4,.* <comib_tests_1>.*
+.*comib,sv 0,r4,.* <comib_tests_1>.*
+.*comib,od 0,r4,.* <comib_tests_1>.*
+.*$gdb_prompt $" { pass "comib_tests_1" }
+ -re "$gdb_prompt $" { fail "comib_tests_1" }
+ timeout { fail "(timeout) comib_tests_1" }
+ }
+
+ send_gdb "x/8i comib_tests_2\n"
+ gdb_expect {
+ -re "
+.*comibf 0,r4,.* <comib_tests_2>.*
+.*comibf,= 0,r4,.* <comib_tests_2>.*
+.*comibf,< 0,r4,.* <comib_tests_2>.*
+.*comibf,<= 0,r4,.* <comib_tests_2>.*
+.*comibf,<< 0,r4,.* <comib_tests_2>.*
+.*comibf,<<= 0,r4,.* <comib_tests_2>.*
+.*comibf,sv 0,r4,.* <comib_tests_2>.*
+.*comibf,od 0,r4,.* <comib_tests_2>.*
+.*$gdb_prompt $" { pass "comib_tests_2" }
+ -re "$gdb_prompt $" { fail "comib_tests_2" }
+ timeout { fail "(timeout) comib_tests_2" }
+ }
+
+ send_gdb "x/8i comib_nullified_tests_1\n"
+ gdb_expect {
+ -re "
+.*comib,n 0,r4,.* <comib_tests_1>.*
+.*comib,=,n 0,r4,.* <comib_tests_1>.*
+.*comib,<,n 0,r4,.* <comib_tests_1>.*
+.*comib,<=,n 0,r4,.* <comib_tests_1>.*
+.*comib,<<,n 0,r4,.* <comib_tests_1>.*
+.*comib,<<=,n 0,r4,.* <comib_tests_1>.*
+.*comib,sv,n 0,r4,.* <comib_tests_1>.*
+.*comib,od,n 0,r4,.* <comib_tests_1>.*
+.*$gdb_prompt $" { pass "comib_nullified_tests_1" }
+ -re "$gdb_prompt $" { fail "comib_nullified_tests_1" }
+ timeout { fail "(timeout) comib_nullified_tests_1" }
+ }
+
+ send_gdb "x/8i comib_nullified_tests_2\n"
+ gdb_expect {
+ -re "
+.*comibf,n 0,r4,.* <comib_tests_2>.*
+.*comibf,=,n 0,r4,.* <comib_tests_2>.*
+.*comibf,<,n 0,r4,.* <comib_tests_2>.*
+.*comibf,<=,n 0,r4,.* <comib_tests_2>.*
+.*comibf,<<,n 0,r4,.* <comib_tests_2>.*
+.*comibf,<<=,n 0,r4,.* <comib_tests_2>.*
+.*comibf,sv,n 0,r4,.* <comib_tests_2>.*
+.*comibf,od,n 0,r4,.* <comib_tests_2>.*
+.*$gdb_prompt $" { pass "comib_nullified_tests_2" }
+ -re "$gdb_prompt $" { fail "comib_nullified_tests_2" }
+ timeout { fail "(timeout) comib_nullified_tests_2" }
+ }
+
+ send_gdb "x/8i addb_tests_1\n"
+ gdb_expect {
+ -re "
+.*addb r1,r4,.* <addb_tests_1>.*
+.*addb,= r1,r4,.* <addb_tests_1>.*
+.*addb,< r1,r4,.* <addb_tests_1>.*
+.*addb,<= r1,r4,.* <addb_tests_1>.*
+.*addb,nuv r1,r4,.* <addb_tests_1>.*
+.*addb,znv r1,r4,.* <addb_tests_1>.*
+.*addb,sv r1,r4,.* <addb_tests_1>.*
+.*addb,od r1,r4,.* <addb_tests_1>.*
+.*$gdb_prompt $" { pass "addb_tests_1" }
+ -re "$gdb_prompt $" { fail "addb_tests_1" }
+ timeout { fail "(timeout) addb_tests_1" }
+ }
+
+ send_gdb "x/8i addb_tests_2\n"
+ gdb_expect {
+ -re "
+.*addbf r1,r4,.* <addb_tests_2>.*
+.*addbf,= r1,r4,.* <addb_tests_2>.*
+.*addbf,< r1,r4,.* <addb_tests_2>.*
+.*addbf,<= r1,r4,.* <addb_tests_2>.*
+.*addbf,nuv r1,r4,.* <addb_tests_2>.*
+.*addbf,znv r1,r4,.* <addb_tests_2>.*
+.*addbf,sv r1,r4,.* <addb_tests_2>.*
+.*addbf,od r1,r4,.* <addb_tests_2>.*
+.*$gdb_prompt $" { pass "addb_tests_2" }
+ -re "$gdb_prompt $" { fail "addb_tests_2" }
+ timeout { fail "(timeout) addb_tests_2" }
+ }
+
+ send_gdb "x/8i addb_nullified_tests_1\n"
+ gdb_expect {
+ -re "
+.*addb,n r1,r4,.* <addb_tests_1>.*
+.*addb,=,n r1,r4,.* <addb_tests_1>.*
+.*addb,<,n r1,r4,.* <addb_tests_1>.*
+.*addb,<=,n r1,r4,.* <addb_tests_1>.*
+.*addb,nuv,n r1,r4,.* <addb_tests_1>.*
+.*addb,znv,n r1,r4,.* <addb_tests_1>.*
+.*addb,sv,n r1,r4,.* <addb_tests_1>.*
+.*addb,od,n r1,r4,.* <addb_tests_1>.*
+.*$gdb_prompt $" { pass "addb_nullified_tests_1" }
+ -re "$gdb_prompt $" { fail "addb_nullified_tests_1" }
+ timeout { fail "(timeout) addb_nullified_tests_1" }
+ }
+
+ send_gdb "x/8i addb_nullified_tests_2\n"
+ gdb_expect {
+ -re "
+.*addbf,n r1,r4,.* <addb_tests_2>.*
+.*addbf,=,n r1,r4,.* <addb_tests_2>.*
+.*addbf,<,n r1,r4,.* <addb_tests_2>.*
+.*addbf,<=,n r1,r4,.* <addb_tests_2>.*
+.*addbf,nuv,n r1,r4,.* <addb_tests_2>.*
+.*addbf,znv,n r1,r4,.* <addb_tests_2>.*
+.*addbf,sv,n r1,r4,.* <addb_tests_2>.*
+.*addbf,od,n r1,r4,.* <addb_tests_2>.*
+.*$gdb_prompt $" { pass "addb_nullified_tests_2" }
+ -re "$gdb_prompt $" { fail "addb_nullified_tests_2" }
+ timeout { fail "(timeout) addb_nullified_tests_2" }
+ }
+
+ send_gdb "x/8i addib_tests_1\n"
+ gdb_expect {
+ -re "
+.*addib -1,r4,.* <addib_tests_1>.*
+.*addib,= -1,r4,.* <addib_tests_1>.*
+.*addib,< -1,r4,.* <addib_tests_1>.*
+.*addib,<= -1,r4,.* <addib_tests_1>.*
+.*addib,nuv -1,r4,.* <addib_tests_1>.*
+.*addib,znv -1,r4,.* <addib_tests_1>.*
+.*addib,sv -1,r4,.* <addib_tests_1>.*
+.*addib,od -1,r4,.* <addib_tests_1>.*
+.*$gdb_prompt $" { pass "addib_tests_1" }
+ -re "$gdb_prompt $" { fail "addib_tests_1" }
+ timeout { fail "(timeout) addib_tests_1" }
+ }
+
+ send_gdb "x/8i addib_tests_2\n"
+ gdb_expect {
+ -re "
+.*addibf -1,r4,.* <addib_tests_2>.*
+.*addibf,= -1,r4,.* <addib_tests_2>.*
+.*addibf,< -1,r4,.* <addib_tests_2>.*
+.*addibf,<= -1,r4,.* <addib_tests_2>.*
+.*addibf,nuv -1,r4,.* <addib_tests_2>.*
+.*addibf,znv -1,r4,.* <addib_tests_2>.*
+.*addibf,sv -1,r4,.* <addib_tests_2>.*
+.*addibf,od -1,r4,.* <addib_tests_2>.*
+.*$gdb_prompt $" { pass "addib_tests_2" }
+ -re "$gdb_prompt $" { fail "addib_tests_2" }
+ timeout { fail "(timeout) addib_tests_2" }
+ }
+
+ send_gdb "x/8i addib_nullified_tests_1\n"
+ gdb_expect {
+ -re "
+.*addib,n -1,r4,.* <addib_tests_1>.*
+.*addib,=,n -1,r4,.* <addib_tests_1>.*
+.*addib,<,n -1,r4,.* <addib_tests_1>.*
+.*addib,<=,n -1,r4,.* <addib_tests_1>.*
+.*addib,nuv,n -1,r4,.* <addib_tests_1>.*
+.*addib,znv,n -1,r4,.* <addib_tests_1>.*
+.*addib,sv,n -1,r4,.* <addib_tests_1>.*
+.*addib,od,n -1,r4,.* <addib_tests_1>.*
+.*$gdb_prompt $" { pass "addb_nullified_tests_1" }
+ -re "$gdb_prompt $" { fail "addb_nullified_tests_1" }
+ timeout { fail "(timeout) addb_nullified_tests_1" }
+ }
+
+ send_gdb "x/8i addib_nullified_tests_2\n"
+ gdb_expect {
+ -re "
+.*addibf,n -1,r4,.* <addib_tests_2>.*
+.*addibf,=,n -1,r4,.* <addib_tests_2>.*
+.*addibf,<,n -1,r4,.* <addib_tests_2>.*
+.*addibf,<=,n -1,r4,.* <addib_tests_2>.*
+.*addibf,nuv,n -1,r4,.* <addib_tests_2>.*
+.*addibf,znv,n -1,r4,.* <addib_tests_2>.*
+.*addibf,sv,n -1,r4,.* <addib_tests_2>.*
+.*addibf,od,n -1,r4,.* <addib_tests_2>.*
+.*$gdb_prompt $" { pass "addb_nullified_tests_2" }
+ -re "$gdb_prompt $" { fail "addb_nullified_tests_2" }
+ timeout { fail "(timeout) addb_nullified_tests_2" }
+ }
+
+ send_gdb "x/8i bb_tests\n"
+ gdb_expect {
+ -re "
+.*bvb,< r4,.* <bb_tests>.*
+.*bvb,>= r4,.* <bb_tests>.*
+.*bvb,<,n r4,.* <bb_tests>.*
+.*bvb,>=,n r4,.* <bb_tests>.*
+.*bb,< r4,5,.* <bb_tests>.*
+.*bb,>= r4,5,.* <bb_tests>.*
+.*bb,<,n r4,5,.* <bb_tests>.*
+.*bb,>=,n r4,5,.* <bb_tests>.*
+.*$gdb_prompt $" { pass "bb_tests" }
+ -re "$gdb_prompt $" { fail "bb_tests" }
+ timeout { fail "(timeout) bb_tests " }
+ }
+}
+
+proc all_integer_computational_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ set add_insns [list {add} {addl} {addo} {addc} {addco} \
+ {sh1add} {sh1addl} {sh1addo} \
+ {sh2add} {sh2addl} {sh2addo} \
+ {sh3add} {sh3addl} {sh3addo} ]
+
+ foreach i $add_insns {
+ send_gdb "x/16i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i r4,r5,r6.*
+.*$i,= r4,r5,r6.*
+.*$i,< r4,r5,r6.*
+.*$i,<= r4,r5,r6.*
+.*$i,nuv r4,r5,r6.*
+.*$i,znv r4,r5,r6.*
+.*$i,sv r4,r5,r6.*
+.*$i,od r4,r5,r6.*
+.*$i,tr r4,r5,r6.*
+.*$i,<> r4,r5,r6.*
+.*$i,>= r4,r5,r6.*
+.*$i,> r4,r5,r6.*
+.*$i,uv r4,r5,r6.*
+.*$i,vnz r4,r5,r6.*
+.*$i,nsv r4,r5,r6.*
+.*$i,ev r4,r5,r6.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ set sub_insns [list {sub} {subo} {subb} {subbo} {subt} {subto} \
+ {ds} {comclr} ]
+
+ foreach i $sub_insns {
+ send_gdb "x/16i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i r4,r5,r6.*
+.*$i,= r4,r5,r6.*
+.*$i,< r4,r5,r6.*
+.*$i,<= r4,r5,r6.*
+.*$i,<< r4,r5,r6.*
+.*$i,<<= r4,r5,r6.*
+.*$i,sv r4,r5,r6.*
+.*$i,od r4,r5,r6.*
+.*$i,tr r4,r5,r6.*
+.*$i,<> r4,r5,r6.*
+.*$i,>= r4,r5,r6.*
+.*$i,> r4,r5,r6.*
+.*$i,>>= r4,r5,r6.*
+.*$i,>> r4,r5,r6.*
+.*$i,nsv r4,r5,r6.*
+.*$i,ev r4,r5,r6.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ set logical_insns [list {or} {xor} {and} {andcm} ]
+
+ foreach i $logical_insns {
+ send_gdb "x/10i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i r4,r5,r6.*
+.*$i,= r4,r5,r6.*
+.*$i,< r4,r5,r6.*
+.*$i,<= r4,r5,r6.*
+.*$i,od r4,r5,r6.*
+.*$i,tr r4,r5,r6.*
+.*$i,<> r4,r5,r6.*
+.*$i,>= r4,r5,r6.*
+.*$i,> r4,r5,r6.*
+.*$i,ev r4,r5,r6.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ set unit_insns1 [list {uxor} {uaddcm} {uaddcmt} ]
+
+ foreach i $unit_insns1 {
+ send_gdb "x/12i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i r4,r5,r6.*
+.*$i,sbz r4,r5,r6.*
+.*$i,shz r4,r5,r6.*
+.*$i,sdc r4,r5,r6.*
+.*$i,sbc r4,r5,r6.*
+.*$i,shc r4,r5,r6.*
+.*$i,tr r4,r5,r6.*
+.*$i,nbz r4,r5,r6.*
+.*$i,nhz r4,r5,r6.*
+.*$i,ndc r4,r5,r6.*
+.*$i,nbc r4,r5,r6.*
+.*$i,nhc r4,r5,r6.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ set unit_insns2 [list {dcor} {idcor} ]
+
+ foreach i $unit_insns2 {
+ send_gdb "x/12i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i r4,r5.*
+.*$i,sbz r4,r5.*
+.*$i,shz r4,r5.*
+.*$i,sdc r4,r5.*
+.*$i,sbc r4,r5.*
+.*$i,shc r4,r5.*
+.*$i,tr r4,r5.*
+.*$i,nbz r4,r5.*
+.*$i,nhz r4,r5.*
+.*$i,ndc r4,r5.*
+.*$i,nbc r4,r5.*
+.*$i,nhc r4,r5.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ set addi_insns [list {addi} {addio} {addit} {addito} ]
+
+ foreach i $addi_insns {
+ send_gdb "x/16i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i 7b,r5,r6.*
+.*$i,= 7b,r5,r6.*
+.*$i,< 7b,r5,r6.*
+.*$i,<= 7b,r5,r6.*
+.*$i,nuv 7b,r5,r6.*
+.*$i,znv 7b,r5,r6.*
+.*$i,sv 7b,r5,r6.*
+.*$i,od 7b,r5,r6.*
+.*$i,tr 7b,r5,r6.*
+.*$i,<> 7b,r5,r6.*
+.*$i,>= 7b,r5,r6.*
+.*$i,> 7b,r5,r6.*
+.*$i,uv 7b,r5,r6.*
+.*$i,vnz 7b,r5,r6.*
+.*$i,nsv 7b,r5,r6.*
+.*$i,ev 7b,r5,r6.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ set subi_insns [list {subi} {subio} {comiclr} ]
+
+ foreach i $subi_insns {
+ send_gdb "x/16i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i 7b,r5,r6.*
+.*$i,= 7b,r5,r6.*
+.*$i,< 7b,r5,r6.*
+.*$i,<= 7b,r5,r6.*
+.*$i,<< 7b,r5,r6.*
+.*$i,<<= 7b,r5,r6.*
+.*$i,sv 7b,r5,r6.*
+.*$i,od 7b,r5,r6.*
+.*$i,tr 7b,r5,r6.*
+.*$i,<> 7b,r5,r6.*
+.*$i,>= 7b,r5,r6.*
+.*$i,> 7b,r5,r6.*
+.*$i,>>= 7b,r5,r6.*
+.*$i,>> 7b,r5,r6.*
+.*$i,nsv 7b,r5,r6.*
+.*$i,ev 7b,r5,r6.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ send_gdb "x/8i vshd_tests\n"
+ gdb_expect {
+ -re "
+.*vshd r4,r5,r6.*
+.*vshd,= r4,r5,r6.*
+.*vshd,< r4,r5,r6.*
+.*vshd,od r4,r5,r6.*
+.*vshd,tr r4,r5,r6.*
+.*vshd,<> r4,r5,r6.*
+.*vshd,>= r4,r5,r6.*
+.*vshd,ev r4,r5,r6.*
+.*$gdb_prompt $" { pass "vshd tests" }
+ -re "$gdb_prompt $" { fail "vshd tests" }
+ timeout { fail "(timeout) "vshd tests" }
+ }
+
+ send_gdb "x/8i shd_tests\n"
+ gdb_expect {
+ -re "
+.*shd r4,r5,5,r6.*
+.*shd,= r4,r5,5,r6.*
+.*shd,< r4,r5,5,r6.*
+.*shd,od r4,r5,5,r6.*
+.*shd,tr r4,r5,5,r6.*
+.*shd,<> r4,r5,5,r6.*
+.*shd,>= r4,r5,5,r6.*
+.*shd,ev r4,r5,5,r6.*
+.*$gdb_prompt $" { pass "shd tests" }
+ -re "$gdb_prompt $" { fail "shd tests" }
+ timeout { fail "(timeout) "shd tests" }
+ }
+
+ set extract_insns1 [list {extru} {extrs} {zdep} {dep} ]
+
+ foreach i $extract_insns1 {
+ send_gdb "x/8i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i r4,5,10,r6.*
+.*$i,= r4,5,10,r6.*
+.*$i,< r4,5,10,r6.*
+.*$i,od r4,5,10,r6.*
+.*$i,tr r4,5,10,r6.*
+.*$i,<> r4,5,10,r6.*
+.*$i,>= r4,5,10,r6.*
+.*$i,ev r4,5,10,r6.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ set extract_insns2 [list {vextru} {vextrs} {zvdep} {vdep} ]
+
+ foreach i $extract_insns2 {
+ send_gdb "x/8i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i r4,5,r6.*
+.*$i,= r4,5,r6.*
+.*$i,< r4,5,r6.*
+.*$i,od r4,5,r6.*
+.*$i,tr r4,5,r6.*
+.*$i,<> r4,5,r6.*
+.*$i,>= r4,5,r6.*
+.*$i,ev r4,5,r6.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ set extract_insns3 [list {vdepi} {zvdepi} ]
+
+ foreach i $extract_insns3 {
+ send_gdb "x/8i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i -1,5,r6.*
+.*$i,= -1,5,r6.*
+.*$i,< -1,5,r6.*
+.*$i,od -1,5,r6.*
+.*$i,tr -1,5,r6.*
+.*$i,<> -1,5,r6.*
+.*$i,>= -1,5,r6.*
+.*$i,ev -1,5,r6.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ set extract_insns4 [list {depi} {zdepi} ]
+
+ foreach i $extract_insns4 {
+ send_gdb "x/8i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i -1,4,10,r6.*
+.*$i,= -1,4,10,r6.*
+.*$i,< -1,4,10,r6.*
+.*$i,od -1,4,10,r6.*
+.*$i,tr -1,4,10,r6.*
+.*$i,<> -1,4,10,r6.*
+.*$i,>= -1,4,10,r6.*
+.*$i,ev -1,4,10,r6.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+}
+
+proc all_system_control_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/14i system_control_tests\n"
+ gdb_expect {
+ -re "
+.*break 5,c.*
+.*rfi.*
+.*rfir.*
+.*ssm 5,r4.*
+.*rsm 5,r4.*
+.*mtsm r4.*
+.*ldsid \\(sr0,r5\\),r4.*
+.*mtsp r4,sr0.*
+.*mtctl r4,ccr.*
+.*mfsp sr0,r4.*
+.*mfctl ccr,r4.*
+.*sync.*
+.*syncdma.*
+.*diag 4d2.*
+.*$gdb_prompt $" { pass "system_constrol_tests" }
+ -re "$gdb_prompt $" { fail "system_control_tests" }
+ timeout { file "(timeout) system_control_tests" }
+ }
+
+ send_gdb "x/4i probe_tests\n"
+ gdb_expect {
+ -re "
+.*prober \\(sr0,r5\\),r6,r7.*
+.*proberi \\(sr0,r5\\),1,r7.*
+.*probew \\(sr0,r5\\),r6,r7.*
+.*probewi \\(sr0,r5\\),1,r7.*
+.*$gdb_prompt $" { pass "probe_tests" }
+ -re "$gdb_prompt $" { fail "probe_tests" }
+ timeout { file "(timeout) probe_tests" }
+ }
+
+ # lci uses the same bit pattern as lha, so accept lha.
+ send_gdb "x/5i lpa_tests\n"
+ gdb_expect {
+ -re "
+.*lpa r4\\(sr0,r5\\),r6.*
+.*lpa,m r4\\(sr0,r5\\),r6.*
+.*lha r4\\(sr0,r5\\),r6.*
+.*lha,m r4\\(sr0,r5\\),r6.*
+.*lha r4\\(sr0,r5\\),r6.*
+.*$gdb_prompt $" { pass "lpa_tests" }
+ -re "$gdb_prompt $" { fail "lpa_tests" }
+ timeout { file "(timeout) lpa_tests" }
+ }
+
+ send_gdb "x/18i purge_tests\n"
+ gdb_expect {
+ -re "
+.*pdtlb r4\\(sr0,r5\\).*
+.*pdtlb,m r4\\(sr0,r5\\).*
+.*pitlb r4\\(sr0,r5\\).*
+.*pitlb,m r4\\(sr0,r5\\).*
+.*pdtlbe r4\\(sr0,r5\\).*
+.*pdtlbe,m r4\\(sr0,r5\\).*
+.*pitlbe r4\\(sr0,r5\\).*
+.*pitlbe,m r4\\(sr0,r5\\).*
+.*pdc r4\\(sr0,r5\\).*
+.*pdc,m r4\\(sr0,r5\\).*
+.*fdc r4\\(sr0,r5\\).*
+.*fdc,m r4\\(sr0,r5\\).*
+.*fic r4\\(sr0,r5\\).*
+.*fic,m r4\\(sr0,r5\\).*
+.*fdce r4\\(sr0,r5\\).*
+.*fdce,m r4\\(sr0,r5\\).*
+.*fice r4\\(sr0,r5\\).*
+.*fice,m r4\\(sr0,r5\\).*
+.*$gdb_prompt $" { pass "purge_tests" }
+ -re "$gdb_prompt $" { fail "purge_tests" }
+ timeout { file "(timeout) purge_tests" }
+ }
+
+ send_gdb "x/4i insert_tests\n"
+ gdb_expect {
+ -re "
+.*idtlba r4,\\(sr0,r5\\).*
+.*iitlba r4,\\(sr0,r5\\).*
+.*idtlbp r4,\\(sr0,r5\\).*
+.*iitlbp r4,\\(sr0,r5\\).*
+.*$gdb_prompt $" { pass "insert_tests" }
+ -re "$gdb_prompt $" { fail "insert_tests" }
+ timeout { file "(timeout) insert_tests" }
+ }
+
+}
+
+proc all_fpu_memory_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/20i fpu_memory_indexing_tests\n"
+ gdb_expect {
+ -re "
+.*fldwx r4\\(sr0,r5\\),fr6.*
+.*fldwx,s r4\\(sr0,r5\\),fr6.*
+.*fldwx,m r4\\(sr0,r5\\),fr6.*
+.*fldwx,sm r4\\(sr0,r5\\),fr6.*
+.*flddx r4\\(sr0,r5\\),fr6.*
+.*flddx,s r4\\(sr0,r5\\),fr6.*
+.*flddx,m r4\\(sr0,r5\\),fr6.*
+.*flddx,sm r4\\(sr0,r5\\),fr6.*
+.*fstwx fr6,r4\\(sr0,r5\\).*
+.*fstwx,s fr6,r4\\(sr0,r5\\).*
+.*fstwx,m fr6,r4\\(sr0,r5\\).*
+.*fstwx,sm fr6,r4\\(sr0,r5\\).*
+.*fstdx fr6,r4\\(sr0,r5\\).*
+.*fstdx,s fr6,r4\\(sr0,r5\\).*
+.*fstdx,m fr6,r4\\(sr0,r5\\).*
+.*fstdx,sm fr6,r4\\(sr0,r5\\).*
+.*fstqx fr6,r4\\(sr0,r5\\).*
+.*fstqx,s fr6,r4\\(sr0,r5\\).*
+.*fstqx,m fr6,r4\\(sr0,r5\\).*
+.*fstqx,sm fr6,r4\\(sr0,r5\\).*
+.*$gdb_prompt $" { pass "fpu_memory_indexing_tests" }
+ -re "$gdb_prompt $" { fail "fpu_memory_indexing_tests" }
+ timeout { file "(timeout) fpu_memory_indexing_tests" }
+ }
+
+ send_gdb "x/15i fpu_short_memory_tests\n"
+ gdb_expect {
+ -re "
+.*fldws 0\\(sr0,r5\\),fr6.*
+.*fldws,mb 0\\(sr0,r5\\),fr6.*
+.*fldws,ma 0\\(sr0,r5\\),fr6.*
+.*fldds 0\\(sr0,r5\\),fr6.*
+.*fldds,mb 0\\(sr0,r5\\),fr6.*
+.*fldds,ma 0\\(sr0,r5\\),fr6.*
+.*fstws fr6,0\\(sr0,r5\\).*
+.*fstws,mb fr6,0\\(sr0,r5\\).*
+.*fstws,ma fr6,0\\(sr0,r5\\).*
+.*fstds fr6,0\\(sr0,r5\\).*
+.*fstds,mb fr6,0\\(sr0,r5\\).*
+.*fstds,ma fr6,0\\(sr0,r5\\).*
+.*fstqs fr6,0\\(sr0,r5\\).*
+.*fstqs,mb fr6,0\\(sr0,r5\\).*
+.*fstqs,ma fr6,0\\(sr0,r5\\).*
+.*$gdb_prompt $" { pass "fpu_short_memory_tests" }
+ -re "$gdb_prompt $" { fail "fpu_short_memory_tests" }
+ timeout { file "(timeout) fpu_short_memory_tests" }
+ }
+
+}
+
+proc all_fpu_computational_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/1i fpu_misc_tests\n"
+ gdb_expect {
+ -re "
+.*ftest.*
+.*$gdb_prompt $" { pass "fpu_misc_tests" }
+ -re "$gdb_prompt $" { fail "fpu_misc_tests" }
+ timeout { file "(timeout) fpu_misc_tests" }
+ }
+
+ set fpu_two_op_insns [list {fcpy} {fabs} {fsqrt} {frnd} ]
+
+ foreach i $fpu_two_op_insns {
+ send_gdb "x/5i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i,sgl fr5,fr10.*
+.*$i,dbl fr5,fr10.*
+.*$i,quad fr5,fr10.*
+.*$i,sgl fr20,fr24.*
+.*$i,dbl fr20,fr24.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ set fpu_conversions [list {fcnvff} {fcnvxf} {fcnvfx} {fcnvfxt} ]
+
+ foreach i $fpu_conversions {
+ send_gdb "x/18i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i,sgl,sgl fr5,fr10.*
+.*$i,sgl,dbl fr5,fr10.*
+.*$i,sgl,quad fr5,fr10.*
+.*$i,dbl,sgl fr5,fr10.*
+.*$i,dbl,dbl fr5,fr10.*
+.*$i,dbl,quad fr5,fr10.*
+.*$i,quad,sgl fr5,fr10.*
+.*$i,quad,dbl fr5,fr10.*
+.*$i,quad,quad fr5,fr10.*
+.*$i,sgl,sgl fr20,fr24.*
+.*$i,sgl,dbl fr20,fr24.*
+.*$i,sgl,quad fr20,fr24.*
+.*$i,dbl,sgl fr20,fr24.*
+.*$i,dbl,dbl fr20,fr24.*
+.*$i,dbl,quad fr20,fr24.*
+.*$i,quad,sgl fr20,fr24.*
+.*$i,quad,dbl fr20,fr24.*
+.*$i,quad,quad fr20,fr24.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ set fpu_three_op_insns [list {fadd} {fsub} {fmpy} {fdiv} {frem} ]
+
+ foreach i $fpu_three_op_insns {
+ send_gdb "x/6i $i"; send_gdb "_tests\n"
+ gdb_expect {
+ -re "
+.*$i,sgl fr4,fr8,fr12.*
+.*$i,dbl fr4,fr8,fr12.*
+.*$i,quad fr4,fr8,fr12.*
+.*$i,sgl fr20,fr24,fr28.*
+.*$i,dbl fr20,fr24,fr28.*
+.*$i,quad fr20,fr24,fr28.*
+.*$gdb_prompt $" { pass "$i tests" }
+ -re "$gdb_prompt $" { fail "$i tests" }
+ timeout { fail "(timeout) $i tests" }
+ }
+ }
+
+ send_gdb "x/4i fmpy_addsub_tests\n"
+ gdb_expect {
+ -re "
+.*fmpyadd,sgl fr16,fr17,fr18,fr19,fr20.*
+.*fmpyadd,dbl fr16,fr17,fr18,fr19,fr20.*
+.*fmpysub,sgl fr16,fr17,fr18,fr19,fr20.*
+.*fmpysub,dbl fr16,fr17,fr18,fr19,fr20.*
+.*$gdb_prompt $" { pass "fmpy_addsub_tests" }
+ -re "$gdb_prompt $" { fail "fmpy_addsub_tests" }
+ timeout { fail "(timeout) fmpy_addsub_tests" }
+ }
+
+ send_gdb "x/i xmpyu_tests\n"
+ gdb_expect {
+ -re "
+.*xmpyu fr4,fr5,fr6.*
+.*$gdb_prompt $" {pass "xmpyu_tests" }
+ -re "$gdb_prompt $" {fail "xmpyu_tests" }
+ timeout { fail "(timeout) xmpyu_tests" }
+ }
+
+}
+
+proc all_fpu_comparison_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ set fpu_comparison_formats [list {sgl} {dbl} {quad} ]
+
+ foreach i $fpu_comparison_formats {
+ send_gdb "x/8i fcmp_$i"; send_gdb "_tests_1\n"
+ gdb_expect {
+ -re "
+.*fcmp,$i,false\\? fr4,fr5.*
+.*fcmp,$i,false fr4,fr5.*
+.*fcmp,$i,\\? fr4,fr5.*
+.*fcmp,$i,!<=> fr4,fr5.*
+.*fcmp,$i,= fr4,fr5.*
+.*fcmp,$i,=t fr4,fr5.*
+.*fcmp,$i,\\?= fr4,fr5.*
+.*fcmp,$i,!<> fr4,fr5.*
+.*$gdb_prompt $" { pass "$i tests (part1) " }
+ -re "$gdb_prompt $" { fail "fcmp_$i tests (part1) " }
+ timeout { fail "(timeout) fcmp_$i tests (part1) " }
+ }
+
+ send_gdb "x/8i fcmp_$i"; send_gdb "_tests_2\n"
+ gdb_expect {
+ -re "
+.*fcmp,$i,!\\?>= fr4,fr5.*
+.*fcmp,$i,< fr4,fr5.*
+.*fcmp,$i,\\?< fr4,fr5.*
+.*fcmp,$i,!>= fr4,fr5.*
+.*fcmp,$i,!\\?> fr4,fr5.*
+.*fcmp,$i,<= fr4,fr5.*
+.*fcmp,$i,\\?<= fr4,fr5.*
+.*fcmp,$i,!> fr4,fr5.*
+.*$gdb_prompt $" { pass "$i tests (part2) " }
+ -re "$gdb_prompt $" { fail "fcmp_$i tests (part2) " }
+ timeout { fail "(timeout) fcmp_$i tests (part2) " }
+ }
+
+ send_gdb "x/8i fcmp_$i"; send_gdb "_tests_3\n"
+ gdb_expect {
+ -re "
+.*fcmp,$i,!\\?<= fr4,fr5.*
+.*fcmp,$i,> fr4,fr5.*
+.*fcmp,$i,\\?> fr4,fr5.*
+.*fcmp,$i,!<= fr4,fr5.*
+.*fcmp,$i,!\\?< fr4,fr5.*
+.*fcmp,$i,>= fr4,fr5.*
+.*fcmp,$i,\\?>= fr4,fr5.*
+.*fcmp,$i,!< fr4,fr5.*
+.*$gdb_prompt $" { pass "$i tests (part3) " }
+ -re "$gdb_prompt $" { fail "fcmp_$i tests (part3) " }
+ timeout { fail "(timeout) fcmp_$i tests (part3) " }
+ }
+
+ send_gdb "x/8i fcmp_$i"; send_gdb "_tests_4\n"
+ gdb_expect {
+ -re "
+.*fcmp,$i,!\\?= fr4,fr5.*
+.*fcmp,$i,<> fr4,fr5.*
+.*fcmp,$i,!= fr4,fr5.*
+.*fcmp,$i,!=t fr4,fr5.*
+.*fcmp,$i,!\\? fr4,fr5.*
+.*fcmp,$i,<=> fr4,fr5.*
+.*fcmp,$i,true\\? fr4,fr5.*
+.*fcmp,$i,true fr4,fr5.*
+.*$gdb_prompt $" { pass "$i tests (part4) " }
+ -re "$gdb_prompt $" { fail "fcmp_$i tests (part4) " }
+ timeout { fail "(timeout) fcmp_$i tests (part4) " }
+ }
+ }
+}
+
+proc all_special_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/4i special_tests\n"
+ gdb_expect {
+ -re "
+.*gfw r4\\(sr0,r5\\).*
+.*gfw,m r4\\(sr0,r5\\).*
+.*gfr r4\\(sr0,r5\\).*
+.*gfr,m r4\\(sr0,r5\\).*
+.*$gdb_prompt $" { pass "special tests" }
+ -re "$gdb_prompt $" { fail "special tests" }
+ timeout { fail "(timeout) special tests " }
+ }
+
+}
+
+proc all_sfu_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/16i sfu_tests\n"
+ gdb_expect {
+ -re "
+.*spop0,4,5.*
+.*spop0,4,73.*
+.*spop0,4,5,n.*
+.*spop0,4,73,n.*
+.*spop1,4,5 r5.*
+.*spop1,4,73 r5.*
+.*spop1,4,5,n r5.*
+.*spop1,4,73,n r5.*
+.*spop2,4,5 r5.*
+.*spop2,4,73 r5.*
+.*spop2,4,5,n r5.*
+.*spop2,4,73,n r5.*
+.*spop3,4,5 r5,r6.*
+.*spop3,4,73 r5,r6.*
+.*spop3,4,5,n r5,r6.*
+.*spop3,4,73,n r5,r6.*
+.*$gdb_prompt $" { pass "sfu tests" }
+ -re "$gdb_prompt $" { fail "sfu tests" }
+ timeout { fail "(timeout) sfu tests " }
+ }
+}
+
+proc all_copr_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/4i copr_tests\n"
+ gdb_expect {
+ -re "
+.*copr,4,5.*
+.*copr,4,73.*
+.*copr,4,5,n.*
+.*copr,4,73,n.*
+.*$gdb_prompt $" { pass "copr tests" }
+ -re "$gdb_prompt $" { fail "copr tests" }
+ timeout { fail "(timeout) copr tests " }
+ }
+}
+
+proc all_copr_mem_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/8i copr_indexing_load\n"
+ gdb_expect {
+ -re "
+.*cldwx,4 r5\\(sr0,r4\\),r26.*
+.*cldwx,4,s r5\\(sr0,r4\\),r26.*
+.*cldwx,4,m r5\\(sr0,r4\\),r26.*
+.*cldwx,4,sm r5\\(sr0,r4\\),r26.*
+.*clddx,4 r5\\(sr0,r4\\),r26.*
+.*clddx,4,s r5\\(sr0,r4\\),r26.*
+.*clddx,4,m r5\\(sr0,r4\\),r26.*
+.*clddx,4,sm r5\\(sr0,r4\\),r26.*
+.*$gdb_prompt $" { pass "copr indexed load tests" }
+ -re "$gdb_prompt $" { fail "copr indexed load tests" }
+ timeout { fail "(timeout) copr indexed load tests " }
+ }
+
+ send_gdb "x/8i copr_indexing_store\n"
+ gdb_expect {
+ -re "
+.*cstwx,4 r26,r5\\(sr0,r4\\).*
+.*cstwx,4,s r26,r5\\(sr0,r4\\).*
+.*cstwx,4,m r26,r5\\(sr0,r4\\).*
+.*cstwx,4,sm r26,r5\\(sr0,r4\\).*
+.*cstdx,4 r26,r5\\(sr0,r4\\).*
+.*cstdx,4,s r26,r5\\(sr0,r4\\).*
+.*cstdx,4,m r26,r5\\(sr0,r4\\).*
+.*cstdx,4,sm r26,r5\\(sr0,r4\\).*
+.*$gdb_prompt $" { pass "copr indexed store tests" }
+ -re "$gdb_prompt $" { fail "copr indexed store tests" }
+ timeout { fail "(timeout) copr indexed load tests " }
+ }
+
+ send_gdb "x/12i copr_short_memory\n"
+ gdb_expect {
+ -re "
+.*cldws,4 0\\(sr0,r4\\),r26.*
+.*cldws,4,mb 0\\(sr0,r4\\),r26.*
+.*cldws,4,ma 0\\(sr0,r4\\),r26.*
+.*cldds,4 0\\(sr0,r4\\),r26.*
+.*cldds,4,mb 0\\(sr0,r4\\),r26.*
+.*cldds,4,ma 0\\(sr0,r4\\),r26.*
+.*cstws,4 r26,0\\(sr0,r4\\).*
+.*cstws,4,mb r26,0\\(sr0,r4\\).*
+.*cstws,4,ma r26,0\\(sr0,r4\\).*
+.*cstds,4 r26,0\\(sr0,r4\\).*
+.*cstds,4,mb r26,0\\(sr0,r4\\).*
+.*cstds,4,ma r26,0\\(sr0,r4\\).*
+.*$gdb_prompt $" { pass "copr short memory tests" }
+ -re "$gdb_prompt $" { fail "copr short memory tests" }
+ timeout { fail "(timeout) copr short memory tests " }
+ }
+}
+
+proc fmemLRbug_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/12i fmemLRbug_tests_1\n"
+ gdb_expect {
+ -re "
+.*fstws fr6R,0\\(sr0,r26\\).*
+.*fstws fr6,4\\(sr0,r26\\).*
+.*fstws fr6,8\\(sr0,r26\\).*
+.*fstds fr6,0\\(sr0,r26\\).*
+.*fstds fr6,4\\(sr0,r26\\).*
+.*fstds fr6,8\\(sr0,r26\\).*
+.*fldws 0\\(sr0,r26\\),fr6R.*
+.*fldws 4\\(sr0,r26\\),fr6.*
+.*fldws 8\\(sr0,r26\\),fr6.*
+.*fldds 0\\(sr0,r26\\),fr6.*
+.*fldds 4\\(sr0,r26\\),fr6.*
+.*fldds 8\\(sr0,r26\\),fr6.*
+.*$gdb_prompt $" { pass "fmem LR register selector tests (part1)" }
+ -re "$gdb_prompt $" { fail "fmem LR register selector tests (part1)" }
+ timeout { fail "(timeout) fmem LR register selector tests (part1)" }
+ }
+
+ send_gdb "x/12i fmemLRbug_tests_2\n"
+ gdb_expect {
+ -re "
+.*fstws fr6R,0\\(sr0,r26\\).*
+.*fstws fr6,4\\(sr0,r26\\).*
+.*fstws fr6,8\\(sr0,r26\\).*
+.*fstds fr6,0\\(sr0,r26\\).*
+.*fstds fr6,4\\(sr0,r26\\).*
+.*fstds fr6,8\\(sr0,r26\\).*
+.*fldws 0\\(sr0,r26\\),fr6R.*
+.*fldws 4\\(sr0,r26\\),fr6.*
+.*fldws 8\\(sr0,r26\\),fr6.*
+.*fldds 0\\(sr0,r26\\),fr6.*
+.*fldds 4\\(sr0,r26\\),fr6.*
+.*fldds 8\\(sr0,r26\\),fr6.*
+.*$gdb_prompt $" { pass "fmem LR register selector tests (part2)" }
+ -re "$gdb_prompt $" { fail "fmem LR register selector tests (part2)" }
+ timeout { fail "(timeout) fmem LR register selector tests (part2)" }
+ }
+
+ send_gdb "x/12i fmemLRbug_tests_3\n"
+ gdb_expect {
+ -re "
+.*fstwx fr6R,r25\\(sr0,r26\\).*
+.*fstwx fr6,r25\\(sr0,r26\\).*
+.*fstwx fr6,r25\\(sr0,r26\\).*
+.*fstdx fr6,r25\\(sr0,r26\\).*
+.*fstdx fr6,r25\\(sr0,r26\\).*
+.*fstdx fr6,r25\\(sr0,r26\\).*
+.*fldwx r25\\(sr0,r26\\),fr6R.*
+.*fldwx r25\\(sr0,r26\\),fr6.*
+.*fldwx r25\\(sr0,r26\\),fr6.*
+.*flddx r25\\(sr0,r26\\),fr6.*
+.*flddx r25\\(sr0,r26\\),fr6.*
+.*flddx r25\\(sr0,r26\\),fr6.*
+.*$gdb_prompt $" { pass "fmem LR register selector tests (part3)" }
+ -re "$gdb_prompt $" { fail "fmem LR register selector tests (part3)" }
+ timeout { fail "(timeout) fmem LR register selector tests (part3)" }
+ }
+
+ send_gdb "x/12i fmemLRbug_tests_4\n"
+ gdb_expect {
+ -re "
+.*fstwx fr6R,r25\\(sr0,r26\\).*
+.*fstwx fr6,r25\\(sr0,r26\\).*
+.*fstwx fr6,r25\\(sr0,r26\\).*
+.*fstdx fr6,r25\\(sr0,r26\\).*
+.*fstdx fr6,r25\\(sr0,r26\\).*
+.*fstdx fr6,r25\\(sr0,r26\\).*
+.*fldwx r25\\(sr0,r26\\),fr6R.*
+.*fldwx r25\\(sr0,r26\\),fr6.*
+.*fldwx r25\\(sr0,r26\\),fr6.*
+.*flddx r25\\(sr0,r26\\),fr6.*
+.*flddx r25\\(sr0,r26\\),fr6.*
+.*flddx r25\\(sr0,r26\\),fr6.*
+.*$gdb_prompt $" { pass "fmem LR register selector tests (part4)" }
+ -re "$gdb_prompt $" { fail "fmem LR register selector tests (part4)" }
+ timeout { fail "(timeout) fmem LR register selector tests (part4)" }
+ }
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+all_integer_memory_tests
+all_immediate_tests
+all_branch_tests
+all_integer_computational_tests
+all_system_control_tests
+all_fpu_memory_tests
+all_fpu_computational_tests
+all_fpu_comparison_tests
+all_special_tests
+all_sfu_tests
+all_copr_tests
+all_copr_mem_tests
+
+# Regression test for a bug Tege found.
+fmemLRbug_tests
diff --git a/gdb/testsuite/gdb.disasm/hppa.s b/gdb/testsuite/gdb.disasm/hppa.s
new file mode 100644
index 00000000000..593d8bfefee
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/hppa.s
@@ -0,0 +1,1738 @@
+ .SPACE $PRIVATE$
+ .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
+ .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
+ .SPACE $TEXT$
+ .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
+ .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
+ .IMPORT $global$,DATA
+ .IMPORT $$dyncall,MILLICODE
+; gcc_compiled.:
+ .SPACE $TEXT$
+ .SUBSPA $CODE$
+
+ .align 4
+ .EXPORT integer_memory_tests,CODE
+ .EXPORT integer_indexing_load,CODE
+ .EXPORT integer_load_short_memory,CODE
+ .EXPORT integer_store_short_memory,CODE
+ .EXPORT immediate_tests,CODE
+ .EXPORT branch_tests_1,CODE
+ .EXPORT branch_tests_2,CODE
+ .EXPORT movb_tests,CODE
+ .EXPORT movb_nullified_tests,CODE
+ .EXPORT movib_tests,CODE
+ .EXPORT movib_nullified_tests,CODE
+ .EXPORT comb_tests_1,CODE
+ .EXPORT comb_tests_2,CODE
+ .EXPORT comb_nullified_tests_1,CODE
+ .EXPORT comb_nullified_tests_2,CODE
+ .EXPORT comib_tests_1,CODE
+ .EXPORT comib_tests_2,CODE
+ .EXPORT comib_nullified_tests_1,CODE
+ .EXPORT comib_nullified_tests_2,CODE
+ .EXPORT addb_tests_1,CODE
+ .EXPORT addb_tests_2,CODE
+ .EXPORT addb_nullified_tests_1,CODE
+ .EXPORT addb_nullified_tests_2,CODE
+ .EXPORT addib_tests_1,CODE
+ .EXPORT addib_tests_2,CODE
+ .EXPORT addib_nullified_tests_1,CODE
+ .EXPORT addib_nullified_tests_2,CODE
+ .EXPORT bb_tests,CODE
+ .EXPORT add_tests,CODE
+ .EXPORT addl_tests,CODE
+ .EXPORT addo_tests,CODE
+ .EXPORT addc_tests,CODE
+ .EXPORT addco_tests,CODE
+ .EXPORT sh1add_tests,CODE
+ .EXPORT sh1addl_tests,CODE
+ .EXPORT sh1addo_tests,CODE
+ .EXPORT sh2add_tests,CODE
+ .EXPORT sh2addl_tests,CODE
+ .EXPORT sh2addo_tests,CODE
+ .EXPORT sh3add_tests,CODE
+ .EXPORT sh3addl_tests,CODE
+ .EXPORT sh3addo_tests,CODE
+ .EXPORT sub_tests,CODE
+ .EXPORT subo_tests,CODE
+ .EXPORT subb_tests,CODE
+ .EXPORT subbo_tests,CODE
+ .EXPORT subt_tests,CODE
+ .EXPORT subto_tests,CODE
+ .EXPORT ds_tests,CODE
+ .EXPORT comclr_tests,CODE
+ .EXPORT or_tests,CODE
+ .EXPORT xor_tests,CODE
+ .EXPORT and_tests,CODE
+ .EXPORT andcm_tests,CODE
+ .EXPORT uxor_tests,CODE
+ .EXPORT uaddcm_tests,CODE
+ .EXPORT uaddcmt_tests,CODE
+ .EXPORT dcor_tests,CODE
+ .EXPORT idcor_tests,CODE
+ .EXPORT addi_tests,CODE
+ .EXPORT addio_tests,CODE
+ .EXPORT addit_tests,CODE
+ .EXPORT addito_tests,CODE
+ .EXPORT subi_tests,CODE
+ .EXPORT subio_tests,CODE
+ .EXPORT comiclr_tests,CODE
+ .EXPORT vshd_tests,CODE
+ .EXPORT shd_tests,CODE
+ .EXPORT extru_tests,CODE
+ .EXPORT extrs_tests,CODE
+ .EXPORT zdep_tests,CODE
+ .EXPORT dep_tests,CODE
+ .EXPORT vextru_tests,CODE
+ .EXPORT vextrs_tests,CODE
+ .EXPORT zvdep_tests,CODE
+ .EXPORT vdep_tests,CODE
+ .EXPORT vdepi_tests,CODE
+ .EXPORT zvdepi_tests,CODE
+ .EXPORT depi_tests,CODE
+ .EXPORT zdepi_tests,CODE
+ .EXPORT system_control_tests,CODE
+ .EXPORT probe_tests,CODE
+ .EXPORT lpa_tests,CODE
+ .EXPORT purge_tests,CODE
+ .EXPORT insert_tests,CODE
+ .EXPORT fpu_misc_tests,CODE
+ .EXPORT fpu_memory_indexing_tests,CODE
+ .EXPORT fpu_short_memory_tests,CODE
+ .EXPORT fcpy_tests,CODE
+ .EXPORT fabs_tests,CODE
+ .EXPORT fsqrt_tests,CODE
+ .EXPORT frnd_tests,CODE
+ .EXPORT fcnvff_tests,CODE
+ .EXPORT fcnvxf_tests,CODE
+ .EXPORT fcnvfx_tests,CODE
+ .EXPORT fcnvfxt_tests,CODE
+ .EXPORT fadd_tests,CODE
+ .EXPORT fsub_tests,CODE
+ .EXPORT fmpy_tests,CODE
+ .EXPORT fdiv_tests,CODE
+ .EXPORT frem_tests,CODE
+ .EXPORT fcmp_sgl_tests_1,CODE
+ .EXPORT fcmp_sgl_tests_2,CODE
+ .EXPORT fcmp_sgl_tests_3,CODE
+ .EXPORT fcmp_sgl_tests_4,CODE
+ .EXPORT fcmp_dbl_tests_1,CODE
+ .EXPORT fcmp_dbl_tests_2,CODE
+ .EXPORT fcmp_dbl_tests_3,CODE
+ .EXPORT fcmp_dbl_tests_4,CODE
+ .EXPORT fcmp_quad_tests_1,CODE
+ .EXPORT fcmp_quad_tests_2,CODE
+ .EXPORT fcmp_quad_tests_3,CODE
+ .EXPORT fcmp_quad_tests_4,CODE
+ .EXPORT fmpy_addsub_tests,CODE
+ .EXPORT xmpyu_tests,CODE
+ .EXPORT special_tests,CODE
+ .EXPORT sfu_tests,CODE
+ .EXPORT copr_tests,CODE
+ .EXPORT copr_indexing_load,CODE
+ .EXPORT copr_indexing_store,CODE
+ .EXPORT copr_short_memory,CODE
+ .EXPORT fmemLRbug_tests_1,CODE
+ .EXPORT fmemLRbug_tests_2,CODE
+ .EXPORT fmemLRbug_tests_3,CODE
+ .EXPORT fmemLRbug_tests_4,CODE
+ .EXPORT main,CODE
+ .EXPORT main,ENTRY,PRIV_LEV=3,RTNVAL=GR
+main
+ .PROC
+ .CALLINFO FRAME=64,NO_CALLS,SAVE_SP
+ .ENTRY
+ copy %r4,%r1
+ copy %r30,%r4
+ stwm %r1,64(0,%r30)
+; First memory reference instructions.
+; Should try corner cases for each field extraction.
+; Should deal with s == 0 case somehow?!?
+integer_memory_tests
+ ldw 0(0,%r4),%r26
+ ldh 0(0,%r4),%r26
+ ldb 0(0,%r4),%r26
+ stw %r26,0(0,%r4)
+ sth %r26,0(0,%r4)
+ stb %r26,0(0,%r4)
+
+; Should make sure pre/post modes are recognized correctly.
+ ldwm 0(0,%r4),%r26
+ stwm %r26,0(0,%r4)
+
+integer_indexing_load
+ ldwx %r5(0,%r4),%r26
+ ldwx,s %r5(0,%r4),%r26
+ ldwx,m %r5(0,%r4),%r26
+ ldwx,sm %r5(0,%r4),%r26
+ ldhx %r5(0,%r4),%r26
+ ldhx,s %r5(0,%r4),%r26
+ ldhx,m %r5(0,%r4),%r26
+ ldhx,sm %r5(0,%r4),%r26
+ ldbx %r5(0,%r4),%r26
+ ldbx,s %r5(0,%r4),%r26
+ ldbx,m %r5(0,%r4),%r26
+ ldbx,sm %r5(0,%r4),%r26
+ ldwax %r5(%r4),%r26
+ ldwax,s %r5(%r4),%r26
+ ldwax,m %r5(%r4),%r26
+ ldwax,sm %r5(%r4),%r26
+ ldcwx %r5(0,%r4),%r26
+ ldcwx,s %r5(0,%r4),%r26
+ ldcwx,m %r5(0,%r4),%r26
+ ldcwx,sm %r5(0,%r4),%r26
+
+integer_load_short_memory
+ ldws 0(0,%r4),%r26
+ ldws,mb 0(0,%r4),%r26
+ ldws,ma 0(0,%r4),%r26
+ ldhs 0(0,%r4),%r26
+ ldhs,mb 0(0,%r4),%r26
+ ldhs,ma 0(0,%r4),%r26
+ ldbs 0(0,%r4),%r26
+ ldbs,mb 0(0,%r4),%r26
+ ldbs,ma 0(0,%r4),%r26
+ ldwas 0(%r4),%r26
+ ldwas,mb 0(%r4),%r26
+ ldwas,ma 0(%r4),%r26
+ ldcws 0(0,%r4),%r26
+ ldcws,mb 0(0,%r4),%r26
+ ldcws,ma 0(0,%r4),%r26
+
+integer_store_short_memory
+ stws %r26,0(0,%r4)
+ stws,mb %r26,0(0,%r4)
+ stws,ma %r26,0(0,%r4)
+ sths %r26,0(0,%r4)
+ sths,mb %r26,0(0,%r4)
+ sths,ma %r26,0(0,%r4)
+ stbs %r26,0(0,%r4)
+ stbs,mb %r26,0(0,%r4)
+ stbs,ma %r26,0(0,%r4)
+ stwas %r26,0(%r4)
+ stwas,mb %r26,0(%r4)
+ stwas,ma %r26,0(%r4)
+ stbys %r26,0(0,%r4)
+ stbys,b %r26,0(0,%r4)
+ stbys,e %r26,0(0,%r4)
+ stbys,b,m %r26,0(0,%r4)
+ stbys,e,m %r26,0(0,%r4)
+
+; Immediate instructions.
+immediate_tests
+ ldo 5(%r26),%r26
+ ldil L%0xdeadbeef,%r26
+ addil L%0xdeadbeef,%r5
+
+; Lots of branch instructions.
+; blr with %r0 as return pointer should really be just br <target>,
+; but the assemblers can't handle it.
+branch_tests_1
+ bl main,%r2
+ bl,n main,%r2
+ b main
+ b,n main
+ gate main,%r2
+ gate,n main,%r2
+ blr %r4,%r2
+ blr,n %r4,%r2
+ blr %r4,%r0
+ blr,n %r4,%r0
+branch_tests_2
+ bv 0(%r2)
+ bv,n 0(%r2)
+ be 0x1234(%sr1,%r2)
+ be,n 0x1234(%sr1,%r2)
+ ble 0x1234(%sr1,%r2)
+ ble,n 0x1234(%sr1,%r2)
+
+; GAS can't assemble movb,n or movib,n.
+movb_tests
+ movb %r4,%r26,movb_tests
+ movb,= %r4,%r26,movb_tests
+ movb,< %r4,%r26,movb_tests
+ movb,od %r4,%r26,movb_tests
+ movb,tr %r4,%r26,movb_tests
+ movb,<> %r4,%r26,movb_tests
+ movb,>= %r4,%r26,movb_tests
+ movb,ev %r4,%r26,movb_tests
+movb_nullified_tests
+ movb,n %r4,%r26,movb_tests
+ movb,=,n %r4,%r26,movb_tests
+ movb,<,n %r4,%r26,movb_tests
+ movb,od,n %r4,%r26,movb_tests
+ movb,tr,n %r4,%r26,movb_tests
+ movb,<>,n %r4,%r26,movb_tests
+ movb,>=,n %r4,%r26,movb_tests
+ movb,ev,n %r4,%r26,movb_tests
+
+movib_tests
+ movib 5,%r26,movib_tests
+ movib,= 5,%r26,movib_tests
+ movib,< 5,%r26,movib_tests
+ movib,od 5,%r26,movib_tests
+ movib,tr 5,%r26,movib_tests
+ movib,<> 5,%r26,movib_tests
+ movib,>= 5,%r26,movib_tests
+ movib,ev 5,%r26,movib_tests
+movib_nullified_tests
+ movib,n 5,%r26,movib_tests
+ movib,=,n 5,%r26,movib_tests
+ movib,<,n 5,%r26,movib_tests
+ movib,od,n 5,%r26,movib_tests
+ movib,tr,n 5,%r26,movib_tests
+ movib,<>,n 5,%r26,movib_tests
+ movib,>=,n 5,%r26,movib_tests
+ movib,ev,n 5,%r26,movib_tests
+
+comb_tests_1
+ comb %r0,%r4,comb_tests_1
+ comb,= %r0,%r4,comb_tests_1
+ comb,< %r0,%r4,comb_tests_1
+ comb,<= %r0,%r4,comb_tests_1
+ comb,<< %r0,%r4,comb_tests_1
+ comb,<<= %r0,%r4,comb_tests_1
+ comb,sv %r0,%r4,comb_tests_1
+ comb,od %r0,%r4,comb_tests_1
+
+comb_tests_2
+ comb,tr %r0,%r4,comb_tests_2
+ comb,<> %r0,%r4,comb_tests_2
+ comb,>= %r0,%r4,comb_tests_2
+ comb,> %r0,%r4,comb_tests_2
+ comb,>>= %r0,%r4,comb_tests_2
+ comb,>> %r0,%r4,comb_tests_2
+ comb,nsv %r0,%r4,comb_tests_2
+ comb,ev %r0,%r4,comb_tests_2
+
+comb_nullified_tests_1
+ comb,n %r0,%r4,comb_tests_1
+ comb,=,n %r0,%r4,comb_tests_1
+ comb,<,n %r0,%r4,comb_tests_1
+ comb,<=,n %r0,%r4,comb_tests_1
+ comb,<<,n %r0,%r4,comb_tests_1
+ comb,<<=,n %r0,%r4,comb_tests_1
+ comb,sv,n %r0,%r4,comb_tests_1
+ comb,od,n %r0,%r4,comb_tests_1
+
+comb_nullified_tests_2
+ comb,tr,n %r0,%r4,comb_tests_2
+ comb,<>,n %r0,%r4,comb_tests_2
+ comb,>=,n %r0,%r4,comb_tests_2
+ comb,>,n %r0,%r4,comb_tests_2
+ comb,>>=,n %r0,%r4,comb_tests_2
+ comb,>>,n %r0,%r4,comb_tests_2
+ comb,nsv,n %r0,%r4,comb_tests_2
+ comb,ev,n %r0,%r4,comb_tests_2
+
+comib_tests_1
+ comib 0,%r4,comib_tests_1
+ comib,= 0,%r4,comib_tests_1
+ comib,< 0,%r4,comib_tests_1
+ comib,<= 0,%r4,comib_tests_1
+ comib,<< 0,%r4,comib_tests_1
+ comib,<<= 0,%r4,comib_tests_1
+ comib,sv 0,%r4,comib_tests_1
+ comib,od 0,%r4,comib_tests_1
+
+comib_tests_2
+ comib,tr 0,%r4,comib_tests_2
+ comib,<> 0,%r4,comib_tests_2
+ comib,>= 0,%r4,comib_tests_2
+ comib,> 0,%r4,comib_tests_2
+ comib,>>= 0,%r4,comib_tests_2
+ comib,>> 0,%r4,comib_tests_2
+ comib,nsv 0,%r4,comib_tests_2
+ comib,ev 0,%r4,comib_tests_2
+
+comib_nullified_tests_1
+ comib,n 0,%r4,comib_tests_1
+ comib,=,n 0,%r4,comib_tests_1
+ comib,<,n 0,%r4,comib_tests_1
+ comib,<=,n 0,%r4,comib_tests_1
+ comib,<<,n 0,%r4,comib_tests_1
+ comib,<<=,n 0,%r4,comib_tests_1
+ comib,sv,n 0,%r4,comib_tests_1
+ comib,od,n 0,%r4,comib_tests_1
+
+comib_nullified_tests_2
+ comib,tr,n 0,%r4,comib_tests_2
+ comib,<>,n 0,%r4,comib_tests_2
+ comib,>=,n 0,%r4,comib_tests_2
+ comib,>,n 0,%r4,comib_tests_2
+ comib,>>=,n 0,%r4,comib_tests_2
+ comib,>>,n 0,%r4,comib_tests_2
+ comib,nsv,n 0,%r4,comib_tests_2
+ comib,ev,n 0,%r4,comib_tests_2
+
+addb_tests_1
+ addb %r1,%r4,addb_tests_1
+ addb,= %r1,%r4,addb_tests_1
+ addb,< %r1,%r4,addb_tests_1
+ addb,<= %r1,%r4,addb_tests_1
+ addb,nuv %r1,%r4,addb_tests_1
+ addb,znv %r1,%r4,addb_tests_1
+ addb,sv %r1,%r4,addb_tests_1
+ addb,od %r1,%r4,addb_tests_1
+
+addb_tests_2
+ addb,tr %r1,%r4,addb_tests_2
+ addb,<> %r1,%r4,addb_tests_2
+ addb,>= %r1,%r4,addb_tests_2
+ addb,> %r1,%r4,addb_tests_2
+ addb,uv %r1,%r4,addb_tests_2
+ addb,vnz %r1,%r4,addb_tests_2
+ addb,nsv %r1,%r4,addb_tests_2
+ addb,ev %r1,%r4,addb_tests_2
+
+addb_nullified_tests_1
+ addb,n %r1,%r4,addb_tests_1
+ addb,=,n %r1,%r4,addb_tests_1
+ addb,<,n %r1,%r4,addb_tests_1
+ addb,<=,n %r1,%r4,addb_tests_1
+ addb,nuv,n %r1,%r4,addb_tests_1
+ addb,znv,n %r1,%r4,addb_tests_1
+ addb,sv,n %r1,%r4,addb_tests_1
+ addb,od,n %r1,%r4,addb_tests_1
+
+addb_nullified_tests_2
+ addb,tr,n %r1,%r4,addb_tests_2
+ addb,<>,n %r1,%r4,addb_tests_2
+ addb,>=,n %r1,%r4,addb_tests_2
+ addb,>,n %r1,%r4,addb_tests_2
+ addb,uv,n %r1,%r4,addb_tests_2
+ addb,vnz,n %r1,%r4,addb_tests_2
+ addb,nsv,n %r1,%r4,addb_tests_2
+ addb,ev,n %r1,%r4,addb_tests_2
+
+addib_tests_1
+ addib -1,%r4,addib_tests_1
+ addib,= -1,%r4,addib_tests_1
+ addib,< -1,%r4,addib_tests_1
+ addib,<= -1,%r4,addib_tests_1
+ addib,nuv -1,%r4,addib_tests_1
+ addib,znv -1,%r4,addib_tests_1
+ addib,sv -1,%r4,addib_tests_1
+ addib,od -1,%r4,addib_tests_1
+
+addib_tests_2
+ addib,tr -1,%r4,addib_tests_2
+ addib,<> -1,%r4,addib_tests_2
+ addib,>= -1,%r4,addib_tests_2
+ addib,> -1,%r4,addib_tests_2
+ addib,uv -1,%r4,addib_tests_2
+ addib,vnz -1,%r4,addib_tests_2
+ addib,nsv -1,%r4,addib_tests_2
+ addib,ev -1,%r4,addib_tests_2
+
+addib_nullified_tests_1
+ addib,n -1,%r4,addib_tests_1
+ addib,=,n -1,%r4,addib_tests_1
+ addib,<,n -1,%r4,addib_tests_1
+ addib,<=,n -1,%r4,addib_tests_1
+ addib,nuv,n -1,%r4,addib_tests_1
+ addib,znv,n -1,%r4,addib_tests_1
+ addib,sv,n -1,%r4,addib_tests_1
+ addib,od,n -1,%r4,addib_tests_1
+
+addib_nullified_tests_2
+ addib,tr,n -1,%r4,addib_tests_2
+ addib,<>,n -1,%r4,addib_tests_2
+ addib,>=,n -1,%r4,addib_tests_2
+ addib,>,n -1,%r4,addib_tests_2
+ addib,uv,n -1,%r4,addib_tests_2
+ addib,vnz,n -1,%r4,addib_tests_2
+ addib,nsv,n -1,%r4,addib_tests_2
+ addib,ev,n -1,%r4,addib_tests_2
+
+
+; Needs to check lots of stuff (like corner bit cases)
+bb_tests
+ bvb,< %r4,bb_tests
+ bvb,>= %r4,bb_tests
+ bvb,<,n %r4,bb_tests
+ bvb,>=,n %r4,bb_tests
+ bb,< %r4,5,bb_tests
+ bb,>= %r4,5,bb_tests
+ bb,<,n %r4,5,bb_tests
+ bb,>=,n %r4,5,bb_tests
+
+; Computational instructions
+add_tests
+ add %r4,%r5,%r6
+ add,= %r4,%r5,%r6
+ add,< %r4,%r5,%r6
+ add,<= %r4,%r5,%r6
+ add,nuv %r4,%r5,%r6
+ add,znv %r4,%r5,%r6
+ add,sv %r4,%r5,%r6
+ add,od %r4,%r5,%r6
+ add,tr %r4,%r5,%r6
+ add,<> %r4,%r5,%r6
+ add,>= %r4,%r5,%r6
+ add,> %r4,%r5,%r6
+ add,uv %r4,%r5,%r6
+ add,vnz %r4,%r5,%r6
+ add,nsv %r4,%r5,%r6
+ add,ev %r4,%r5,%r6
+
+addl_tests
+ addl %r4,%r5,%r6
+ addl,= %r4,%r5,%r6
+ addl,< %r4,%r5,%r6
+ addl,<= %r4,%r5,%r6
+ addl,nuv %r4,%r5,%r6
+ addl,znv %r4,%r5,%r6
+ addl,sv %r4,%r5,%r6
+ addl,od %r4,%r5,%r6
+ addl,tr %r4,%r5,%r6
+ addl,<> %r4,%r5,%r6
+ addl,>= %r4,%r5,%r6
+ addl,> %r4,%r5,%r6
+ addl,uv %r4,%r5,%r6
+ addl,vnz %r4,%r5,%r6
+ addl,nsv %r4,%r5,%r6
+ addl,ev %r4,%r5,%r6
+
+addo_tests
+ addo %r4,%r5,%r6
+ addo,= %r4,%r5,%r6
+ addo,< %r4,%r5,%r6
+ addo,<= %r4,%r5,%r6
+ addo,nuv %r4,%r5,%r6
+ addo,znv %r4,%r5,%r6
+ addo,sv %r4,%r5,%r6
+ addo,od %r4,%r5,%r6
+ addo,tr %r4,%r5,%r6
+ addo,<> %r4,%r5,%r6
+ addo,>= %r4,%r5,%r6
+ addo,> %r4,%r5,%r6
+ addo,uv %r4,%r5,%r6
+ addo,vnz %r4,%r5,%r6
+ addo,nsv %r4,%r5,%r6
+ addo,ev %r4,%r5,%r6
+
+addc_tests
+ addc %r4,%r5,%r6
+ addc,= %r4,%r5,%r6
+ addc,< %r4,%r5,%r6
+ addc,<= %r4,%r5,%r6
+ addc,nuv %r4,%r5,%r6
+ addc,znv %r4,%r5,%r6
+ addc,sv %r4,%r5,%r6
+ addc,od %r4,%r5,%r6
+ addc,tr %r4,%r5,%r6
+ addc,<> %r4,%r5,%r6
+ addc,>= %r4,%r5,%r6
+ addc,> %r4,%r5,%r6
+ addc,uv %r4,%r5,%r6
+ addc,vnz %r4,%r5,%r6
+ addc,nsv %r4,%r5,%r6
+ addc,ev %r4,%r5,%r6
+
+addco_tests
+ addco %r4,%r5,%r6
+ addco,= %r4,%r5,%r6
+ addco,< %r4,%r5,%r6
+ addco,<= %r4,%r5,%r6
+ addco,nuv %r4,%r5,%r6
+ addco,znv %r4,%r5,%r6
+ addco,sv %r4,%r5,%r6
+ addco,od %r4,%r5,%r6
+ addco,tr %r4,%r5,%r6
+ addco,<> %r4,%r5,%r6
+ addco,>= %r4,%r5,%r6
+ addco,> %r4,%r5,%r6
+ addco,uv %r4,%r5,%r6
+ addco,vnz %r4,%r5,%r6
+ addco,nsv %r4,%r5,%r6
+ addco,ev %r4,%r5,%r6
+
+sh1add_tests
+ sh1add %r4,%r5,%r6
+ sh1add,= %r4,%r5,%r6
+ sh1add,< %r4,%r5,%r6
+ sh1add,<= %r4,%r5,%r6
+ sh1add,nuv %r4,%r5,%r6
+ sh1add,znv %r4,%r5,%r6
+ sh1add,sv %r4,%r5,%r6
+ sh1add,od %r4,%r5,%r6
+ sh1add,tr %r4,%r5,%r6
+ sh1add,<> %r4,%r5,%r6
+ sh1add,>= %r4,%r5,%r6
+ sh1add,> %r4,%r5,%r6
+ sh1add,uv %r4,%r5,%r6
+ sh1add,vnz %r4,%r5,%r6
+ sh1add,nsv %r4,%r5,%r6
+ sh1add,ev %r4,%r5,%r6
+
+sh1addl_tests
+ sh1addl %r4,%r5,%r6
+ sh1addl,= %r4,%r5,%r6
+ sh1addl,< %r4,%r5,%r6
+ sh1addl,<= %r4,%r5,%r6
+ sh1addl,nuv %r4,%r5,%r6
+ sh1addl,znv %r4,%r5,%r6
+ sh1addl,sv %r4,%r5,%r6
+ sh1addl,od %r4,%r5,%r6
+ sh1addl,tr %r4,%r5,%r6
+ sh1addl,<> %r4,%r5,%r6
+ sh1addl,>= %r4,%r5,%r6
+ sh1addl,> %r4,%r5,%r6
+ sh1addl,uv %r4,%r5,%r6
+ sh1addl,vnz %r4,%r5,%r6
+ sh1addl,nsv %r4,%r5,%r6
+ sh1addl,ev %r4,%r5,%r6
+
+sh1addo_tests
+ sh1addo %r4,%r5,%r6
+ sh1addo,= %r4,%r5,%r6
+ sh1addo,< %r4,%r5,%r6
+ sh1addo,<= %r4,%r5,%r6
+ sh1addo,nuv %r4,%r5,%r6
+ sh1addo,znv %r4,%r5,%r6
+ sh1addo,sv %r4,%r5,%r6
+ sh1addo,od %r4,%r5,%r6
+ sh1addo,tr %r4,%r5,%r6
+ sh1addo,<> %r4,%r5,%r6
+ sh1addo,>= %r4,%r5,%r6
+ sh1addo,> %r4,%r5,%r6
+ sh1addo,uv %r4,%r5,%r6
+ sh1addo,vnz %r4,%r5,%r6
+ sh1addo,nsv %r4,%r5,%r6
+ sh1addo,ev %r4,%r5,%r6
+
+
+sh2add_tests
+ sh2add %r4,%r5,%r6
+ sh2add,= %r4,%r5,%r6
+ sh2add,< %r4,%r5,%r6
+ sh2add,<= %r4,%r5,%r6
+ sh2add,nuv %r4,%r5,%r6
+ sh2add,znv %r4,%r5,%r6
+ sh2add,sv %r4,%r5,%r6
+ sh2add,od %r4,%r5,%r6
+ sh2add,tr %r4,%r5,%r6
+ sh2add,<> %r4,%r5,%r6
+ sh2add,>= %r4,%r5,%r6
+ sh2add,> %r4,%r5,%r6
+ sh2add,uv %r4,%r5,%r6
+ sh2add,vnz %r4,%r5,%r6
+ sh2add,nsv %r4,%r5,%r6
+ sh2add,ev %r4,%r5,%r6
+
+sh2addl_tests
+ sh2addl %r4,%r5,%r6
+ sh2addl,= %r4,%r5,%r6
+ sh2addl,< %r4,%r5,%r6
+ sh2addl,<= %r4,%r5,%r6
+ sh2addl,nuv %r4,%r5,%r6
+ sh2addl,znv %r4,%r5,%r6
+ sh2addl,sv %r4,%r5,%r6
+ sh2addl,od %r4,%r5,%r6
+ sh2addl,tr %r4,%r5,%r6
+ sh2addl,<> %r4,%r5,%r6
+ sh2addl,>= %r4,%r5,%r6
+ sh2addl,> %r4,%r5,%r6
+ sh2addl,uv %r4,%r5,%r6
+ sh2addl,vnz %r4,%r5,%r6
+ sh2addl,nsv %r4,%r5,%r6
+ sh2addl,ev %r4,%r5,%r6
+
+sh2addo_tests
+ sh2addo %r4,%r5,%r6
+ sh2addo,= %r4,%r5,%r6
+ sh2addo,< %r4,%r5,%r6
+ sh2addo,<= %r4,%r5,%r6
+ sh2addo,nuv %r4,%r5,%r6
+ sh2addo,znv %r4,%r5,%r6
+ sh2addo,sv %r4,%r5,%r6
+ sh2addo,od %r4,%r5,%r6
+ sh2addo,tr %r4,%r5,%r6
+ sh2addo,<> %r4,%r5,%r6
+ sh2addo,>= %r4,%r5,%r6
+ sh2addo,> %r4,%r5,%r6
+ sh2addo,uv %r4,%r5,%r6
+ sh2addo,vnz %r4,%r5,%r6
+ sh2addo,nsv %r4,%r5,%r6
+ sh2addo,ev %r4,%r5,%r6
+
+
+sh3add_tests
+ sh3add %r4,%r5,%r6
+ sh3add,= %r4,%r5,%r6
+ sh3add,< %r4,%r5,%r6
+ sh3add,<= %r4,%r5,%r6
+ sh3add,nuv %r4,%r5,%r6
+ sh3add,znv %r4,%r5,%r6
+ sh3add,sv %r4,%r5,%r6
+ sh3add,od %r4,%r5,%r6
+ sh3add,tr %r4,%r5,%r6
+ sh3add,<> %r4,%r5,%r6
+ sh3add,>= %r4,%r5,%r6
+ sh3add,> %r4,%r5,%r6
+ sh3add,uv %r4,%r5,%r6
+ sh3add,vnz %r4,%r5,%r6
+ sh3add,nsv %r4,%r5,%r6
+ sh3add,ev %r4,%r5,%r6
+
+sh3addl_tests
+ sh3addl %r4,%r5,%r6
+ sh3addl,= %r4,%r5,%r6
+ sh3addl,< %r4,%r5,%r6
+ sh3addl,<= %r4,%r5,%r6
+ sh3addl,nuv %r4,%r5,%r6
+ sh3addl,znv %r4,%r5,%r6
+ sh3addl,sv %r4,%r5,%r6
+ sh3addl,od %r4,%r5,%r6
+ sh3addl,tr %r4,%r5,%r6
+ sh3addl,<> %r4,%r5,%r6
+ sh3addl,>= %r4,%r5,%r6
+ sh3addl,> %r4,%r5,%r6
+ sh3addl,uv %r4,%r5,%r6
+ sh3addl,vnz %r4,%r5,%r6
+ sh3addl,nsv %r4,%r5,%r6
+ sh3addl,ev %r4,%r5,%r6
+
+sh3addo_tests
+ sh3addo %r4,%r5,%r6
+ sh3addo,= %r4,%r5,%r6
+ sh3addo,< %r4,%r5,%r6
+ sh3addo,<= %r4,%r5,%r6
+ sh3addo,nuv %r4,%r5,%r6
+ sh3addo,znv %r4,%r5,%r6
+ sh3addo,sv %r4,%r5,%r6
+ sh3addo,od %r4,%r5,%r6
+ sh3addo,tr %r4,%r5,%r6
+ sh3addo,<> %r4,%r5,%r6
+ sh3addo,>= %r4,%r5,%r6
+ sh3addo,> %r4,%r5,%r6
+ sh3addo,uv %r4,%r5,%r6
+ sh3addo,vnz %r4,%r5,%r6
+ sh3addo,nsv %r4,%r5,%r6
+ sh3addo,ev %r4,%r5,%r6
+
+
+sub_tests
+ sub %r4,%r5,%r6
+ sub,= %r4,%r5,%r6
+ sub,< %r4,%r5,%r6
+ sub,<= %r4,%r5,%r6
+ sub,<< %r4,%r5,%r6
+ sub,<<= %r4,%r5,%r6
+ sub,sv %r4,%r5,%r6
+ sub,od %r4,%r5,%r6
+ sub,tr %r4,%r5,%r6
+ sub,<> %r4,%r5,%r6
+ sub,>= %r4,%r5,%r6
+ sub,> %r4,%r5,%r6
+ sub,>>= %r4,%r5,%r6
+ sub,>> %r4,%r5,%r6
+ sub,nsv %r4,%r5,%r6
+ sub,ev %r4,%r5,%r6
+
+subo_tests
+ subo %r4,%r5,%r6
+ subo,= %r4,%r5,%r6
+ subo,< %r4,%r5,%r6
+ subo,<= %r4,%r5,%r6
+ subo,<< %r4,%r5,%r6
+ subo,<<= %r4,%r5,%r6
+ subo,sv %r4,%r5,%r6
+ subo,od %r4,%r5,%r6
+ subo,tr %r4,%r5,%r6
+ subo,<> %r4,%r5,%r6
+ subo,>= %r4,%r5,%r6
+ subo,> %r4,%r5,%r6
+ subo,>>= %r4,%r5,%r6
+ subo,>> %r4,%r5,%r6
+ subo,nsv %r4,%r5,%r6
+ subo,ev %r4,%r5,%r6
+
+subb_tests
+ subb %r4,%r5,%r6
+ subb,= %r4,%r5,%r6
+ subb,< %r4,%r5,%r6
+ subb,<= %r4,%r5,%r6
+ subb,<< %r4,%r5,%r6
+ subb,<<= %r4,%r5,%r6
+ subb,sv %r4,%r5,%r6
+ subb,od %r4,%r5,%r6
+ subb,tr %r4,%r5,%r6
+ subb,<> %r4,%r5,%r6
+ subb,>= %r4,%r5,%r6
+ subb,> %r4,%r5,%r6
+ subb,>>= %r4,%r5,%r6
+ subb,>> %r4,%r5,%r6
+ subb,nsv %r4,%r5,%r6
+ subb,ev %r4,%r5,%r6
+
+subbo_tests
+ subbo %r4,%r5,%r6
+ subbo,= %r4,%r5,%r6
+ subbo,< %r4,%r5,%r6
+ subbo,<= %r4,%r5,%r6
+ subbo,<< %r4,%r5,%r6
+ subbo,<<= %r4,%r5,%r6
+ subbo,sv %r4,%r5,%r6
+ subbo,od %r4,%r5,%r6
+ subbo,tr %r4,%r5,%r6
+ subbo,<> %r4,%r5,%r6
+ subbo,>= %r4,%r5,%r6
+ subbo,> %r4,%r5,%r6
+ subbo,>>= %r4,%r5,%r6
+ subbo,>> %r4,%r5,%r6
+ subbo,nsv %r4,%r5,%r6
+ subbo,ev %r4,%r5,%r6
+
+subt_tests
+ subt %r4,%r5,%r6
+ subt,= %r4,%r5,%r6
+ subt,< %r4,%r5,%r6
+ subt,<= %r4,%r5,%r6
+ subt,<< %r4,%r5,%r6
+ subt,<<= %r4,%r5,%r6
+ subt,sv %r4,%r5,%r6
+ subt,od %r4,%r5,%r6
+ subt,tr %r4,%r5,%r6
+ subt,<> %r4,%r5,%r6
+ subt,>= %r4,%r5,%r6
+ subt,> %r4,%r5,%r6
+ subt,>>= %r4,%r5,%r6
+ subt,>> %r4,%r5,%r6
+ subt,nsv %r4,%r5,%r6
+ subt,ev %r4,%r5,%r6
+
+subto_tests
+ subto %r4,%r5,%r6
+ subto,= %r4,%r5,%r6
+ subto,< %r4,%r5,%r6
+ subto,<= %r4,%r5,%r6
+ subto,<< %r4,%r5,%r6
+ subto,<<= %r4,%r5,%r6
+ subto,sv %r4,%r5,%r6
+ subto,od %r4,%r5,%r6
+ subto,tr %r4,%r5,%r6
+ subto,<> %r4,%r5,%r6
+ subto,>= %r4,%r5,%r6
+ subto,> %r4,%r5,%r6
+ subto,>>= %r4,%r5,%r6
+ subto,>> %r4,%r5,%r6
+ subto,nsv %r4,%r5,%r6
+ subto,ev %r4,%r5,%r6
+
+ds_tests
+ ds %r4,%r5,%r6
+ ds,= %r4,%r5,%r6
+ ds,< %r4,%r5,%r6
+ ds,<= %r4,%r5,%r6
+ ds,<< %r4,%r5,%r6
+ ds,<<= %r4,%r5,%r6
+ ds,sv %r4,%r5,%r6
+ ds,od %r4,%r5,%r6
+ ds,tr %r4,%r5,%r6
+ ds,<> %r4,%r5,%r6
+ ds,>= %r4,%r5,%r6
+ ds,> %r4,%r5,%r6
+ ds,>>= %r4,%r5,%r6
+ ds,>> %r4,%r5,%r6
+ ds,nsv %r4,%r5,%r6
+ ds,ev %r4,%r5,%r6
+
+comclr_tests
+ comclr %r4,%r5,%r6
+ comclr,= %r4,%r5,%r6
+ comclr,< %r4,%r5,%r6
+ comclr,<= %r4,%r5,%r6
+ comclr,<< %r4,%r5,%r6
+ comclr,<<= %r4,%r5,%r6
+ comclr,sv %r4,%r5,%r6
+ comclr,od %r4,%r5,%r6
+ comclr,tr %r4,%r5,%r6
+ comclr,<> %r4,%r5,%r6
+ comclr,>= %r4,%r5,%r6
+ comclr,> %r4,%r5,%r6
+ comclr,>>= %r4,%r5,%r6
+ comclr,>> %r4,%r5,%r6
+ comclr,nsv %r4,%r5,%r6
+ comclr,ev %r4,%r5,%r6
+
+or_tests
+ or %r4,%r5,%r6
+ or,= %r4,%r5,%r6
+ or,< %r4,%r5,%r6
+ or,<= %r4,%r5,%r6
+ or,od %r4,%r5,%r6
+ or,tr %r4,%r5,%r6
+ or,<> %r4,%r5,%r6
+ or,>= %r4,%r5,%r6
+ or,> %r4,%r5,%r6
+ or,ev %r4,%r5,%r6
+xor_tests
+ xor %r4,%r5,%r6
+ xor,= %r4,%r5,%r6
+ xor,< %r4,%r5,%r6
+ xor,<= %r4,%r5,%r6
+ xor,od %r4,%r5,%r6
+ xor,tr %r4,%r5,%r6
+ xor,<> %r4,%r5,%r6
+ xor,>= %r4,%r5,%r6
+ xor,> %r4,%r5,%r6
+ xor,ev %r4,%r5,%r6
+
+and_tests
+ and %r4,%r5,%r6
+ and,= %r4,%r5,%r6
+ and,< %r4,%r5,%r6
+ and,<= %r4,%r5,%r6
+ and,od %r4,%r5,%r6
+ and,tr %r4,%r5,%r6
+ and,<> %r4,%r5,%r6
+ and,>= %r4,%r5,%r6
+ and,> %r4,%r5,%r6
+ and,ev %r4,%r5,%r6
+
+andcm_tests
+ andcm %r4,%r5,%r6
+ andcm,= %r4,%r5,%r6
+ andcm,< %r4,%r5,%r6
+ andcm,<= %r4,%r5,%r6
+ andcm,od %r4,%r5,%r6
+ andcm,tr %r4,%r5,%r6
+ andcm,<> %r4,%r5,%r6
+ andcm,>= %r4,%r5,%r6
+ andcm,> %r4,%r5,%r6
+ andcm,ev %r4,%r5,%r6
+
+
+uxor_tests
+ uxor %r4,%r5,%r6
+ uxor,sbz %r4,%r5,%r6
+ uxor,shz %r4,%r5,%r6
+ uxor,sdc %r4,%r5,%r6
+ uxor,sbc %r4,%r5,%r6
+ uxor,shc %r4,%r5,%r6
+ uxor,tr %r4,%r5,%r6
+ uxor,nbz %r4,%r5,%r6
+ uxor,nhz %r4,%r5,%r6
+ uxor,ndc %r4,%r5,%r6
+ uxor,nbc %r4,%r5,%r6
+ uxor,nhc %r4,%r5,%r6
+
+uaddcm_tests
+ uaddcm %r4,%r5,%r6
+ uaddcm,sbz %r4,%r5,%r6
+ uaddcm,shz %r4,%r5,%r6
+ uaddcm,sdc %r4,%r5,%r6
+ uaddcm,sbc %r4,%r5,%r6
+ uaddcm,shc %r4,%r5,%r6
+ uaddcm,tr %r4,%r5,%r6
+ uaddcm,nbz %r4,%r5,%r6
+ uaddcm,nhz %r4,%r5,%r6
+ uaddcm,ndc %r4,%r5,%r6
+ uaddcm,nbc %r4,%r5,%r6
+ uaddcm,nhc %r4,%r5,%r6
+
+uaddcmt_tests
+ uaddcmt %r4,%r5,%r6
+ uaddcmt,sbz %r4,%r5,%r6
+ uaddcmt,shz %r4,%r5,%r6
+ uaddcmt,sdc %r4,%r5,%r6
+ uaddcmt,sbc %r4,%r5,%r6
+ uaddcmt,shc %r4,%r5,%r6
+ uaddcmt,tr %r4,%r5,%r6
+ uaddcmt,nbz %r4,%r5,%r6
+ uaddcmt,nhz %r4,%r5,%r6
+ uaddcmt,ndc %r4,%r5,%r6
+ uaddcmt,nbc %r4,%r5,%r6
+ uaddcmt,nhc %r4,%r5,%r6
+
+dcor_tests
+ dcor %r4,%r5
+ dcor,sbz %r4,%r5
+ dcor,shz %r4,%r5
+ dcor,sdc %r4,%r5
+ dcor,sbc %r4,%r5
+ dcor,shc %r4,%r5
+ dcor,tr %r4,%r5
+ dcor,nbz %r4,%r5
+ dcor,nhz %r4,%r5
+ dcor,ndc %r4,%r5
+ dcor,nbc %r4,%r5
+ dcor,nhc %r4,%r5
+
+idcor_tests
+ idcor %r4,%r5
+ idcor,sbz %r4,%r5
+ idcor,shz %r4,%r5
+ idcor,sdc %r4,%r5
+ idcor,sbc %r4,%r5
+ idcor,shc %r4,%r5
+ idcor,tr %r4,%r5
+ idcor,nbz %r4,%r5
+ idcor,nhz %r4,%r5
+ idcor,ndc %r4,%r5
+ idcor,nbc %r4,%r5
+ idcor,nhc %r4,%r5
+
+addi_tests
+ addi 123,%r5,%r6
+ addi,= 123,%r5,%r6
+ addi,< 123,%r5,%r6
+ addi,<= 123,%r5,%r6
+ addi,nuv 123,%r5,%r6
+ addi,znv 123,%r5,%r6
+ addi,sv 123,%r5,%r6
+ addi,od 123,%r5,%r6
+ addi,tr 123,%r5,%r6
+ addi,<> 123,%r5,%r6
+ addi,>= 123,%r5,%r6
+ addi,> 123,%r5,%r6
+ addi,uv 123,%r5,%r6
+ addi,vnz 123,%r5,%r6
+ addi,nsv 123,%r5,%r6
+ addi,ev 123,%r5,%r6
+
+addio_tests
+ addio 123,%r5,%r6
+ addio,= 123,%r5,%r6
+ addio,< 123,%r5,%r6
+ addio,<= 123,%r5,%r6
+ addio,nuv 123,%r5,%r6
+ addio,znv 123,%r5,%r6
+ addio,sv 123,%r5,%r6
+ addio,od 123,%r5,%r6
+ addio,tr 123,%r5,%r6
+ addio,<> 123,%r5,%r6
+ addio,>= 123,%r5,%r6
+ addio,> 123,%r5,%r6
+ addio,uv 123,%r5,%r6
+ addio,vnz 123,%r5,%r6
+ addio,nsv 123,%r5,%r6
+ addio,ev 123,%r5,%r6
+
+addit_tests
+ addit 123,%r5,%r6
+ addit,= 123,%r5,%r6
+ addit,< 123,%r5,%r6
+ addit,<= 123,%r5,%r6
+ addit,nuv 123,%r5,%r6
+ addit,znv 123,%r5,%r6
+ addit,sv 123,%r5,%r6
+ addit,od 123,%r5,%r6
+ addit,tr 123,%r5,%r6
+ addit,<> 123,%r5,%r6
+ addit,>= 123,%r5,%r6
+ addit,> 123,%r5,%r6
+ addit,uv 123,%r5,%r6
+ addit,vnz 123,%r5,%r6
+ addit,nsv 123,%r5,%r6
+ addit,ev 123,%r5,%r6
+
+addito_tests
+ addito 123,%r5,%r6
+ addito,= 123,%r5,%r6
+ addito,< 123,%r5,%r6
+ addito,<= 123,%r5,%r6
+ addito,nuv 123,%r5,%r6
+ addito,znv 123,%r5,%r6
+ addito,sv 123,%r5,%r6
+ addito,od 123,%r5,%r6
+ addito,tr 123,%r5,%r6
+ addito,<> 123,%r5,%r6
+ addito,>= 123,%r5,%r6
+ addito,> 123,%r5,%r6
+ addito,uv 123,%r5,%r6
+ addito,vnz 123,%r5,%r6
+ addito,nsv 123,%r5,%r6
+ addito,ev 123,%r5,%r6
+
+subi_tests
+ subi 123,%r5,%r6
+ subi,= 123,%r5,%r6
+ subi,< 123,%r5,%r6
+ subi,<= 123,%r5,%r6
+ subi,<< 123,%r5,%r6
+ subi,<<= 123,%r5,%r6
+ subi,sv 123,%r5,%r6
+ subi,od 123,%r5,%r6
+ subi,tr 123,%r5,%r6
+ subi,<> 123,%r5,%r6
+ subi,>= 123,%r5,%r6
+ subi,> 123,%r5,%r6
+ subi,>>= 123,%r5,%r6
+ subi,>> 123,%r5,%r6
+ subi,nsv 123,%r5,%r6
+ subi,ev 123,%r5,%r6
+
+subio_tests
+ subio 123,%r5,%r6
+ subio,= 123,%r5,%r6
+ subio,< 123,%r5,%r6
+ subio,<= 123,%r5,%r6
+ subio,<< 123,%r5,%r6
+ subio,<<= 123,%r5,%r6
+ subio,sv 123,%r5,%r6
+ subio,od 123,%r5,%r6
+ subio,tr 123,%r5,%r6
+ subio,<> 123,%r5,%r6
+ subio,>= 123,%r5,%r6
+ subio,> 123,%r5,%r6
+ subio,>>= 123,%r5,%r6
+ subio,>> 123,%r5,%r6
+ subio,nsv 123,%r5,%r6
+ subio,ev 123,%r5,%r6
+
+comiclr_tests
+ comiclr 123,%r5,%r6
+ comiclr,= 123,%r5,%r6
+ comiclr,< 123,%r5,%r6
+ comiclr,<= 123,%r5,%r6
+ comiclr,<< 123,%r5,%r6
+ comiclr,<<= 123,%r5,%r6
+ comiclr,sv 123,%r5,%r6
+ comiclr,od 123,%r5,%r6
+ comiclr,tr 123,%r5,%r6
+ comiclr,<> 123,%r5,%r6
+ comiclr,>= 123,%r5,%r6
+ comiclr,> 123,%r5,%r6
+ comiclr,>>= 123,%r5,%r6
+ comiclr,>> 123,%r5,%r6
+ comiclr,nsv 123,%r5,%r6
+ comiclr,ev 123,%r5,%r6
+
+vshd_tests
+ vshd %r4,%r5,%r6
+ vshd,= %r4,%r5,%r6
+ vshd,< %r4,%r5,%r6
+ vshd,od %r4,%r5,%r6
+ vshd,tr %r4,%r5,%r6
+ vshd,<> %r4,%r5,%r6
+ vshd,>= %r4,%r5,%r6
+ vshd,ev %r4,%r5,%r6
+
+shd_tests
+ shd %r4,%r5,5,%r6
+ shd,= %r4,%r5,5,%r6
+ shd,< %r4,%r5,5,%r6
+ shd,od %r4,%r5,5,%r6
+ shd,tr %r4,%r5,5,%r6
+ shd,<> %r4,%r5,5,%r6
+ shd,>= %r4,%r5,5,%r6
+ shd,ev %r4,%r5,5,%r6
+
+extru_tests
+ extru %r4,5,10,%r6
+ extru,= %r4,5,10,%r6
+ extru,< %r4,5,10,%r6
+ extru,od %r4,5,10,%r6
+ extru,tr %r4,5,10,%r6
+ extru,<> %r4,5,10,%r6
+ extru,>= %r4,5,10,%r6
+ extru,ev %r4,5,10,%r6
+
+extrs_tests
+ extrs %r4,5,10,%r6
+ extrs,= %r4,5,10,%r6
+ extrs,< %r4,5,10,%r6
+ extrs,od %r4,5,10,%r6
+ extrs,tr %r4,5,10,%r6
+ extrs,<> %r4,5,10,%r6
+ extrs,>= %r4,5,10,%r6
+ extrs,ev %r4,5,10,%r6
+
+zdep_tests
+ zdep %r4,5,10,%r6
+ zdep,= %r4,5,10,%r6
+ zdep,< %r4,5,10,%r6
+ zdep,od %r4,5,10,%r6
+ zdep,tr %r4,5,10,%r6
+ zdep,<> %r4,5,10,%r6
+ zdep,>= %r4,5,10,%r6
+ zdep,ev %r4,5,10,%r6
+
+dep_tests
+ dep %r4,5,10,%r6
+ dep,= %r4,5,10,%r6
+ dep,< %r4,5,10,%r6
+ dep,od %r4,5,10,%r6
+ dep,tr %r4,5,10,%r6
+ dep,<> %r4,5,10,%r6
+ dep,>= %r4,5,10,%r6
+ dep,ev %r4,5,10,%r6
+
+vextru_tests
+ vextru %r4,5,%r6
+ vextru,= %r4,5,%r6
+ vextru,< %r4,5,%r6
+ vextru,od %r4,5,%r6
+ vextru,tr %r4,5,%r6
+ vextru,<> %r4,5,%r6
+ vextru,>= %r4,5,%r6
+ vextru,ev %r4,5,%r6
+
+vextrs_tests
+ vextrs %r4,5,%r6
+ vextrs,= %r4,5,%r6
+ vextrs,< %r4,5,%r6
+ vextrs,od %r4,5,%r6
+ vextrs,tr %r4,5,%r6
+ vextrs,<> %r4,5,%r6
+ vextrs,>= %r4,5,%r6
+ vextrs,ev %r4,5,%r6
+
+zvdep_tests
+ zvdep %r4,5,%r6
+ zvdep,= %r4,5,%r6
+ zvdep,< %r4,5,%r6
+ zvdep,od %r4,5,%r6
+ zvdep,tr %r4,5,%r6
+ zvdep,<> %r4,5,%r6
+ zvdep,>= %r4,5,%r6
+ zvdep,ev %r4,5,%r6
+
+
+vdep_tests
+ vdep %r4,5,%r6
+ vdep,= %r4,5,%r6
+ vdep,< %r4,5,%r6
+ vdep,od %r4,5,%r6
+ vdep,tr %r4,5,%r6
+ vdep,<> %r4,5,%r6
+ vdep,>= %r4,5,%r6
+ vdep,ev %r4,5,%r6
+
+vdepi_tests
+ vdepi -1,5,%r6
+ vdepi,= -1,5,%r6
+ vdepi,< -1,5,%r6
+ vdepi,od -1,5,%r6
+ vdepi,tr -1,5,%r6
+ vdepi,<> -1,5,%r6
+ vdepi,>= -1,5,%r6
+ vdepi,ev -1,5,%r6
+
+zvdepi_tests
+ zvdepi -1,5,%r6
+ zvdepi,= -1,5,%r6
+ zvdepi,< -1,5,%r6
+ zvdepi,od -1,5,%r6
+ zvdepi,tr -1,5,%r6
+ zvdepi,<> -1,5,%r6
+ zvdepi,>= -1,5,%r6
+ zvdepi,ev -1,5,%r6
+
+depi_tests
+ depi -1,4,10,%r6
+ depi,= -1,4,10,%r6
+ depi,< -1,4,10,%r6
+ depi,od -1,4,10,%r6
+ depi,tr -1,4,10,%r6
+ depi,<> -1,4,10,%r6
+ depi,>= -1,4,10,%r6
+ depi,ev -1,4,10,%r6
+
+zdepi_tests
+ zdepi -1,4,10,%r6
+ zdepi,= -1,4,10,%r6
+ zdepi,< -1,4,10,%r6
+ zdepi,od -1,4,10,%r6
+ zdepi,tr -1,4,10,%r6
+ zdepi,<> -1,4,10,%r6
+ zdepi,>= -1,4,10,%r6
+ zdepi,ev -1,4,10,%r6
+
+
+system_control_tests
+ break 5,12
+ rfi
+ rfir
+ ssm 5,%r4
+ rsm 5,%r4
+ mtsm %r4
+ ldsid (%sr0,%r5),%r4
+ mtsp %r4,%sr0
+ mtctl %r4,%cr10
+ mfsp %sr0,%r4
+ mfctl %cr10,%r4
+ sync
+ syncdma
+ diag 1234
+
+probe_tests
+ prober (%sr0,%r5),%r6,%r7
+ proberi (%sr0,%r5),1,%r7
+ probew (%sr0,%r5),%r6,%r7
+ probewi (%sr0,%r5),1,%r7
+
+lpa_tests
+ lpa %r4(%sr0,%r5),%r6
+ lpa,m %r4(%sr0,%r5),%r6
+ lha %r4(%sr0,%r5),%r6
+ lha,m %r4(%sr0,%r5),%r6
+ lci %r4(%sr0,%r5),%r6
+
+purge_tests
+ pdtlb %r4(%sr0,%r5)
+ pdtlb,m %r4(%sr0,%r5)
+ pitlb %r4(%sr0,%r5)
+ pitlb,m %r4(%sr0,%r5)
+ pdtlbe %r4(%sr0,%r5)
+ pdtlbe,m %r4(%sr0,%r5)
+ pitlbe %r4(%sr0,%r5)
+ pitlbe,m %r4(%sr0,%r5)
+ pdc %r4(%sr0,%r5)
+ pdc,m %r4(%sr0,%r5)
+ fdc %r4(%sr0,%r5)
+ fdc,m %r4(%sr0,%r5)
+ fic %r4(%sr0,%r5)
+ fic,m %r4(%sr0,%r5)
+ fdce %r4(%sr0,%r5)
+ fdce,m %r4(%sr0,%r5)
+ fice %r4(%sr0,%r5)
+ fice,m %r4(%sr0,%r5)
+
+insert_tests
+ idtlba %r4,(%sr0,%r5)
+ iitlba %r4,(%sr0,%r5)
+ idtlbp %r4,(%sr0,%r5)
+ iitlbp %r4,(%sr0,%r5)
+
+fpu_misc_tests
+ ftest
+
+fpu_memory_indexing_tests
+ fldwx %r4(%sr0,%r5),%fr6
+ fldwx,s %r4(%sr0,%r5),%fr6
+ fldwx,m %r4(%sr0,%r5),%fr6
+ fldwx,sm %r4(%sr0,%r5),%fr6
+ flddx %r4(%sr0,%r5),%fr6
+ flddx,s %r4(%sr0,%r5),%fr6
+ flddx,m %r4(%sr0,%r5),%fr6
+ flddx,sm %r4(%sr0,%r5),%fr6
+ fstwx %fr6,%r4(%sr0,%r5)
+ fstwx,s %fr6,%r4(%sr0,%r5)
+ fstwx,m %fr6,%r4(%sr0,%r5)
+ fstwx,sm %fr6,%r4(%sr0,%r5)
+ fstdx %fr6,%r4(%sr0,%r5)
+ fstdx,s %fr6,%r4(%sr0,%r5)
+ fstdx,m %fr6,%r4(%sr0,%r5)
+ fstdx,sm %fr6,%r4(%sr0,%r5)
+ fstqx %fr6,%r4(%sr0,%r5)
+ fstqx,s %fr6,%r4(%sr0,%r5)
+ fstqx,m %fr6,%r4(%sr0,%r5)
+ fstqx,sm %fr6,%r4(%sr0,%r5)
+
+fpu_short_memory_tests
+ fldws 0(%sr0,%r5),%fr6
+ fldws,mb 0(%sr0,%r5),%fr6
+ fldws,ma 0(%sr0,%r5),%fr6
+ fldds 0(%sr0,%r5),%fr6
+ fldds,mb 0(%sr0,%r5),%fr6
+ fldds,ma 0(%sr0,%r5),%fr6
+ fstws %fr6,0(%sr0,%r5)
+ fstws,mb %fr6,0(%sr0,%r5)
+ fstws,ma %fr6,0(%sr0,%r5)
+ fstds %fr6,0(%sr0,%r5)
+ fstds,mb %fr6,0(%sr0,%r5)
+ fstds,ma %fr6,0(%sr0,%r5)
+ fstqs %fr6,0(%sr0,%r5)
+ fstqs,mb %fr6,0(%sr0,%r5)
+ fstqs,ma %fr6,0(%sr0,%r5)
+
+
+fcpy_tests
+ fcpy,sgl %fr5,%fr10
+ fcpy,dbl %fr5,%fr10
+ fcpy,quad %fr5,%fr10
+ fcpy,sgl %fr20,%fr24
+ fcpy,dbl %fr20,%fr24
+
+fabs_tests
+ fabs,sgl %fr5,%fr10
+ fabs,dbl %fr5,%fr10
+ fabs,quad %fr5,%fr10
+ fabs,sgl %fr20,%fr24
+ fabs,dbl %fr20,%fr24
+
+fsqrt_tests
+ fsqrt,sgl %fr5,%fr10
+ fsqrt,dbl %fr5,%fr10
+ fsqrt,quad %fr5,%fr10
+ fsqrt,sgl %fr20,%fr24
+ fsqrt,dbl %fr20,%fr24
+
+frnd_tests
+ frnd,sgl %fr5,%fr10
+ frnd,dbl %fr5,%fr10
+ frnd,quad %fr5,%fr10
+ frnd,sgl %fr20,%fr24
+ frnd,dbl %fr20,%fr24
+
+fcnvff_tests
+ fcnvff,sgl,sgl %fr5,%fr10
+ fcnvff,sgl,dbl %fr5,%fr10
+ fcnvff,sgl,quad %fr5,%fr10
+ fcnvff,dbl,sgl %fr5,%fr10
+ fcnvff,dbl,dbl %fr5,%fr10
+ fcnvff,dbl,quad %fr5,%fr10
+ fcnvff,quad,sgl %fr5,%fr10
+ fcnvff,quad,dbl %fr5,%fr10
+ fcnvff,quad,quad %fr5,%fr10
+ fcnvff,sgl,sgl %fr20,%fr24
+ fcnvff,sgl,dbl %fr20,%fr24
+ fcnvff,sgl,quad %fr20,%fr24
+ fcnvff,dbl,sgl %fr20,%fr24
+ fcnvff,dbl,dbl %fr20,%fr24
+ fcnvff,dbl,quad %fr20,%fr24
+ fcnvff,quad,sgl %fr20,%fr24
+ fcnvff,quad,dbl %fr20,%fr24
+ fcnvff,quad,quad %fr20,%fr24
+
+fcnvxf_tests
+ fcnvxf,sgl,sgl %fr5,%fr10
+ fcnvxf,sgl,dbl %fr5,%fr10
+ fcnvxf,sgl,quad %fr5,%fr10
+ fcnvxf,dbl,sgl %fr5,%fr10
+ fcnvxf,dbl,dbl %fr5,%fr10
+ fcnvxf,dbl,quad %fr5,%fr10
+ fcnvxf,quad,sgl %fr5,%fr10
+ fcnvxf,quad,dbl %fr5,%fr10
+ fcnvxf,quad,quad %fr5,%fr10
+ fcnvxf,sgl,sgl %fr20,%fr24
+ fcnvxf,sgl,dbl %fr20,%fr24
+ fcnvxf,sgl,quad %fr20,%fr24
+ fcnvxf,dbl,sgl %fr20,%fr24
+ fcnvxf,dbl,dbl %fr20,%fr24
+ fcnvxf,dbl,quad %fr20,%fr24
+ fcnvxf,quad,sgl %fr20,%fr24
+ fcnvxf,quad,dbl %fr20,%fr24
+ fcnvxf,quad,quad %fr20,%fr24
+
+fcnvfx_tests
+ fcnvfx,sgl,sgl %fr5,%fr10
+ fcnvfx,sgl,dbl %fr5,%fr10
+ fcnvfx,sgl,quad %fr5,%fr10
+ fcnvfx,dbl,sgl %fr5,%fr10
+ fcnvfx,dbl,dbl %fr5,%fr10
+ fcnvfx,dbl,quad %fr5,%fr10
+ fcnvfx,quad,sgl %fr5,%fr10
+ fcnvfx,quad,dbl %fr5,%fr10
+ fcnvfx,quad,quad %fr5,%fr10
+ fcnvfx,sgl,sgl %fr20,%fr24
+ fcnvfx,sgl,dbl %fr20,%fr24
+ fcnvfx,sgl,quad %fr20,%fr24
+ fcnvfx,dbl,sgl %fr20,%fr24
+ fcnvfx,dbl,dbl %fr20,%fr24
+ fcnvfx,dbl,quad %fr20,%fr24
+ fcnvfx,quad,sgl %fr20,%fr24
+ fcnvfx,quad,dbl %fr20,%fr24
+ fcnvfx,quad,quad %fr20,%fr24
+
+fcnvfxt_tests
+ fcnvfxt,sgl,sgl %fr5,%fr10
+ fcnvfxt,sgl,dbl %fr5,%fr10
+ fcnvfxt,sgl,quad %fr5,%fr10
+ fcnvfxt,dbl,sgl %fr5,%fr10
+ fcnvfxt,dbl,dbl %fr5,%fr10
+ fcnvfxt,dbl,quad %fr5,%fr10
+ fcnvfxt,quad,sgl %fr5,%fr10
+ fcnvfxt,quad,dbl %fr5,%fr10
+ fcnvfxt,quad,quad %fr5,%fr10
+ fcnvfxt,sgl,sgl %fr20,%fr24
+ fcnvfxt,sgl,dbl %fr20,%fr24
+ fcnvfxt,sgl,quad %fr20,%fr24
+ fcnvfxt,dbl,sgl %fr20,%fr24
+ fcnvfxt,dbl,dbl %fr20,%fr24
+ fcnvfxt,dbl,quad %fr20,%fr24
+ fcnvfxt,quad,sgl %fr20,%fr24
+ fcnvfxt,quad,dbl %fr20,%fr24
+ fcnvfxt,quad,quad %fr20,%fr24
+
+fadd_tests
+ fadd,sgl %fr4,%fr8,%fr12
+ fadd,dbl %fr4,%fr8,%fr12
+ fadd,quad %fr4,%fr8,%fr12
+ fadd,sgl %fr20,%fr24,%fr28
+ fadd,dbl %fr20,%fr24,%fr28
+ fadd,quad %fr20,%fr24,%fr28
+
+fsub_tests
+ fsub,sgl %fr4,%fr8,%fr12
+ fsub,dbl %fr4,%fr8,%fr12
+ fsub,quad %fr4,%fr8,%fr12
+ fsub,sgl %fr20,%fr24,%fr28
+ fsub,dbl %fr20,%fr24,%fr28
+ fsub,quad %fr20,%fr24,%fr28
+
+fmpy_tests
+ fmpy,sgl %fr4,%fr8,%fr12
+ fmpy,dbl %fr4,%fr8,%fr12
+ fmpy,quad %fr4,%fr8,%fr12
+ fmpy,sgl %fr20,%fr24,%fr28
+ fmpy,dbl %fr20,%fr24,%fr28
+ fmpy,quad %fr20,%fr24,%fr28
+
+fdiv_tests
+ fdiv,sgl %fr4,%fr8,%fr12
+ fdiv,dbl %fr4,%fr8,%fr12
+ fdiv,quad %fr4,%fr8,%fr12
+ fdiv,sgl %fr20,%fr24,%fr28
+ fdiv,dbl %fr20,%fr24,%fr28
+ fdiv,quad %fr20,%fr24,%fr28
+
+frem_tests
+ frem,sgl %fr4,%fr8,%fr12
+ frem,dbl %fr4,%fr8,%fr12
+ frem,quad %fr4,%fr8,%fr12
+ frem,sgl %fr20,%fr24,%fr28
+ frem,dbl %fr20,%fr24,%fr28
+ frem,quad %fr20,%fr24,%fr28
+
+fcmp_sgl_tests_1
+ fcmp,sgl,false? %fr4,%fr5
+ fcmp,sgl,false %fr4,%fr5
+ fcmp,sgl,? %fr4,%fr5
+ fcmp,sgl,!<=> %fr4,%fr5
+ fcmp,sgl,= %fr4,%fr5
+ fcmp,sgl,=T %fr4,%fr5
+ fcmp,sgl,?= %fr4,%fr5
+ fcmp,sgl,!<> %fr4,%fr5
+fcmp_sgl_tests_2
+ fcmp,sgl,!?>= %fr4,%fr5
+ fcmp,sgl,< %fr4,%fr5
+ fcmp,sgl,?< %fr4,%fr5
+ fcmp,sgl,!>= %fr4,%fr5
+ fcmp,sgl,!?> %fr4,%fr5
+ fcmp,sgl,<= %fr4,%fr5
+ fcmp,sgl,?<= %fr4,%fr5
+ fcmp,sgl,!> %fr4,%fr5
+fcmp_sgl_tests_3
+ fcmp,sgl,!?<= %fr4,%fr5
+ fcmp,sgl,> %fr4,%fr5
+ fcmp,sgl,?> %fr4,%fr5
+ fcmp,sgl,!<= %fr4,%fr5
+ fcmp,sgl,!?< %fr4,%fr5
+ fcmp,sgl,>= %fr4,%fr5
+ fcmp,sgl,?>= %fr4,%fr5
+ fcmp,sgl,!< %fr4,%fr5
+fcmp_sgl_tests_4
+ fcmp,sgl,!?= %fr4,%fr5
+ fcmp,sgl,<> %fr4,%fr5
+ fcmp,sgl,!= %fr4,%fr5
+ fcmp,sgl,!=T %fr4,%fr5
+ fcmp,sgl,!? %fr4,%fr5
+ fcmp,sgl,<=> %fr4,%fr5
+ fcmp,sgl,true? %fr4,%fr5
+ fcmp,sgl,true %fr4,%fr5
+
+fcmp_dbl_tests_1
+ fcmp,dbl,false? %fr4,%fr5
+ fcmp,dbl,false %fr4,%fr5
+ fcmp,dbl,? %fr4,%fr5
+ fcmp,dbl,!<=> %fr4,%fr5
+ fcmp,dbl,= %fr4,%fr5
+ fcmp,dbl,=T %fr4,%fr5
+ fcmp,dbl,?= %fr4,%fr5
+ fcmp,dbl,!<> %fr4,%fr5
+fcmp_dbl_tests_2
+ fcmp,dbl,!?>= %fr4,%fr5
+ fcmp,dbl,< %fr4,%fr5
+ fcmp,dbl,?< %fr4,%fr5
+ fcmp,dbl,!>= %fr4,%fr5
+ fcmp,dbl,!?> %fr4,%fr5
+ fcmp,dbl,<= %fr4,%fr5
+ fcmp,dbl,?<= %fr4,%fr5
+ fcmp,dbl,!> %fr4,%fr5
+fcmp_dbl_tests_3
+ fcmp,dbl,!?<= %fr4,%fr5
+ fcmp,dbl,> %fr4,%fr5
+ fcmp,dbl,?> %fr4,%fr5
+ fcmp,dbl,!<= %fr4,%fr5
+ fcmp,dbl,!?< %fr4,%fr5
+ fcmp,dbl,>= %fr4,%fr5
+ fcmp,dbl,?>= %fr4,%fr5
+ fcmp,dbl,!< %fr4,%fr5
+fcmp_dbl_tests_4
+ fcmp,dbl,!?= %fr4,%fr5
+ fcmp,dbl,<> %fr4,%fr5
+ fcmp,dbl,!= %fr4,%fr5
+ fcmp,dbl,!=T %fr4,%fr5
+ fcmp,dbl,!? %fr4,%fr5
+ fcmp,dbl,<=> %fr4,%fr5
+ fcmp,dbl,true? %fr4,%fr5
+ fcmp,dbl,true %fr4,%fr5
+
+fcmp_quad_tests_1
+ fcmp,quad,false? %fr4,%fr5
+ fcmp,quad,false %fr4,%fr5
+ fcmp,quad,? %fr4,%fr5
+ fcmp,quad,!<=> %fr4,%fr5
+ fcmp,quad,= %fr4,%fr5
+ fcmp,quad,=T %fr4,%fr5
+ fcmp,quad,?= %fr4,%fr5
+ fcmp,quad,!<> %fr4,%fr5
+fcmp_quad_tests_2
+ fcmp,quad,!?>= %fr4,%fr5
+ fcmp,quad,< %fr4,%fr5
+ fcmp,quad,?< %fr4,%fr5
+ fcmp,quad,!>= %fr4,%fr5
+ fcmp,quad,!?> %fr4,%fr5
+ fcmp,quad,<= %fr4,%fr5
+ fcmp,quad,?<= %fr4,%fr5
+ fcmp,quad,!> %fr4,%fr5
+fcmp_quad_tests_3
+ fcmp,quad,!?<= %fr4,%fr5
+ fcmp,quad,> %fr4,%fr5
+ fcmp,quad,?> %fr4,%fr5
+ fcmp,quad,!<= %fr4,%fr5
+ fcmp,quad,!?< %fr4,%fr5
+ fcmp,quad,>= %fr4,%fr5
+ fcmp,quad,?>= %fr4,%fr5
+ fcmp,quad,!< %fr4,%fr5
+fcmp_quad_tests_4
+ fcmp,quad,!?= %fr4,%fr5
+ fcmp,quad,<> %fr4,%fr5
+ fcmp,quad,!= %fr4,%fr5
+ fcmp,quad,!=T %fr4,%fr5
+ fcmp,quad,!? %fr4,%fr5
+ fcmp,quad,<=> %fr4,%fr5
+ fcmp,quad,true? %fr4,%fr5
+ fcmp,quad,true %fr4,%fr5
+
+fmpy_addsub_tests
+ fmpyadd,sgl %fr16,%fr17,%fr18,%fr19,%fr20
+ fmpyadd,dbl %fr16,%fr17,%fr18,%fr19,%fr20
+ fmpysub,sgl %fr16,%fr17,%fr18,%fr19,%fr20
+ fmpysub,dbl %fr16,%fr17,%fr18,%fr19,%fr20
+
+xmpyu_tests
+ xmpyu %fr4,%fr5,%fr6
+
+special_tests
+ gfw %r4(%sr0,%r5)
+ gfw,m %r4(%sr0,%r5)
+ gfr %r4(%sr0,%r5)
+ gfr,m %r4(%sr0,%r5)
+
+sfu_tests
+ spop0,4,5
+ spop0,4,115
+ spop0,4,5,n
+ spop0,4,115,n
+ spop1,4,5 5
+ spop1,4,115 5
+ spop1,4,5,n 5
+ spop1,4,115,n 5
+ spop2,4,5 5
+ spop2,4,115 5
+ spop2,4,5,n 5
+ spop2,4,115,n 5
+ spop3,4,5 5,6
+ spop3,4,115 5,6
+ spop3,4,5,n 5,6
+ spop3,4,115,n 5,6
+
+copr_tests
+ copr,4,5
+ copr,4,115
+ copr,4,5,n
+ copr,4,115,n
+
+copr_indexing_load
+ cldwx,4 5(0,4),26
+ cldwx,4,s 5(0,4),26
+ cldwx,4,m 5(0,4),26
+ cldwx,4,sm 5(0,4),26
+ clddx,4 5(0,4),26
+ clddx,4,s 5(0,4),26
+ clddx,4,m 5(0,4),26
+ clddx,4,sm 5(0,4),26
+
+copr_indexing_store
+ cstwx,4 26,5(0,4)
+ cstwx,4,s 26,5(0,4)
+ cstwx,4,m 26,5(0,4)
+ cstwx,4,sm 26,5(0,4)
+ cstdx,4 26,5(0,4)
+ cstdx,4,s 26,5(0,4)
+ cstdx,4,m 26,5(0,4)
+ cstdx,4,sm 26,5(0,4)
+
+copr_short_memory
+ cldws,4 0(0,4),26
+ cldws,4,mb 0(0,4),26
+ cldws,4,ma 0(0,4),26
+ cldds,4 0(0,4),26
+ cldds,4,mb 0(0,4),26
+ cldds,4,ma 0(0,4),26
+ cstws,4 26,0(0,4)
+ cstws,4,mb 26,0(0,4)
+ cstws,4,ma 26,0(0,4)
+ cstds,4 26,0(0,4)
+ cstds,4,mb 26,0(0,4)
+ cstds,4,ma 26,0(0,4)
+
+fmemLRbug_tests_1
+ fstws %fr6R,0(%r26)
+ fstws %fr6L,4(%r26)
+ fstws %fr6,8(%r26)
+ fstds %fr6R,0(%r26)
+ fstds %fr6L,4(%r26)
+ fstds %fr6,8(%r26)
+ fldws 0(%r26),%fr6R
+ fldws 4(%r26),%fr6L
+ fldws 8(%r26),%fr6
+ fldds 0(%r26),%fr6R
+ fldds 4(%r26),%fr6L
+ fldds 8(%r26),%fr6
+
+fmemLRbug_tests_2
+ fstws %fr6R,0(%sr0,%r26)
+ fstws %fr6L,4(%sr0,%r26)
+ fstws %fr6,8(%sr0,%r26)
+ fstds %fr6R,0(%sr0,%r26)
+ fstds %fr6L,4(%sr0,%r26)
+ fstds %fr6,8(%sr0,%r26)
+ fldws 0(%sr0,%r26),%fr6R
+ fldws 4(%sr0,%r26),%fr6L
+ fldws 8(%sr0,%r26),%fr6
+ fldds 0(%sr0,%r26),%fr6R
+ fldds 4(%sr0,%r26),%fr6L
+ fldds 8(%sr0,%r26),%fr6
+
+fmemLRbug_tests_3
+ fstwx %fr6R,%r25(%r26)
+ fstwx %fr6L,%r25(%r26)
+ fstwx %fr6,%r25(%r26)
+ fstdx %fr6R,%r25(%r26)
+ fstdx %fr6L,%r25(%r26)
+ fstdx %fr6,%r25(%r26)
+ fldwx %r25(%r26),%fr6R
+ fldwx %r25(%r26),%fr6L
+ fldwx %r25(%r26),%fr6
+ flddx %r25(%r26),%fr6R
+ flddx %r25(%r26),%fr6L
+ flddx %r25(%r26),%fr6
+
+fmemLRbug_tests_4
+ fstwx %fr6R,%r25(%sr0,%r26)
+ fstwx %fr6L,%r25(%sr0,%r26)
+ fstwx %fr6,%r25(%sr0,%r26)
+ fstdx %fr6R,%r25(%sr0,%r26)
+ fstdx %fr6L,%r25(%sr0,%r26)
+ fstdx %fr6,%r25(%sr0,%r26)
+ fldwx %r25(%sr0,%r26),%fr6R
+ fldwx %r25(%sr0,%r26),%fr6L
+ fldwx %r25(%sr0,%r26),%fr6
+ flddx %r25(%sr0,%r26),%fr6R
+ flddx %r25(%sr0,%r26),%fr6L
+ flddx %r25(%sr0,%r26),%fr6
+
+ ldw 0(0,%r4),%r26
+ ldw 0(0,%r4),%r26
+ ldo 64(%r4),%r30
+ ldwm -64(0,%r30),%r4
+ bv,n 0(%r2)
+ .EXIT
+ .PROCEND
diff --git a/gdb/testsuite/gdb.disasm/mn10200.exp b/gdb/testsuite/gdb.disasm/mn10200.exp
new file mode 100644
index 00000000000..33cdb47c5c7
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/mn10200.exp
@@ -0,0 +1,478 @@
+
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Jeff Law. (law@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if ![istarget "mn10200*-*-*"] {
+ verbose "Tests ignored for all but mn10200 based targets."
+ return
+}
+
+global exec_output
+set prms_id 0
+set bug_id 0
+
+set testfile "mn10200"
+set srcfile ${srcdir}/${subdir}/${testfile}.s
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc add_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/12i add_tests\n"
+ gdb_expect {
+ -re "
+.*add d1,d2.*
+.*add d2,a3.*
+.*add a2,d1.*
+.*add a3,a2.*
+.*add 16,d1.*
+.*add 256,d2.*
+.*add 131071,d3.*
+.*add 16,a1.*
+.*add 256,a2.*
+.*add 131071,a3.*
+.*addc d1,d2.*
+.*addnf 16,a2.*
+.*$gdb_prompt $" { pass "add tests" }
+ -re "$gdb_prompt $" { fail "add tests" }
+ timeout { fail "(timeout) add tests" }
+ }
+}
+
+proc bcc_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/15i bCC_tests\n"
+ gdb_expect {
+ -re "
+.*beq 0x\[0-9a-f]+ <bCC_tests>.*
+.*bne 0x\[0-9a-f]+ <bCC_tests>.*
+.*bgt 0x\[0-9a-f]+ <bCC_tests>.*
+.*bge 0x\[0-9a-f]+ <bCC_tests>.*
+.*ble 0x\[0-9a-f]+ <bCC_tests>.*
+.*blt 0x\[0-9a-f]+ <bCC_tests>.*
+.*bhi 0x\[0-9a-f]+ <bCC_tests>.*
+.*bcc 0x\[0-9a-f]+ <bCC_tests>.*
+.*bls 0x\[0-9a-f]+ <bCC_tests>.*
+.*bcs 0x\[0-9a-f]+ <bCC_tests>.*
+.*bvc 0x\[0-9a-f]+ <bCC_tests>.*
+.*bvs 0x\[0-9a-f]+ <bCC_tests>.*
+.*bnc 0x\[0-9a-f]+ <bCC_tests>.*
+.*bns 0x\[0-9a-f]+ <bCC_tests>.*
+.*bra 0x\[0-9a-f]+ <bCC_tests>.*
+.*$gdb_prompt $" { pass "bCC tests" }
+ -re "$gdb_prompt $" { fail "bCC tests" }
+ timeout { fail "(timeout) bCC tests" }
+ }
+}
+
+proc bccx_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/14i bCCx_tests\n"
+ gdb_expect {
+ -re "
+.*beqx 0x\[0-9a-f]+ <bCCx_tests>.*
+.*bnex 0x\[0-9a-f]+ <bCCx_tests>.*
+.*bgtx 0x\[0-9a-f]+ <bCCx_tests>.*
+.*bgex 0x\[0-9a-f]+ <bCCx_tests>.*
+.*blex 0x\[0-9a-f]+ <bCCx_tests>.*
+.*bltx 0x\[0-9a-f]+ <bCCx_tests>.*
+.*bhix 0x\[0-9a-f]+ <bCCx_tests>.*
+.*bccx 0x\[0-9a-f]+ <bCCx_tests>.*
+.*blsx 0x\[0-9a-f]+ <bCCx_tests>.*
+.*bcsx 0x\[0-9a-f]+ <bCCx_tests>.*
+.*bvcx 0x\[0-9a-f]+ <bCCx_tests>.*
+.*bvsx 0x\[0-9a-f]+ <bCCx_tests>.*
+.*bncx 0x\[0-9a-f]+ <bCCx_tests>.*
+.*bnsx 0x\[0-9a-f]+ <bCCx_tests>.*
+.*$gdb_prompt $" { pass "bCCx tests" }
+ -re "$gdb_prompt $" { fail "bCCx tests" }
+ timeout { fail "(timeout) bCCx tests" }
+ }
+}
+
+proc bit_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/4 bit_tests\n"
+ gdb_expect {
+ -re "
+.*btst 64,d1.*
+.*btst 8192,d2.*
+.*bset d1,\\(a2\\).*
+.*bclr d1,\\(a2\\).*
+.*$gdb_prompt $" { pass "bit tests" }
+ -re "$gdb_prompt $" { fail "bit tests" }
+ timeout { fail "(timeout) bit tests" }
+ }
+}
+
+proc cmp_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/9i cmp_tests\n"
+ gdb_expect {
+ -re "
+.*cmp d1,d2.*
+.*cmp d2,a3.*
+.*cmp a3,d3.*
+.*cmp a3,a2.*
+.*cmp 16,d3.*
+.*cmp 256,d2.*
+.*cmp 131071,d1.*
+.*cmp 256,a2.*
+.*cmp 131071,a1.*
+.*$gdb_prompt $" { pass "cmp tests" }
+ -re "$gdb_prompt $" { fail "cmp tests" }
+ timeout { fail "(timeout) cmp tests" }
+ }
+}
+
+proc extend_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/5i extend_tests\n"
+ gdb_expect {
+ -re "
+.*ext d1.*
+.*extx d2.*
+.*extxu d3.*
+.*extxb d2.*
+.*extxbu d1.*
+.*$gdb_prompt $" { pass "extend tests" }
+ -re "$gdb_prompt $" { fail "extend tests" }
+ timeout { fail "(timeout) extend tests" }
+ }
+}
+
+proc logical_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/11i logical_tests\n"
+ gdb_expect {
+ -re "
+.*and d1,d2.*
+.*and 127,d2.*
+.*and 32767,d3.*
+.*and 32767,psw.*
+.*or d1,d2.*
+.*or 127,d2.*
+.*or 32767,d3.*
+.*or 32767,psw.*
+.*xor d1,d2.*
+.*xor 32767,d3.*
+.*not d3.*
+.*$gdb_prompt $" { pass "logical tests" }
+ -re "$gdb_prompt $" { fail "logical tests" }
+ timeout { fail "(timeout) logical tests" }
+ }
+}
+
+proc mov_tests_1 { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/12i mov_tests_1\n"
+ gdb_expect {
+ -re "
+.*mov d1,a2.*
+.*mov a2,d1.*
+.*mov d1,d2.*
+.*mov a2,a1.*
+.*mov psw,d3.*
+.*mov d2,psw.*
+.*mov mdr,d1.*
+.*mov d2,mdr.*
+.*mov \\(a2\\),d1.*
+.*mov \\(8,a2\\),d1.*
+.*mov \\(256,a2\\),d1.*
+.*mov \\(131071,a2\\),d1.*
+.*$gdb_prompt $" { pass "mov1 tests" }
+ -re "$gdb_prompt $" { fail "mov1 tests" }
+ timeout { fail "(timeout) mov1 tests" }
+ }
+}
+
+proc mov_tests_2 { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/9 mov_tests_2\n"
+ gdb_expect {
+ -re "
+.*mov \\(d1,a1\\),d2.*
+.*mov \\(0x8000.*\\),d1.*
+.*mov \\(0x1ffff.*\\),d1.*
+.*mov \\(8,a2\\),a1.*
+.*mov \\(256,a2\\),a1.*
+.*mov \\(131071,a2\\),a1.*
+.*mov \\(d1,a1\\),a2.*
+.*mov \\(0x8000.*\\),a1.*
+.*mov \\(0x1ffff.*\\),a1.*
+.*$gdb_prompt $" { pass "mov2 tests" }
+ -re "$gdb_prompt $" { fail "mov2 tests" }
+ timeout { fail "(timeout) mov2 tests" }
+ }
+}
+
+proc mov_tests_3 { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/10 mov_tests_3\n"
+ gdb_expect {
+ -re "
+.*mov d1,\\(a2\\).*
+.*mov d1,\\(32,a2\\).*
+.*mov d1,\\(256,a2\\).*
+.*mov d1,\\(131071,a2\\).*
+.*mov d1,\\(d2,a2\\).*
+.*mov d1,\\(0x80.*\\).*
+.*mov d1,\\(0x1ffff.*\\).*
+.*mov a1,\\(32,a2\\).*
+.*mov a1,\\(256,a2\\).*
+.*mov a1,\\(131071,a2\\).*
+.*$gdb_prompt $" { pass "mov3 tests" }
+ -re "$gdb_prompt $" { fail "mov3 tests" }
+ timeout { fail "(timeout) mov3 tests" }
+ }
+}
+
+proc mov_tests_4 { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/8 mov_tests_4\n"
+ gdb_expect {
+ -re "
+.*mov a1,\\(d2,a2\\).*
+.*mov a1,\\(0x80.*\\).*
+.*mov a1,\\(0x1ffff.*\\).*
+.*mov 8,d1.*
+.*mov 256,d1.*
+.*mov 131071,d1.*
+.*mov 256,a1.*
+.*mov 131071,a1.*
+.*$gdb_prompt $" { pass "mov4 tests" }
+ -re "$gdb_prompt $" { fail "mov4 tests" }
+ timeout { fail "(timeout) mov4 tests" }
+ }
+}
+
+proc movb_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/12 movb_tests\n"
+ gdb_expect {
+ -re "
+.*movb \\(8,a2\\),d1.*
+.*movb \\(256,a2\\),d1.*
+.*movb \\(131071,a2\\),d1.*
+.*movb \\(d2,a2\\),d3.*
+.*movb \\(0x1ffff.*\\),d2.*
+.*movb d1,\\(a2\\).*
+.*movb d1,\\(8,a2\\).*
+.*movb d1,\\(256,a2\\).*
+.*movb d1,\\(131071,a2\\).*
+.*movb d1,\\(d2,a2\\).*
+.*movb d1,\\(0x100.*\\).*
+.*movb d1,\\(0x1ffff.*\\).*
+.*$gdb_prompt $" { pass "movb tests" }
+ -re "$gdb_prompt $" { fail "movb tests" }
+ timeout { fail "(timeout) movb tests" }
+ }
+}
+
+proc movbu_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/7 movbu_tests\n"
+ gdb_expect {
+ -re "
+.*movbu \\(a2\\),d1.*
+.*movbu \\(8,a2\\),d1.*
+.*movbu \\(256,a2\\),d1.*
+.*movbu \\(131071,a2\\),d1.*
+.*movbu \\(d1,a1\\),d2.*
+.*movbu \\(0x8000.*\\),d1.*
+.*movbu \\(0x1ffff.*\\),d1.*
+.*$gdb_prompt $" { pass "movbu tests" }
+ -re "$gdb_prompt $" { fail "movbu tests" }
+ timeout { fail "(timeout) movbu tests" }
+ }
+}
+
+proc movx_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/6 movx_tests\n"
+ gdb_expect {
+ -re "
+.*movx \\(8,a2\\),d1.*
+.*movx \\(256,a2\\),d1.*
+.*movx \\(131071,a2\\),d1.*
+.*movx d1,\\(8,a2\\).*
+.*movx d1,\\(256,a2\\).*
+.*movx d1,\\(131071,a2\\).*
+.*$gdb_prompt $" { pass "movx tests" }
+ -re "$gdb_prompt $" { fail "movx tests" }
+ timeout { fail "(timeout) movx tests" }
+ }
+}
+
+proc muldiv_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/3 muldiv_tests\n"
+ gdb_expect {
+ -re "
+.*mul d1,d2.*
+.*mulu d2,d3.*
+.*divu d3,d2.*
+.*$gdb_prompt $" { pass "muldiv tests" }
+ -re "$gdb_prompt $" { fail "muldiv tests" }
+ timeout { fail "(timeout) muldiv tests" }
+ }
+}
+
+proc misc_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/9 misc_tests\n"
+ gdb_expect {
+ -re "
+.*jmp 0x\[0-9a-f]+ <main>.*
+.*jmp 0x\[0-9a-f]+ <start>.*
+.*jmp \\(a2\\).*
+.*jsr 0x\[0-9a-f]+ <main>.*
+.*jsr 0x\[0-9a-f]+ <start>.*
+.*jsr \\(a2\\).*
+.*rts.*
+.*rti.*
+.*nop.*
+.*$gdb_prompt $" { pass "misc tests" }
+ -re "$gdb_prompt $" { fail "misc tests" }
+ timeout { fail "(timeout) misc tests" }
+ }
+}
+
+proc shift_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/4i shift_tests\n"
+ gdb_expect {
+ -re "
+.*asr d2.*
+.*lsr d3.*
+.*ror d1.*
+.*rol d2.*
+.*$gdb_prompt $" { pass "shift tests" }
+ -re "$gdb_prompt $" { fail "shift tests" }
+ timeout { fail "(timeout) shift tests" }
+ }
+}
+
+proc sub_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/9i sub_tests\n"
+ gdb_expect {
+ -re "
+.*sub d1,d2.*
+.*sub d2,a3.*
+.*sub a3,d3.*
+.*sub a3,a2.*
+.*sub 32767,d2.*
+.*sub 131071,d2.*
+.*sub 32767,a2.*
+.*sub 131071,a2.*
+.*subc d1,d2.*
+.*$gdb_prompt $" { pass "sub tests" }
+ -re "$gdb_prompt $" { fail "sub tests" }
+ timeout { fail "(timeout) sub tests" }
+ }
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+add_tests
+bcc_tests
+bccx_tests
+bit_tests
+cmp_tests
+extend_tests
+logical_tests
+mov_tests_1
+mov_tests_2
+mov_tests_3
+mov_tests_4
+movb_tests
+movbu_tests
+movx_tests
+muldiv_tests
+misc_tests
+shift_tests
+sub_tests
diff --git a/gdb/testsuite/gdb.disasm/mn10200.s b/gdb/testsuite/gdb.disasm/mn10200.s
new file mode 100644
index 00000000000..32357b0401b
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/mn10200.s
@@ -0,0 +1,217 @@
+ .text
+ .global _main
+ .global add_tests
+ .global bCC_tests
+ .global bCCx_tests
+ .global bit_tests
+ .global cmp_tests
+ .global extend_tests
+ .global logical_tests
+ .global mov_tests_1
+ .global mov_tests_2
+ .global mov_tests_3
+ .global mov_tests_4
+ .global movb_tests
+ .global movbu_tests
+ .global movx_tests
+ .global misc_tests
+ .global shift_tests
+ .global sub_tests
+
+_main:
+ nop
+
+add_tests:
+ add d1,d2
+ add d2,a3
+ add a2,d1
+ add a3,a2
+ add 16,d1
+ add 256,d2
+ add 131071,d3
+ add 16,a1
+ add 256,a2
+ add 131071,a3
+ addc d1,d2
+ addnf 16,a2
+
+bCC_tests:
+ beq bCC_tests
+ bne bCC_tests
+ bgt bCC_tests
+ bge bCC_tests
+ ble bCC_tests
+ blt bCC_tests
+ bhi bCC_tests
+ bcc bCC_tests
+ bls bCC_tests
+ bcs bCC_tests
+ bvc bCC_tests
+ bvs bCC_tests
+ bnc bCC_tests
+ bns bCC_tests
+ bra bCC_tests
+
+bCCx_tests:
+ beqx bCCx_tests
+ bnex bCCx_tests
+ bgtx bCCx_tests
+ bgex bCCx_tests
+ blex bCCx_tests
+ bltx bCCx_tests
+ bhix bCCx_tests
+ bccx bCCx_tests
+ blsx bCCx_tests
+ bcsx bCCx_tests
+ bvcx bCCx_tests
+ bvsx bCCx_tests
+ bncx bCCx_tests
+ bnsx bCCx_tests
+
+bit_tests:
+ btst 64,d1
+ btst 8192,d2
+ bset d1,(a2)
+ bclr d1,(a2)
+
+cmp_tests:
+ cmp d1,d2
+ cmp d2,a3
+ cmp a3,d3
+ cmp a3,a2
+ cmp 16,d3
+ cmp 256,d2
+ cmp 131071,d1
+ cmp 256,a2
+ cmp 131071,a1
+
+extend_tests:
+ ext d1
+ extx d2
+ extxu d3
+ extxb d2
+ extxbu d1
+
+logical_tests:
+ and d1,d2
+ and 127,d2
+ and 32767,d3
+ and 32767,psw
+ or d1,d2
+ or 127,d2
+ or 32767,d3
+ or 32767,psw
+ xor d1,d2
+ xor 32767,d3
+ not d3
+
+mov_tests_1:
+ mov d1,a2
+ mov a2,d1
+ mov d1,d2
+ mov a2,a1
+ mov psw,d3
+ mov d2,psw
+ mov mdr,d1
+ mov d2,mdr
+ mov (a2),d1
+ mov (8,a2),d1
+ mov (256,a2),d1
+ mov (131071,a2),d1
+
+mov_tests_2:
+ mov (d1,a1),d2
+ mov (32768),d1
+ mov (131071),d1
+ mov (8,a2),a1
+ mov (256,a2),a1
+ mov (131071,a2),a1
+ mov (d1,a1),a2
+ mov (32768),a1
+ mov (131071),a1
+
+mov_tests_3:
+ mov d1,(a2)
+ mov d1,(32,a2)
+ mov d1,(256,a2)
+ mov d1,(131071,a2)
+ mov d1,(d2,a2)
+ mov d1,(128)
+ mov d1,(131071)
+ mov a1,(32,a2)
+ mov a1,(256,a2)
+ mov a1,(131071,a2)
+
+mov_tests_4:
+ mov a1,(d2,a2)
+ mov a1,(128)
+ mov a1,(131071)
+ mov 8,d1
+ mov 256,d1
+ mov 131071,d1
+ mov 256,a1
+ mov 131071,a1
+
+movb_tests:
+ movb (8,a2),d1
+ movb (256,a2),d1
+ movb (131071,a2),d1
+ movb (d2,a2),d3
+ movb (131071),d2
+ movb d1,(a2)
+ movb d1,(8,a2)
+ movb d1,(256,a2)
+ movb d1,(131071,a2)
+ movb d1,(d2,a2)
+ movb d1,(256)
+ movb d1,(131071)
+
+movbu_tests:
+ movbu (a2),d1
+ movbu (8,a2),d1
+ movbu (256,a2),d1
+ movbu (131071,a2),d1
+ movbu (d1,a1),d2
+ movbu (32768),d1
+ movbu (131071),d1
+
+movx_tests:
+ movx (8,a2),d1
+ movx (256,a2),d1
+ movx (131071,a2),d1
+ movx d1,(8,a2)
+ movx d1,(256,a2)
+ movx d1,(131071,a2)
+
+muldiv_tests:
+ mul d1,d2
+ mulu d2,d3
+ divu d3,d2
+
+misc_tests:
+ jmp _main
+ jmp _start
+ jmp (a2)
+ jsr _main
+ jsr _start
+ jsr (a2)
+ rts
+ rti
+ nop
+
+shift_tests:
+ asr d2
+ lsr d3
+ ror d1
+ rol d2
+
+sub_tests:
+ sub d1,d2
+ sub d2,a3
+ sub a3,d3
+ sub a3,a2
+ sub 32767,d2
+ sub 131071,d2
+ sub 32767,a2
+ sub 131071,a2
+ subc d1,d2
diff --git a/gdb/testsuite/gdb.disasm/mn10300.exp b/gdb/testsuite/gdb.disasm/mn10300.exp
new file mode 100644
index 00000000000..0f12226205b
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/mn10300.exp
@@ -0,0 +1,569 @@
+
+# Copyright 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Jeff Law. (law@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if ![istarget "mn10300*-*-*"] {
+ verbose "Tests ignored for all but mn10300 based targets."
+ return
+}
+
+global exec_output
+set prms_id 0
+set bug_id 0
+
+set testfile "mn10300"
+set srcfile ${srcdir}/${subdir}/${testfile}.s
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc add_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/14i add_tests\n"
+ gdb_expect {
+ -re "
+.*add d1,d2.*
+.*add d2,a3.*
+.*add a3,a2.*
+.*add a2,d1.*
+.*add 16,d1.*
+.*add 256,d2.*
+.*add 131071,d3.*
+.*add 16,a1.*
+.*add 256,a2.*
+.*add 131071,a3.*
+.*add 16,sp.*
+.*add 256,sp.*
+.*add 131071,sp.*
+.*addc d1,d2.*
+.*$gdb_prompt $" { pass "add tests" }
+ -re "$gdb_prompt $" { fail "add tests" }
+ timeout { fail "(timeout) add tests" }
+ }
+}
+
+proc bcc_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/15i bCC_tests\n"
+ gdb_expect {
+ -re "
+.*beq 0x\[0-9a-f]+ <bCC_tests>.*
+.*bne 0x\[0-9a-f]+ <bCC_tests>.*
+.*bgt 0x\[0-9a-f]+ <bCC_tests>.*
+.*bge 0x\[0-9a-f]+ <bCC_tests>.*
+.*ble 0x\[0-9a-f]+ <bCC_tests>.*
+.*blt 0x\[0-9a-f]+ <bCC_tests>.*
+.*bhi 0x\[0-9a-f]+ <bCC_tests>.*
+.*bcc 0x\[0-9a-f]+ <bCC_tests>.*
+.*bls 0x\[0-9a-f]+ <bCC_tests>.*
+.*bcs 0x\[0-9a-f]+ <bCC_tests>.*
+.*bvc 0x\[0-9a-f]+ <bCC_tests>.*
+.*bvs 0x\[0-9a-f]+ <bCC_tests>.*
+.*bnc 0x\[0-9a-f]+ <bCC_tests>.*
+.*bns 0x\[0-9a-f]+ <bCC_tests>.*
+.*bra 0x\[0-9a-f]+ <bCC_tests>.*
+.*$gdb_prompt $" { pass "bCC tests" }
+ -re "$gdb_prompt $" { fail "bCC tests" }
+ timeout { fail "(timeout) bCC tests" }
+ }
+}
+
+proc bit_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/11i bit_tests\n"
+ gdb_expect {
+ -re "
+.*btst 64,d1.*
+.*btst 8192,d2.*
+.*btst 131071,d3.*
+.*btst 64,\\(8,a1\\).*
+.*btst 64,\\(0x1ffff\\).*
+.*bset d1,\\(a2\\).*
+.*bset 64,\\(8,a1\\).*
+.*bset 64,\\(0x1ffff\\).*
+.*bclr d1,\\(a2\\).*
+.*bclr 64,\\(8,a1\\).*
+.*bclr 64,\\(0x1ffff\\).*
+.*$gdb_prompt $" { pass "bit tests" }
+ -re "$gdb_prompt $" { fail "bit tests" }
+ timeout { fail "(timeout) bit tests" }
+ }
+}
+
+proc cmp_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/10i cmp_tests\n"
+ gdb_expect {
+ -re "
+.*cmp d1,d2.*
+.*cmp d2,a3.*
+.*cmp a3,d3.*
+.*cmp a3,a2.*
+.*cmp 16,d3.*
+.*cmp 256,d2.*
+.*cmp 131071,d1.*
+.*cmp 16,a3.*
+.*cmp 256,a2.*
+.*cmp 131071,a1.*
+.*$gdb_prompt $" { pass "cmp tests" }
+ -re "$gdb_prompt $" { fail "cmp tests" }
+ timeout { fail "(timeout) cmp tests" }
+ }
+}
+
+proc extend_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/5i extend_tests\n"
+ gdb_expect {
+ -re "
+.*ext d1.*
+.*extb d2.*
+.*extbu d3.*
+.*exth d2.*
+.*exthu d1.*
+.*$gdb_prompt $" { pass "extend tests" }
+ -re "$gdb_prompt $" { fail "extend tests" }
+ timeout { fail "(timeout) extend tests" }
+ }
+}
+
+proc extended_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/13i extended_tests\n"
+ gdb_expect {
+ -re "
+.*putx d1.*
+.*getx d2.*
+.*mulq d1,d2.*
+.*mulq 16,d2.*
+.*mulq 256,d3.*
+.*mulq 131071,d3.*
+.*mulqu d1,d2.*
+.*mulqu 16,d2.*
+.*mulqu 256,d3.*
+.*mulqu 131071,d3.*
+.*sat16 d2,d3.*
+.*sat24 d3,d2.*
+.*bsch d1,d2.*
+.*$gdb_prompt $" { pass "extended tests" }
+ -re "$gdb_prompt $" { fail "extended tests" }
+ timeout { fail "(timeout) extended tests" }
+ }
+}
+
+proc logical_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/14i logical_tests\n"
+ gdb_expect {
+ -re "
+.*and d1,d2.*
+.*and 127,d2.*
+.*and 32767,d3.*
+.*and 131071,d3.*
+.*and 32767,psw.*
+.*or d1,d2.*
+.*or 127,d2.*
+.*or 32767,d3.*
+.*or 131071,d3.*
+.*or 32767,psw.*
+.*xor d1,d2.*
+.*xor 32767,d3.*
+.*xor 131071,d3.*
+.*not d3.*
+.*$gdb_prompt $" { pass "logical tests" }
+ -re "$gdb_prompt $" { fail "logical tests" }
+ timeout { fail "(timeout) logical tests" }
+ }
+}
+
+proc loop_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/12i loop_tests\n"
+ gdb_expect {
+ -re "
+.*leq.*
+.*lne.*
+.*lgt.*
+.*lge.*
+.*lle.*
+.*llt.*
+.*lhi.*
+.*lcc.*
+.*lls.*
+.*lcs.*
+.*lra.*
+.*setlb.*
+.*$gdb_prompt $" { pass "loop tests" }
+ -re "$gdb_prompt $" { fail "loop tests" }
+ timeout { fail "(timeout) loop tests" }
+ }
+}
+
+proc mov_tests_1 { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/16i mov_tests_1\n"
+ gdb_expect {
+ -re "
+.*mov d1,d2.*
+.*mov d1,a2.*
+.*mov a2,d1.*
+.*mov a2,a1.*
+.*mov sp,a2.*
+.*mov a1,sp.*
+.*mov d2,psw.*
+.*mov mdr,d1.*
+.*mov d2,mdr.*
+.*mov \\(a2\\),d1.*
+.*mov \\(8,a2\\),d1.*
+.*mov \\(256,a2\\),d1.*
+.*mov \\(131071,a2\\),d1.*
+.*mov \\(8,sp\\),d1.*
+.*mov \\(256,sp\\),d1.*
+.*mov psw,d3.*
+.*$gdb_prompt $" { pass "mov1 tests" }
+ -re "$gdb_prompt $" { fail "mov1 tests" }
+ timeout { fail "(timeout) mov1 tests" }
+ }
+}
+
+proc mov_tests_2 { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/15i mov_tests_2\n"
+ gdb_expect {
+ -re "
+.*mov \\(131071,sp\\),d1.*
+.*mov \\(d1,a1\\),d2.*
+.*mov \\(0x8000.*\\),d1.*
+.*mov \\(0x1ffff.*\\),d1.*
+.*mov \\(a2\\),a1.*
+.*mov \\(8,a2\\),a1.*
+.*mov \\(256,a2\\),a1.*
+.*mov \\(131071,a2\\),a1.*
+.*mov \\(8,sp\\),a1.*
+.*mov \\(256,sp\\),a1.*
+.*mov \\(131071,sp\\),a1.*
+.*mov \\(d1,a1\\),a2.*
+.*mov \\(0x8000.*\\),a1.*
+.*mov \\(0x1ffff.*\\),a1.*
+.*mov \\(32,a1\\),sp.*
+.*$gdb_prompt $" { pass "mov2 tests" }
+ -re "$gdb_prompt $" { fail "mov2 tests" }
+ timeout { fail "(timeout) mov2 tests" }
+ }
+}
+
+proc mov_tests_3 { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/15i mov_tests_3\n"
+ gdb_expect {
+ -re "
+.*mov d1,\\(a2\\).*
+.*mov d1,\\(32,a2\\).*
+.*mov d1,\\(256,a2\\).*
+.*mov d1,\\(131071,a2\\).*
+.*mov d1,\\(32,sp\\).*
+.*mov d1,\\(32768,sp\\).*
+.*mov d1,\\(131071,sp\\).*
+.*mov d1,\\(d2,a2\\).*
+.*mov d1,\\(0x80.*\\).*
+.*mov d1,\\(0x1ffff.*\\).*
+.*mov a1,\\(a2\\).*
+.*mov a1,\\(32,a2\\).*
+.*mov a1,\\(256,a2\\).*
+.*mov a1,\\(131071,a2\\).*
+.*mov a1,\\(32,sp\\).*
+.*$gdb_prompt $" { pass "mov3 tests" }
+ -re "$gdb_prompt $" { fail "mov3 tests" }
+ timeout { fail "(timeout) mov3 tests" }
+ }
+}
+
+proc mov_tests_4 { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/12i mov_tests_4\n"
+ gdb_expect {
+ -re "
+.*mov a1,\\(32768,sp\\).*
+.*mov a1,\\(131071,sp\\).*
+.*mov a1,\\(d2,a2\\).*
+.*mov a1,\\(0x80.*\\).*
+.*mov a1,\\(0x1ffff.*\\).*
+.*mov sp,\\(32,a1\\).*
+.*mov 8,d1.*
+.*mov 256,d1.*
+.*mov 131071,d1.*
+.*mov 8,a1.*
+.*mov 256,a1.*
+.*mov 131071,a1.*
+.*$gdb_prompt $" { pass "mov4 tests" }
+ -re "$gdb_prompt $" { fail "mov4 tests" }
+ timeout { fail "(timeout) mov4 tests" }
+ }
+}
+
+proc movbu_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/20i movbu_tests\n"
+ gdb_expect {
+ -re "
+.*movbu \\(a2\\),d1.*
+.*movbu \\(8,a2\\),d1.*
+.*movbu \\(256,a2\\),d1.*
+.*movbu \\(131071,a2\\),d1.*
+.*movbu \\(8,sp\\),d1.*
+.*movbu \\(256,sp\\),d1.*
+.*movbu \\(131071,sp\\),d1.*
+.*movbu \\(d1,a1\\),d2.*
+.*movbu \\(0x8000.*\\),d1.*
+.*movbu \\(0x1ffff.*\\),d1.*
+.*movbu d1,\\(a2\\).*
+.*movbu d1,\\(32,a2\\).*
+.*movbu d1,\\(256,a2\\).*
+.*movbu d1,\\(131071,a2\\).*
+.*movbu d1,\\(32,sp\\).*
+.*movbu d1,\\(32768,sp\\).*
+.*movbu d1,\\(131071,sp\\).*
+.*movbu d1,\\(d2,a2\\).*
+.*movbu d1,\\(0x80.*\\).*
+.*movbu d1,\\(0x1ffff.*\\).*
+.*$gdb_prompt $" { pass "movbu tests" }
+ -re "$gdb_prompt $" { fail "movbu tests" }
+ timeout { fail "(timeout) movbu tests" }
+ }
+}
+
+proc movhu_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/20i movhu_tests\n"
+ gdb_expect {
+ -re "
+.*movhu \\(a2\\),d1.*
+.*movhu \\(8,a2\\),d1.*
+.*movhu \\(256,a2\\),d1.*
+.*movhu \\(131071,a2\\),d1.*
+.*movhu \\(8,sp\\),d1.*
+.*movhu \\(256,sp\\),d1.*
+.*movhu \\(131071,sp\\),d1.*
+.*movhu \\(d1,a1\\),d2.*
+.*movhu \\(0x8000.*\\),d1.*
+.*movhu \\(0x1ffff.*\\),d1.*
+.*movhu d1,\\(a2\\).*
+.*movhu d1,\\(32,a2\\).*
+.*movhu d1,\\(256,a2\\).*
+.*movhu d1,\\(131071,a2\\).*
+.*movhu d1,\\(32,sp\\).*
+.*movhu d1,\\(32768,sp\\).*
+.*movhu d1,\\(131071,sp\\).*
+.*movhu d1,\\(d2,a2\\).*
+.*movhu d1,\\(0x80.*\\).*
+.*movhu d1,\\(0x1ffff.*\\).*
+.*$gdb_prompt $" { pass "movhu tests" }
+ -re "$gdb_prompt $" { fail "movhu tests" }
+ timeout { fail "(timeout) movhu tests" }
+ }
+}
+
+proc movm_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/4i movm_tests\n"
+ gdb_expect {
+ -re "
+.*movm \\(sp\\),.a2,a3..*
+.*movm \\(sp\\),.d2,d3,a2,a3,other..*
+.*movm .a2,a3.,\\(sp\\).*
+.*movm .d2,d3,a2,a3,other.,\\(sp\\).*
+.*$gdb_prompt $" { pass "movm tests" }
+ -re "$gdb_prompt $" { fail "movm tests" }
+ timeout { fail "(timeout) movm tests" }
+ }
+}
+
+proc muldiv_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/4i muldiv_tests\n"
+ gdb_expect {
+ -re "
+.*mul d1,d2.*
+.*mulu d2,d3.*
+.*div d3,d3.*
+.*divu d3,d2.*
+.*$gdb_prompt $" { pass "muldiv tests" }
+ -re "$gdb_prompt $" { fail "muldiv tests" }
+ timeout { fail "(timeout) muldiv tests" }
+ }
+}
+
+proc other_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/19i other_tests\n"
+ gdb_expect {
+ -re "
+.*clr d2.*
+.*inc d1.*
+.*inc a2.*
+.*inc4 a3.*
+.*jmp \\(a2\\).*
+.*jmp 0x\[0-9a-f]+ <main>.*
+.*jmp 0x\[0-9a-f]+ <start>.*
+.*call 0x\[0-9a-f]+ <main>,.a2,a3.,9.*
+.*call 0x\[0-9a-f]+ <start>,.a2,a3.,32.*
+.*calls \\(a2\\).*
+.*calls 0x\[0-9a-f]+ <main>.*
+.*calls 0x\[0-9a-f]+ <start>.*
+.*ret .a2,a3.,7.*
+.*retf .a2,a3.,5.*
+.*rets.*
+.*rti.*
+.*trap.*
+.*nop.*
+.*rtm.*
+.*$gdb_prompt $" { pass "other tests" }
+ -re "$gdb_prompt $" { fail "other tests" }
+ timeout { fail "(timeout) other tests" }
+ }
+}
+
+proc shift_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/9i shift_tests\n"
+ gdb_expect {
+ -re "
+.*asr d1,d2.*
+.*asr 4,d2.*
+.*lsr d2,d3.*
+.*lsr 4,d3.*
+.*asl d3,d2.*
+.*asl 4,d2.*
+.*asl2 d2.*
+.*ror d1.*
+.*rol d2.*
+.*$gdb_prompt $" { pass "shift tests" }
+ -re "$gdb_prompt $" { fail "shift tests" }
+ timeout { fail "(timeout) shift tests" }
+ }
+}
+
+proc sub_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/7i sub_tests\n"
+ gdb_expect {
+ -re "
+.*sub d1,d2.*
+.*sub d2,a3.*
+.*sub a3,d3.*
+.*sub a3,a2.*
+.*sub 131071,d2.*
+.*sub 131071,a1.*
+.*subc d1,d2.*
+.*$gdb_prompt $" { pass "sub tests" }
+ -re "$gdb_prompt $" { fail "sub tests" }
+ timeout { fail "(timeout) sub tests" }
+ }
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+add_tests
+bcc_tests
+bit_tests
+cmp_tests
+extend_tests
+extended_tests
+logical_tests
+loop_tests
+mov_tests_1
+mov_tests_2
+mov_tests_3
+mov_tests_4
+movbu_tests
+movhu_tests
+movm_tests
+muldiv_tests
+other_tests
+shift_tests
+sub_tests
diff --git a/gdb/testsuite/gdb.disasm/mn10300.s b/gdb/testsuite/gdb.disasm/mn10300.s
new file mode 100644
index 00000000000..3ad6c95e6a1
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/mn10300.s
@@ -0,0 +1,300 @@
+ .text
+ .global _main
+ .global add_tests
+ .global bCC_tests
+ .global bit_tests
+ .global cmp_tests
+ .global extend_tests
+ .global extended_tests
+ .global logical_tests
+ .global loop_tests
+ .global mov_tests_1
+ .global mov_tests_2
+ .global mov_tests_3
+ .global mov_tests_4
+ .global movbu_tests
+ .global movhu_tests
+ .global movm_tests
+ .global muldiv_tests
+ .global other_tests
+ .global shift_tests
+ .global sub_tests
+
+_main:
+ nop
+
+add_tests:
+ add d1,d2
+ add d2,a3
+ add a3,a2
+ add a2,d1
+ add 16,d1
+ add 256,d2
+ add 131071,d3
+ add 16,a1
+ add 256,a2
+ add 131071,a3
+ add 16,sp
+ add 256,sp
+ add 131071,sp
+ addc d1,d2
+
+bCC_tests:
+ beq bCC_tests
+ bne bCC_tests
+ bgt bCC_tests
+ bge bCC_tests
+ ble bCC_tests
+ blt bCC_tests
+ bhi bCC_tests
+ bcc bCC_tests
+ bls bCC_tests
+ bcs bCC_tests
+ bvc bCC_tests
+ bvs bCC_tests
+ bnc bCC_tests
+ bns bCC_tests
+ bra bCC_tests
+
+bit_tests:
+ btst 64,d1
+ btst 8192,d2
+ btst 131071,d3
+ btst 64,(8,a1)
+ btst 64,(0x1ffff)
+ bset d1,(a2)
+ bset 64,(8,a1)
+ bset 64,(0x1ffff)
+ bclr d1,(a2)
+ bclr 64,(8,a1)
+ bclr 64,(0x1ffff)
+
+cmp_tests:
+ cmp d1,d2
+ cmp d2,a3
+ cmp a3,d3
+ cmp a3,a2
+ cmp 16,d3
+ cmp 256,d2
+ cmp 131071,d1
+ cmp 16,a3
+ cmp 256,a2
+ cmp 131071,a1
+
+
+extend_tests:
+ ext d1
+ extb d2
+ extbu d3
+ exth d2
+ exthu d1
+
+extended_tests:
+ putx d1
+ getx d2
+ mulq d1,d2
+ mulq 16,d2
+ mulq 256,d3
+ mulq 131071,d3
+ mulqu d1,d2
+ mulqu 16,d2
+ mulqu 256,d3
+ mulqu 131071,d3
+ sat16 d2,d3
+ sat24 d3,d2
+ bsch d1,d2
+
+logical_tests:
+ and d1,d2
+ and 127,d2
+ and 32767,d3
+ and 131071,d3
+ and 32767,psw
+ or d1,d2
+ or 127,d2
+ or 32767,d3
+ or 131071,d3
+ or 32767,psw
+ xor d1,d2
+ xor 32767,d3
+ xor 131071,d3
+ not d3
+
+loop_tests:
+ leq
+ lne
+ lgt
+ lge
+ lle
+ llt
+ lhi
+ lcc
+ lls
+ lcs
+ lra
+ setlb
+
+mov_tests_1:
+ mov d1,d2
+ mov d1,a2
+ mov a2,d1
+ mov a2,a1
+ mov sp,a2
+ mov a1,sp
+ mov d2,psw
+ mov mdr,d1
+ mov d2,mdr
+ mov (a2),d1
+ mov (8,a2),d1
+ mov (256,a2),d1
+ mov (131071,a2),d1
+ mov (8,sp),d1
+ mov (256,sp),d1
+ mov psw,d3
+
+mov_tests_2:
+ mov (131071,sp),d1
+ mov (d1,a1),d2
+ mov (32768),d1
+ mov (131071),d1
+ mov (a2),a1
+ mov (8,a2),a1
+ mov (256,a2),a1
+ mov (131071,a2),a1
+ mov (8,sp),a1
+ mov (256,sp),a1
+ mov (131071,sp),a1
+ mov (d1,a1),a2
+ mov (32768),a1
+ mov (131071),a1
+ mov (32,a1),sp
+
+mov_tests_3:
+ mov d1,(a2)
+ mov d1,(32,a2)
+ mov d1,(256,a2)
+ mov d1,(131071,a2)
+ mov d1,(32,sp)
+ mov d1,(32768,sp)
+ mov d1,(131071,sp)
+ mov d1,(d2,a2)
+ mov d1,(128)
+ mov d1,(131071)
+ mov a1,(a2)
+ mov a1,(32,a2)
+ mov a1,(256,a2)
+ mov a1,(131071,a2)
+ mov a1,(32,sp)
+
+mov_tests_4:
+ mov a1,(32768,sp)
+ mov a1,(131071,sp)
+ mov a1,(d2,a2)
+ mov a1,(128)
+ mov a1,(131071)
+ mov sp,(32,a1)
+ mov 8,d1
+ mov 256,d1
+ mov 131071,d1
+ mov 8,a1
+ mov 256,a1
+ mov 131071,a1
+
+movbu_tests:
+ movbu (a2),d1
+ movbu (8,a2),d1
+ movbu (256,a2),d1
+ movbu (131071,a2),d1
+ movbu (8,sp),d1
+ movbu (256,sp),d1
+ movbu (131071,sp),d1
+ movbu (d1,a1),d2
+ movbu (32768),d1
+ movbu (131071),d1
+ movbu d1,(a2)
+ movbu d1,(32,a2)
+ movbu d1,(256,a2)
+ movbu d1,(131071,a2)
+ movbu d1,(32,sp)
+ movbu d1,(32768,sp)
+ movbu d1,(131071,sp)
+ movbu d1,(d2,a2)
+ movbu d1,(128)
+ movbu d1,(131071)
+
+movhu_tests:
+ movhu (a2),d1
+ movhu (8,a2),d1
+ movhu (256,a2),d1
+ movhu (131071,a2),d1
+ movhu (8,sp),d1
+ movhu (256,sp),d1
+ movhu (131071,sp),d1
+ movhu (d1,a1),d2
+ movhu (32768),d1
+ movhu (131071),d1
+ movhu d1,(a2)
+ movhu d1,(32,a2)
+ movhu d1,(256,a2)
+ movhu d1,(131071,a2)
+ movhu d1,(32,sp)
+ movhu d1,(32768,sp)
+ movhu d1,(131071,sp)
+ movhu d1,(d2,a2)
+ movhu d1,(128)
+ movhu d1,(131071)
+
+movm_tests:
+ movm (sp),[a2,a3]
+ movm (sp),[d2,d3,a2,a3,other]
+ movm [a2,a3],(sp)
+ movm [d2,d3,a2,a3,other],(sp)
+
+
+muldiv_tests:
+ mul d1,d2
+ mulu d2,d3
+ div d3,d3
+ divu d3,d2
+
+other_tests:
+ clr d2
+ inc d1
+ inc a2
+ inc4 a3
+ jmp (a2)
+ jmp _main
+ jmp _start
+ call _main,[a2,a3],9
+ call _start,[a2,a3],32
+ calls (a2)
+ calls _main
+ calls _start
+ ret [a2,a3],7
+ retf [a2,a3],5
+ rets
+ rti
+ trap
+ nop
+ rtm
+
+shift_tests:
+ asr d1,d2
+ asr 4,d2
+ lsr d2,d3
+ lsr 4,d3
+ asl d3,d2
+ asl 4,d2
+ asl2 d2
+ ror d1
+ rol d2
+
+sub_tests:
+ sub d1,d2
+ sub d2,a3
+ sub a3,d3
+ sub a3,a2
+ sub 131071,d2
+ sub 131071,a1
+ subc d1,d2
+
diff --git a/gdb/testsuite/gdb.disasm/sh3.exp b/gdb/testsuite/gdb.disasm/sh3.exp
new file mode 100644
index 00000000000..6c82f9151fb
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/sh3.exp
@@ -0,0 +1,123 @@
+# Copyright (C) 1992, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Jeff Law. (law@cs.utah.edu)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if ![istarget "sh3*-*-*"] {
+ verbose "Tests ignored for all but sh3 based targets."
+ return
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "sh3"
+set srcfile ${srcdir}/${subdir}/${testfile}.s
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcfile}" "${binfile}" executable ""] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+proc all_fp_move_and_load_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/9i fp_move_and_load_tests\n"
+ gdb_expect {
+ -re "
+.*fmov.s\t@r0,fr0.*
+.*fmov.s\tfr0,@r0.*
+.*fmov.s\t@r0\\+,fr0.*
+.*fmov.s\tfr0,@-r0.*
+.*fmov.s\t@\\(r0,r0\\),fr0.*
+.*fmov.s\tfr0,@\\(r0,r0\\).*
+.*fmov\tfr0,fr1.*
+.*fldi0\tfr0.*
+.*fldi1\tfr0.*
+.*$gdb_prompt $" { pass "fp_move_and_load_tests" }
+ -re "$gdb_prompt $" { fail "fp_move_and_load_tests" }
+ timeout { fail "(timeout) fp_move_and_load_tests" }
+ }
+}
+
+proc all_fp_arithmetic_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/13i fp_arithmetic_tests\n"
+ gdb_expect {
+ -re "
+.*fadd\tfr0,fr1.*
+.*fsub\tfr0,fr1.*
+.*fmul\tfr0,fr1.*
+.*fdiv\tfr0,fr1.*
+.*fmac\tfr0,fr0,fr1.*
+.*fcmp/eq\tfr0,fr1.*
+.*fcmp/gt\tfr0,fr1.*
+.*ftst/nan\tfr0.*
+.*fneg\tfr0.*
+.*fabs\tfr0.*
+.*fsqrt\tfr0.*
+.*float\tfpul,fr0.*
+.*ftrc\tfr0,fpul.*
+.*$gdb_prompt $" { pass "fp_arithmetic_tests" }
+ -re "$gdb_prompt $" { fail "fp_arithmetic_tests" }
+ timeout { fail "(timeout) fp_arithmetic_tests" }
+ }
+}
+
+proc all_fp_misc_tests { } {
+ global gdb_prompt
+ global hex
+ global decimal
+
+ send_gdb "x/10i fp_misc_tests\n"
+ gdb_expect {
+ -re "
+.*fsts\tfpul,fr0.*
+.*flds\tfr0,fpul.*
+.*lds\tr3,fpul.*
+.*lds\\.l\t@r3\\+,fpul.*
+.*lds\tr3,fpscr.*
+.*lds\\.l\t@r3\\+,fpscr.*
+.*sts\tfpul,r3.*
+.*sts\\.l\tfpul,@-r3.*
+.*sts\tfpscr,r3.*
+.*sts\\.l\tfpscr,@-r3.*
+.*$gdb_prompt $" { pass "fp_misc_tests" }
+ -re "$gdb_prompt $" { fail "fp_misc_tests" }
+ timeout { fail "(timeout) fp_misc_tests" }
+ }
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+all_fp_move_and_load_tests
+all_fp_arithmetic_tests
+all_fp_misc_tests
+
diff --git a/gdb/testsuite/gdb.disasm/sh3.s b/gdb/testsuite/gdb.disasm/sh3.s
new file mode 100644
index 00000000000..8bab256901c
--- /dev/null
+++ b/gdb/testsuite/gdb.disasm/sh3.s
@@ -0,0 +1,54 @@
+ .file "test.c"
+ .data
+
+! Hitachi SH cc1 (cygnus-2.7.1-950728) arguments: -O -fpeephole
+! -ffunction-cse -freg-struct-return -fdelayed-branch -fcommon -fgnu-linker
+
+gcc2_compiled.:
+___gnu_compiled_c:
+ .text
+ .align 2
+ .global _fp_move_and_load_tests
+ .global _fp_arithmetic_tests
+ .global _fp_misc_tests
+ .global _main
+
+_main:
+_fp_move_and_load_tests:
+ fmov.s @r0,fr0
+ fmov.s fr0,@r0
+ fmov.s @r0+,fr0
+ fmov.s fr0,@-r0
+ fmov.s @(r0,r0),fr0
+ fmov.s fr0,@(r0,r0)
+ fmov fr0,fr1
+ fldi0 fr0
+ fldi1 fr0
+
+_fp_arithmetic_tests:
+ fadd fr0,fr1
+ fsub fr0,fr1
+ fmul fr0,fr1
+ fdiv fr0,fr1
+ fmac fr0,fr0,fr1
+ fcmp/eq fr0,fr1
+ fcmp/gt fr0,fr1
+ ftst/nan fr0
+ fneg fr0
+ fabs fr0
+ fsqrt fr0
+ float fpul,fr0
+ ftrc fr0,fpul
+
+_fp_misc_tests:
+ fsts fpul,fr0
+ flds fr0,fpul
+ lds r3,fpul
+ lds.l @r3+,fpul
+ lds r3,fpscr
+ lds.l @r3+,fpscr
+ sts fpul,r3
+ sts.l fpul,@-r3
+ sts fpscr,r3
+ sts.l fpscr,@-r3
+
diff --git a/gdb/testsuite/gdb.fortran/exprs.exp b/gdb/testsuite/gdb.fortran/exprs.exp
new file mode 100644
index 00000000000..cccc82a3f5d
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/exprs.exp
@@ -0,0 +1,273 @@
+# Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was adapted from Chill tests by Stan Shebs (shebs@cygnus.com).
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# Set the current language to fortran. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_fortran {} {
+ global gdb_prompt
+
+ if [gdb_test "set language fortran" ""] {
+ return 0;
+ }
+
+ if ![gdb_test "show language" ".* source language is \"fortran\".*"] {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+proc test_integer_literals_accepted {} {
+ global gdb_prompt
+
+ # Test various decimal values.
+
+ gdb_test "p 123" " = 123"
+ gdb_test "p -123" " = -123"
+}
+
+proc test_character_literals_accepted {} {
+ global gdb_prompt
+
+ # Test various character values.
+
+ gdb_test "p 'a'" " = 'a'"
+}
+
+proc test_integer_literals_rejected {} {
+ global gdb_prompt
+
+ test_print_reject "p _"
+}
+
+proc test_logical_literals_accepted {} {
+ global gdb_prompt
+
+ # Test the only possible values for a logical, TRUE and FALSE.
+
+ gdb_test "p .TRUE." " = .TRUE."
+ gdb_test "p .FALSE." " = .FALSE."
+}
+
+proc test_float_literals_accepted {} {
+ global gdb_prompt
+
+ # Test various floating point formats
+
+ gdb_test "p .44 .LT. .45" " = .TRUE."
+ gdb_test "p .44 .GT. .45" " = .FALSE."
+ gdb_test "p 0.44 .LT. 0.45" " = .TRUE."
+ gdb_test "p 0.44 .GT. 0.45" " = .FALSE."
+ gdb_test "p 44. .LT. 45." " = .TRUE."
+ gdb_test "p 44. .GT. 45." " = .FALSE."
+ gdb_test "p 44.0 .LT. 45.0" " = .TRUE."
+ gdb_test "p 44.0 .GT. 45.0" " = .FALSE."
+ gdb_test "p 10D20 .LT. 10D21" " = .TRUE."
+ gdb_test "p 10D20 .GT. 10D21" " = .FALSE."
+ gdb_test "p 10d20 .LT. 10d21" " = .TRUE."
+ gdb_test "p 10d20 .GT. 10d21" " = .FALSE."
+ gdb_test "p 10E20 .LT. 10E21" " = .TRUE."
+ gdb_test "p 10E20 .GT. 10E21" " = .FALSE."
+ gdb_test "p 10e20 .LT. 10e21" " = .TRUE."
+ gdb_test "p 10e20 .GT. 10e21" " = .FALSE."
+ gdb_test "p 10.D20 .LT. 10.D21" " = .TRUE."
+ gdb_test "p 10.D20 .GT. 10.D21" " = .FALSE."
+ gdb_test "p 10.d20 .LT. 10.d21" " = .TRUE."
+ gdb_test "p 10.d20 .GT. 10.d21" " = .FALSE."
+ gdb_test "p 10.E20 .LT. 10.E21" " = .TRUE."
+ gdb_test "p 10.E20 .GT. 10.E21" " = .FALSE."
+ gdb_test "p 10.e20 .LT. 10.e21" " = .TRUE."
+ gdb_test "p 10.e20 .GT. 10.e21" " = .FALSE."
+ gdb_test "p 10.0D20 .LT. 10.0D21" " = .TRUE."
+ gdb_test "p 10.0D20 .GT. 10.0D21" " = .FALSE."
+ gdb_test "p 10.0d20 .LT. 10.0d21" " = .TRUE."
+ gdb_test "p 10.0d20 .GT. 10.0d21" " = .FALSE."
+ gdb_test "p 10.0E20 .LT. 10.0E21" " = .TRUE."
+ gdb_test "p 10.0E20 .GT. 10.0E21" " = .FALSE."
+ gdb_test "p 10.0e20 .LT. 10.0e21" " = .TRUE."
+ gdb_test "p 10.0e20 .GT. 10.0e21" " = .FALSE."
+ gdb_test "p 10.0D+20 .LT. 10.0D+21" " = .TRUE."
+ gdb_test "p 10.0D+20 .GT. 10.0D+21" " = .FALSE."
+ gdb_test "p 10.0d+20 .LT. 10.0d+21" " = .TRUE."
+ gdb_test "p 10.0d+20 .GT. 10.0d+21" " = .FALSE."
+ gdb_test "p 10.0E+20 .LT. 10.0E+21" " = .TRUE."
+ gdb_test "p 10.0E+20 .GT. 10.0E+21" " = .FALSE."
+ gdb_test "p 10.0e+20 .LT. 10.0e+21" " = .TRUE."
+ gdb_test "p 10.0e+20 .GT. 10.0e+21" " = .FALSE."
+ gdb_test "p 10.0D-11 .LT. 10.0D-10" " = .TRUE."
+ gdb_test "p 10.0D-11 .GT. 10.0D-10" " = .FALSE."
+ gdb_test "p 10.0d-11 .LT. 10.0d-10" " = .TRUE."
+ gdb_test "p 10.0d-11 .GT. 10.0d-10" " = .FALSE."
+ gdb_test "p 10.0E-11 .LT. 10.0E-10" " = .TRUE."
+ gdb_test "p 10.0E-11 .GT. 10.0E-10" " = .FALSE."
+ gdb_test "p 10.0e-11 .LT. 10.0e-10" " = .TRUE."
+ gdb_test "p 10.0e-11 .GT. 10.0e-10" " = .FALSE."
+}
+
+proc test_convenience_variables {} {
+ global gdb_prompt
+
+ gdb_test "set \$foo = 101" " = 101\[\r\n\]*" \
+ "Set a new convenience variable"
+
+ gdb_test "print \$foo" " = 101" \
+ "Print contents of new convenience variable"
+
+ gdb_test "set \$foo = 301" " = 301\[\r\n\]*" \
+ "Set convenience variable to a new value"
+
+ gdb_test "print \$foo" " = 301" \
+ "Print new contents of convenience variable"
+
+ gdb_test "set \$_ = 11" " = 11\[\r\n\]*" \
+ "Set convenience variable \$_"
+
+ gdb_test "print \$_" " = 11" \
+ "Print contents of convenience variable \$_"
+
+ gdb_test "print \$foo + 10" " = 311" \
+ "Use convenience variable in arithmetic expression"
+
+ gdb_test "print (\$foo = 32) + 4" " = 36" \
+ "Use convenience variable assignment in arithmetic expression"
+
+ gdb_test "print \$bar" " = VOID" \
+ "Print contents of uninitialized convenience variable"
+}
+
+proc test_value_history {} {
+ global gdb_prompt
+
+ gdb_test "print 101" "\\\$1 = 101" \
+ "Set value-history\[1\] using \$1"
+
+ gdb_test "print 102" "\\\$2 = 102" \
+ "Set value-history\[2\] using \$2"
+
+ gdb_test "print 103" "\\\$3 = 103" \
+ "Set value-history\[3\] using \$3"
+
+ gdb_test "print \$\$" "\\\$4 = 102" \
+ "Print value-history\[MAX-1\] using inplicit index \$\$"
+
+ gdb_test "print \$\$" "\\\$5 = 103" \
+ "Print value-history\[MAX-1\] again using implicit index \$\$"
+
+ gdb_test "print \$" "\\\$6 = 103" \
+ "Print value-history\[MAX\] using implicit index \$"
+
+ gdb_test "print \$\$2" "\\\$7 = 102" \
+ "Print value-history\[MAX-2\] using explicit index \$\$2"
+
+ gdb_test "print \$0" "\\\$8 = 102" \
+ "Print value-history\[MAX\] using explicit index \$0"
+
+ gdb_test "print 108" "\\\$9 = 108" ""
+
+ gdb_test "print \$\$0" "\\\$10 = 108" \
+ "Print value-history\[MAX\] using explicit index \$\$0"
+
+ gdb_test "print \$1" "\\\$11 = 101" \
+ "Print value-history\[1\] using explicit index \$1"
+
+ gdb_test "print \$2" "\\\$12 = 102" \
+ "Print value-history\[2\] using explicit index \$2"
+
+ gdb_test "print \$3" "\\\$13 = 103" \
+ "Print value-history\[3\] using explicit index \$3"
+
+ gdb_test "print \$-3" "\\\$14 = 100" \
+ "Print (value-history\[MAX\] - 3) using implicit index \$"
+
+ gdb_test "print \$1 + 3" "\\\$15 = 104" \
+ "Use value-history element in arithmetic expression"
+}
+
+proc test_arithmetic_expressions {} {
+ global gdb_prompt
+
+ # Test unary minus with various operands
+
+# gdb_test "p -(TRUE)" " = -1" "unary minus applied to bool"
+# gdb_test "p -('a')" " = xxx" "unary minus applied to char"
+ gdb_test "p -(1)" " = -1" "unary minus applied to int"
+ gdb_test "p -(1.0)" " = -1" "unary minus applied to real"
+
+ # Test addition with various operands
+
+ gdb_test "p .TRUE. + 1" " = 2" "bool plus int"
+ gdb_test "p 1 + 1" " = 2" "int plus int"
+ gdb_test "p 1.0 + 1" " = 2" "real plus int"
+ gdb_test "p 1.0 + 2.0" " = 3" "real plus real"
+
+ # Test subtraction with various operands
+
+ gdb_test "p .TRUE. - 1" " = 0" "bool minus int"
+ gdb_test "p 3 - 1" " = 2" "int minus int"
+ gdb_test "p 3.0 - 1" " = 2" "real minus int"
+ gdb_test "p 5.0 - 2.0" " = 3" "real minus real"
+
+ # Test multiplication with various operands
+
+ gdb_test "p .TRUE. * 1" " = 1" "bool times int"
+ gdb_test "p 2 * 3" " = 6" "int times int"
+ gdb_test "p 2.0 * 3" " = 6" "real times int"
+ gdb_test "p 2.0 * 3.0" " = 6" "real times real"
+
+ # Test division with various operands
+
+ gdb_test "p .TRUE. / 1" " = 1" "bool divided by int"
+ gdb_test "p 6 / 3" " = 2" "int divided by int"
+ gdb_test "p 6.0 / 3" " = 2" "real divided by int"
+ gdb_test "p 6.0 / 3.0" " = 2" "real divided by real"
+
+ # Test modulo with various operands
+
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ""
+
+if [set_lang_fortran] then {
+ test_value_history
+ test_convenience_variables
+ test_integer_literals_accepted
+ test_integer_literals_rejected
+ test_logical_literals_accepted
+ test_character_literals_accepted
+ test_float_literals_accepted
+ test_arithmetic_expressions
+} else {
+ warning "$test_name tests suppressed." 0
+}
diff --git a/gdb/testsuite/gdb.fortran/types.exp b/gdb/testsuite/gdb.fortran/types.exp
new file mode 100644
index 00000000000..13bec5d3be7
--- /dev/null
+++ b/gdb/testsuite/gdb.fortran/types.exp
@@ -0,0 +1,114 @@
+# Copyright 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was adapted from Chill tests by Stan Shebs (shebs@cygnus.com).
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# Set the current language to fortran. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_fortran {} {
+ global gdb_prompt
+
+ if [gdb_test "set language fortran" ""] {
+ return 0;
+ }
+
+ if ![gdb_test "show language" ".* source language is \"fortran\".*"] {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+proc test_integer_literal_types_accepted {} {
+ global gdb_prompt
+
+ # Test various decimal values.
+ # Should be integer*4 probably.
+ gdb_test "pt 123" "type = int"
+}
+
+proc test_character_literal_types_accepted {} {
+ global gdb_prompt
+
+ # Test various character values.
+
+ gdb_test "pt 'a'" "type = character\\*1"
+}
+
+proc test_integer_literal_types_rejected {} {
+ global gdb_prompt
+
+ test_print_reject "pt _"
+}
+
+proc test_logical_literal_types_accepted {} {
+ global gdb_prompt
+
+ # Test the only possible values for a logical, TRUE and FALSE.
+
+ gdb_test "pt .TRUE." "type = logical\\*2"
+ gdb_test "pt .FALSE." "type = logical\\*2"
+}
+
+proc test_float_literal_types_accepted {} {
+ global gdb_prompt
+
+ # Test various floating point formats
+
+ # this used to guess whether to look for "real*4" or
+ # "real*8" based on a target config variable, but noone
+ # maintained it properly.
+
+ gdb_test "pt .44" "type = real\\*\[0-9\]+"
+ gdb_test "pt 44.0" "type = real\\*\[0-9\]+"
+ gdb_test "pt 10D20" "type = real\\*\[0-9\]+"
+ gdb_test "pt 10D20" "type = real\\*\[0-9\]+"
+ gdb_test "pt 10d20" "type = real\\*\[0-9\]+"
+ gdb_test "pt 10d20" "type = real\\*\[0-9\]+"
+ gdb_test "pt 10E20" "type = real\\*\[0-9\]+"
+ gdb_test "pt 10E20" "type = real\\*\[0-9\]+"
+ gdb_test "pt 10e20" "type = real\\*\[0-9\]+"
+ gdb_test "pt 10e20" "type = real\\*\[0-9\]+"
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ""
+
+if [set_lang_fortran] then {
+ test_integer_literal_types_accepted
+ test_integer_literal_types_rejected
+ test_logical_literal_types_accepted
+ test_character_literal_types_accepted
+ test_float_literal_types_accepted
+} else {
+ warning "$test_name tests suppressed." 0
+}
diff --git a/gdb/testsuite/gdb.gdb/xfullpath.exp b/gdb/testsuite/gdb.gdb/xfullpath.exp
new file mode 100644
index 00000000000..e4a6e2a0419
--- /dev/null
+++ b/gdb/testsuite/gdb.gdb/xfullpath.exp
@@ -0,0 +1,198 @@
+# Copyright 2002
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Joel Brobecker. (brobecker@gnat.com), derived
+# from selftest.exp, written by Rob Savoye.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# are we on a target board
+if [is_remote target] {
+ return
+}
+
+if [istarget "m68k*-*-hpux*"] then {
+ # The top-level makefile passes CFLAGS= (no -g) for hp300. This probably
+ # should be fixed (it is only needed for gcc bootstrapping, not gdb),
+ # but until then.....
+ setup_xfail "*-*-*"
+ fail "cannot test self if compiled without debug info"
+ return -1
+}
+
+proc setup_test { executable } {
+ global gdb_prompt
+ global timeout
+
+ # load yourself into the debugger
+ # This can take a relatively long time, particularly for testing where
+ # the executable is being accessed over a network, or where gdb does not
+ # support partial symbols for a particular target and has to load the
+ # entire symbol table. Set the timeout to 10 minutes, which should be
+ # adequate for most environments (it *has* timed out with 5 min on a
+ # SPARCstation SLC under moderate load, so this isn't unreasonable).
+ # After gdb is started, set the timeout to 30 seconds for the duration
+ # of this test, and then back to the original value.
+
+ set oldtimeout $timeout
+ set timeout 600
+ verbose "Timeout is now $timeout seconds" 2
+ if {[gdb_load $executable] <0} then {
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+ return -1
+ }
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+
+ # Set a breakpoint at main
+ gdb_test "break captured_main" \
+ "Breakpoint.*at.* file.*, line.*" \
+ "breakpoint in captured_main"
+
+ # run yourself
+ # It may take a very long time for the inferior gdb to start (lynx),
+ # so we bump it back up for the duration of this command.
+ set timeout 600
+
+ set description "run until breakpoint at captured_main"
+ send_gdb "run -nw\n"
+ gdb_expect {
+ -re "Starting program.*Breakpoint \[0-9\]+,.*captured_main .data.* at .*main.c:.*$gdb_prompt $" {
+ pass "$description"
+ }
+ -re "Starting program.*Breakpoint \[0-9\]+,.*captured_main .data.*$gdb_prompt $" {
+ xfail "$description (line numbers scrambled?)"
+ }
+ -re "vfork: No more processes.*$gdb_prompt $" {
+ fail "$description (out of virtual memory)"
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+ return -1
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$description"
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+ return -1
+ }
+ timeout {
+ fail "$description (timeout)"
+ }
+ }
+
+ set timeout $oldtimeout
+ verbose "Timeout is now $timeout seconds" 2
+
+ return 0
+}
+
+proc test_with_self { executable } {
+
+ set setup_result [setup_test $executable]
+ if {$setup_result <0} then {
+ return -1
+ }
+
+ # A file which contains a directory prefix
+ gdb_test "print xfullpath (\"./xfullpath.exp\")" \
+ ".\[0-9\]+ =.*\".*/xfullpath.exp\"" \
+ "A filename with ./ as the directory prefix"
+
+ # A file which contains a directory prefix
+ gdb_test "print xfullpath (\"../../defs.h\")" \
+ ".\[0-9\]+ =.*\".*/defs.h\"" \
+ "A filename with ../ in the directory prefix"
+
+ # A one-character filename
+ gdb_test "print xfullpath (\"./a\")" \
+ ".\[0-9\]+ =.*\".*/a\"" \
+ "A one-char filename in the current directory"
+
+ # A file in the root directory
+ gdb_test "print xfullpath (\"/root_file_which_should_exist\")" \
+ ".\[0-9\]+ =.*\"/root_file_which_should_exist\"" \
+ "A filename in the root directory"
+
+ # A file which does not have a directory prefix
+ gdb_test "print xfullpath (\"xfullpath.exp\")" \
+ ".\[0-9\]+ =.*\"xfullpath.exp\"" \
+ "A filename without any directory prefix"
+
+ # A one-char filename without any directory prefix
+ gdb_test "print xfullpath (\"a\")" \
+ ".\[0-9\]+ =.*\"a\"" \
+ "A one-char filename without any directory prefix"
+
+ # An empty filename
+ gdb_test "print xfullpath (\"\")" \
+ ".\[0-9\]+ =.*\"\"" \
+ "An empty filename"
+
+ return 0
+}
+
+# Find a pathname to a file that we would execute if the shell was asked
+# to run $arg using the current PATH.
+
+proc find_gdb { arg } {
+
+ # If the arg directly specifies an existing executable file, then
+ # simply use it.
+
+ if [file executable $arg] then {
+ return $arg
+ }
+
+ set result [which $arg]
+ if [string match "/" [ string range $result 0 0 ]] then {
+ return $result
+ }
+
+ # If everything fails, just return the unqualified pathname as default
+ # and hope for best.
+
+ return $arg
+}
+
+# Run the test with self.
+# Copy the file executable file in case this OS doesn't like to edit its own
+# text space.
+
+set GDB_FULLPATH [find_gdb $GDB]
+
+# Remove any old copy lying around.
+remote_file host delete x$tool
+
+gdb_start
+set file [remote_download host $GDB_FULLPATH x$tool]
+set result [test_with_self $file];
+gdb_exit;
+catch "remote_file host delete $file";
+
+if {$result <0} then {
+ warning "Couldn't test self"
+ return -1
+}
diff --git a/gdb/testsuite/gdb.hp/Makefile.in b/gdb/testsuite/gdb.hp/Makefile.in
new file mode 100644
index 00000000000..2a1a9df175b
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/Makefile.in
@@ -0,0 +1,44 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+SUBDIRS = @subdirs@
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ core *.o
+ if [ x"${SUBDIRS}" != x ] ; then \
+ for dir in ${SUBDIRS}; \
+ do \
+ echo "$$dir:"; \
+ if [ -d $$dir ]; then \
+ (cd $$dir; $(MAKE) clean); \
+ fi; \
+ done ; \
+ else true; fi
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+ -rm -f *-init.exp
+ -rm -fr *.log summary detail *.plog *.sum *.psum site.*
+ if [ x"${SUBDIRS}" != x ] ; then \
+ for dir in ${SUBDIRS}; \
+ do \
+ echo "$$dir:"; \
+ if [ -d $$dir ]; then \
+ (cd $$dir; $(MAKE) distclean); \
+ fi; \
+ done ; \
+ else true; fi
+
+Makefile: $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.hp/configure b/gdb/testsuite/gdb.hp/configure
new file mode 100755
index 00000000000..e01b9625989
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/configure
@@ -0,0 +1,1008 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=gdb.aCC
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:575: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:596: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:614: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+# Directories to use in all configurations.
+configdirs="gdb.aCC \
+ gdb.base-hp \
+ gdb.compat \
+ gdb.defects \
+ gdb.objdbg \
+ gdb.threads-hp"
+
+# configure the subdirectories too
+subdirs="$configdirs"
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@subdirs@%$subdirs%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
+if test "$no_recursion" != yes; then
+
+ # Remove --cache-file and --srcdir arguments so they do not pile up.
+ ac_sub_configure_args=
+ ac_prev=
+ for ac_arg in $ac_configure_args; do
+ if test -n "$ac_prev"; then
+ ac_prev=
+ continue
+ fi
+ case "$ac_arg" in
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ ;;
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+ *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
+ esac
+ done
+
+ for ac_config_dir in $configdirs; do
+
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
+ if test ! -d $srcdir/$ac_config_dir; then
+ continue
+ fi
+
+ echo configuring in $ac_config_dir
+
+ case "$srcdir" in
+ .) ;;
+ *)
+ if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
+ else
+ { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
+ fi
+ ;;
+ esac
+
+ ac_popdir=`pwd`
+ cd $ac_config_dir
+
+ # A "../" for each directory in /$ac_config_dir.
+ ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
+
+ case "$srcdir" in
+ .) # No --srcdir option. We are building in place.
+ ac_sub_srcdir=$srcdir ;;
+ /*) # Absolute path.
+ ac_sub_srcdir=$srcdir/$ac_config_dir ;;
+ *) # Relative path.
+ ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
+ esac
+
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_sub_srcdir/configure; then
+ ac_sub_configure=$ac_sub_srcdir/configure
+ elif test -f $ac_sub_srcdir/configure.in; then
+ ac_sub_configure=$ac_configure
+ else
+ echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
+ ac_sub_configure=
+ fi
+
+ # The recursion is here.
+ if test -n "$ac_sub_configure"; then
+
+ # Make the cache file name correct relative to the subdirectory.
+ case "$cache_file" in
+ /*) ac_sub_cache_file=$cache_file ;;
+ *) # Relative path.
+ ac_sub_cache_file="$ac_dots$cache_file" ;;
+ esac
+
+ echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
+ # The eval makes quoting arguments work.
+ if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
+ then :
+ else
+ { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
+ fi
+ fi
+
+ cd $ac_popdir
+ done
+fi
+
diff --git a/gdb/testsuite/gdb.hp/configure.in b/gdb/testsuite/gdb.hp/configure.in
new file mode 100644
index 00000000000..dd84c343bab
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/configure.in
@@ -0,0 +1,17 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(gdb.aCC)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
+AC_CANONICAL_SYSTEM
+
+AC_CONFIG_SUBDIRS(gdb.aCC gdb.base-hp gdb.compat gdb.defects gdb.objdbg gdb.threads-hp)
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.hp/gdb.aCC/Makefile.in b/gdb/testsuite/gdb.hp/gdb.aCC/Makefile.in
new file mode 100644
index 00000000000..1295c1e5585
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.aCC/Makefile.in
@@ -0,0 +1,27 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = exception namespace optimize run
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ *.o *.ci
+ -rm -f core $(EXECUTABLES)
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+ -rm -f *-init.exp
+ -rm -fr *.log summary detail *.plog *.sum *.psum site.*
+
+Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.hp/gdb.aCC/configure b/gdb/testsuite/gdb.hp/gdb.aCC/configure
new file mode 100755
index 00000000000..f3ffcd514db
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.aCC/configure
@@ -0,0 +1,899 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=exception.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../../.. $srcdir/`cd $srcdir;pwd`/../../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../../.. $srcdir/`cd $srcdir;pwd`/../../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:573: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:594: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:612: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.hp/gdb.aCC/configure.in b/gdb/testsuite/gdb.hp/gdb.aCC/configure.in
new file mode 100644
index 00000000000..c5fb71f0e02
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.aCC/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(exception.exp)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.hp/gdb.aCC/exception.cc b/gdb/testsuite/gdb.hp/gdb.aCC/exception.cc
new file mode 100644
index 00000000000..27459329a8b
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.aCC/exception.cc
@@ -0,0 +1,48 @@
+// Test file for exception handling support.
+
+#include <iostream.h>
+
+int foo (int i)
+{
+ if (i < 32)
+ throw (int) 13;
+ else
+ return i * 2;
+}
+
+extern "C" int bar (int k, unsigned long eharg, int flag);
+
+int bar (int k, unsigned long eharg, int flag)
+{
+ cout << "k is " << k << " eharg is " << eharg << " flag is " << flag << endl;
+ return 1;
+}
+
+int main()
+{
+ int j;
+
+ try {
+ j = foo (20);
+ }
+ catch (int x) {
+ cout << "Got an except " << x << endl;
+ }
+
+ try {
+ try {
+ j = foo (20);
+ }
+ catch (int x) {
+ cout << "Got an except " << x << endl;
+ throw;
+ }
+ }
+ catch (int y) {
+ cout << "Got an except (rethrown) " << y << endl;
+ }
+
+ // Not caught
+ foo (20);
+
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.aCC/exception.exp b/gdb/testsuite/gdb.hp/gdb.aCC/exception.exp
new file mode 100644
index 00000000000..a0914ae5ba4
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.aCC/exception.exp
@@ -0,0 +1,439 @@
+# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# tests for exception-handling support
+# Written by Satish Pai <pai@apollo.hp.com> 1997-07-23
+
+# This file is part of the gdb testsuite
+
+# Note: These tests are geared to the HP aCC compiler,
+# which has an idiosyncratic way of emitting debug info
+# for exceptions -- it uses a callback mechanism, which
+# is different from the way g++ records exception info
+# for debugging
+
+# The tests are in two parts; the first part deals with
+# statically linked (archive-bound) executables, and the
+# second part repeats those tests with dynamically linked
+# (shared bound) executables. (In the latter case we use
+# a different mechanism to get the address of the notification
+# hook in the C++ support library.) The tests themselves are
+# the same in both parts.
+#
+# IMPORTANT:
+# ---------
+# IF YOU CHANGE A TEST IN ONE PART MAKE SURE YOU CHANGE IT
+# --------------------------------------------------------
+# IN THE OTHER PART TOO!
+# ----------------------
+
+
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { [skip_hp_tests] } then { continue }
+
+#
+# test running programs
+#
+
+# Part I : Archive-bound executables
+# ----------------------------------
+
+set testfile "exception"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1;
+}
+
+
+if { $gcc_compiled } then { continue }
+
+set cmdline "$CXX_FOR_TARGET ${srcdir}/${subdir}/${srcfile} +A -Wl,-a,archive -g -o ${binfile}"
+
+remote_exec build $cmdline
+
+# Start with a fresh gdb
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# Set a catch catchpoint
+
+send_gdb "catch catch\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\]* \\(catch\\)\r\n$gdb_prompt $" {
+ pass "catch catch (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "catch catch (static executable)" }
+ timeout { fail "(timeout) catch catch (static executable)" }
+}
+
+# Set a throw catchpoint
+
+send_gdb "catch throw\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\]* \\(throw\\)\r\n$gdb_prompt $" {
+ pass "catch throw (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "catch throw (static executable)" }
+ timeout { fail "(timeout) catch throw (static executable)" }
+}
+
+# The catchpoints should be listed in the list of breakpoints.
+
+send_gdb "info break\n"
+gdb_expect {
+ -re ".*\[0-9\]*\[ \]*catch catch\[ \]*keep y\[ \]*exception catch\[ \]*\r\n\[0-9\]*\[ \]*catch throw\[ \]*keep y\[ \]*exception throw\[ \]*\r\n$gdb_prompt $" {
+ pass "info break with catchpoints (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "info break (static executable)" }
+ timeout { fail "(timeout) info break (static executable)" }
+}
+
+# Info catch currently does not work with HP aCC. No easy way to
+# list the active handlers on the stack.
+
+send_gdb "info catch\n"
+gdb_expect {
+ -re "Info catch not supported with this target/compiler combination.\r\n$gdb_prompt $" {
+ pass "info catch (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "info catch (static executable)" }
+ timeout { fail "(timeout) info catch (static executable)" }
+}
+
+# Get the first exception thrown
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing.*Catchpoint \[0-9\]* \\(exception thrown\\), throw location.*exception\\.cc:8, catch location .*exception\\.cc:28\r\n.*$gdb_prompt $" {
+ pass "caught a throw (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch a throw (static executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch a throw? (static executable)" }
+}
+
+send_gdb "backtrace\n"
+gdb_expect {
+ -re "#0\[ \]*__d_eh_break.*\r\n#1\[ \]*$hex in __d_eh_notify_callback \\(eh_type=__EH_NOTIFY_THROW.*\r\n#2\[ \]*$hex in __eh_notify_throw.*\r\n#3\[ \]*$hex in foo \\(i=20\\) at .*exception\\.cc:8\r\n#4\[ \]*$hex in main.* at .*exception\\.cc:26\r\n$gdb_prompt $" {
+ pass "backtrace after throw (static executable)"
+ }
+ -re "#0\[ \]*__d_eh_break.*\r\n#1\[ \]*$hex in __d_eh_notify_callback \\(eh_type=\[0-9\].*\r\n#2\[ \]*$hex in __eh_notify_throw.*\r\n#3\[ \]*$hex in foo \\(i=20\\) at .*exception\\.cc:8\r\n#4\[ \]*$hex in main.* at .*exception\\.cc:26\r\n$gdb_prompt $" {
+ pass "backtrace after throw (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "backtrace after throw (static executable)" }
+ timeout { fail "(timeout) backtrace after throw (static executable)" }
+}
+
+# Now intercept it when it is caught.
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing.*Catchpoint \[0-9\]* \\(exception caught\\), throw location.*exception\\.cc:8, catch location .*exception\\.cc:28\r\n.*$gdb_prompt $" {
+ pass "caught a catch (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch a catch (static executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch a catch? (static executable)" }
+}
+
+send_gdb "backtrace\n"
+gdb_expect {
+ -re "#0\[ \]*__d_eh_break.*\r\n#1\[ \]*$hex in __d_eh_notify_callback \\(eh_type=__EH_NOTIFY_CATCH.*\r\n.*\r\n#3\[ \]*$hex in __throw__.*\r\n#4\[ \]*$hex in foo \\(i=20\\) at .*exception.cc:8\r\n#5\[ \]*$hex in main.* at .*exception.cc:26\r\n$gdb_prompt $" {
+ pass "backtrace after catch (static executable)"
+ }
+ -re "#0\[ \]*__d_eh_break.*\r\n#1\[ \]*$hex in __d_eh_notify_callback \\(eh_type=\[0-9\].*\r\n.*\r\n#3\[ \]*$hex in __throw__.*\r\n#4\[ \]*$hex in foo \\(i=20\\) at .*exception.cc:8\r\n#5\[ \]*$hex in main.* at .*exception.cc:26\r\n$gdb_prompt $" {
+ pass "backtrace after catch (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "backtrace after catch (static executable)" }
+ timeout { fail "(timeout) backtrace after catch (static executable)" }
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\.\r\nGot.*\r\nCatchpoint \[0-9\]* \\(exception thrown\\), throw location.*exception\\.cc:8, catch location .*exception\\.cc:36\r\n.*$gdb_prompt $" {
+ pass "caught a throw (2) (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch a throw (2) (static executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch a throw (2)? (static executable)" }
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing.*Catchpoint \[0-9\]* \\(exception caught\\), throw location.*exception\\.cc:8, catch location .*exception\\.cc:36\r\n.*$gdb_prompt $" {
+ pass "caught a catch (2) (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch a catch (2) (static executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch a catch (2)? (static executable)" }
+}
+
+# Now the exception will be rethrown.
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\.\r\nGot.*\r\nCatchpoint \[0-9\]* \\(exception thrown\\), throw location.*exception\\.cc:38, catch location .*exception\\.cc:41\r\n.*$gdb_prompt $" {
+ pass "caught a rethrow (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch a rethrow (static executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch a rethrow? (static executable)" }
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing.*Catchpoint \[0-9\]* \\(exception caught\\), throw location.*exception\\.cc:3\[68\], catch location .*exception\\.cc:41\r\n.*$gdb_prompt $" {
+ # FIXME: guo: why XFAIL? need comment
+ xfail "caught a catch (3) (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch a catch (3) (static executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch a catch (3)? (static executable)" }
+}
+
+send_gdb "backtrace\n"
+gdb_expect {
+ -re "#0\[ \]*__d_eh_break.*\r\n#1\[ \]*$hex in __d_eh_notify_callback \\(eh_type=__EH_NOTIFY_CATCH.*\r\n.*\r\n#3\[ \]*$hex in __rethrow.*\r\n#4\[ \]*$hex in main.* at .*exception\\.cc:3\[68\]\r\n#5\[ \]*$hex in foo \\(i=20\\) at .*exception.cc:8\r\n#6\[ \]*$hex in main.* at .*exception.cc:34\r\n$gdb_prompt $" {
+ # FIXME: guo: why XFAIL? need comment
+ xfail "backtrace after catch (3) (static executable)"
+ }
+ -re "#0\[ \]*__d_eh_break.*\r\n#1\[ \]*$hex in __d_eh_notify_callback \\(eh_type=\[0-9\].*\r\n.*\r\n#3\[ \]*$hex in __rethrow.*\r\n#4\[ \]*$hex in main.* at .*exception\\.cc:3\[68\]\r\n#5\[ \]*$hex in foo \\(i=20\\) at .*exception.cc:8\r\n#6\[ \]*$hex in main.* at .*exception.cc:34\r\n$gdb_prompt $" {
+ # FIXME: guo: why XFAIL? need comment
+ xfail "backtrace after catch (3) (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "backtrace after catch (3) (static executable)" }
+ timeout { fail "(timeout) backtrace after catch (3) (static executable)" }
+}
+
+# Now the exception will be thrown, but not catch-able anywhere.
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\.\r\nGot.*\r\nCatchpoint \[0-9\]* \\(exception thrown\\), throw location.*exception\\.cc:8, catch location unknown\r\n.*$gdb_prompt $" {
+ pass "caught an uncatchable throw (static executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch an uncatchable throw (static executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch an uncatchable throw? (static executable)" }
+}
+
+# Part II : Shared-bound executables
+# ----------------------------------
+
+# Start with a fresh gdb
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+set prms_id 0
+set bug_id 0
+
+set testfile "exception"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will a
+utomatically fail."
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# Set a catch catchpoint
+
+send_gdb "catch catch\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\]* \\(catch\\)\r\n$gdb_prompt $" {
+ pass "catch catch (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "catch catch (dynamic executable)" }
+ timeout { fail "(timeout) catch catch (dynamic executable)" }
+}
+
+# Set a throw catchpoint
+
+send_gdb "catch throw\n"
+gdb_expect {
+ -re "Catchpoint \[0-9\]* \\(throw\\)\r\n$gdb_prompt $" {
+ pass "catch throw (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "catch throw (dynamic executable)" }
+ timeout { fail "(timeout) catch throw (dynamic executable)" }
+}
+
+# The catchpoints should be listed in the list of breakpoints.
+
+send_gdb "info break\n"
+gdb_expect {
+ -re ".*\[0-9\]*\[ \]*catch catch\[ \]*keep y\[ \]*exception catch\[ \]*\r\n\[0-9\]*\[ \]*catch throw\[ \]*keep y\[ \]*exception throw\[ \]*\r\n$gdb_prompt $" {
+ pass "info break with catchpoints (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "info break (dynamic executable)" }
+ timeout { fail "(timeout) info break (dynamic executable)" }
+}
+
+# Info catch currently does not work with HP aCC. No easy way to
+# list the active handlers on the stack.
+
+send_gdb "info catch\n"
+gdb_expect {
+ -re "Info catch not supported with this target/compiler combination.\r\n$gdb_prompt $" {
+ pass "info catch (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "info catch (dynamic executable)" }
+ timeout { fail "(timeout) info catch (dynamic executable)" }
+}
+
+# Get the first exception thrown
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing.*Catchpoint \[0-9\]* \\(exception thrown\\), throw location.*exception\\.cc:8, catch location .*exception\\.cc:28\r\n.*$gdb_prompt $" {
+ pass "caught a throw (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch a throw (dynamic executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch a throw? (dynamic executable)" }
+}
+
+send_gdb "backtrace\n"
+gdb_expect {
+ -re "#0\[ \]*__d_eh_break.*\r\n#1\[ \]*$hex in __d_eh_notify_callback \\(eh_type=__EH_NOTIFY_THROW.*\r\n#2\[ \]*$hex in __eh_notify_throw.*\r\n#3\[ \]*$hex in foo \\(i=20\\) at .*exception\\.cc:8\r\n#4\[ \]*$hex in main.* at .*exception\\.cc:26\r\n$gdb_prompt $" {
+ pass "backtrace after throw (dynamic executable)"
+ }
+ -re "#0\[ \]*__d_eh_break.*\r\n#1\[ \]*$hex in __d_eh_notify_callback \\(eh_type=\[0-9\].*\r\n#2\[ \]*$hex in __eh_notify_throw.*\r\n#3\[ \]*$hex in foo \\(i=20\\) at .*exception\\.cc:8\r\n#4\[ \]*$hex in main.* at .*exception\\.cc:26\r\n$gdb_prompt $" {
+ pass "backtrace after throw (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "backtrace after throw (dynamic executable)" }
+ timeout { fail "(timeout) backtrace after throw (dynamic executable)" }
+}
+
+# Now intercept it when it is caught.
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing.*Catchpoint \[0-9\]* \\(exception caught\\), throw location.*exception\\.cc:8, catch location .*exception\\.cc:28\r\n.*$gdb_prompt $" {
+ pass "caught a catch (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch a catch (dynamic executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch a catch? (dynamic executable)" }
+}
+
+send_gdb "backtrace\n"
+gdb_expect {
+ -re "#0\[ \]*__d_eh_break.*\r\n#1\[ \]*$hex in __d_eh_notify_callback \\(eh_type=__EH_NOTIFY_CATCH.*\r\n.*\r\n#3\[ \]*$hex in __throw__.*\r\n#4\[ \]*$hex in foo \\(i=20\\) at .*exception.cc:8\r\n#5\[ \]*$hex in main.* at .*exception.cc:26\r\n$gdb_prompt $" {
+ pass "backtrace after catch (dynamic executable)"
+ }
+ -re "#0\[ \]*__d_eh_break.*\r\n#1\[ \]*$hex in __d_eh_notify_callback \\(eh_type=\[0-9\].*\r\n.*\r\n#3\[ \]*$hex in __throw__.*\r\n#4\[ \]*$hex in foo \\(i=20\\) at .*exception.cc:8\r\n#5\[ \]*$hex in main.* at .*exception.cc:26\r\n$gdb_prompt $" {
+ pass "backtrace after catch (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "backtrace after catch (dynamic executable)" }
+ timeout { fail "(timeout) backtrace after catch (dynamic executable)" }
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\.\r\nGot.*\r\nCatchpoint \[0-9\]* \\(exception thrown\\), throw location.*exception\\.cc:8, catch location .*exception\\.cc:36\r\n.*$gdb_prompt $" {
+ pass "caught a throw (2) (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch a throw (2) (dynamic executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch a throw (2)? (dynamic executable)" }
+}
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing.*Catchpoint \[0-9\]* \\(exception caught\\), throw location.*exception\\.cc:8, catch location .*exception\\.cc:36\r\n.*$gdb_prompt $" {
+ pass "caught a catch (2) (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch a catch (2) (dynamic executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch a catch (2)? (dynamic executable)" }
+}
+
+# Now the exception will be rethrown.
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\.\r\nGot.*\r\nCatchpoint \[0-9\]* \\(exception thrown\\), throw location.*exception\\.cc:38, catch location .*exception\\.cc:41\r\n.*$gdb_prompt $" {
+ pass "caught a rethrow (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch a rethrow (dynamic executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch a rethrow? (dynamic executable)" }
+}
+
+#DTS CLLbs14858
+#The throw location should be at line 38 instead of 36.
+setup_xfail hppa*-*-* CLLbs14858
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing.*Catchpoint \[0-9\]* \\(exception caught\\), throw location.*exception\\.cc:3\[68\], catch location .*exception\\.cc:41\r\n.*$gdb_prompt $" {
+ # FIXME: guo: according to comment above the RE is wrong!
+ pass "caught a catch (3) (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch a catch (3) (dynamic executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch a catch (3)? (dynamic executable)" }
+}
+
+#DTS CLLbs14858
+#The line number for main() should be at exception.cc:38 instead of exception.cc:36
+setup_xfail hppa*-*-* CLLbs14858
+send_gdb "backtrace\n"
+gdb_expect {
+ -re "#0\[ \]*__d_eh_break.*\r\n#1\[ \]*$hex in __d_eh_notify_callback \\(eh_type=__EH_NOTIFY_CATCH.*\r\n.*\r\n#3\[ \]*$hex in __rethrow.*\r\n#4\[ \]*$hex in main.* at .*exception\\.cc:3\[68\]\r\n#5\[ \]*$hex in foo \\(i=20\\) at .*exception.cc:8\r\n#6\[ \]*$hex in main.* at .*exception.cc:34\r\n$gdb_prompt $" {
+ # FIXME: guo: according to comment above the RE is wrong!
+ pass "backtrace after catch (3) (dynamic executable)"
+ }
+ -re "#0\[ \]*__d_eh_break.*\r\n#1\[ \]*$hex in __d_eh_notify_callback \\(eh_type=\[0-9\].*\r\n.*\r\n#3\[ \]*$hex in __rethrow.*\r\n#4\[ \]*$hex in main.* at .*exception\\.cc:3\[68\]\r\n#5\[ \]*$hex in foo \\(i=20\\) at .*exception.cc:8\r\n#6\[ \]*$hex in main.* at .*exception.cc:34\r\n$gdb_prompt $" {
+ # FIXME: guo: according to comment above the RE is wrong!
+ pass "backtrace after catch (3) (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "backtrace after catch (3) (dynamic executable)" }
+ timeout { fail "(timeout) backtrace after catch (3) (dynamic executable)" }
+}
+
+# Now the exception will be thrown, but not catch-able anywhere.
+
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\.\r\nGot.*\r\nCatchpoint \[0-9\]* \\(exception thrown\\), throw location.*exception\\.cc:8, catch location unknown\r\n.*$gdb_prompt $" {
+ pass "caught an uncatchable throw (dynamic executable)"
+ }
+ -re ".*$gdb_prompt $" { fail "didn't catch an uncatchable throw (dynamic executable)" }
+ timeout { fail "(timeout) after continue -- didn't catch an uncatchable throw? (dynamic executable)" }
+}
+
diff --git a/gdb/testsuite/gdb.hp/gdb.aCC/optimize.c b/gdb/testsuite/gdb.hp/gdb.aCC/optimize.c
new file mode 100644
index 00000000000..2a8daa8c7a0
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.aCC/optimize.c
@@ -0,0 +1,76 @@
+/* Source for debugging optimimzed code test.
+
+ cc -g -O -o optimize optimize.c
+*/
+int callee();
+int test_opt;
+
+int main()
+{
+ int a,b,c,d,e,f,g,h;
+
+ a = 10;;
+
+ /* Value propagate
+ */
+ b = 2 * a + 1;
+ c = 3 * b + 2;
+
+ /* Re-use expressions
+ */
+ d = (2 * a + 1) * (3 * b + 2);
+ e = (2 * a + 1) * (3 * b + 2);
+
+ /* Create dead stores--do lines still exist?
+ */
+ d = (2 * a + 1) * (3 * b + 2);
+ e = (2 * a + 1) * (3 * b + 2);
+ d = (2 * a + 1) * (3 * b + 2);
+ e = (2 * a + 1) * (3 * b + 2);
+
+ /* Alpha and psi motion
+ */
+ if( test_opt ) {
+ f = e - d;
+ f = f--;
+ }
+ else {
+ f = e - d;
+ f = f + d * e;
+ }
+
+ /* Chi and Rho motion
+ */
+ h = 0;
+ do {
+ h++;
+ a = b * c + d * e; /* Chi */
+ f = f + d * e;
+ g = f + d * e; /* Rho */
+ callee( g+1 );
+ test_opt = (test_opt != 1); /* Cycles */
+ } while( g && h < 10);
+
+ /* Opps for tail recursion, unrolling,
+ * folding, evaporating
+ */
+ for( a = 0; a < 100; a++ ) {
+ callee( callee ( callee( a )));
+ callee( callee ( callee( a )));
+ callee( callee ( callee( a )));
+ }
+
+ return callee( test_opt );
+}
+
+/* defined late to keep line numbers the same
+*/
+int callee( x )
+ int x; /* not used! */
+{
+ test_opt++; /* side effect */
+
+ return test_opt;
+}
+
+/* end */ \ No newline at end of file
diff --git a/gdb/testsuite/gdb.hp/gdb.aCC/optimize.exp b/gdb/testsuite/gdb.hp/gdb.aCC/optimize.exp
new file mode 100644
index 00000000000..84b51b6aca9
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.aCC/optimize.exp
@@ -0,0 +1,149 @@
+# Copyright (C) 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# optimize.exp -- Expect script for testing apps compiled with -O
+
+# There is no DOC support for gdb yet, return 0 for now.
+return 0
+
+global timeout
+
+# use this to debug:
+#
+#log_user 1
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_hp_tests] } then { continue }
+
+set testfile optimize
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+
+if { $gcc_compiled } then { continue }
+
+
+# Vanilla -O, which is the same as +O2
+#
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug optimize=+O2}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+send_gdb "file $binfile\n"
+gdb_expect {
+ -re ".*no debugging symbols found.*$gdb_prompt $" {
+ fail "Didn't find debug symbols; CHFts23488"
+ }
+ -re ".*No header section (PXDB data).*$gdb_prompt $" {
+ fail "pointless warning"
+ }
+ -re ".*done.*$gdb_prompt $" {
+ pass "load debug symbols"
+ }
+ timeout { fail "timeout on file" }
+}
+
+# Two lines at the same place after opt.
+#
+gdb_test "b 28" ".*"
+gdb_test "b 26" ".*also set at.*" "same line"
+
+gdb_test "b 47" ".*"
+gdb_test "b 48" ".*also set at.*" "same line"
+
+gdb_test "tb main" ".*"
+
+set old_timeout $timeout
+set timeout [expr "$timeout + 200"]
+send_gdb "r\n"
+gdb_expect {
+ -re ".*No header section (PXDB data).*$gdb_prompt $" {
+ fail "pointless warning"
+ }
+ -re ".*main.*2\[12].*$gdb_prompt $" {
+ # All the lines before line 21 or 22 are
+ # evaporated by the compiler.
+ #
+ pass "hit main"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "didn't hit main"
+ }
+ timeout { fail "timeout on run" }
+}
+set timeout $old_timeout
+
+gdb_test "c" ".*Breakpoint 1.*33.*"
+gdb_test "c" ".*51.*"
+gdb_test "cle" ".*Deleted breakpoints.*" "set 2, so del 2"
+
+gdb_test "b callee" ".*"
+gdb_test "c" ".*callee.*" "hit called rtn"
+
+gdb_exit
+
+# +O4, don't use -g
+#
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {optimize=+O4}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+send_gdb "file $binfile\n"
+gdb_expect {
+ -re ".*no debugging symbols found.*$gdb_prompt $" {
+ pass "Didn't find debug symbols, as expected"
+ }
+ -re ".*No header section (PXDB data).*$gdb_prompt $" {
+ fail "pointless warning"
+ }
+ -re ".*done.*$gdb_prompt $" {
+ fail "Somehow found debug symbols--make this a pass?"
+ }
+ timeout { fail "timeout on file" }
+}
+
+gdb_test "b main" ".*"
+gdb_test "b callee" ".*"
+gdb_test "r" ".*Breakpoint 1.*main.*"
+gdb_test "si 3" ".*main.*" "steps"
+gdb_test "x/4i \$pc" ".*main.*main+4.*main+8.*"
+gdb_test "c" ".*callee.*" "hit bp"
+gdb_test "disas" ".*callee.*callee+4.*callee+12.*"
+gdb_test "si" ".*callee.*"
+gdb_test "fin" ".*Run till exit.*main.*" "finish"
+gdb_test "x/i \$pc" ".*main+.*" "back in main"
+gdb_exit
+
+#remote_exec build "rm -f ${binfile}"
+return 0
diff --git a/gdb/testsuite/gdb.hp/gdb.aCC/run.c b/gdb/testsuite/gdb.hp/gdb.aCC/run.c
new file mode 100644
index 00000000000..6bff81ad7ee
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.aCC/run.c
@@ -0,0 +1,72 @@
+/*
+ * This simple classical example of recursion is useful for
+ * testing stack backtraces and such.
+ */
+
+#ifdef vxworks
+
+# include <stdio.h>
+
+/* VxWorks does not supply atoi. */
+static int
+atoi (char *z)
+ /* char *z;*/
+{
+ int i = 0;
+
+ while (*z >= '0' && *z <= '9')
+ i = i * 10 + (*z++ - '0');
+ return i;
+}
+
+/* I don't know of any way to pass an array to VxWorks. This function
+ can be called directly from gdb. */
+
+void vxmain (char *arg)
+/*char *arg;*/
+{
+ char *argv[2];
+
+ argv[0] = "";
+ argv[1] = arg;
+ main (2, argv, (char **) 0);
+}
+
+#else /* ! vxworks */
+# include <stdio.h>
+# include <stdlib.h>
+#endif /* ! vxworks */
+
+int main (int argc, char *argv[], char **envp)
+/*int argc;
+char *argv[], **envp;*/
+{
+ int factorial (int);
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+#ifdef FAKEARGV
+ printf ("%d\n", factorial (1));
+#else
+ if (argc != 2) {
+ printf ("usage: factorial <number>\n");
+ return 1;
+ } else {
+ printf ("%d\n", factorial (atoi (argv[1])));
+ }
+#endif
+ return 0;
+}
+
+int factorial (int value)
+/*int value;*/
+{
+ int local_var;
+
+ if (value > 1) {
+ value *= factorial (value - 1);
+ }
+ local_var = value;
+ return (value);
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.aCC/watch-cmd.exp b/gdb/testsuite/gdb.hp/gdb.aCC/watch-cmd.exp
new file mode 100644
index 00000000000..e447c0b5cf5
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.aCC/watch-cmd.exp
@@ -0,0 +1,157 @@
+# Copyright (C) 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+#
+# test special commands
+#
+set prms_id 0
+set bug_id 0
+
+if { [skip_hp_tests] } then { continue }
+
+set testfile "run"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+if { $gcc_compiled } then { continue }
+
+
+gdb_exit
+gdb_start
+delete_breakpoints
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+
+proc watchpoint_command_test {} {
+ global gdb_prompt
+
+ if [target_info exists noargs] {
+ verbose "Skipping watchpoint_command_test because of noargs."
+ return
+ }
+
+ if { ![runto factorial] } then { gdb_suppress_tests }
+ # Don't depend upon argument passing, since most simulators don't currently
+ # support it. Bash value variable to be what we want.
+ gdb_test "p value=6" "" "set value to 6 in watchpoint_command_test"
+ delete_breakpoints
+
+ # Verify that we can create a watchpoint, and give it a commands
+ # list that continues the inferior. We set the watchpoint on a
+ # local variable, too, so that it self-deletes when the watched
+ # data goes out of scope.
+ #
+ # What should happen is: Each time the watchpoint triggers, it
+ # continues the inferior. Eventually, the watchpoint will self-
+ # delete, when the watched variable is out of scope. But by that
+ # time, the inferior should have exited. GDB shouldn't crash or
+ # anything untoward as a result of this.
+ #
+ send_gdb "watch local_var\n"
+ gdb_expect {
+ -re ".*\[Ww\]atchpoint (\[0-9\]*): local_var.*$gdb_prompt $"\
+ { pass "watch local_var"
+ set wp_id $expect_out(1,string)
+ send_gdb "commands $wp_id\n"
+ gdb_expect {
+ -re "Type commands for when breakpoint $wp_id is hit, one per line.*>"\
+ { pass "begin commands on watch"}
+ -re "$gdb_prompt $"\
+ {fail "begin commands on watch"}
+ timeout {fail "(timeout) begin commands on watch"}
+ }
+ }
+ -re "$gdb_prompt $"\
+ {fail "watch local_var"}
+ timeout {fail "(timeout) watch local_var"}
+ }
+# set wp_id $expect_out(1,string)
+# send_gdb "commands $wp_id\n"
+# gdb_expect {
+# -re "Type commands for when breakpoint $wp_id is hit, one per line.*>"\
+# {pass "begin commands on watch"}
+# -re "$gdb_prompt $"\
+# {fail "begin commands on watch"}
+# timeout {fail "(timeout) begin commands on watch"}
+# }
+ send_gdb "print value\n"
+ gdb_expect {
+ -re ">"\
+ {pass "add print command to watch"}
+ -re "$gdb_prompt $"\
+ {fail "add print command to watch"}
+ timeout {fail "(timeout) add print command to watch"}
+ }
+ send_gdb "continue\n"
+ gdb_expect {
+ -re ">"\
+ {pass "add continue command to watch"}
+ -re "$gdb_prompt $"\
+ {fail "add continue command to watch"}
+ timeout {fail "(timeout) add continue command to watch"}
+ }
+ send_gdb "end\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "begin commands on watch"}
+ timeout {fail "(timeout) begin commands on watch"}
+ }
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Continuing.*\[Ww\]atchpoint $wp_id deleted because the program has left the block in.*which its expression is valid.*in main.*$gdb_prompt $"\
+ {pass "continue with watch"}
+ -re "$gdb_prompt $"\
+ {fail "continue with watch"}
+ timeout {fail "(timeout) continue with watch"}
+ }
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Continuing.*$gdb_prompt $"\
+ {pass "continue until exit"}
+ -re "$gdb_prompt $"\
+ {fail "continue until exit"}
+ timeout {fail "(timeout) continue until exit"}
+ }
+}
+
+watchpoint_command_test
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/Makefile.in b/gdb/testsuite/gdb.hp/gdb.base-hp/Makefile.in
new file mode 100644
index 00000000000..adbde9df27e
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/Makefile.in
@@ -0,0 +1,32 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = dollar hwwatchbus.bak pxdb reg reg-pa64 \
+ so-thresh genso-thresh sized-enum
+
+MISCELLANEOUS = so-thresh.c so-thresh.lopt so-thresh.make.out \
+ lib*-so-thresh.*
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ *.o *.ci
+ -rm -f core $(EXECUTABLES)
+ -rm -f $(MISCELLANEOUS)
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+ -rm -f *-init.exp
+ -rm -fr *.log summary detail *.plog *.sum *.psum site.*
+
+Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c b/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c
new file mode 100644
index 00000000000..67edb8b70d4
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.c
@@ -0,0 +1,362 @@
+/* Support program for testing gdb's ability to call functions
+ in an inferior which doesn't itself call malloc, pass appropriate
+ arguments to those functions, and get the returned result. */
+
+#ifdef NO_PROTOTYPES
+#define PARAMS(paramlist) ()
+#else
+#define PARAMS(paramlist) paramlist
+#endif
+
+# include <string.h>
+
+char char_val1 = 'a';
+char char_val2 = 'b';
+
+short short_val1 = 10;
+short short_val2 = -23;
+
+int int_val1 = 87;
+int int_val2 = -26;
+
+long long_val1 = 789;
+long long_val2 = -321;
+
+float float_val1 = 3.14159;
+float float_val2 = -2.3765;
+
+double double_val1 = 45.654;
+double double_val2 = -67.66;
+
+#define DELTA (0.001)
+
+char *string_val1 = (char *)"string 1";
+char *string_val2 = (char *)"string 2";
+
+char char_array_val1[] = "carray 1";
+char char_array_val2[] = "carray 2";
+
+struct struct1 {
+ char c;
+ short s;
+ int i;
+ long l;
+ float f;
+ double d;
+ char a[4];
+} struct_val1 = { 'x', 87, 76, 51, 2.1234, 9.876, "foo" };
+
+/* Some functions that can be passed as arguments to other test
+ functions, or called directly. */
+#ifdef PROTOTYPES
+int add (int a, int b)
+#else
+int add (a, b) int a, b;
+#endif
+{
+ return (a + b);
+}
+
+#ifdef PROTOTYPES
+int doubleit (int a)
+#else
+int doubleit (a)
+int a;
+#endif
+{
+ return (a + a);
+}
+
+int (*func_val1) PARAMS((int,int)) = add;
+int (*func_val2) PARAMS((int)) = doubleit;
+
+/* An enumeration and functions that test for specific values. */
+
+enum enumtype { enumval1, enumval2, enumval3 };
+enum enumtype enum_val1 = enumval1;
+enum enumtype enum_val2 = enumval2;
+enum enumtype enum_val3 = enumval3;
+
+#ifdef PROTOTYPES
+int t_enum_value1 (enum enumtype enum_arg)
+#else
+t_enum_value1 (enum_arg)
+enum enumtype enum_arg;
+#endif
+{
+ return (enum_arg == enum_val1);
+}
+
+#ifdef PROTOTYPES
+int t_enum_value2 (enum enumtype enum_arg)
+#else
+t_enum_value2 (enum_arg)
+enum enumtype enum_arg;
+#endif
+{
+ return (enum_arg == enum_val2);
+}
+
+#ifdef PROTOTYPES
+int t_enum_value3 (enum enumtype enum_arg)
+#else
+t_enum_value3 (enum_arg)
+enum enumtype enum_arg;
+#endif
+{
+ return (enum_arg == enum_val3);
+}
+
+/* A function that takes a vector of integers (along with an explicit
+ count) and returns their sum. */
+
+#ifdef PROTOTYPES
+int sum_args (int argc, int argv[])
+#else
+int sum_args (argc, argv)
+int argc;
+int argv[];
+#endif
+{
+ int sumval = 0;
+ int idx;
+
+ for (idx = 0; idx < argc; idx++)
+ {
+ sumval += argv[idx];
+ }
+ return (sumval);
+}
+
+/* Test that we can call functions that take structs and return
+ members from that struct */
+
+#ifdef PROTOTYPES
+char t_structs_c (struct struct1 tstruct) { return (tstruct.c); }
+short t_structs_s (struct struct1 tstruct) { return (tstruct.s); }
+int t_structs_i (struct struct1 tstruct) { return (tstruct.i); }
+long t_structs_l (struct struct1 tstruct) { return (tstruct.l); }
+float t_structs_f (struct struct1 tstruct) { return (tstruct.f); }
+double t_structs_d (struct struct1 tstruct) { return (tstruct.d); }
+char *t_structs_a (struct struct1 tstruct)
+{
+ static char buf[8];
+ strcpy (buf, tstruct.a);
+ return buf;
+}
+#else
+char t_structs_c (tstruct) struct struct1 tstruct; { return (tstruct.c); }
+short t_structs_s (tstruct) struct struct1 tstruct; { return (tstruct.s); }
+int t_structs_i (tstruct) struct struct1 tstruct; { return (tstruct.i); }
+long t_structs_l (tstruct) struct struct1 tstruct; { return (tstruct.l); }
+float t_structs_f (tstruct) struct struct1 tstruct; { return (tstruct.f); }
+double t_structs_d (tstruct) struct struct1 tstruct; { return (tstruct.d); }
+char *t_structs_a (tstruct) struct struct1 tstruct;
+{
+ static char buf[8];
+ strcpy (buf, tstruct.a);
+ return buf;
+}
+#endif
+
+/* Test that calling functions works if there are a lot of arguments. */
+#ifdef PROTOTYPES
+int sum10 (int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9)
+#else
+int
+sum10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9)
+ int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
+#endif
+{
+ return i0 + i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9;
+}
+
+/* Gotta have a main to be able to generate a linked, runnable
+ executable, and also provide a useful place to set a breakpoint. */
+
+#ifdef PROTOTYPES
+int main()
+#else
+main ()
+#endif
+{
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ t_structs_c(struct_val1);
+ return 0;
+
+}
+
+/* Functions that expect specific values to be passed and return
+ either 0 or 1, depending upon whether the values were
+ passed incorrectly or correctly, respectively. */
+
+#ifdef PROTOTYPES
+int t_char_values (char char_arg1, char char_arg2)
+#else
+int t_char_values (char_arg1, char_arg2)
+char char_arg1, char_arg2;
+#endif
+{
+ return ((char_arg1 == char_val1) && (char_arg2 == char_val2));
+}
+
+int
+#ifdef PROTOTYPES
+t_small_values (char arg1, short arg2, int arg3, char arg4, short arg5,
+ char arg6, short arg7, int arg8, short arg9, short arg10)
+#else
+t_small_values (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)
+ char arg1;
+ short arg2;
+ int arg3;
+ char arg4;
+ short arg5;
+ char arg6;
+ short arg7;
+ int arg8;
+ short arg9;
+ short arg10;
+#endif
+{
+ return arg1 + arg2 + arg3 + arg4 + arg5 + arg6 + arg7 + arg8 + arg9 + arg10;
+}
+
+#ifdef PROTOTYPES
+int t_short_values (short short_arg1, short short_arg2)
+#else
+int t_short_values (short_arg1, short_arg2)
+short short_arg1, short_arg2;
+#endif
+{
+ return ((short_arg1 == short_val1) && (short_arg2 == short_val2));
+}
+
+#ifdef PROTOTYPES
+int t_int_values (int int_arg1, int int_arg2)
+#else
+int t_int_values (int_arg1, int_arg2)
+int int_arg1, int_arg2;
+#endif
+{
+ return ((int_arg1 == int_val1) && (int_arg2 == int_val2));
+}
+
+#ifdef PROTOTYPES
+int t_long_values (long long_arg1, long long_arg2)
+#else
+int t_long_values (long_arg1, long_arg2)
+long long_arg1, long_arg2;
+#endif
+{
+ return ((long_arg1 == long_val1) && (long_arg2 == long_val2));
+}
+
+/* NOTE: THIS FUNCTION MUST NOT BE PROTOTYPED!!!!!
+ There must be one version of "t_float_values" (this one)
+ that is not prototyped, and one (if supported) that is (following).
+ That way GDB can be tested against both cases. */
+
+int t_float_values (float_arg1, float_arg2)
+float float_arg1, float_arg2;
+{
+ return ((float_arg1 - float_val1) < DELTA
+ && (float_arg1 - float_val1) > -DELTA
+ && (float_arg2 - float_val2) < DELTA
+ && (float_arg2 - float_val2) > -DELTA);
+}
+
+int
+#ifdef NO_PROTOTYPES
+/* In this case we are just duplicating t_float_values, but that is the
+ easiest way to deal with either ANSI or non-ANSI. */
+t_float_values2 (float_arg1, float_arg2)
+ float float_arg1, float_arg2;
+#else
+t_float_values2 (float float_arg1, float float_arg2)
+#endif
+{
+ return ((float_arg1 - float_val1) < DELTA
+ && (float_arg1 - float_val1) > -DELTA
+ && (float_arg2 - float_val2) < DELTA
+ && (float_arg2 - float_val2) > -DELTA);
+}
+
+#ifdef PROTOTYPES
+int t_double_values (double double_arg1, double double_arg2)
+#else
+int t_double_values (double_arg1, double_arg2)
+double double_arg1, double_arg2;
+#endif
+{
+ return ((double_arg1 - double_val1) < DELTA
+ && (double_arg1 - double_val1) > -DELTA
+ && (double_arg2 - double_val2) < DELTA
+ && (double_arg2 - double_val2) > -DELTA);
+}
+
+#ifdef PROTOTYPES
+int t_string_values (char *string_arg1, char *string_arg2)
+#else
+int t_string_values (string_arg1, string_arg2)
+char *string_arg1, *string_arg2;
+#endif
+{
+ return (!strcmp (string_arg1, string_val1) &&
+ !strcmp (string_arg2, string_val2));
+}
+
+#ifdef PROTOTYPES
+int t_char_array_values (char char_array_arg1[], char char_array_arg2[])
+#else
+int t_char_array_values (char_array_arg1, char_array_arg2)
+char char_array_arg1[], char_array_arg2[];
+#endif
+{
+ return (!strcmp (char_array_arg1, char_array_val1) &&
+ !strcmp (char_array_arg2, char_array_val2));
+}
+
+
+/* This used to simply compare the function pointer arguments with
+ known values for func_val1 and func_val2. Doing so is valid ANSI
+ code, but on some machines (RS6000, HPPA, others?) it may fail when
+ called directly by GDB.
+
+ In a nutshell, it's not possible for GDB to determine when the address
+ of a function or the address of the function's stub/trampoline should
+ be passed.
+
+ So, to avoid GDB lossage in the common case, we perform calls through the
+ various function pointers and compare the return values. For the HPPA
+ at least, this allows the common case to work.
+
+ If one wants to try something more complicated, pass the address of
+ a function accepting a "double" as one of its first 4 arguments. Call
+ that function indirectly through the function pointer. This would fail
+ on the HPPA. */
+
+#ifdef PROTOTYPES
+int t_func_values (int (*func_arg1)(int, int), int (*func_arg2)(int))
+#else
+int t_func_values (func_arg1, func_arg2)
+int (*func_arg1) PARAMS ((int, int));
+int (*func_arg2) PARAMS ((int));
+#endif
+{
+ return ((*func_arg1) (5,5) == (*func_val1) (5,5)
+ && (*func_arg2) (6) == (*func_val2) (6));
+}
+
+#ifdef PROTOTYPES
+int t_call_add (int (*func_arg1)(int, int), int a, int b)
+#else
+int t_call_add (func_arg1, a, b)
+int (*func_arg1) PARAMS ((int, int));
+int a, b;
+#endif
+{
+ return ((*func_arg1)(a, b));
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.exp b/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.exp
new file mode 100644
index 00000000000..586cabb7cdf
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/callfwmall.exp
@@ -0,0 +1,346 @@
+# Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+# These tests are the same as those in callfuncs.exp, except that the
+# test program here does not call malloc.
+#
+# "What in the world does malloc have to do with calling functions in
+# the inferior?" Well, nothing. GDB's ability to invoke a function
+# in the inferior program works just fine in programs that have no
+# malloc function available. It doesn't rely on the inferior's
+# malloc, directly or indirectly. It just uses the inferior's stack
+# space.
+#
+# "Then what's the point of this test file?" Well, it just so happens
+# that this file, in addition to testing inferior function calls, also
+# tests GDB's ability to evaluate string literals (like "string 1" and
+# "string 2" in the tests below). Evaluating *those* sorts of
+# expressions does require malloc.
+#
+# (As an extension to C, GDB also has a syntax for literal arrays of
+# anything, not just characters. For example, the expression
+# {2,3,4,5} (which appears in the tests below) evaluates to an array
+# of four ints. So rather than talking just about string literals,
+# we'll use the broader term "array literals".)
+#
+# Now, in this file, we only evaluate array literals when we're about
+# to pass them to a function, but don't be confused --- this is a red
+# herring. You can evaluate "abcdef" even if you're not about to pass
+# that to a function, and doing so requires malloc even if you're just
+# going to store a pointer to it in a variable, like this:
+#
+# (gdb) ptype s
+# type = char *
+# (gdb) set variable s = "abcdef"
+#
+# According to C's rules for evaluating expressions, arrays are
+# converted into pointers to their first element. This means that, in
+# order to evaluate an expression like "abcdef", GDB needs to actually
+# find some memory in the inferior we can plop the characters into;
+# then we use that memory's address as the address of our array
+# literal. GDB finds this memory by calling the inferior's malloc
+# function, if it has one. So, evaluating an array literal depends on
+# performing an inferior function call, but not vice versa. (GDB
+# can't just allocate the space on the stack; the pointer may remain
+# live long after the current frame has been popped.)
+#
+# "But, if evaluating array literals requires malloc, what's the point
+# of testing that GDB can do so in a program that doesn't have malloc?
+# It can't work!" On most systems, that's right, but HP-UX has some
+# sort of dynamic linking magic that ensures that *every* program has
+# malloc. So on HP-UX, GDB can evaluate array literals even in
+# inferior programs that don't use malloc. That's why this test is in
+# gdb.hp.
+#
+# This file has, for some reason, led to well more than its fair share
+# of misunderstandings about the relationship between array literal
+# expressions and inferior function calls. Folks talk as if you can
+# only evaluate array literals when you're about to pass them to a
+# function. I think they're assuming that, since GDB is constructing
+# a new frame on the inferior's stack (correct), it's going to use
+# that space for the array literals (incorrect). Remember that those
+# array literals may need to be live long after the inferior function
+# call returns; GDB can't tell.
+#
+# What makes the confusion worse is that there *is* a relationship
+# between array literals and inferior function calls --- GDB uses
+# inferior function calls to evaluate array literals. But many people
+# jump to other, incorrect conclusions about this.
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+if { [skip_hp_tests] } then { continue }
+
+set testfile "callfwmall"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+if {$hp_aCC_compiler} {
+ set prototypes 1
+} else {
+ set prototypes 0
+}
+
+
+# Some targets can't call functions, so don't even bother with this
+# test.
+if [target_info exists gdb,cannot_call_functions] {
+ setup_xfail "*-*-*" 2416
+ fail "This target can not call functions"
+ continue
+}
+
+# Set the current language to C. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_c {} {
+ global gdb_prompt
+
+ send_gdb "set language c\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language c (timeout)" ; return 0 }
+ }
+
+ send_gdb "show language\n"
+ gdb_expect {
+ -re ".* source language is \"c\".*$gdb_prompt $" {
+ pass "set language to \"c\""
+ return 1
+ }
+ -re ".*$gdb_prompt $" {
+ fail "setting language to \"c\""
+ return 0
+ }
+ timeout {
+ fail "can't show language (timeout)"
+ return 0
+ }
+ }
+}
+
+# FIXME: Before calling this proc, we should probably verify that
+# we can call inferior functions and get a valid integral value
+# returned.
+# Note that it is OK to check for 0 or 1 as the returned values, because C
+# specifies that the numeric value of a relational or logical expression
+# (computed in the inferior) is 1 for true and 0 for false.
+
+proc do_function_calls {} {
+ global prototypes
+ global gcc_compiled
+ global gdb_prompt
+
+ # We need to up this because this can be really slow on some boards.
+ set timeout 60;
+
+ gdb_test "p t_char_values(0,0)" " = 0"
+ gdb_test "p t_char_values('a','b')" " = 1"
+ gdb_test "p t_char_values(char_val1,char_val2)" " = 1"
+ gdb_test "p t_char_values('a',char_val2)" " = 1"
+ gdb_test "p t_char_values(char_val1,'b')" " = 1"
+
+ gdb_test "p t_short_values(0,0)" " = 0"
+ gdb_test "p t_short_values(10,-23)" " = 1"
+ gdb_test "p t_short_values(short_val1,short_val2)" " = 1"
+ gdb_test "p t_short_values(10,short_val2)" " = 1"
+ gdb_test "p t_short_values(short_val1,-23)" " = 1"
+
+ gdb_test "p t_int_values(0,0)" " = 0"
+ gdb_test "p t_int_values(87,-26)" " = 1"
+ gdb_test "p t_int_values(int_val1,int_val2)" " = 1"
+ gdb_test "p t_int_values(87,int_val2)" " = 1"
+ gdb_test "p t_int_values(int_val1,-26)" " = 1"
+
+ gdb_test "p t_long_values(0,0)" " = 0"
+ gdb_test "p t_long_values(789,-321)" " = 1"
+ gdb_test "p t_long_values(long_val1,long_val2)" " = 1"
+ gdb_test "p t_long_values(789,long_val2)" " = 1"
+ gdb_test "p t_long_values(long_val1,-321)" " = 1"
+
+ if ![target_info exists gdb,skip_float_tests] {
+ gdb_test "p t_float_values(0.0,0.0)" " = 0"
+
+ # These next four tests fail on the mn10300.
+ # The first value is passed in regs, the other in memory.
+ # Gcc emits different stabs for the two parameters; the first is
+ # claimed to be a float, the second a double.
+ # dbxout.c in gcc claims this is the desired behavior.
+ setup_xfail "mn10300-*-*"
+ gdb_test "p t_float_values(3.14159,-2.3765)" " = 1"
+ setup_xfail "mn10300-*-*"
+ gdb_test "p t_float_values(float_val1,float_val2)" " = 1"
+ setup_xfail "mn10300-*-*"
+ gdb_test "p t_float_values(3.14159,float_val2)" " = 1"
+ setup_xfail "mn10300-*-*"
+ gdb_test "p t_float_values(float_val1,-2.3765)" " = 1"
+
+ # Test passing of arguments which might not be widened.
+ gdb_test "p t_float_values2(0.0,0.0)" " = 0"
+
+ # Although PR 5318 mentions SunOS specifically, this seems
+ # to be a generic problem on quite a few platforms.
+ if $prototypes then {
+ setup_xfail "sparc-*-*" "mips*-*-*" 5318
+ if {!$gcc_compiled} then {
+ setup_xfail "alpha-dec-osf2*" "i*86-*-sysv4*" 5318
+ }
+ }
+ gdb_test "p t_float_values2(3.14159,float_val2)" " = 1"
+ gdb_test "p t_small_values(1,2,3,4,5,6,7,8,9,10)" " = 55"
+
+ gdb_test "p t_double_values(0.0,0.0)" " = 0"
+ gdb_test "p t_double_values(45.654,-67.66)" " = 1"
+ gdb_test "p t_double_values(double_val1,double_val2)" " = 1"
+ gdb_test "p t_double_values(45.654,double_val2)" " = 1"
+ gdb_test "p t_double_values(double_val1,-67.66)" " = 1"
+
+ }
+
+ gdb_test "p t_string_values(string_val2,string_val1)" " = 0"
+ gdb_test "p t_string_values(string_val1,string_val2)" " = 1"
+ gdb_test "p t_string_values(\"string 1\",\"string 2\")" " = 1"
+ gdb_test "p t_string_values(\"string 1\",string_val2)" " = 1"
+ gdb_test "p t_string_values(string_val1,\"string 2\")" " = 1"
+
+ gdb_test "p t_char_array_values(char_array_val2,char_array_val1)" " = 0"
+ gdb_test "p t_char_array_values(char_array_val1,char_array_val2)" " = 1"
+ gdb_test "p t_char_array_values(\"carray 1\",\"carray 2\")" " = 1"
+ gdb_test "p t_char_array_values(\"carray 1\",char_array_val2)" " = 1"
+ gdb_test "p t_char_array_values(char_array_val1,\"carray 2\")" " = 1"
+
+ gdb_test "p doubleit(4)" " = 8"
+ gdb_test "p add(4,5)" " = 9"
+ gdb_test "p t_func_values(func_val2,func_val1)" " = 0"
+ gdb_test "p t_func_values(func_val1,func_val2)" " = 1"
+
+ # On the rs6000, we need to pass the address of the trampoline routine,
+ # not the address of add itself. I don't know how to go from add to
+ # the address of the trampoline. Similar problems exist on the HPPA,
+ # and in fact can present an unsolvable problem as the stubs may not
+ # even exist in the user's program. We've slightly recoded t_func_values
+ # to avoid such problems in the common case. This may or may not help
+ # the RS6000.
+ setup_xfail "rs6000*-*-*"
+ setup_xfail "powerpc*-*-*"
+
+ if {![istarget hppa*-*-hpux*]} then {
+ gdb_test "p t_func_values(add,func_val2)" " = 1"
+ }
+
+ setup_xfail "rs6000*-*-*"
+ setup_xfail "powerpc*-*-*"
+
+ if {![istarget hppa*-*-hpux*]} then {
+ gdb_test "p t_func_values(func_val1,doubleit)" " = 1"
+ }
+
+ gdb_test "p t_call_add(func_val1,3,4)" " = 7"
+
+ setup_xfail "rs6000*-*-*"
+ setup_xfail "powerpc*-*-*"
+
+ if {![istarget hppa*-*-hpux*]} then {
+ gdb_test "p t_call_add(add,3,4)" " = 7"
+ }
+
+ gdb_test "p t_enum_value1(enumval1)" " = 1"
+ gdb_test "p t_enum_value1(enum_val1)" " = 1"
+ gdb_test "p t_enum_value1(enum_val2)" " = 0"
+
+ gdb_test "p t_enum_value2(enumval2)" " = 1"
+ gdb_test "p t_enum_value2(enum_val2)" " = 1"
+ gdb_test "p t_enum_value2(enum_val1)" " = 0"
+
+ gdb_test "p sum_args(1,{2})" " = 2"
+ gdb_test "p sum_args(2,{2,3})" " = 5"
+ gdb_test "p sum_args(3,{2,3,4})" " = 9"
+ gdb_test "p sum_args(4,{2,3,4,5})" " = 14"
+ gdb_test "p sum10 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)" " = 55"
+
+ gdb_test "p t_structs_c(struct_val1)" "= 120 'x'" \
+ "call inferior func with struct - returns char"
+ gdb_test "p t_structs_s(struct_val1)" "= 87" \
+ "call inferior func with struct - returns short"
+ gdb_test "p t_structs_i(struct_val1)" "= 76" \
+ "call inferior func with struct - returns int"
+ gdb_test "p t_structs_l(struct_val1)" "= 51" \
+ "call inferior func with struct - returns long"
+ gdb_test "p t_structs_f(struct_val1)" "= 2.12.*" \
+ "call inferior func with struct - returns float"
+ gdb_test "p t_structs_d(struct_val1)" "= 9.87.*" \
+ "call inferior func with struct - returns double"
+ gdb_test "p t_structs_a(struct_val1)" "= (.unsigned char .. )?\"foo\"" \
+ "call inferior func with struct - returns char *"
+
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "set print sevenbit-strings" ""
+gdb_test "set print address off" ""
+gdb_test "set width 0" ""
+
+if { $hp_aCC_compiler } {
+ # Do not set language explicitly to 'C'. This will cause aCC
+ # tests to fail because promotion rules are different. Just let
+ # the language be set to the default.
+
+ if { ![runto_main] } {
+ gdb_suppress_tests;
+ }
+
+ gdb_test "set overload-resolution 0" ".*"
+} else {
+ if { ![set_lang_c] } {
+ gdb_suppress_tests;
+ } else {
+ if { ![runto_main] } {
+ gdb_suppress_tests;
+ }
+ }
+}
+
+gdb_test "next" ".*"
+do_function_calls
+
+return 0
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/configure b/gdb/testsuite/gdb.hp/gdb.base-hp/configure
new file mode 100755
index 00000000000..958011d03dc
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/configure
@@ -0,0 +1,899 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=dollar.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../../.. $srcdir/`cd $srcdir;pwd`/../../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../../.. $srcdir/`cd $srcdir;pwd`/../../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:573: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:594: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:612: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/configure.in b/gdb/testsuite/gdb.hp/gdb.base-hp/configure.in
new file mode 100644
index 00000000000..f6f43a7d932
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(dollar.exp)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/dollar.c b/gdb/testsuite/gdb.hp/gdb.base-hp/dollar.c
new file mode 100644
index 00000000000..8fd9893c704
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/dollar.c
@@ -0,0 +1,10 @@
+#ifdef PROTOTYPES
+int main (int argc, char **argv)
+#else
+main (argc, argv, envp)
+ int argc;
+ char **argv;
+#endif
+{
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/dollar.exp b/gdb/testsuite/gdb.hp/gdb.base-hp/dollar.exp
new file mode 100644
index 00000000000..b3a6335a1f5
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/dollar.exp
@@ -0,0 +1,155 @@
+# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# GDB tests for names beginning with '$'
+
+# This is aimed at HP-UX systems where a lot of system
+# routines and names begin with '$' or '$$'. GDB 4.16 was
+# unable to deal with these names as they clashed with
+# convenience variables. Wildebeest should accept such
+# names in preference to convenience variables.
+
+# This file was written by Satish Pai <pai@apollo.hp.com>
+# 1997-09-24
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+if { [skip_hp_tests] } { continue }
+
+set testfile "dollar"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+#source ${binfile}.ci
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# Test for millicode routines
+# hppa64 does not support dyncall
+if ![istarget "hppa64*-*-*"] {
+send_gdb "print \$\$dyncall\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{<text variable, no debug info>\\} $hex <>.*$gdb_prompt $" { pass "print \$\$dyncall" }
+ -re "\\$\[0-9\]* = \\{<text variable, no debug info>\\} $hex <.*dyncall>.*$gdb_prompt $" { pass "print \$\$dyncall" }
+ -re "\\$\[0-9\]* = void" { fail "print \$\$dyncall -- interpreted as convenience var" }
+ -re "$gdb_prompt $" { fail "print \$\$dyncall" }
+ timeout { fail "(timeout) print \$\$dyncall" }
+}
+send_gdb "print \$\$dyncall_external\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{<text variable, no debug info>\\} $hex <>.*$gdb_prompt $" { pass "print \$\$dyncall_external" }
+ -re "\\$\[0-9\]* = \\{<text variable, no debug info>\\} $hex <.*dyncall_external>.*$gdb_prompt $" { pass "print \$\$dyncall_external" }
+ -re "\\$\[0-9\]* = void" { fail "print \$\$dyncall_external -- interpreted as convenience var" }
+ -re "$gdb_prompt $" { fail "print \$\$dyncall_external" }
+ timeout { fail "(timeout) print \$\$dyncall_external" }
+}
+
+# Set a breakpoint on a millicode routine
+send_gdb "break \$\$dyncall\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]* at $hex.*$gdb_prompt $" { pass "break \$\$dyncall" }
+ -re "Function.*not defined.*$gdb_prompt $" {fail "break \$\$dyncall -- no \$\$dyncall?" }
+ -re "Convenience variables used in line specs must have integer values\\..*$gdb_prompt $" {
+ fail "break \$\$dyncall -- treated as convenince variable"
+ }
+ -re "$gdb_prompt $" { fail "print break \$\$dyncall" }
+ timeout { fail "(timeout) print break \$\$dyncall" }
+}
+
+# Disassemble $$dyncall
+send_gdb "disassemble \$\$dyncall\n"
+gdb_expect {
+ -re "Dump of assembler code for function.*$gdb_prompt $" { pass "disas \$\$dyncall" }
+ -re "$gdb_prompt $" { fail "disas \$\$dyncall" }
+ timeout { fail "(timeout) disas \$\$dyncall" }
+}
+
+# Try to set $$dyncall like a convenience var.
+send_gdb "set \$\$dyncall = 77\n"
+gdb_expect {
+ -re "Invalid cast.*$gdb_prompt $" { pass "set \$\$dyncall = 77" }
+ -re "$gdb_prompt $" { fail "set \$\$dyncall = 77" }
+ timeout { fail "(timeout) set \$\$dyncall = 77" }
+}
+}
+
+# Try out some other $ name, not millicode
+if [istarget "hppa64*-*-*"] {
+ #hppa64 uses __argv instead of $ARGV.
+ send_gdb "print \__argv\n"
+ gdb_expect {
+ -re "\\$\[0-9\]* = \[0-9\]*.*$gdb_prompt $" { pass "print \__argv" }
+ -re "\\$\[0-9\]* = void.*$gdb_prompt $" {
+ fail "print \__argv (interpreted as convenience var)"
+ }
+ -re "$gdb_prompt $" { fail "print \__argv" }
+ timeout { fail "(timeout) print \__argv" }
+ }
+
+ send_gdb "ptype \__argv\n"
+ gdb_expect {
+ -re "type = <data variable, no debug info>.*$gdb_prompt $" {
+ pass "ptype \__argv"
+ }
+ -re "type = void.*$gdb_prompt $" {
+ fail "ptype \__argv (interpreted as convenience var)"
+ }
+ -re "$gdb_prompt $" { fail "ptype \__argv" }
+ timeout { fail "(timeout) ptype \__argv" }
+ }
+} else {
+send_gdb "print \$ARGV\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \[0-9\]*.*$gdb_prompt $" { pass "print \$ARGV" }
+ -re "\\$\[0-9\]* = void.*$gdb_prompt $" { fail "print \$ARGV (interpreted as convenience var)" }
+ -re "$gdb_prompt $" { fail "print \$ARGV" }
+ timeout { fail "(timeout) print \$ARGV" }
+}
+send_gdb "ptype \$ARGV\n"
+gdb_expect {
+ -re "type = <data variable, no debug info>.*$gdb_prompt $" { pass "ptype \$ARGV" }
+ -re "type = void.*$gdb_prompt $" { fail "ptype \$ARGV (interpreted as convenience var)" }
+ -re "$gdb_prompt $" { fail "ptype \$ARGV" }
+ timeout { fail "(timeout) ptype \$ARGV" }
+}
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/genso-thresh.c b/gdb/testsuite/gdb.hp/gdb.base-hp/genso-thresh.c
new file mode 100644
index 00000000000..50756bb975d
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/genso-thresh.c
@@ -0,0 +1,229 @@
+/*
+ * Program to generate the so-thresh testcase,
+ * including associated linked-against shared libraries.
+ * Build as:
+ *
+ * cc -g -o genso-thresh genso-thresh.c
+ *
+ * Invoke as:
+ *
+ * genso-thresh
+ *
+ * It will put all the code in the current directory (".").
+ *
+ * A makefile can also be generated if the -makemake option is used.
+ * To use the makefile:
+ *
+ * make -f so-thresh.mk all
+ *
+ * The name of the application is
+ *
+ * so-thresh
+ *
+ * (Revised from a program by John Bishop. --rehrauer)
+ */
+
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/fcntl.h>
+
+int main (argc, argv)
+int argc;
+char **argv;
+{
+#define NUMBER_OF_INT_VARS 1500
+#define NUMBER_OF_LIBS 3
+ int lib_num = NUMBER_OF_LIBS;
+ int i;
+ int i2;
+ FILE *main_file;
+ FILE *lib_file;
+ FILE *make_file;
+ FILE *link_file;
+
+ char testcase_name [1000];
+ char linkfile_name [1000];
+ char makefile_name [1000];
+ char mainfile_name [1000];
+
+ char file_name[100];
+ /*
+ * 0123456789 <-- length of field
+ * "./fil0000000002.c"; <-- typical filename
+ * 12345678901234567890 <-- length of string
+ * 10 20
+ * ^where null goes
+ */
+ char file_name_core[100];
+
+ /* Verify input.
+ */
+ if ((argc < 1) || (argc > 2) || (argv == NULL) ||
+ ((argc == 2) && (strcmp (argv[1], "-makemake") != 0)))
+ {
+ printf ("** Syntax: %s [-makemake]\n", argv[0]);
+ return;
+ }
+
+ if (strncmp (argv[0], "gen", 3) != 0)
+ {
+ printf ("** This tool expected to be named \"gen<something>\"\n");
+ return;
+ }
+ strcpy (testcase_name, argv[0]+3);
+
+ strcpy (linkfile_name, testcase_name);
+ strcat (linkfile_name, ".lopt");
+ link_file = fopen (linkfile_name, "w");
+ fprintf (link_file, "# Linker options for %s test\n", testcase_name);
+
+ /* Generate the makefile, if requested.
+ */
+ if (argc == 2)
+ {
+ strcpy (makefile_name, testcase_name);
+ strcat (makefile_name, ".mk.new");
+ make_file = fopen (makefile_name, "w");
+ printf (" Note: New makefile (%s) generated.\n", makefile_name);
+ printf (" May want to update existing makefile, if any.\n");
+ fprintf (make_file, "# Generated automatically by %s\n", argv[0]);
+ fprintf (make_file, "# Make file for %s test\n", testcase_name);
+ fprintf (make_file, "\n");
+ fprintf (make_file, "CFLAGS = +DA1.1 -g\n");
+ fprintf (make_file, "\n");
+ fprintf (make_file, "# This is how to build this generator.\n");
+ fprintf (make_file, "%s.o: %s.c\n", argv[0], argv[0]);
+ fprintf (make_file, "\t$(CC) $(CFLAGS) -o %s.o -c %s.c\n", argv[0], argv[0]);
+ fprintf (make_file, "%s: %s.o\n", argv[0], argv[0]);
+ fprintf (make_file, "\t$(CC) $(CFLAGS) -o %s %s.o\n", argv[0], argv[0]);
+ fprintf (make_file, "\n");
+ fprintf (make_file, "# This is how to run this generator.\n");
+ fprintf (make_file, "# This target should be made before the 'all' target,\n");
+ fprintf (make_file, "# to ensure that the shlib sources are all available.\n");
+ fprintf (make_file, "require_shlibs: %s\n", argv[0]);
+ for (i=0; i < lib_num; i++)
+ {
+ fprintf (make_file, "\tif ! [ -a lib%2.2d_%s.c ] ; then \\\n", i, testcase_name);
+ fprintf (make_file, "\t %s ; \\\n", argv[0]);
+ fprintf (make_file, "\tfi\n");
+ }
+ fprintf (make_file, "\n");
+ fprintf (make_file, "# This is how to build all the shlibs.\n");
+ fprintf (make_file, "# Be sure to first make the require_shlibs target!\n");
+ for (i=0; i < lib_num; i++)
+ {
+ fprintf (make_file, "lib%2.2d_%s.o: lib%2.2d_%s.c\n", i, testcase_name, i, testcase_name);
+ fprintf (make_file, "\t$(CC) $(CFLAGS) +Z -o lib%2.2d_%s.o -c lib%2.2d_%s.c\n", i, testcase_name, i, testcase_name);
+ fprintf (make_file, "lib%2.2d-%s.sl: lib%2.2d-%s.o\n", i, testcase_name, i, testcase_name);
+ fprintf (make_file, "\t$(LD) $(LDFLAGS) -b -o lib%2.2d-%s.sl lib%2.2d-%s.o\n", i, testcase_name, i, testcase_name);
+ }
+ fprintf (make_file, "\n");
+fprintf (make_file, "# For convenience, here's names for all pieces of all shlibs.\n");
+ fprintf (make_file, "SHLIB_SOURCES = \\\n");
+ for (i=0; i < lib_num-1; i++)
+ fprintf (make_file, "\tlib%2.2d-%s.c \\\n", i, testcase_name);
+ fprintf (make_file, "\tlib%2.2d-%s.c\n", lib_num-1, testcase_name);
+ fprintf (make_file, "SHLIB_OBJECTS = $(SHLIB_SOURCES:.c=.o)\n");
+ fprintf (make_file, "SHLIBS = $(SHLIB_SOURCES:.c=.sl)\n");
+ fprintf (make_file, "SHLIB_NAMES = $(SHLIB_SOURCES:.c=)\n");
+ fprintf (make_file, "EXECUTABLES = $(SHLIBS) %s %s\n", argv[0], testcase_name);
+ fprintf (make_file, "OBJECT_FILES = $(SHLIB_OBJECTS) %s.o %s.o\n", argv[0], testcase_name);
+ fprintf (make_file, "\n");
+ fprintf (make_file, "shlib_objects: $(SHLIB_OBJECTS)\n");
+ fprintf (make_file, "shlibs: $(SHLIBS)\n");
+ fprintf (make_file, "\n");
+ fprintf (make_file, "# This is how to build the debuggable testcase that uses the shlibs.\n");
+ fprintf (make_file, "%s.o: %s.c\n", testcase_name, testcase_name);
+ fprintf (make_file, "\t$(CC) $(CFLAGS) -o %s.o -c %s.c\n", testcase_name, testcase_name);
+ fprintf (make_file, "%s: shlibs %s.o\n", testcase_name, testcase_name);
+ fprintf (make_file, "\t$(LD) $(LDFLAGS) -o %s -lc -L. ", testcase_name);
+ fprintf (make_file, "-c %s /opt/langtools/lib/end.o /lib/crt0.o %s.o\n", linkfile_name, testcase_name);
+ fprintf (make_file, "\n");
+ fprintf (make_file, "# Yeah, but you should first make the require_shlibs target!\n");
+ fprintf (make_file, "all: %s %s\n", testcase_name, argv[0]);
+ fprintf (make_file, "\n");
+ fprintf (make_file, "# To remove everything built via this makefile...\n");
+ fprintf (make_file, "clean:\n");
+ /* Do this carefully, to avoid hitting silly HP-UX ARG_MAX limits... */
+ fprintf (make_file, "\trm -f lib0*-%s.*\n", testcase_name);
+ fprintf (make_file, "\trm -f lib1*-%s.*\n", testcase_name);
+ fprintf (make_file, "\trm -f lib2*-%s.*\n", testcase_name);
+ fprintf (make_file, "\trm -f lib3*-%s.*\n", testcase_name);
+ fprintf (make_file, "\trm -f lib4*-%s.*\n", testcase_name);
+ fprintf (make_file, "\trm -f lib5*-%s.*\n", testcase_name);
+ fprintf (make_file, "\trm -f lib6*-%s.*\n", testcase_name);
+ fprintf (make_file, "\trm -f lib7*-%s.*\n", testcase_name);
+ fprintf (make_file, "\trm -f lib8*-%s.*\n", testcase_name);
+ fprintf (make_file, "\trm -f lib9*-%s.*\n", testcase_name);
+ fprintf (make_file, "\trm -f %s %s %s %s.c\n", argv[0], testcase_name, linkfile_name, testcase_name);
+ fprintf (make_file, "\n");
+ fclose (make_file);
+ }
+
+ /* Generate the code for the libraries.
+ */
+ for (i=0; i < lib_num; i++) {
+
+ /* Generate the names for the library.
+ */
+ sprintf (file_name, "lib%2.2d-%s.c", i, testcase_name);
+ sprintf (file_name_core, "lib%2.2d-%s", i, testcase_name);
+
+ /* Generate the source code.
+ */
+ lib_file = fopen (file_name, "w");
+ fprintf (lib_file, "/* Shared library file number %d */\n", i);
+ fprintf (lib_file, "#include <stdio.h>\n\n");
+ fprintf (lib_file, "/* The following variables largely exist to bloat this library's debug info. */\n");
+ fprintf (lib_file, "static char c_static_buf_%d [100];\n", i);
+ for (i2=0; i2<NUMBER_OF_INT_VARS; i2++)
+ fprintf (lib_file, "int i_%d_%d;\n", i, i2);
+ fprintf (lib_file, "\nint r_%d ()\n", i);
+ fprintf (lib_file, "{\n");
+ for (i2=0; i2<NUMBER_OF_INT_VARS; i2++)
+ fprintf (lib_file, " i_%d_%d = %d*%d;\n", i, i2, i2, i2);
+ fprintf (lib_file, " return 1;\n");
+ fprintf (lib_file, "}\n\n");
+ fprintf (lib_file, "/* end of generated file */\n");
+ fclose (lib_file);
+
+ /* Add a linker options line
+ */
+ fprintf (link_file, "-l%2.2d-%s\n", i, testcase_name);
+ }
+
+ /* Generate the "main" file.
+ */
+ strcpy (mainfile_name, testcase_name);
+ strcat (mainfile_name, ".c");
+ main_file = fopen (mainfile_name, "w");
+ fprintf (main_file, "/* Generated test progam with %d shared libraries. */\n\n",
+ lib_num);
+ fprintf (main_file, "#include <stdio.h>\n\n");
+
+ for (i = 0; i < lib_num; i++) {
+ fprintf (main_file, "extern int r_%d();\n", i);
+ }
+
+ fprintf (main_file, "\n");
+ fprintf (main_file, "int main()\n");
+ fprintf (main_file, "{\n");
+ fprintf (main_file, " int accum;\n");
+ fprintf (main_file, " int lib_num = %d;\n", lib_num);
+
+ for (i = 0; i < lib_num; i++) {
+ fprintf (main_file, " accum += r_%d();\n", i);
+ }
+
+ fprintf (main_file, " printf( \"Final value: %%d, should be %%d\\n\", accum, lib_num );\n\n");
+ fprintf (main_file, " return 0;\n");
+ fprintf (main_file, "}\n\n");
+ fprintf (main_file, "/* end of generated file */\n");
+ fclose (main_file);
+
+ /* Finish up the link file and the build file
+ */
+ fclose (link_file);
+}
+
+/* End of file */
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.c b/gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.c
new file mode 100644
index 00000000000..833d027fc87
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.c
@@ -0,0 +1,9 @@
+/* This program raises a SIGBUS signal on HP-UX when the
+ pointer "bogus_p" is dereferenced.
+ */
+int * bogus_p = (int *)3;
+
+int main()
+{
+ *bogus_p = 0xdeadbeef;
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.exp b/gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.exp
new file mode 100644
index 00000000000..3e529f8c0e6
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/hwwatchbus.exp
@@ -0,0 +1,83 @@
+# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+set prms_id 0
+set bug_id 0
+
+if { [skip_hp_tests] } then { continue }
+
+if { ![istarget "hppa*-*-hpux11.*"] } {
+ verbose "HPUX h/w watch test ignored for non-hppa or pre-HP/UX-10.30 targets."
+ return 0
+}
+
+set testfile "hwwatchbus"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# build the first test case
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+# Start with a fresh gdb
+
+gdb_exit
+remote_exec build "rm -f ${binfile}.bak"
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+
+# We ought to be able to set a hardware watchpoint, step, and
+# get a SIGBUS or SIGSEGV signal reported.
+#
+if ![runto_main] then {
+ fail "can't run to main"
+ return 0
+}
+
+send_gdb "watch bogus_p\n"
+gdb_expect {
+ -re "Hardware watchpoint \[0-9\]*: bogus_p.*$gdb_prompt $"\
+ {pass "set h/w watchpoint"}
+ -re "$gdb_prompt $"\
+ {fail "set h/w watchpoint"}
+ timeout {fail "(timeout) set h/w watchpoint"}
+}
+
+send_gdb "step\n"
+gdb_expect {
+ -re "Program received signal (SIGBUS|SIGSEGV), (Bus error|Segmentation fault).* in main .*${srcfile}:8.*$gdb_prompt $"\
+ {pass "see real signal when h/w watchpoint set"}
+ -re "$gdb_prompt $"\
+ {fail "see real signal when h/w watchpoint set"}
+ timeout {fail "(timeout) see real signal when h/w watchpoint set"}
+}
+
+remote_exec build "mv ${binfile} ${binfile}.bak"
+return 0
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.c b/gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.c
new file mode 100644
index 00000000000..31046b5454b
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.c
@@ -0,0 +1,37 @@
+#include <stdio.h>
+
+#ifdef PROTOTYPES
+int callee (int x)
+#else
+int callee( x )
+int x;
+#endif
+{
+ int y = x * x;
+ return (y - 2);
+}
+
+int main()
+{
+ int i;
+ for (i = 1; i < 10; i++)
+ {
+ printf( "%d ", callee( i ));
+
+ }
+ printf( " Goodbye!\n" );
+ return 0;
+}
+/* This routine exists only for aCC. The way we compile this test is
+ that we use aCC for the actual compile into the object file but then
+ use ld directly for the link. When we do this, we get an undefined
+ symbol _main(). Therefore, for aCC, we have this routine in here and
+ ld is happy. */
+
+#ifdef __cplusplus
+extern "C" {
+void _main()
+{
+}
+}
+#endif
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.exp b/gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.exp
new file mode 100644
index 00000000000..4e48107c60a
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/pxdb.exp
@@ -0,0 +1,128 @@
+# Copyright (C) 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+
+# This file is part of the gdb testsuite
+
+
+# pxdb.exp Test that gdb calls pxdb on an application
+# built without it.
+#
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+if { [skip_hp_tests] } then { continue }
+
+set testfile pxdb
+set srcfile ${testfile}.c
+set objfile ${objdir}/${subdir}/${testfile}.o
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile} "c++"] {
+ return -1;
+}
+
+if { $gcc_compiled } then { continue }
+
+# To build a non-pxdb-ed file, use
+#
+# <compile to .o file>
+# export LD_PXDB /dev/null
+# ld -o hello_no_pxdb hello.o /opt/langtools/lib/end.o /usr/ccs/lib/crt0.o -lc
+#
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+#
+# use this to debug:
+#log_user 1
+
+
+# Following should get the error message:
+#
+# ld: (Warning) Can't exec pxdb using path: /dev/null
+#
+#execute_anywhere "ksh -c \"export LD_PXDB=/dev/null\""
+
+if [istarget "hppa64-*-*"] {
+set cmdline "ksh -c \"LD_PXDB=/dev/null ld -o ${binfile} ${objfile} /opt/langtools/lib/pa20_64/crt0.o /opt/langtools/lib/pa20_64/end.o -lc\""
+} else {
+set cmdline "ksh -c \"LD_PXDB=/dev/null ld -o ${binfile} ${objfile} /usr/ccs/lib/crt0.o /opt/langtools/lib/end.o -lc\""
+}
+
+remote_exec build "rm ${binfile}"
+remote_exec build $cmdline
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+# We expect to see this:
+#
+# "warning: File not processed by pxdb--about to process now.
+# "
+# ".
+# "Procedures: 7
+# "Files: 2
+# "Reading symbols from ~/c_code.dir/hello_no_pxdb...done.
+# "(gdb)
+#
+send_gdb "file ${binfile}\n"
+gdb_expect {
+
+ -re ".*warning: File not processed by pxdb.*Procedures: \[0-9\]+.*$gdb_prompt $"\
+ { pass "PXDB call" }
+
+ -re "$gdb_prompt $" {
+ if [istarget hppa*-*-hpux*] {
+ pass "Didn't call pxdb"
+ } else {
+ fail "Didn't call pxdb"
+ }
+ }
+
+ -re ".*$gdb_prompt $" { fail "Some other message" }
+
+ timeout { fail "call pxdb (timeout)" }
+}
+
+# Make sure the new data makes sense
+#
+if { ![runto callee] } then { return }
+
+send_gdb "print x\n"
+gdb_expect {
+ -re ".*= 1.*$gdb_prompt $" { pass "Good data after pxdb call" }
+ -re ".*$gdb_prompt $" { fail "No data after pxdb call" }
+ timeout { fail "(timeout)" }
+}
+
+gdb_exit
+return 0
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/reg-pa64.exp b/gdb/testsuite/gdb.hp/gdb.base-hp/reg-pa64.exp
new file mode 100644
index 00000000000..ce42c786e3d
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/reg-pa64.exp
@@ -0,0 +1,189 @@
+# Tests of wide register displays for GDB on HPPA 2.0 machines
+# Copyright 1994, 1995 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# use this to debug:
+#log_user 1
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+if { [skip_hp_tests] } { continue }
+
+if ![istarget "hppa*-*-*"] {
+ verbose "Wide register test ignored for non-hppa targets."
+ return 0
+}
+
+if ![istarget "hppa64-hp-hpux*"] {
+ verbose "reg-pa64.exp is only for PA2.0W (aka PA64)."
+ return 0
+}
+
+set testfile "reg-pa64"
+set srcfile ${testfile}.s
+set binfile ${objdir}/${subdir}/${testfile}
+
+# To build a pa 2.0 executable
+#
+# as +DA2.0W -o reg-pa64 reg-pa64.s
+# or
+# cc +DA2.0W -g -o reg-pa64 reg-pa64.s
+#
+# Don't reject if there are warnings, as we expect this warning:
+#
+# (Warning) At least one PA 2.0 object file (pa2.0_test2.o) was detected.
+# The linked output may not run on a PA 1.x system.
+#
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# test machine--there's no 2.0n architecture, so we have
+# to try to run the app.
+#
+gdb_test "break main" "Breakpoint.*" "initial set-up"
+
+send_gdb "run\n"
+gdb_expect {
+ -re ".*Executable file incompatible with hardware.*$gdb_prompt $" {
+ # Not hppa2.0 machine
+ #
+ return 0
+ }
+ -re "Cannot exec.*$gdb_prompt $" {
+ # Not hppa2.0 machine
+ #
+ return 0
+ }
+ -re ".*Starting program:.*$gdb_prompt $" {
+ pass "Ready to start test"
+ }
+ timeout {
+ fail "initial set-up, part 2 (timeout)"
+ return 0
+ }
+}
+
+# Let the program set known values. This secretly deletes
+# the breakpoint at main and re-runs to mainend.
+#
+runto mainend
+
+# Look for known values
+#
+gdb_test "info reg r1" "r1 1"
+gdb_test "info reg r4" "r4 2"
+gdb_test "info reg r5" "r5 4"
+gdb_test "info reg r6" "r6 8"
+gdb_test "info reg r7" "r7 10"
+gdb_test "info reg r8" "r8 20"
+gdb_test "info reg r9" "r9 40"
+gdb_test "info reg r10" "r10 80"
+gdb_test "info reg r11" "r11 100"
+gdb_test "info reg r12" "r12 200"
+gdb_test "info reg r13" "r13 400"
+gdb_test "info reg r14" "r14 800"
+gdb_test "info reg r15" "r15 1000"
+gdb_test "info reg r16" "r16 2000"
+
+# Two odd variants that GDB supports are:
+# "1" means "r1", and
+# "$1" means "r1"
+#
+gdb_test "info reg 1 4" "r1 1.*r4 2"
+gdb_test "info reg \$1" "r1 1"
+
+# Verify that GDB responds gracefully to a register ID number that
+# is out of range.
+#
+gdb_test "info reg 999" "999: invalid register"
+
+# Make sure the floating point status and error registers
+# don't show up as floating point numbers!
+#
+gdb_test "info reg fpsr" ".*fpsr 0.*" "fpsr"
+gdb_test "info reg fpe1" ".*fpe1 .*" "fpe1"
+gdb_test "info reg fpe2" ".*fpe2 .*" "fpe2"
+gdb_test "info reg fpe3" ".*fpe3 .*" "fpe3"
+#DTS CLLbs16708
+#info reg should recognize fpe4..fpe7.
+setup_xfail hppa64-hp-hpux* CLLbs16708
+gdb_test "info reg fpe4" ".*fpe4 .*" "fpe4"
+setup_xfail hppa64-hp-hpux* CLLbs16708
+gdb_test "info reg fpe5" ".*fpe5 .*" "fpe5"
+setup_xfail hppa64-hp-hpux* CLLbs16708
+gdb_test "info reg fpe6" ".*fpe6 .*" "fpe6"
+setup_xfail hppa64-hp-hpux* CLLbs16708
+gdb_test "info reg fpe7" ".*fpe7 .*" "fpe7"
+
+gdb_test "info reg fr4" ".*fr4.*(double precision).* 1.*"
+gdb_test "info reg fr5" ".*fr5.*(double precision).* 2.*"
+gdb_test "info reg fr6" ".*fr6.*(double precision).* 2.*"
+gdb_test "info reg fr7" ".*fr7.*(double precision).* 4.*"
+gdb_test "info reg fr8" ".*fr8.*(double precision).* 8.*"
+gdb_test "info reg fr9" ".*fr9.*(double precision).* 32.*"
+gdb_test "info reg fr10" ".*fr10.*(double precision).* 256.*"
+
+gdb_test "info reg r19" "r19 deadbeefbadcadee"
+
+# Need to add test of use of $<register-name>
+#
+# Q: How do you say a literal "$" in expect?
+# A: You say "\$". A literal "\" is "\\".
+#
+# Please note that this test will fail as long as we are running
+# in 32-bit mode: it will produce "$1 = 0xbadcadee". To fix it
+# would require building a real 64-bit gdb (expression evaluation,
+# in particular).
+#
+send_gdb "p/x \$r19\n"
+gdb_expect {
+ -re ".*= 0xdeadbeefbadcadee.*$gdb_prompt $" {
+ pass "64-bit works"
+ }
+ -re ".*= 0xbadcadee.*$gdb_prompt $" {
+ pass "32-bit extract when using PRINT; expected but not good"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "didn't print any part of right value"
+ }
+ timeout {
+ fail "timeout on print"
+ }
+}
+
+# Need to add tests of setting wide regs too. E.g.
+#
+# set $r4 = 0x1234567890123456
+# p/x $r4
+#
+
+# done
+#
+gdb_exit
+
+return 0
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/reg-pa64.s b/gdb/testsuite/gdb.hp/gdb.base-hp/reg-pa64.s
new file mode 100644
index 00000000000..4c284d79580
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/reg-pa64.s
@@ -0,0 +1,104 @@
+; assemble as "as -o reg-pa64 reg-pa64.s"
+; or
+; cc -g -o +DA2.0W
+;
+; PA-RISC 2.0 register contents test.
+;
+ .level 2.0W
+
+ .code
+ .export main,ENTRY
+ .export mainend,CODE
+ .export lab1,CODE
+ .space $TEXT$
+ .subspa $CODE$
+one
+ .align 8
+ .stringz "?\xF0\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00"
+
+main
+ .proc
+ .callinfo NO_CALLS,FRAME=0
+ .entry
+
+ ;; Test we have right register numbers
+ ;;
+ ADD %r0,%r0,%r1 ; 0
+ LDI 1,%r1 ; 1
+ ;;
+ ;; Don't put anything into r2 or r3--they are special registers.
+ ;;
+ ADD %r1,%r1,%r4 ; 2
+ ADD %r4,%r4,%r5 ; 4
+ ADD %r5,%r5,%r6 ; 8
+ ADD %r6,%r6,%r7 ; 16
+ ADD %r7,%r7,%r8 ; 32
+ ADD %r8,%r8,%r9 ; 64
+ ADD %r9,%r9,%r10 ; 128
+ ADD %r10,%r10,%r11 ; 256
+ ADD %r11,%r11,%r12 ; 512
+ ADD %r12,%r12,%r13 ; 1024
+ ADD %r13,%r13,%r14 ; 2048
+ ADD %r14,%r14,%r15 ; 4096
+ ADD %r15,%r15,%r16 ; 9192
+
+ ;; Test high bits, to be sure we show them.
+ ;;
+ LDI 0xde,%r19 ; "de"
+ DEPD,Z %r19,55,56,%r19 ; "de00"
+ LDI 0xad,%r18 ; "ad"
+ ADD %r18,%r19,%r19 ; "dead"
+ DEPD,Z %r19,55,56,%r19 ; "dead00"
+ LDI 0xbe,%r18 ; "be"
+ ADD %r18,%r19,%r19 ; "deadbe"
+ DEPD,Z %r19,55,56,%r19 ; "deadbe00"
+ LDI 0xef,%r18 ; "ef"
+ ADD %r18,%r19,%r19 ; "deadbeef"
+ ;
+ DEPD,Z %r19,55,56,%r19 ; "deadbeef00"
+ LDI 0xba,%r18 ; "ba"
+ ADD %r18,%r19,%r19 ; "deadbeefba"
+ DEPD,Z %r19,55,56,%r19 ; "deadbeefba00"
+ LDI 0xdc,%r18 ; "dc"
+ ADD %r18,%r19,%r19 ; "deadbeefbadc"
+ DEPD,Z %r19,55,56,%r19 ; "deadbeefbadc00"
+ LDI 0xad,%r18 ; "ad"
+ ADD %r18,%r19,%r19 ; "deadbeefbadcad"
+ DEPD,Z %r19,55,56,%r19 ; "deadbeefbadcad00"
+ LDI 0xee,%r18 ; "ee"
+ ADD %r18,%r19,%r19 ; "deadbeefbadcadee"
+
+lab1 ;; Test floating point registers
+ ;;
+ ;; LDIL LR'one,%r22 ;
+ ;; FLDD RR'one(%r22),%fr4 ; 1.0
+ ;; FLDD RR'one+8(%r22),%fr5 ; 2.0
+ ;; FLDD RR'one+8(%r22),%fr6 ; 2.0
+ B,L here,%r2
+ NOP
+here DEPDI 0x0,63,2,%r2
+ LDO one-here(%r2),%r2
+ FLDD 0(%r2),%fr4
+ FLDD 8(%r2),%fr5
+ FLDD 8(%r2),%fr6
+
+ FMPY,DBL %fr5,%fr6,%fr7 ; 4.0
+ FMPY,DBL %fr6,%fr7,%fr8 ; 8.0
+ FMPY,DBL %fr7,%fr8,%fr9 ; 32.0
+ FMPY,DBL %fr8,%fr9,%fr10 ; 256.0
+
+ ;; The NOP prevents anything from end.o or crt0.o from
+ ;; being appended immediately after "mainend". If that
+ ;; happens, then we may have other labels that have the
+ ;; same address as "mainend", and thus the debugger
+ ;; may symbolize this PC to something other than "mainend".
+mainend
+ NOP
+ .exit
+ .procend
+
+ .space $TEXT$
+ .subspa $CODE$
+ .subspa $LIT$ ;; <don't use> ,QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=16
+ .end
+
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/reg.exp b/gdb/testsuite/gdb.hp/gdb.base-hp/reg.exp
new file mode 100644
index 00000000000..797dc854580
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/reg.exp
@@ -0,0 +1,192 @@
+# Copyright (C) 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Tests of wide register displays for GDB on HPPA 2.0 machines
+
+# use this to debug:
+#log_user 1
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { [skip_hp_tests] } then { continue }
+
+set testfile "reg"
+
+if [istarget "hppa64-hp-hpux*"] {
+ verbose "reg.exp is not for PA2.0W."
+ return 0
+}
+set srcfile ${testfile}.s
+set binfile ${objdir}/${subdir}/${testfile}
+
+# To build a pa 2.0 executable
+#
+# as -o reg reg.s
+# or
+# cc -g -o reg reg.s
+#
+# The +DA2.0N flag doesn't seem to be needed.
+#
+# Don't reject if there are warnings, as we expect this warning:
+#
+# (Warning) At least one PA 2.0 object file (pa2.0_test2.o) was detected.
+# The linked output may not run on a PA 1.x system.
+#
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# test machine--there's no 2.0n architecture, so we have
+# to try to run the app.
+#
+send_gdb "break main\n"
+ gdb_expect {
+ -re "Breakpoint.*$gdb_prompt $" {
+ pass "initial set-up"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "initial set-up"
+ }
+ timeout {
+ fail "initial set-up (timeout)"
+ }
+ }
+
+send_gdb "run\n"
+ gdb_expect {
+ -re ".*Executable file incompatible with hardware.*$gdb_prompt $" {
+ # Not hppa2.0 machine
+ #
+ return 0
+ }
+ -re "Cannot exec.*$gdb_prompt $" {
+ # Not hppa2.0 machine
+ #
+ return 0
+ }
+ -re ".*Starting program:.*$gdb_prompt $" {
+ pass "Ready to start test"
+ }
+ timeout {
+ fail "initial set-up, part 2 (timeout)"
+ return 0
+ }
+ }
+
+# Let the program set known values. This secretly deletes
+# the breakpoint at main and re-runs to mainend.
+#
+runto mainend
+
+# Look for known values
+#
+gdb_test "info reg r1" "r1 1"
+gdb_test "info reg r4" "r4 2"
+gdb_test "info reg r5" "r5 4"
+gdb_test "info reg r6" "r6 8"
+gdb_test "info reg r7" "r7 10"
+gdb_test "info reg r8" "r8 20"
+gdb_test "info reg r9" "r9 40"
+gdb_test "info reg r10" "r10 80"
+gdb_test "info reg r11" "r11 100"
+gdb_test "info reg r12" "r12 200"
+gdb_test "info reg r13" "r13 400"
+gdb_test "info reg r14" "r14 800"
+gdb_test "info reg r15" "r15 1000"
+gdb_test "info reg r16" "r16 2000"
+
+# Two odd variants that GDB supports are:
+# "1" means "r1", and
+# "$1" means "r1"
+#
+gdb_test "info reg 1 4" "r1 1.*r4 2"
+gdb_test "info reg \$1" "r1 1"
+
+# Verify that GDB responds gracefully to a register ID number that
+# is out of range.
+#
+gdb_test "info reg 999" "999: invalid register"
+
+# Make sure the floating point status and error registers
+# don't show up as floating point numbers!
+#
+gdb_test "info reg fpsr" ".*fpsr 0.*" "fpsr"
+gdb_test "info reg fpe1" ".*fpe1 0.*" "fpe1"
+gdb_test "info reg fpe2" ".*fpe2 0.*" "fpe2"
+gdb_test "info reg fpe3" ".*fpe3 0.*" "fpe3"
+gdb_test "info reg fpe4" ".*fpe4 0.*" "fpe4"
+gdb_test "info reg fpe5" ".*fpe5 0.*" "fpe5"
+gdb_test "info reg fpe6" ".*fpe6 0.*" "fpe6"
+gdb_test "info reg fpe7" ".*fpe7 0.*" "fpe7"
+
+gdb_test "info reg fr4" ".*fr4.*(double precision).* 1"
+gdb_test "info reg fr5" ".*fr5.*(double precision).* 2"
+gdb_test "info reg fr6" ".*fr6.*(double precision).* 2"
+gdb_test "info reg fr7" ".*fr7.*(double precision).* 4"
+gdb_test "info reg fr8" ".*fr8.*(double precision).* 8"
+gdb_test "info reg fr9" ".*fr9.*(double precision).* 32"
+gdb_test "info reg fr10" ".*fr10.*(double precision).* 256"
+
+gdb_test "info reg r19" "r19 deadbeefbadcadee"
+
+# Need to add test of use of $<register-name>
+#
+# Q: How do you say a literal "$" in expect?
+# A: You say "\$". A literal "\" is "\\".
+#
+# Please note that this test will fail as long as we are running
+# in 32-bit mode: it will produce "$1 = 0xbadcadee". To fix it
+# would require building a real 64-bit gdb (expression evaluation,
+# in particular).
+#
+send_gdb "p/x \$r19\n"
+ gdb_expect {
+ -re ".*= 0xdeadbeefbadcadee.*$gdb_prompt $" {
+ pass "64-bit works"
+ }
+ -re ".*= 0xbadcadee.*$gdb_prompt $" {
+ pass "32-bit extract when using PRINT; expected but not good"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "didn't print any part of right value"
+ }
+ timeout {
+ fail "timeout on print"
+ }
+ }
+
+# Need to add tests of setting wide regs too. E.g.
+#
+# set $r4 = 0x1234567890123456
+# p/x $r4
+#
+
+# done
+#
+gdb_exit
+
+return 0
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/reg.s b/gdb/testsuite/gdb.hp/gdb.base-hp/reg.s
new file mode 100644
index 00000000000..8cc15f8f6e6
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/reg.s
@@ -0,0 +1,96 @@
+; assemble as "as -o reg reg.s"
+; or
+; cc -g -o +DA2.0N
+;
+; PA-RISC 2.0 register contents test.
+;
+ .level 2.0
+
+ .code
+ .export main,ENTRY
+ .export mainend,CODE
+ .export lab1,CODE
+ .space $TEXT$
+ .subspa $CODE$
+
+main
+ .proc
+ .callinfo NO_CALLS,FRAME=0
+ .entry
+
+ ;; Test we have right register numbers
+ ;;
+ ADD %r0,%r0,%r1 ; 0
+ LDI 1,%r1 ; 1
+ ;;
+ ;; Don't put anything into r2 or r3--they are special registers.
+ ;;
+ ADD %r1,%r1,%r4 ; 2
+ ADD %r4,%r4,%r5 ; 4
+ ADD %r5,%r5,%r6 ; 8
+ ADD %r6,%r6,%r7 ; 16
+ ADD %r7,%r7,%r8 ; 32
+ ADD %r8,%r8,%r9 ; 64
+ ADD %r9,%r9,%r10 ; 128
+ ADD %r10,%r10,%r11 ; 256
+ ADD %r11,%r11,%r12 ; 512
+ ADD %r12,%r12,%r13 ; 1024
+ ADD %r13,%r13,%r14 ; 2048
+ ADD %r14,%r14,%r15 ; 4096
+ ADD %r15,%r15,%r16 ; 9192
+
+ ;; Test high bits, to be sure we show them.
+ ;;
+ LDI 0xde,%r19 ; "de"
+ DEPD,Z %r19,55,56,%r19 ; "de00"
+ LDI 0xad,%r18 ; "ad"
+ ADD %r18,%r19,%r19 ; "dead"
+ DEPD,Z %r19,55,56,%r19 ; "dead00"
+ LDI 0xbe,%r18 ; "be"
+ ADD %r18,%r19,%r19 ; "deadbe"
+ DEPD,Z %r19,55,56,%r19 ; "deadbe00"
+ LDI 0xef,%r18 ; "ef"
+ ADD %r18,%r19,%r19 ; "deadbeef"
+ ;
+ DEPD,Z %r19,55,56,%r19 ; "deadbeef00"
+ LDI 0xba,%r18 ; "ba"
+ ADD %r18,%r19,%r19 ; "deadbeefba"
+ DEPD,Z %r19,55,56,%r19 ; "deadbeefba00"
+ LDI 0xdc,%r18 ; "dc"
+ ADD %r18,%r19,%r19 ; "deadbeefbadc"
+ DEPD,Z %r19,55,56,%r19 ; "deadbeefbadc00"
+ LDI 0xad,%r18 ; "ad"
+ ADD %r18,%r19,%r19 ; "deadbeefbadcad"
+ DEPD,Z %r19,55,56,%r19 ; "deadbeefbadcad00"
+ LDI 0xee,%r18 ; "ee"
+ ADD %r18,%r19,%r19 ; "deadbeefbadcadee"
+
+lab1 ;; Test floating point registers
+ ;;
+ LDIL LR'one,%r22 ;
+ FLDD RR'one(%r22),%fr4 ; 1.0
+ FLDD RR'one+8(%r22),%fr5 ; 2.0
+ FLDD RR'one+8(%r22),%fr6 ; 2.0
+ FMPY,DBL %fr5,%fr6,%fr7 ; 4.0
+ FMPY,DBL %fr6,%fr7,%fr8 ; 8.0
+ FMPY,DBL %fr7,%fr8,%fr9 ; 32.0
+ FMPY,DBL %fr8,%fr9,%fr10 ; 256.0
+
+ ;; The NOP prevents anything from end.o or crt0.o from
+ ;; being appended immediately after "mainend". If that
+ ;; happens, then we may have other labels that have the
+ ;; same address as "mainend", and thus the debugger
+ ;; may symbolize this PC to something other than "mainend".
+mainend
+ NOP
+ .exit
+ .procend
+
+ .space $TEXT$
+ .subspa $CODE$
+ .subspa $LIT$ ;; <don't use> ,QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=16
+one
+ .align 8
+ .stringz "?\xF0\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00"
+ .end
+
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/sized-enum.c b/gdb/testsuite/gdb.hp/gdb.base-hp/sized-enum.c
new file mode 100644
index 00000000000..a6d57881f48
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/sized-enum.c
@@ -0,0 +1,43 @@
+
+enum Normal {
+ red,
+ blue,
+ green
+};
+
+short enum Small {
+ pink,
+ cyan,
+ grey
+};
+
+char enum Tiny {
+ orange,
+ yellow,
+ brown
+};
+
+
+main()
+{
+ enum Normal normal[3];
+ short enum Small small[3];
+ char enum Tiny tiny[3];
+ int i;
+
+ for (i=0; i < 3; i++)
+ {
+ normal[i] = (enum Normal) i;
+ small[i] = (short enum Small) i;
+ tiny[i] = (char enum Tiny) i;
+ }
+ normal[0] = 0; /* place to hang a breakpoint */
+}
+
+
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/sized-enum.exp b/gdb/testsuite/gdb.hp/gdb.base-hp/sized-enum.exp
new file mode 100644
index 00000000000..0b5b6871eff
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/sized-enum.exp
@@ -0,0 +1,165 @@
+# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# GDB tests for sized enumerations
+
+# This is aimed at HP-UX systems. The HP C compiler
+# allows specifying "char" or "short" for an enum, to
+# indicate that it is 1 or 2 bytes long.
+
+# This file was written by Satish Pai <pai@apollo.hp.com>
+# 1997-09-24
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+if { [skip_hp_tests] } then { continue }
+
+set testfile "sized-enum"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+if { $gcc_compiled } then { continue }
+if {$hp_aCC_compiler} {continue}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+#
+# set it up at a breakpoint so we can play with the variable values
+#
+
+if ![runto_main] then {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# set a breakpoint and go there
+send_gdb "break 34\n"
+gdb_expect {
+ -re "Breakpoint.*line 34.*$gdb_prompt $" { pass "set break 34" }
+ -re "$gdb_prompt $" { fail "set break 34" }
+ timeout { fail "(timeout) set break 34" }
+}
+send_gdb "continue\n"
+gdb_expect {
+ -re "Continuing\\.\r\n\r\nBreakpoint \[0-9\]*, main....at.*sized-enum\\.c:34\r\n34.*\r\n$gdb_prompt $" { pass "continue" }
+ -re "$gdb_prompt $" { fail "continue" }
+ timeout { fail "(timeout) continue" }
+}
+
+# print stuff
+send_gdb "print normal\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{red, blue, green\\}.*$gdb_prompt $" { pass "print normal" }
+ -re "$gdb_prompt $" { fail "print normal" }
+ timeout { fail "(timeout) print normal" }
+}
+send_gdb "print small\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{pink, cyan, grey\\}.*$gdb_prompt $" { pass "print small" }
+ -re "$gdb_prompt $" { fail "print small" }
+ timeout { fail "(timeout) print small" }
+}
+send_gdb "print tiny\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = \\{orange, yellow, brown\\}.*$gdb_prompt $" { pass "print tiny" }
+ -re "$gdb_prompt $" { fail "print tiny" }
+ timeout { fail "(timeout) print tiny" }
+}
+
+# print type sizes
+send_gdb "print sizeof (Normal)\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 4.*$gdb_prompt $" { pass "print sizeof (Normal)" }
+ -re "$gdb_prompt $" { fail "print sizeof (Normal)" }
+ timeout { fail "(timeout) print sizeof (Normal)" }
+}
+send_gdb "print sizeof (Small)\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 2.*$gdb_prompt $" { pass "print sizeof (Small)" }
+ -re "$gdb_prompt $" { fail "print sizeof (Small)" }
+ timeout { fail "(timeout) print sizeof (Small)" }
+}
+send_gdb "print sizeof (Tiny)\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 1.*$gdb_prompt $" { pass "print sizeof (Tiny)" }
+ -re "$gdb_prompt $" { fail "print sizeof (Tiny)" }
+ timeout { fail "(timeout) print sizeof (Tiny)" }
+}
+
+# print types
+send_gdb "ptype normal\n"
+gdb_expect {
+ -re "type = enum Normal \\{red, blue, green\\} \\\[3\\\].*$gdb_prompt $" { pass "ptype normal" }
+ -re "$gdb_prompt $" { fail "ptype normal" }
+ timeout { fail "(timeout) ptype normal" }
+}
+send_gdb "ptype small\n"
+gdb_expect {
+ -re "type = short enum Small \\{pink, cyan, grey\\} \\\[3\\\].*$gdb_prompt $" { pass "ptype small" }
+ -re "$gdb_prompt $" { fail "ptype small" }
+ timeout { fail "(timeout) ptype small" }
+}
+send_gdb "ptype tiny\n"
+gdb_expect {
+ -re "type = char enum Tiny \\{orange, yellow, brown\\} \\\[3\\\].*$gdb_prompt $" { pass "ptype tiny" }
+ -re "$gdb_prompt $" { fail "ptype tiny" }
+ timeout { fail "(timeout) ptype tiny" }
+}
+
+# convert to int
+send_gdb "print (int) blue\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 1.*$gdb_prompt $" { pass "print (int) blue" }
+ -re "$gdb_prompt $" { fail "print (int) blue" }
+ timeout { fail "(timeout) print (int) blue" }
+}
+send_gdb "print (int) cyan\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 1.*$gdb_prompt $" { pass "print (int) cyan" }
+ -re "$gdb_prompt $" { fail "print (int) cyan" }
+ timeout { fail "(timeout) print (int) cyan" }
+}
+send_gdb "print (int) yellow\n"
+gdb_expect {
+ -re "\\$\[0-9\]* = 1.*$gdb_prompt $" { pass "print (int) yellow" }
+ -re "$gdb_prompt $" { fail "print (int) yellow" }
+ timeout { fail "(timeout) print (int) yellow" }
+}
+
+
+
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.exp b/gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.exp
new file mode 100644
index 00000000000..0a5de66d1ef
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.exp
@@ -0,0 +1,341 @@
+# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+set prms_id 0
+set bug_id 0
+
+if { [skip_hp_tests] } then { continue }
+
+set testfile "so-thresh"
+set binfile ${objdir}/${subdir}/${testfile}
+
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+# This testcase is relatively large, and therefore can take awhile to
+# load. We'd best set the timeout to something suitable, or we may
+# seem to fail...
+#
+set timeout 60
+
+# Build procedure for this testcase:
+# ${srcdir}/${subdir}/so-thresh.sh ${subdir}
+# which calls,
+# make -f ${srcdir}/${subdir}/so-thresh.mk <targets> <macros>
+# which builds,
+# genso-thresh (from genso-thresh.c)
+# which generates,
+# lib00-so-thresh.c
+# lib01-so-thresh.c
+# lib02-so-thresh.c
+# so-thresh.lopt (link options file)
+# lib0*-so-thresh.sl (from .c files above)
+# so-thresh (from so-thresh.c)
+# using lib0*-so-thresh.sl and so-thresh.lopt
+#
+# Since so-thresh.mk requires SRCDIR and OBJDIR macro definitions,
+# and SRCDIR / OBJDIR could be in relative path format, we use
+# so-thresh.sh script to pin down SRCDIR / OBJDIR (using $PWD/ prefix
+# when detected relative path values for srcdir / objdir), before the
+# 'cd $subdir' call (when this can be done in TCL here, we can call
+# make directly instead).
+#
+# remote_exec build "sh -c \\\"cd ${objdir}/${subdir}\\; make -v -f ${srcdir}/${subdir}/${testfile}.mk clean require_shlibs all SRCDIR=${srcdir}/${subdir} OBJDIR=${objdir}/${subdir}\\\""
+
+remote_exec build "${srcdir}/${subdir}/${testfile}.sh $subdir"
+
+# Only HP-UX (and any other platforms using SOM shared libraries, I
+# guess) interprets the auto-solib-limit variable as a threshhold,
+# rather than a boolean that strictly enables or disables automatic
+# loading of shlib symbol tables.
+#
+# On HP-UX, it is the size threshhold (in megabytes) at which to
+# stop auto loading of symbol tables.
+#
+if ![istarget "hppa*-hp-hpux*"] then {
+ setup_xfail "*-*-*"
+}
+
+# Start with a fresh gdb
+#
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# This is a test of gdb's ability on HP-UX to stop automatically
+# loading symbols of shared libraries, when the total size of the
+# debugger's symbol table reaches a specified threshhold.
+#
+
+# On HP-UX, the help text for auto-solib-limit mentions that it
+# serves as a threshhold.
+#
+send_gdb "help set auto-solib-limit\n"
+gdb_expect {
+ -re "Set threshold .in Mb. for autoloading shared library symbols.*
+When shared library autoloading is enabled, new libraries will be loaded.*
+only until the total size of shared library symbols exceeds this.*
+threshold in megabytes. Is ignored when using .sharedlibrary.*$gdb_prompt $"\
+ {pass "help set auto-solib-limit"}
+ -re "$gdb_prompt $"\
+ {fail "help set auto-solib-limit"}
+ timeout {fail "(timeout) help set auto-solib-limit"}
+}
+
+# On HP-UX, the threshhold is by default set to 50, which means
+# 50 megabytes.
+#
+send_gdb "show auto-solib-limit\n"
+gdb_expect {
+ -re "Threshold .in Mb. for autoloading shared library symbols is $decimal.*$gdb_prompt $"\
+ {pass "show auto-solib-limit "}
+ -re "$gdb_prompt $"\
+ {fail "show auto-solib-limit "}
+ timeout {fail "(timeout) show auto-solib-limit "}
+}
+
+send_gdb "set auto-solib-limit 1\n"
+gdb_expect {
+ -re ".*$gdb_prompt $"
+ {pass "set auto-solib-limit to 1"}
+ -re ".*$gdb_prompt $"
+ {fail "set auto-solib-limit to 1"}
+ timeout {fail "(timeout) set auto-solib-limit to 1"}
+}
+
+
+# We have manually verified that our testcase exceeds 1 Mbytes
+# of heap space in GDB to hold the symbols for the main program
+# and all associated linked-against libraries. Thus, when we
+# run to the program's main, and therefore notice all the linked-
+# against shlibs, we expect to hit the threshhold.
+#
+# (Note that we're not using the expect [runto main] function here,
+# 'cause we want to match on output from the run command.
+#
+send_gdb "break main\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]* at.*$gdb_prompt $"\
+ {pass "1 set break at main"}
+ -re "$gdb_prompt $"\
+ {fail "1 set break at main"}
+ timeout {fail "(timeout) 1 set break at main"}
+}
+
+send_gdb "run\n"
+gdb_expect {
+ -re ".*warning. Symbols for some libraries have not been loaded, because.*
+doing so would exceed the size threshold specified by auto-solib-limit.*
+To manually load symbols, use the 'sharedlibrary' command.*
+To raise the threshold, set auto-solib-limit to a larger value and rerun.*
+the program.*$gdb_prompt $"\
+ {pass "run to main hit auto-solib-limit threshold"}
+ -re "$gdb_prompt $"\
+ {fail "run to main hit auto-solib-limit threshold"}
+ timeout {fail "(timeout) run to main hit auto-solib-limit threshold"}
+}
+
+# Verify that "info share" mentions something about libraries whose
+# symbols weren't loaded.
+#
+# We'll assume that at least the last two shlib's symbols weren't
+# loaded. As a side-effect of matching this pattern, the text start
+# address of the last one is captured in expect_out(1,string).
+# (we'll need it for the 'add-symbol-file' command in a nonce...)
+#
+send_gdb "info sharedlibrary\n"
+gdb_expect {
+ -re ".*lib01_$testfile.sl .*symbols not loaded.*0x\[0-9\]* (0x\[0-9a-fA-F\]*).*$gdb_prompt $"\
+ { send_gdb "add-symbol-file lib02_$testfile.sl $expect_out(1,string)\n"
+ gdb_expect {
+ -re "add symbol table.*y or n.*$"\
+ {send_gdb "y\n"
+ gdb_expect {
+ -re "$gdb_prompt $" {pass "add-symbol-file and info sharedlib"}
+ timeout {fail "(timeout) add-symbol-file and info sharedlib"}
+ }}
+ -re "$gdb_prompt $"\
+ {fail "add-symbol-file and info sharedlib"}
+ timeout {fail "(timeout) add-symbol-file and info sharedlib"}
+ }
+ }
+ -re "$gdb_prompt $" {
+ setup_xfail hppa*-*-* CHFts24108
+ fail "info sharedlibrary shows shlibs with unloaded symbols"
+ }
+ timeout {fail "(timeout) info sharedlibrary shows shlibs with unloaded symbols"}
+}
+
+# Verify that we can manually load the symbol table of a library
+# whose symbols weren't loaded. (We'll pick the last one.)
+#
+
+# I moved this test inside the one above, because the expect_out array is not ok if the
+# previous test has failed, and expect would error out (elz)
+#
+#send_gdb "add-symbol-file lib02_$testfile.sl $expect_out(1,string)\n"
+#gdb_expect {
+# -re "add symbol table.*y or n.*$"\
+# {send_gdb "y\n"
+# gdb_expect {
+# -re "$gdb_prompt $" {pass "add-symbol-file"}
+# timeout {fail "(timeout) add-symbol-file"}
+# }}
+# -re "$gdb_prompt $"\
+# {fail "add-symbol-file"}
+# timeout {fail "(timeout) add-symbol-file"}
+#}
+
+# Verify that we can manually load the symbols for all libraries
+# which weren't already loaded.
+#
+# Warning! On a machine with little free swap space, this may
+# fail!
+#
+send_gdb "sharedlibrary\n"
+gdb_expect {
+ -re "Reading symbols from.*done.*$gdb_prompt $"\
+ {pass "sharedlibrary"}
+ -re "$gdb_prompt $" {
+ setup_xfail hppa*-*-* CHFts24108
+ fail "sharedlibrary"
+ }
+ timeout {fail "(timeout) sharedlibrary"}
+}
+
+# Rerun the program, this time verifying that we can set the
+# threshhold high enough to avoid hitting it.
+#
+# It appears that gdb isn't freeing memory when rerunning, as one
+# would expect. To avoid potentially hitting a virtual memory
+# ceiling, start with a fresh gdb.
+#
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+send_gdb "break main\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]* at.*$gdb_prompt $"\
+ {pass "2 set break at main"}
+ -re "$gdb_prompt $"\
+ {fail "2 set break at main"}
+ timeout {fail "(timeout) 2 set break at main"}
+}
+
+send_gdb "set auto-solib-limit 9999\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "set auto-solib-limit threshold to practical infinity"}
+ timeout {fail "(timeout) set auto-solib-limit threshold to practical infinity"}
+}
+send_gdb "run\n"
+gdb_expect {
+ -re ".*warning. Symbols for some libraries have not been loaded, because.*
+doing so would exceed the size threshold specified by auto-solib-limit.*
+To manually load symbols, use the 'sharedlibrary' command.*
+To raise the threshold, set auto-solib-limit to a larger value and rerun.*
+the program.*$gdb_prompt $"\
+ {fail "rerun threshold at practical infinity (still hit threshold)"}
+ -re "$gdb_prompt $"\
+ {pass "rerun with threshold at practical infinity"}
+ timeout {fail "(timeout) rerun with threshold at practical infinity"}
+}
+
+# Rerun the program, this time altogether disabling the auto loading
+# feature. There should be no information at all about shared
+# libraries now.
+#
+# ??rehrauer: Personally, I'd call that a bug, since it doesn't give
+# you the ability to manually load single shlibs (you need the text
+# start address that 'info share' normall gives you). On the other
+# hand, one can easily choose to load them all...
+#
+# It appears that gdb isn't freeing memory when rerunning, as one
+# would expect. To avoid potentially hitting a virtual memory
+# ceiling, start with a fresh gdb.
+#
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+send_gdb "break main\n"
+gdb_expect {
+ -re "Breakpoint \[0-9\]* at.*$gdb_prompt $"\
+ {pass "3 set break at main"}
+ -re "$gdb_prompt $"\
+ {fail "3 set break at main"}
+ timeout {fail "(timeout) 3 set break at main"}
+}
+
+send_gdb "set auto-solib-limit 0\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "set auto-solib-limit threshold to 0"}
+ timeout {fail "(timeout) set auto-solib-limit threshold to 0"}
+}
+send_gdb "run\n"
+gdb_expect {
+ -re ".*warning. Symbols for some libraries have not been loaded, because.*
+doing so would exceed the size threshold specified by auto-solib-limit.*
+To manually load symbols, use the 'sharedlibrary' command.*
+To raise the threshold, set auto-solib-limit to a larger value and rerun.*
+the program.*$gdb_prompt $"\
+ {fail "rerun threshold at 0 (still hit threshold)"}
+ -re "$gdb_prompt $"\
+ {pass "rerun with threshold at 0"}
+ timeout {fail "(timeout) rerun with threshold at 0"}
+}
+
+# Verify that we can still manually load symbols for all libraries.
+# (We'll assume that if the last shlib's symbols are loaded, that
+# all of them were.)
+#
+# Note that we set the GDB "height" variable to prevent GDB from
+# prompting
+#
+# Warning! On a machine with little free swap space, this may
+# fail!
+#
+send_gdb "set height 9999\n"
+gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "set screen page height to practical infinity"}
+ timeout {fail "(timeout) set screen page height to practical infinity"}
+}
+send_gdb "sharedlibrary\n"
+gdb_expect {
+ -re ".*Reading symbols from .*/lib02-so-thresh\\.sl\\.\\.\\.done\\..*$gdb_prompt $"\
+ {pass "manually load all symbols"}
+ -re "$gdb_prompt $" {
+ setup_xfail hppa*-*-* CHFts24108
+ fail "manually load all symbols (CHFts24108)"
+ }
+ timeout {fail "(timeout) manually load all symbols"}
+}
+
+return 0
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.mk b/gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.mk
new file mode 100644
index 00000000000..f71e9210c7f
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.mk
@@ -0,0 +1,74 @@
+# Make file for so-thresh test
+
+OBJDIR=.
+SRCDIR=.
+CFLAGS = +DA1.1 -g
+CC=cc
+
+# This is how to build this generator.
+genso-thresh.o: ${SRCDIR}/genso-thresh.c
+ $(CC) $(CFLAGS) -o genso-thresh.o -c ${SRCDIR}/genso-thresh.c
+genso-thresh: genso-thresh.o
+ $(CC) $(CFLAGS) -o genso-thresh genso-thresh.o
+
+# This is how to run this generator.
+# This target should be made before the 'all' target,
+# to ensure that the shlib sources are all available.
+require_shlibs: genso-thresh
+ if ! [ -a lib00-so-thresh.c ] ; then \
+ genso-thresh ; \
+ fi
+ if ! [ -a lib01-so-thresh.c ] ; then \
+ genso-thresh ; \
+ fi
+ if ! [ -a lib02-so-thresh.c ] ; then \
+ genso-thresh ; \
+ fi
+
+# This is how to build all the shlibs.
+# Be sure to first make the require_shlibs target!
+lib00-so-thresh.o: lib00-so-thresh.c
+ $(CC) $(CFLAGS) +Z -o lib00-so-thresh.o -c lib00-so-thresh.c
+lib00-so-thresh.sl: lib00-so-thresh.o
+ $(LD) $(LDFLAGS) -b -o lib00-so-thresh.sl lib00-so-thresh.o
+lib01-so-thresh.o: lib01-so-thresh.c
+ $(CC) $(CFLAGS) +Z -o lib01-so-thresh.o -c lib01-so-thresh.c
+lib01-so-thresh.sl: lib01-so-thresh.o
+ $(LD) $(LDFLAGS) -b -o lib01-so-thresh.sl lib01-so-thresh.o
+lib02-so-thresh.o: lib02-so-thresh.c
+ $(CC) $(CFLAGS) +Z -o lib02-so-thresh.o -c lib02-so-thresh.c
+lib02-so-thresh.sl: lib02-so-thresh.o
+ $(LD) $(LDFLAGS) -b -o lib02-so-thresh.sl lib02-so-thresh.o
+
+
+
+
+# For convenience, here's names for all pieces of all shlibs.
+SHLIB_SOURCES = \
+ lib00-so-thresh.c \
+ lib01-so-thresh.c \
+ lib02-so-thresh.c
+
+SHLIB_OBJECTS = $(SHLIB_SOURCES:.c=.o)
+SHLIBS = $(SHLIB_SOURCES:.c=.sl)
+SHLIB_NAMES = $(SHLIB_SOURCES:.c=)
+EXECUTABLES = $(SHLIBS) genso-thresh so-thresh
+OBJECT_FILES = $(SHLIB_OBJECTS) genso-thresh.o so-thresh.o
+
+shlib_objects: $(SHLIB_OBJECTS)
+shlibs: $(SHLIBS)
+
+# This is how to build the debuggable testcase that uses the shlibs.
+so-thresh.o: so-thresh.c
+ $(CC) $(CFLAGS) -o so-thresh.o -c so-thresh.c
+so-thresh: shlibs so-thresh.o
+ $(LD) $(LDFLAGS) -o so-thresh -lc -L${OBJDIR} -c so-thresh.lopt /opt/langtools/lib/end.o /lib/crt0.o so-thresh.o
+
+# Yeah, but you should first make the require_shlibs target!
+all: so-thresh genso-thresh
+
+# To remove everything built via this makefile...
+clean:
+ rm -f lib0*-so-thresh.*
+ rm -f *.o genso-thresh so-thresh.lopt so-thresh.c
+ rm -f so-thresh
diff --git a/gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.sh b/gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.sh
new file mode 100755
index 00000000000..6b6d6ecc3cd
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.base-hp/so-thresh.sh
@@ -0,0 +1,34 @@
+#!/bin/ksh
+
+# so-thresh.sh
+#
+# This script is a "wrapper" to use the so-thresh.mk
+# Makefile. See the comments in so-thresh.exp
+# regarding why this script exists.
+
+#set -o xtrace
+#set -o verbose
+
+if [ "$srcdir" = "${srcdir#/}" ]
+then
+ srcdir="$PWD/$srcdir"
+fi
+
+if [ "$objdir" = "${objdir#/}" ]
+then
+ objdir="$PWD/$objdir"
+fi
+
+subdir="$1"
+
+HERE=$PWD
+cd $subdir
+
+MAKEFLAGS=
+make -f ${srcdir}/${subdir}/so-thresh.mk clean require_shlibs all SRCDIR=${srcdir}/${subdir} OBJDIR=${objdir}/${subdir} > ${objdir}/${subdir}/so-thresh.make.out 2>&1
+STATUS=$?
+
+cd $HERE
+echo "return STATUS is $STATUS"
+
+exit $STATUS
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/Makefile.in b/gdb/testsuite/gdb.hp/gdb.compat/Makefile.in
new file mode 100644
index 00000000000..ada0f1a23ef
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.compat/Makefile.in
@@ -0,0 +1,27 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = xdb xdb-test
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ *.o *.ci
+ -rm -f core $(EXECUTABLES)
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+ -rm -f *-init.exp
+ -rm -fr *.log summary detail *.plog *.sum *.psum site.*
+
+Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/average.c b/gdb/testsuite/gdb.hp/gdb.compat/average.c
new file mode 100644
index 00000000000..25ba2ee6a6c
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.compat/average.c
@@ -0,0 +1,46 @@
+/* This is a sample program for the HP WDB debugger. */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef PROTOTYPES
+extern int sum(int *, int, int);
+#else
+extern int sum();
+#endif
+
+#define num 10
+
+static int my_list[num] = {3,4,2,0,2,1,8,3,6,7};
+
+#ifdef __STDC__
+void print_average(int *list, int low, int high)
+#else
+void print_average(list, low, high)
+int *list, low, high;
+#endif
+ {
+ int total = 0, num_elements = 0, average = 0;
+ total = sum(list, low, high);
+ num_elements = high - low; /* note this is an off-by-one bug */
+
+ average = total / num_elements;
+ printf("%10.d\n", average);
+ }
+
+#ifdef __STDC__
+int main(void)
+#else
+main ()
+#endif
+{
+ char c;
+ int first = 0, last = 0;
+ last = num-1;
+
+ /* Try two test cases. */
+ print_average (my_list, first, last);
+ print_average (my_list, first, last - 3);
+
+ exit(0);
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/configure b/gdb/testsuite/gdb.hp/gdb.compat/configure
new file mode 100755
index 00000000000..2bccc23b215
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.compat/configure
@@ -0,0 +1,899 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=xdb1.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../../.. $srcdir/`cd $srcdir;pwd`/../../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../../.. $srcdir/`cd $srcdir;pwd`/../../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:573: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:594: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:612: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/configure.in b/gdb/testsuite/gdb.hp/gdb.compat/configure.in
new file mode 100644
index 00000000000..71ab87dd2c9
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.compat/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(xdb1.exp)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/sum.c b/gdb/testsuite/gdb.hp/gdb.compat/sum.c
new file mode 100644
index 00000000000..d295f7e2793
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.compat/sum.c
@@ -0,0 +1,15 @@
+/* This is a sample program for the HP/DDE debugger. */
+#include <stdio.h>
+
+#ifdef __STDC__
+int sum(int *list, int low, int high)
+#else
+int sum(list, low, high)
+int *list, low, high;
+#endif
+ {
+ int i = 0, s = 0;
+ for (i = low; i <= high; i++)
+ s += list[i];
+ return(s);
+ }
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/xdb.c b/gdb/testsuite/gdb.hp/gdb.compat/xdb.c
new file mode 100644
index 00000000000..e3e3fc23e9f
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.compat/xdb.c
@@ -0,0 +1,20 @@
+#include <stdio.h>
+
+int callee( x )
+int x;
+{
+ int y = x * x;
+ return (y - 2);
+}
+
+main()
+{
+ int i;
+ for (i = 1; i < 10; i++)
+ {
+ printf( "%d ", callee( i ));
+
+ }
+ printf( " Goodbye!\n" );
+
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/xdb0.c b/gdb/testsuite/gdb.hp/gdb.compat/xdb0.c
new file mode 100644
index 00000000000..fa5c76f7418
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.compat/xdb0.c
@@ -0,0 +1,42 @@
+#include "xdb0.h"
+
+main ()
+{
+ int x;
+#ifdef usestubs
+ set_debug_traps();
+ breakpoint();
+#endif
+ x = 0;
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+ foo (x++);
+}
+
+static void
+unused ()
+{
+ /* Not used for anything */
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/xdb0.h b/gdb/testsuite/gdb.hp/gdb.compat/xdb0.h
new file mode 100644
index 00000000000..c4d337c6770
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.compat/xdb0.h
@@ -0,0 +1,36 @@
+/* An include file that actually causes code to be generated in the
+ including file. This is known to cause problems on some systems. */
+
+static void
+foo (x)
+int x;
+{
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+ bar (x++);
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/xdb1.c b/gdb/testsuite/gdb.hp/gdb.compat/xdb1.c
new file mode 100644
index 00000000000..51632b94d07
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.compat/xdb1.c
@@ -0,0 +1,33 @@
+void
+bar (x)
+int x;
+{
+ printf ("%d\n", x);
+
+ long_line ();
+}
+
+static void
+unused ()
+{
+ /* Not used for anything */
+}
+
+
+/* This routine has a very long line that will break searching in older
+ versions of GDB. */
+
+long_line ()
+{
+ oof (67);
+
+ oof (6789);
+
+ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 5 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 10 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 15 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 20 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 25 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 30 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 35 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 40 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 45 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 50 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 55 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 60 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* 65 */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (12); /* */ oof (12); oof (12); oof (12); oof (12); oof (12); oof (1234); /* 70 */
+}
+
+oof (n)
+ int n;
+{
+ return n + 1;
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp b/gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp
new file mode 100644
index 00000000000..f371852c78d
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.compat/xdb1.exp
@@ -0,0 +1,78 @@
+# Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { [skip_hp_tests] } then { continue }
+
+global usestubs
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "xdb"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+if { $gcc_compiled } then { continue }
+
+global GDBFLAGS
+set saved_gdbflags $GDBFLAGS
+
+set GDBFLAGS "$GDBFLAGS --xdb"
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "set pagination off" ""
+gdb_test "show pagination" "State of pagination is off."
+gdb_test "set pagination on" ""
+gdb_test "show pagination" "State of pagination is on."
+
+gdb_test "txbreak callee" "Breakpoint.*at.*"
+gdb_test "info break" "Num.*Type.*Disp.*Enb.*Address.*What\r\n.*breakpoint.*del.*y.*"
+
+gdb_test "xbreak callee" "Breakpoint.*at.*.*"
+gdb_test "info break" "Num.*Type.*Disp.*Enb.*Address.*What\r\n.*breakpoint.*keep.*y.*"
+
+gdb_exit
+set GDBFLAGS $saved_gdbflags
+return 0
+
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/xdb2.exp b/gdb/testsuite/gdb.hp/gdb.compat/xdb2.exp
new file mode 100644
index 00000000000..9bcdf589df8
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.compat/xdb2.exp
@@ -0,0 +1,105 @@
+# Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+ }
+
+if { [skip_hp_tests] } then { continue }
+
+global message
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+set testfile "xdb"
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/xdb0.c" "${binfile}0.o" object {debug}] != "" } {
+ perror "Couldn't compile ${testfile}0.c to object"
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/xdb1.c" "${binfile}1.o" object {debug}] != "" } {
+ perror "Couldn't compile ${testfile}1.c to object"
+ return -1
+}
+
+if { [gdb_compile "${binfile}0.o ${binfile}1.o" ${binfile} executable {debug}] != "" } {
+ perror "Couldn't link ${testfile}."
+ return -1
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+if { $gcc_compiled } then { continue }
+
+global GDBFLAGS
+set saved_gdbflags $GDBFLAGS
+set GDBFLAGS "$GDBFLAGS --xdb"
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+gdb_test "break main" ""
+gdb_test "run" ""
+gdb_test "go +2" "Breakpoint.*at.*file.*xdb0\.c, line 12\.\r\nContinuing at.*\r\nmain \\(\\) at.*xdb0\.c:12\r\n12\[ \t\]+foo \\(x\\+\\+\\);"
+gdb_test "go -2" "Note: breakpoint.*also set at pc.*\.\r\nBreakpoint.*at.*file.*xdb0\.c, line 10\.\r\nContinuing at.*\.\r\n\r\nBreakpoint.*, main \\(\\) at.*xdb0\.c:10.*"
+gdb_test "go 16" "Breakpoint.*at.*file.*xdb0\.c, line 16\.\r\nContinuing at.*\.\r\nmain \\(\\) at.*xdb0\.c:16\r\n16\[ \t\]+foo \\(x\\+\\+\\);"
+
+send_gdb "go bar\n"
+ gdb_expect {
+ -re ".*Line 5 is not in .main.. Jump anyway.*y or n. $" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "$gdb_prompt $"\
+ {pass "go bar"}
+ timeout {fail "(timeout) go bar"}
+ }
+ }
+ -re "Continuing at.*\.\r\nbar \\(x=0\\) at.*xdb1\.c:5" {}
+ timeout { perror "(timeout) go bar" ; return }
+ }
+
+# Verify that GDB responds gracefully to a "go" command without
+# an argument.
+#
+gdb_test "go" "Usage: go <location>"
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "break bar" ""
+gdb_test "run" ""
+gdb_test "backtrace full" ".*bar \\(x=0\\) at.*xdb1\.c:5\r\nNo locals\.\r\n.1.* in foo \\(x=1\\) at.*xdb0\.h:8\r\nNo locals\.\r\n.2.* in main \\(\\) at.*xdb0\.c:11\r\n.*x = 1"
+gdb_test "bt 1 full" ".*bar \\(x=0\\) at.*xdb1\.c:5\r\nNo locals\.\r\n\\(More stack frames follow\.\.\.\\)"
+gdb_test "bt full 2" ".*bar \\(x=0\\) at.*xdb1\.c:5\r\nNo locals\.\r\n.1.* in foo \\(x=1\\) at.*xdb0\.h:8\r\nNo locals\.\r\n\\(More stack frames follow\.\.\.\\)"
+
+set GDBFLAGS $saved_gdbflags
+return 0
diff --git a/gdb/testsuite/gdb.hp/gdb.compat/xdb3.exp b/gdb/testsuite/gdb.hp/gdb.compat/xdb3.exp
new file mode 100644
index 00000000000..de983d3e9c9
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.compat/xdb3.exp
@@ -0,0 +1,321 @@
+# Copyright (C) 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+if { [skip_hp_tests] } then { continue }
+
+set testfile1 "average"
+set testfile2 "sum"
+set testfile "xdb-test"
+set binfile1 ${objdir}/${subdir}/${testfile1}
+set binfile2 ${objdir}/${subdir}/${testfile2}
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/average.c" "${binfile1}.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/sum.c" "${binfile2}.o" object {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if { [gdb_compile "${binfile1}.o ${binfile2}.o" ${binfile} executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+if { $gcc_compiled } then { continue }
+
+
+proc xdb_reinitialize_dir { subdir } {
+ global gdb_prompt
+
+ send_gdb "D\n"
+ gdb_expect {
+ -re "Reinitialize source path to empty.*y or n. " {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "Source directories searched.*$gdb_prompt $" {
+ send_gdb "D $subdir\n"
+ gdb_expect {
+ -re "Source directories searched.*$gdb_prompt $" {
+ verbose "Dir set to $subdir"
+ }
+ -re ".*$gdb_prompt $" {
+ perror "Dir \"$subdir\" failed."
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ perror "Dir \"$subdir\" failed."
+ }
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ perror "Dir \"$subdir\" failed."
+ }
+ }
+}
+
+#
+#test_search
+#
+proc test_search { } {
+ gdb_test "set listsize 4" ""
+ gdb_test "list average.c:1" "1\[ \t\]+/. This is a sample .*"
+ gdb_test "/ print_average" "17\[ \t\]+void print_average\\(int \\*list.*"
+ gdb_test "/ print_average" "19\[ \t\]+void print_average\\(list, low, high\\)"
+ gdb_test "/ print_average" "42\[ \t\]+print_average \\(my_list, first, last\\);"
+ gdb_test "? print_average" "19\[ \t\]+void print_average\\(list, low, high\\)"
+ gdb_test "? sum" "9\[ \t]+extern int sum\\(\\);"
+}
+
+#
+#test_viewing_loc
+#
+proc test_viewing_loc { } {
+ gdb_test "L" "No stack."
+ gdb_test "break main" ""
+ gdb_test "R" ""
+ gdb_test "L" "#0\[ \t\]+main \\(\\) at.*average.c:38\r\n38\[ \t\]+int first = 0, last = 0;"
+}
+
+#
+#test_dir_list
+#
+proc test_dir_list { } {
+ gdb_test "ld" "Source directories searched: .*"
+}
+
+#
+#test_list_sources
+#
+proc test_list_sources { } {
+ if [istarget "hppa64-*-*"] {
+ gdb_test "lf" "Source files for which symbols have been read in:\r\n\r\n.*average\\.c.*Source files for which symbols will be read in on demand:\r\n\r\nglobals,.*\[se\]\[un\]\[md\]\\.c.*\[se\]\[un\]\[md\]\\.c"
+ } else {
+ gdb_test "lf" "Source files for which symbols have been read in:\r\n\r\n.*average\\.c.*\r\n\r\nSource files for which symbols will be read in on demand:\r\n\r\nglobals, end\\.c,.*sum\\.c"
+ }
+}
+#
+#test_vlist
+#
+proc test_vlist { } {
+ gdb_test "v main" "34\[ \t\]+main \\(\\)\r\n35\[ \t\]+#endif\r\n36\[ \t\]+.\r\n37\[ \t\]+char c;"
+}
+
+#
+#test_va
+#
+proc test_va { } {
+ if [istarget "hppa64-*-*"] {
+ gdb_test "va main" "Dump of assembler code for function main:\r\n.*0x.* <main>:\[ \t\]+std %rp,-0x10\\(%sp\\)\r\n0x.* <main\\+4>:\[ \t\]+std,ma %r3,0xd0\\(%sp\\)\r\n.*0x.* <main\\+8>:\[ \t\]+std %r4,-0xc8\\(%sp\\)\r\n.*0x.* <main\\+12>:\[ \t\]+copy %ret1,%r3\r\n.*"
+ } else {
+ gdb_test "va main" "Dump of assembler code for function main:\r\n.*0x.* <main>:\[ \t\]+stw %rp,-0x14\\(%sr0,%sp\\)\r\n0x.* <main\\+4>:\[ \t\]+ldo 0x\[48\]0\\(%sp\\),%sp\r\n.*0x.* <main\\+8>:\[ \t\]+stw %r0,-0x.*\\(%sr0,%sp\\)\r\n.*0x.* <main\\+12>:\[ \t\]+stw %r0,-0x.*\\(%sr0,%sp\\)\r\n.*"
+ }
+}
+
+#
+#test_list_globals
+#
+proc test_list_globals { } {
+ gdb_test "lg" "All defined variables:\r\n\r\nFile globals:.*"
+# gdb_test "lg" "All defined variables:\r\n\r\nFile globals:\r\nchar __buffer.512.;\r\nint __d_eh_catch_catch;\r\nint __d_eh_catch_throw;.*"
+}
+
+#
+#test_list_registers
+#
+proc test_list_registers { } {
+ if [istarget "hppa64-*-*"] {
+ gdb_test "lr" "\[ \t\]+flags:.*r17:.*pcsqh:.*cr0:.*\r\n\[ \t\]+r1:.*r18:.*pcoqt:.*cr8:.*"
+ } else {
+ gdb_test "lr" "\[ \t\]+flags:.*r18:.*pcsqt:.*ccr:.*\r\n\[ \t\]+r1:.*r19:.*eiem:.*cr12:.*"
+ }
+ gdb_test "lr r1" "r1 .*"
+}
+
+#
+#test_backtrace
+#
+proc test_backtrace { } {
+ gdb_test "t" "#0 main \\(\\) at.*average.c:39"
+ gdb_test "T" "#0 main \\(\\) at.*average.c:39\r\n\[ \t\]+c = *.*\r\n\[ \t\]+first = 0\r\n\[ \t\]+last = 0"
+
+ gdb_test "break sum" ""
+ gdb_test "cont" ""
+ gdb_test "next"
+
+ gdb_test "t" "#0 sum \\(list=0x.*, low=0, high=9\\) at.*sum\.c:12\r\n#1 0x.* in print_average \\(list=0x.*, low=0, high=9\\) at.*average\.c:24\r\n#2 0x.* in main \\(\\) at.*average\.c:42"
+ gdb_test "t 1" "#0 sum \\(list=0x.*, low=0, high=9\\) at.*sum\.c:12\r\n\\(More stack frames follow\.\.\.\\)"
+ gdb_test "T" "#0 sum \\(list=0x.*, low=0, high=9\\) at.*sum\.c:12\r\n\[ \t\]+i = 0\r\n\[ \t\]+s = 0\r\n#1 0x.* in print_average \\(list=0x.*, low=0, high=9\\) at.*average\.c:24\r\n\[ \t\]+total = 0\r\n\[ \t\]+num_elements = 0\r\n\[ \t\]+average = 0\r\n#2 0x.* in main \\(\\) at.*average\.c:42\r\n\[ \t\]+c = *.*\r\n\[ \t\]+first = 0\r\n\[ \t\]+last = 9"
+ gdb_test "T 1" "#0 sum \\(list=0x.*, low=0, high=9\\) at.*sum\.c:12\r\n\[ \t\]+i = 0\r\n\[ \t\]+s = 0\r\n\\(More stack frames follow\.\.\.\\)"
+
+ gdb_test "V" "#0 sum \\(list=0x.*, low=0, high=9\\) at.*sum\.c:12\r\n\\12\[ \t\]+for \\(i = low;.*\\)"
+ gdb_test "V 1" "#1 0x.* in print_average \\(list=0x.*, low=0, high=9\\) at.*average\.c:24\r\n24\[ \t\]+total = sum\\(list, low, high\\);"
+}
+
+#
+# test_go
+#
+proc test_go { } {
+ gdb_test "break main" ""
+ gdb_test "R" ""
+
+ gdb_test "g +1" "Breakpoint.*at 0x.*: file.*average\.c, line 39\.\r\nContinuing at 0x.*\.\r\nmain \\(\\) at.*average\.c:39\r\n39\[ \t\]+last = num-1;"
+ gdb_test "g 42" "Breakpoint.*at 0x.*: file.*average\.c, line 42\.\r\nContinuing at 0x.*\.\r\nmain \\(\\) at.*average\.c:42\r\n42\[ \t\]+print_average \\(my_list, first, last\\);"
+
+}
+
+#
+#test_breakpoints
+#
+proc test_breakpoints { } {
+ global gdb_prompt
+
+ gdb_test "sb" ""
+ gdb_test "lb" "Num.*Type.*Disp.*Enb.*Address.*What\r\n1\[ \r\]+breakpoint\[ \r\]+keep n.*in main at.*average\.c:38.*"
+ gdb_test "ab" ""
+ gdb_test "lb" "Num.*Type.*Disp.*Enb.*Address.*What\r\n1\[ \r\]+breakpoint\[ \r\]+keep y.*in main at.*average\.c:38.*"
+ gdb_test "ba sum" "Breakpoint.*at.*: file.*sum\.c, line 11\."
+ gdb_test "cont" ""
+ gdb_test "bx" "Breakpoint.*at.*: file.*sum.c, line 15\."
+ #gdb_test "bx if (1)" "Breakpoint.*at.*: file.*sum.c, line 15\."
+ gdb_test "bx 1" "Breakpoint.*at.*: file.*average.c, line 29\."
+ gdb_test "bx 1 if (1)" "Breakpoint.*at.*: file.*average.c, line 29\."
+ gdb_test "bc 1 2" "Will ignore next 2 crossings of breakpoint 1\."
+ gdb_test "lb 1" "Num.*Type.*Disp.*Enb.*Address.*What\r\n1\[ \r\]+breakpoint\[ \r\]+keep y.*in main at.*average\.c:38\r\n.*breakpoint already hit 1 time\r\n.*ignore next 2 hits.*"
+
+ send_gdb "db\n"
+ gdb_expect {
+ -re "Delete all breakpoints.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "y\r\n$gdb_prompt $" {}
+ -re ".*$gdb_prompt $" { # This happens if there were no breakpoints
+ }
+ timeout { perror "Delete all breakpoints (timeout)" ; return }
+ }
+ send_gdb "lb\n"
+ gdb_expect {
+ -re "No breakpoints or watchpoints..*$gdb_prompt $" {}
+ -re ".*$gdb_prompt $" { perror "breakpoints not deleted" ; return }
+ timeout { perror "info breakpoints (timeout)" ; return }
+ }
+gdb_test "xbreak" "Breakpoint.*at.*file.*sum.c, line 15."
+gdb_test "xbreak print_average" "Breakpoint.*at.*file.*average.c, line 29."
+gdb_test "xbreak if (1)" "Note: breakpoint.*also set at pc.*Breakpoint.*at.*file.*sum.c, line 15."
+gdb_test "xbreak print_average if (1)" "Note: breakpoint.*also set at pc.*Breakpoint.*at.*file.*average.c, line 29."
+
+ send_gdb "lb\n"
+ gdb_expect {
+ -re "Num Type Disp Enb Address What.*breakpoint keep y.*sum.c:15.*breakpoint keep y.*average.c:29.*breakpoint keep y.*sum.c:15.*stop only if 1.*breakpoint keep y.*average.c:29.*stop only if 1.*$gdb_prompt $" {pass "lb on xbreaks"}
+ -re ".*$gdb_prompt $" { fail "breakpoints not deleted"}
+ timeout { fail "info breakpoints (timeout)" }
+ }
+
+}
+
+#
+# test_signals
+#
+proc test_signals { } {
+ gdb_test "handle SIGTERM nostop noprint" ""
+ gdb_test "z 15 s" "Signal.*Stop.*Print.*Pass to program.*Description\r\nSIGTERM.*Yes.*Yes.*Yes.*Terminated"
+ gdb_test "z 15 r" "Signal.*Stop.*Print.*Pass to program.*Description\r\nSIGTERM.*No.*No.*Yes.*Terminated"
+ gdb_test "z 15 i" "Signal.*Stop.*Print.*Pass to program.*Description\r\nSIGTERM.*No.*No.*No.*Terminated"
+ gdb_test "z 15 r" "Signal.*Stop.*Print.*Pass to program.*Description\r\nSIGTERM.*No.*Yes.*No.*Terminated"
+ gdb_test "z 15 Q" "Signal.*Stop.*Print.*Pass to program.*Description\r\nSIGTERM.*No.*No.*No.*Terminated"
+ gdb_test "lz" "Signal.*Stop.*Print.*Pass to program.*Description\r\n\r\nSIGHUP.*Yes.*"
+}
+
+
+
+# Start with a fresh gdb.
+global GDBFLAGS
+set saved_gdbflags $GDBFLAGS
+
+set GDBFLAGS "$GDBFLAGS --xdb"
+
+gdb_exit
+gdb_start
+
+xdb_reinitialize_dir $srcdir/$subdir
+
+gdb_load ${binfile}
+send_gdb "set width 0\n"
+gdb_expect -re "$gdb_prompt $"
+test_search
+test_viewing_loc
+test_dir_list
+test_list_sources
+test_vlist
+test_va
+gdb_test "next"
+gdb_test "l" "No arguments.\r\nc = *.*\r\nfirst = 0\r\nlast = 0"
+#test_list_globals
+test_list_registers
+test_backtrace
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+xdb_reinitialize_dir $srcdir/$subdir
+
+gdb_load ${binfile}
+send_gdb "set width 0\n"
+gdb_expect -re "$gdb_prompt $"
+test_go
+
+
+gdb_exit
+gdb_start
+xdb_reinitialize_dir $srcdir/$subdir
+
+gdb_load ${binfile}
+send_gdb "set width 0\n"
+gdb_expect -re "$gdb_prompt $"
+gdb_test "break main" ""
+gdb_test "R" ""
+gdb_test "S" "39\[ \t\]+last = num-1;"
+test_breakpoints
+test_signals
+gdb_test "sm" ""
+gdb_test "info set" ".*pagination: State of pagination is off.*"
+gdb_test "am" ""
+gdb_test "info set" ".*pagination: State of pagination is on.*"
+gdb_exit
+
+set GDBFLAGS $saved_gdbflags
+
+return 0
+
+
+
+
+
+
diff --git a/gdb/testsuite/gdb.hp/gdb.defects/Makefile.in b/gdb/testsuite/gdb.hp/gdb.defects/Makefile.in
new file mode 100644
index 00000000000..f0a785837c4
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.defects/Makefile.in
@@ -0,0 +1,27 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = bs14602 bs15503 solib-d solib-d1.sl solib-d2.sl
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ *.o *.ci
+ -rm -f core $(EXECUTABLES)
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+ -rm -f *-init.exp
+ -rm -fr *.log summary detail *.plog *.sum *.psum site.*
+
+Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.hp/gdb.defects/bs14602.c b/gdb/testsuite/gdb.hp/gdb.defects/bs14602.c
new file mode 100644
index 00000000000..232b40842ea
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.defects/bs14602.c
@@ -0,0 +1,9 @@
+/* Test file for bs14602.exp */
+
+double v_double = 0;
+long double v_long_double = 12345.67890;
+
+int main () {
+ v_double = 0;
+ v_long_double = 12345.67890;
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.defects/bs14602.exp b/gdb/testsuite/gdb.hp/gdb.defects/bs14602.exp
new file mode 100644
index 00000000000..d1500f01bd0
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.defects/bs14602.exp
@@ -0,0 +1,117 @@
+# This file was written by Sue Kimura. (sue_kimura@hp.com)
+#
+# Test for CLLbs14602 -- problem with recognizing long double on 10.20.
+#
+# Source file: bs14602.c
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+if { [skip_hp_tests] } { continue }
+
+#
+# test running programs
+#
+set prms_id 0
+set bug_id 0
+
+
+set testfile bs14602
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+# set up appropriate compile option to recognize long double
+if {$hp_aCC_compiler || $hp_cc_compiler} {
+ set ansi_option "-Ae"
+} else {
+ set ansi_option ""
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "$binfile" executable "debug {additional_flags=${ansi_option}}"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+
+# get to end of main so we can check out some stuff
+if ![runto main] {
+ perror "couldn't run to breakpoint main"
+ continue
+}
+
+gdb_test "txbreak" \
+ "Breakpoint $decimal at $hex: file .*bs14602.c, line 9." \
+ "set breakpoint at end of main"
+
+gdb_test "continue" \
+ "Continuing.\r\n$hex in main* \\(\\) at .*bs14602.c:9\r\n.*" \
+ "continue to end of main"
+
+# test some simple things about long double
+gdb_test "whatis v_long_double" \
+ "type = long double" \
+ "whatis v_long_double"
+
+gdb_test "ptype v_long_double" \
+ "type = long double" \
+ "ptype v_long_double"
+
+gdb_test "print sizeof \(long double\)" \
+ " = 16" \
+ "print sizeof long double"
+
+gdb_test "print sizeof \(v_long_double\)" \
+ " = 16" \
+ "print sizeof v_long_double"
+
+gdb_test "print v_long_double" \
+ " = 12345.67890000000079453457146883011" \
+ "print v_long_double - 1"
+
+gdb_test "set variable v_long_double = 98765.43210" \
+ "" \
+ "set variable v_long_double to constant value"
+
+gdb_test "print v_long_double" \
+ " = 98765.43210000000544823706150054932" \
+ "print v_long_double - 2"
+
+gdb_test "set variable v_double = v_long_double" \
+ "" \
+ " set variable v_double with v_long_double"
+
+gdb_test "print v_double" \
+ " = 98765.432100000005" \
+ " print v_double"
+
+#reset v_long_double
+gdb_test "set variable v_long_double = 0" \
+ "" \
+ "reset v_long_double to 0"
+
+gdb_test "print v_long_double" \
+ " = 0" \
+ "print v_long_double - 3"
+
+gdb_test "set variable v_long_double = v_double" \
+ "" \
+ " set variable v_long_double with v_long_double"
+
+gdb_test "print v_long_double" \
+ " = 98765.43210000000544823706150054932" \
+ "print v_long_double - 4 "
diff --git a/gdb/testsuite/gdb.hp/gdb.defects/bs15503.cc b/gdb/testsuite/gdb.hp/gdb.defects/bs15503.cc
new file mode 100644
index 00000000000..759bc0f8943
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.defects/bs15503.cc
@@ -0,0 +1,52 @@
+#include <string>
+#include <iostream.h>
+
+template <class T>
+class StringTest {
+public:
+ virtual void runTest();
+ void testFunction();
+};
+
+template <class T>
+void StringTest<T>:: runTest() {
+ testFunction ();
+}
+
+template <class T>
+void StringTest <T>::testFunction() {
+ // initialize s with string literal
+ cout << "in StringTest" << endl;
+ string s("I am a shot string");
+ cout << s << endl;
+
+ // insert 'r' to fix "shot"
+ s.insert(s.begin()+10,'r' );
+ cout << s << endl;
+
+ // concatenate another string
+ s += "and now a longer string";
+ cout << s << endl;
+
+ // find position where blank needs to be inserted
+ string::size_type spos = s.find("and");
+ s.insert(spos, " ");
+ cout << s << endl;
+
+ // erase the concatenated part
+ s.erase(spos);
+ cout << s << endl;
+}
+
+int main() {
+ StringTest<wchar_t> ts;
+ ts.runTest();
+}
+
+/* output:
+I am a shot string
+I am a short string
+I am a short stringand now a longer string
+I am a short string and now a longer string
+I am a short string
+*/
diff --git a/gdb/testsuite/gdb.hp/gdb.defects/bs15503.exp b/gdb/testsuite/gdb.hp/gdb.defects/bs15503.exp
new file mode 100644
index 00000000000..ef249516bd6
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.defects/bs15503.exp
@@ -0,0 +1,88 @@
+# Copyright (C) 1992 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Test case for CLLbs15503
+# This file was written by Sue Kimura (sue_kimura@hp.com)
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+if { [skip_hp_tests] } { continue }
+
+set testfile "bs15503"
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+# The testcode is non-conforming and rejected by GCC. So bypass this
+# test completely unless we're compiling with HP's compiler.
+if {!$hp_aCC_compiler && !$hp_cc_compiler} {
+ return 0
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable "debug c++"] != "" } {
+ perror "Couldn't compile ${srcfile}"
+ return -1
+}
+
+
+# Start with a fresh gdb.
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+# Load $binfile -- there should be no warnings about "Procedure ... spans
+# file or module boundaries", "No symbols in psymtab for file ..." or
+# "File ... has ending address after starting address of next file..."
+
+if [istarget "hppa64-hp-hpux*" ] {
+ gdb_test "file $binfile" \
+ "Detected 64-bit executable..*Invoking .*gdb64..*Use \"run\" to continue execution." \
+ "loading $binfile"
+} else {
+ gdb_test "file $binfile" \
+ "Reading symbols from $binfile...done." \
+ "loading $binfile"
+}
+# Test setting breakpoint on template function
+#
+gdb_test "break StringTest<wchar_t>::testFunction" \
+ "Breakpoint $decimal at $hex: file .*bs15503.cc, line 19." \
+ "break point on function"
+
+gdb_test "run" \
+ "Starting program:.*Breakpoint $decimal, StringTest<wchar_t>::testFunction \\(this=$hex\\).*cout << \"in StringTest\" << endl;.*" \
+ "run to function breakpoint"
+
+#restart with fresh gdb
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+gdb_test "break 32" \
+ "Breakpoint $decimal at $hex: file .*bs15503.cc, line 32." \
+ "break point on line in function"
+
+gdb_test "run" \
+ ".*32.*string::size_type spos = s.find\\(\"and\"\\);.*" \
+ "run to break point on line in function"
diff --git a/gdb/testsuite/gdb.hp/gdb.defects/configure b/gdb/testsuite/gdb.hp/gdb.defects/configure
new file mode 100755
index 00000000000..7d8f044d8f6
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.defects/configure
@@ -0,0 +1,899 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=bs14602.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../../.. $srcdir/`cd $srcdir;pwd`/../../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../../.. $srcdir/`cd $srcdir;pwd`/../../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:573: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:594: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:612: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.hp/gdb.defects/configure.in b/gdb/testsuite/gdb.hp/gdb.defects/configure.in
new file mode 100644
index 00000000000..fb886862941
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.defects/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(bs14602.exp)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.hp/gdb.defects/solib-d.c b/gdb/testsuite/gdb.hp/gdb.defects/solib-d.c
new file mode 100644
index 00000000000..ec803fe06a5
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.defects/solib-d.c
@@ -0,0 +1,6 @@
+main()
+{
+ function_from_primary();
+ function_from_secondary();
+}
+
diff --git a/gdb/testsuite/gdb.hp/gdb.defects/solib-d.exp b/gdb/testsuite/gdb.hp/gdb.defects/solib-d.exp
new file mode 100644
index 00000000000..c0d206777e7
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.defects/solib-d.exp
@@ -0,0 +1,278 @@
+# Copyright (C) 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# This file was written by srikanth (with huge chunks borrowed from old ones)
+#
+# Regression test for
+#
+# CLLbs14756
+#
+# o catch load command does not stop for implicit loads.
+#
+# CLLbs15382
+#
+# o sharedlibrary command ignores its argument and ends
+# up loading every shared library there is ...
+#
+# CLLbs15582
+#
+# o info line non-existent-function dumps core
+# o clear non-existent function dumps core
+# o xbreak non-existent-function dumps core
+#
+# CLLbs15725
+#
+# o gdb prints static and extern variables in shlibs incorrectly.
+#
+# CLLbs16090
+#
+# o deferred breakpoints should kick in for shlibs loaded explicitly
+# with the sharedlibrary command.
+# o GDB confuses export stubs with actual function.
+#
+#
+
+if $tracelevel {
+ strace $tracelevel
+}
+
+if { [skip_hp_tests] } { continue }
+
+set prms_id 0
+set bug_id 0
+
+# are we on a target board
+if ![isnative] {
+ return
+}
+
+# This test is presently only valid on HP-UX, since it requires
+# that we use HP-UX-specific compiler & linker options to build
+# the testcase.
+#
+setup_xfail "*-*-*"
+clear_xfail "hppa*-*-*hpux*"
+
+set prototypes 0
+set testfile "solib-d"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+set testfile1 ${objdir}/${subdir}/${testfile}1.o
+set testfile2 ${objdir}/${subdir}/${testfile}2.o
+set libfile1 ${objdir}/${subdir}/${testfile}1.sl
+set libfile2 ${objdir}/${subdir}/${testfile}2.sl
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1;
+}
+
+# set up appropriate compile option to recognize long double
+if {$hp_aCC_compiler || $hp_cc_compiler} {
+ set picflag "+z"
+ set ansiflag "-Ae"
+} else {
+ set picflag "-fpic"
+ set ansiflag ""
+}
+
+
+# Build the shared libraries this test case needs.
+#
+#cd ${subdir}
+
+if { [gdb_compile "${srcdir}/${subdir}/${testfile}1.c" "${testfile1}" object "{debug additional_flags=${picflag}}"] != "" } {
+ perror "Couldn't compile ${testfile}1.c"
+ return -1
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${testfile}2.c" "${testfile2}" object "{debug additional_flags=${picflag}}"] != ""} {
+ perror "Couldn't compile ${testfile}2.c"
+ return -1
+}
+
+remote_exec build "ld -b ${testfile1} -o ${libfile1}"
+remote_exec build "ld -b ${testfile2} -o ${libfile2}"
+
+# Build the test case
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${libfile1} ${libfile2}" "${binfile}" executable "{debug additional_flags=${ansiflag} -Wl,-aarchive}"] != "" } {
+ perror "Couldn't build ${binfile}"
+ return -1
+}
+
+# Start with a fresh gdb
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# Verify that we can set a generic catchpoint on shlib loads. I.e., that
+# we can catch any shlib load, without specifying the name.
+#
+gdb_test "catch load" "Catchpoint \[0-9\]* .load <any library>.*" \
+ "set generic catch load"
+
+# Verify that implicit shlib loads are caught and reported.
+send_gdb "run\n"
+gdb_expect {
+ -re ".*solib-d1.*$gdb_prompt $" {
+ pass "Catch implicit load at startup"
+ }
+ -re "Program exited.*$gdb_prompt $" {
+ fail "CLLbs14756 || CLLbs16090 came back ???"
+ }
+ timeout { fail "(timeout) implicit library load" }
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+if ![runto_main] { fail "breakpoint at main did not trigger ?" }
+
+# verify that we print globals from shlibs correctly.
+gdb_test "p global_from_primary" " = 5678" \
+ "print global from shlib (CLLbs15725)"
+
+gdb_test "p global_from_secondary" " = 9012" \
+ "print global from shlib (CLLbs15725)"
+
+# verify that we print static variables from shlibs correctly.
+if { ![runto function_from_primary] } { return }
+gdb_test "p file_static" " = 1234" "print file static variable (CLLbs15725)"
+
+if { ![runto function_from_secondary] } { return }
+gdb_test "p local_static" " = 3456" "print local static variable (CLLbs15725)"
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "set auto-solib-add 0" "" "turn off auto shlib debug loading"
+
+if ![runto_main] {
+ perror "C function calling tests suppressed"
+}
+
+# verify that "clear non-existent-symbol" does not crash
+gdb_test "clear junkfunc" "Location not found.*" \
+ "clear non-existent function does not dump core !"
+
+# verify that "info line non-existent-symbol" does not crash
+gdb_test "info line junkfunc" "Location not found.*" \
+ "info line junkfunc does not dump core !"
+
+# verify that "xbreak non-existent-symbol" does not crash
+gdb_test "xbreak junkfunc" "Function \"junkfunc\" not defined.*" \
+ "xbreak junkfunc does not dump core !"
+
+gdb_test "list function_from_primary" \
+ "No line number known for function_from_primary.*" \
+ "turning off auto shlib debug loading"
+
+send_gdb "sharedlibrary solib-d1\n"
+gdb_expect {
+ -re "Reading symbols from.*solib-d1.*$gdb_prompt $" {
+ pass "loading primary library on demand (1)"
+ }
+ -re "--Adding symbols for shared library.*solib-d1.*$gdb_prompt $" {
+ pass "loading primary library on demand (2)"
+ }
+ -re "$gdb_prompt $" { fail "loading primary library on demand (3)" }
+ timeout { fail "(timeout) loading primary library on demand" }
+}
+
+# make sure that load above of primary also did not pull in secondary.
+send_gdb "list function_from_secondary\n"
+gdb_expect {
+ -re "No symbol.*context.*$gdb_prompt $" {
+ pass "loaded only what we needed (1)"
+ }
+ -re "No line number known for function_from_secondary.*$gdb_prompt $" {
+ pass "loaded only what we needed (2)"
+ }
+ -re ".*9012.*$gdb_prompt $" { fail "Oops ! CLLbs15382 came back ?" }
+ timeout { fail "(timeout) printing global" }
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "set auto-solib-add 0" "" "turn off auto shlib debug loading"
+
+gdb_test "set stop-on-solib-event 1" "" "stop-on-solib-event"
+
+# verify that we set breakpoint on the function and not the export stub
+# used to be that we set bp on the export stub of _start and thus miss
+# shlib loads in some cases (where the stub exists)
+send_gdb "run\n"
+gdb_expect {
+ -re "Stopped due to shared library event.*$gdb_prompt $" {
+ pass "stop for shlib event"
+ }
+ -re "Program exited.*$gdb_prompt $" {
+ fail "Bug CLLbs16090 came back ?"
+ }
+ timeout { fail "(timeout) stop for shlib event " }
+}
+
+gdb_test "b main" "Breakpoint 1 at.*" "set breakpoint on main"
+
+gdb_test "set stop-on-solib-event 0" "" "stop-on-solib-event (timeout)"
+
+# verify that we set breakpoint on the function and not the export stub
+gdb_test "cont" "Breakpoint 1.*main.*" "run to main"
+
+# On PA64 we read in the unwind info and linker symbol table which lets
+# us set the breakpoint and not defer it.
+send_gdb "b garbage\n"
+gdb_expect {
+ -re "Breakpoint.*deferred.*garbage.*library containing.*is loaded.*$gdb_prompt $" {
+ pass " set deferred breakpoint (1)"
+ }
+ -re "Breakpoint 2 at 0x.*$gdb_prompt $" {
+ pass " set deferred breakpoint (2)"
+ }
+ -re "$gdb_prompt $" { fail " set deferred breakpoint (3)" }
+ timeout { fail "(timeout) set deferred breakpoint" }
+}
+
+# make sure that the sharedlibrary command enables any deferred breakpoints
+# that it should.
+send_gdb "sharedlibrary lib\n"
+gdb_expect {
+ -re "Reading.*solib-d1.*$gdb_prompt $" {
+ pass "load up all shared libs (1)"
+ }
+ -re "Loading.*dld.sl.*--Adding symbols.*solib-d1.*$gdb_prompt $" {
+ pass "load up all shared libs (2)"
+ }
+ -re "$gdb_prompt $" { fail "load up all libraries" }
+ timeout { fail "(timeout) load all libraries " }
+}
+
+# do we stop at garbage ? If yes ok.
+gdb_test "cont" "Breakpoint.*garbage.*" "deferred breakpoint enabled"
+
+gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.hp/gdb.defects/solib-d1.c b/gdb/testsuite/gdb.hp/gdb.defects/solib-d1.c
new file mode 100644
index 00000000000..b6da64d21d2
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.defects/solib-d1.c
@@ -0,0 +1,12 @@
+static int file_static = 1234;
+int global_from_primary = 5678;
+
+int function_from_primary()
+{
+ garbage();
+}
+
+force_generation_of_export_stub()
+{
+ _start(); /* force main module to have an export stub for _start() */
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.defects/solib-d2.c b/gdb/testsuite/gdb.hp/gdb.defects/solib-d2.c
new file mode 100644
index 00000000000..024616baf28
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.defects/solib-d2.c
@@ -0,0 +1,11 @@
+int global_from_secondary = 9012;
+int function_from_secondary()
+{
+ static int local_static = 3456;
+ return 0;
+}
+
+garbage()
+{
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/Makefile.in b/gdb/testsuite/gdb.hp/gdb.objdbg/Makefile.in
new file mode 100644
index 00000000000..5411c46fc55
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/Makefile.in
@@ -0,0 +1,28 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = objdbg01/test0 objdbg01/test1 objdbg02/test \
+ objdbg03/test objdbg04/test0 objdbg04/test1
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ objdbg*/*.o objdbg*/*.ci
+ -rm -f core $(EXECUTABLES)
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+ -rm -f *-init.exp
+ -rm -fr *.log summary detail *.plog *.sum *.psum site.*
+
+Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/configure b/gdb/testsuite/gdb.hp/gdb.objdbg/configure
new file mode 100755
index 00000000000..123ca4e3e73
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/configure
@@ -0,0 +1,992 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=objdbg01.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../../.. $srcdir/`cd $srcdir;pwd`/../../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../../.. $srcdir/`cd $srcdir;pwd`/../../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:573: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:594: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:612: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+subdirs="objdbg01 objdbg02 objdbg03 objdbg04"
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
+if test "$no_recursion" != yes; then
+
+ # Remove --cache-file and --srcdir arguments so they do not pile up.
+ ac_sub_configure_args=
+ ac_prev=
+ for ac_arg in $ac_configure_args; do
+ if test -n "$ac_prev"; then
+ ac_prev=
+ continue
+ fi
+ case "$ac_arg" in
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ ;;
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ ;;
+ *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;;
+ esac
+ done
+
+ for ac_config_dir in objdbg01 objdbg02 objdbg03 objdbg04; do
+
+ # Do not complain, so a configure script can configure whichever
+ # parts of a large source tree are present.
+ if test ! -d $srcdir/$ac_config_dir; then
+ continue
+ fi
+
+ echo configuring in $ac_config_dir
+
+ case "$srcdir" in
+ .) ;;
+ *)
+ if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :;
+ else
+ { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; }
+ fi
+ ;;
+ esac
+
+ ac_popdir=`pwd`
+ cd $ac_config_dir
+
+ # A "../" for each directory in /$ac_config_dir.
+ ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'`
+
+ case "$srcdir" in
+ .) # No --srcdir option. We are building in place.
+ ac_sub_srcdir=$srcdir ;;
+ /*) # Absolute path.
+ ac_sub_srcdir=$srcdir/$ac_config_dir ;;
+ *) # Relative path.
+ ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;;
+ esac
+
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_sub_srcdir/configure; then
+ ac_sub_configure=$ac_sub_srcdir/configure
+ elif test -f $ac_sub_srcdir/configure.in; then
+ ac_sub_configure=$ac_configure
+ else
+ echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2
+ ac_sub_configure=
+ fi
+
+ # The recursion is here.
+ if test -n "$ac_sub_configure"; then
+
+ # Make the cache file name correct relative to the subdirectory.
+ case "$cache_file" in
+ /*) ac_sub_cache_file=$cache_file ;;
+ *) # Relative path.
+ ac_sub_cache_file="$ac_dots$cache_file" ;;
+ esac
+
+ echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
+ # The eval makes quoting arguments work.
+ if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
+ then :
+ else
+ { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
+ fi
+ fi
+
+ cd $ac_popdir
+ done
+fi
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/configure.in b/gdb/testsuite/gdb.hp/gdb.objdbg/configure.in
new file mode 100644
index 00000000000..811f37e0975
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/configure.in
@@ -0,0 +1,16 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(objdbg01.exp)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../../..)
+AC_CANONICAL_SYSTEM
+AC_CONFIG_SUBDIRS(objdbg01 objdbg02 objdbg03 objdbg04)
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01.exp b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01.exp
new file mode 100644
index 00000000000..70d9d0c983d
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01.exp
@@ -0,0 +1,222 @@
+# Test reading debug information from in object files.
+
+if { [skip_hp_tests] } { continue }
+
+if { ![istarget "hppa*-*-hpux*"] } {
+ verbose "HPUX test ignored for non-hppa targets."
+ return 0
+}
+
+set testfile "test"
+set srcsubdir ${srcdir}/${subdir}/objdbg01
+set toolssubdir ${srcdir}/${subdir}/tools
+set objdbgdir ${objdir}/${subdir}/objdbg01
+set binfile ${objdbgdir}/${testfile}
+set symaddrfile ${toolssubdir}/symaddr
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+if {!$hp_aCC_compiler && !$hp_cc_compiler} {
+ return 0
+}
+
+if { [gdb_compile "${toolssubdir}/test-objdbg.cc" "${objdbgdir}/test-objdbg.o" object "debug c++ {additional_flags=-I${toolssubdir} +objdebug}"] != "" } {
+ gdb_suppress_entire_file "WARNING: +objdebug option is not supported in this compiler version, test ignored."
+}
+
+if { [gdb_compile "${srcsubdir}/x1.cc" "${objdbgdir}/x1.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x1.cc"
+ return -1
+}
+
+if { [gdb_compile "${srcsubdir}/x2.cc" "${objdbgdir}/x2.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x2.cc"
+ return -1
+}
+
+if { [gdb_compile "${srcsubdir}/x3.cc" "${objdbgdir}/x3.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x3.cc"
+ return -1
+}
+
+if { [gdb_compile "${objdbgdir}/x1.o ${objdbgdir}/x2.o ${objdbgdir}/x3.o" "${binfile}0" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile ${binfile}0"
+ return -1
+}
+
+if {[gdb_compile "${objdbgdir}/x3.o ${objdbgdir}/x2.o ${objdbgdir}/x1.o" "${binfile}1" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile ${binfile}1"
+ return -1
+}
+
+# Test two executables. The first has x1.cc linked first, the second
+# has x3.cc linked first. The difference is that in the first one,
+# the Info<PP> instantiation from x1.cc is taken, in the second, its
+# from x3.cc.
+
+for {set filenum 0} {$filenum < 2} {incr filenum 1} {
+
+ # Lets test some commons
+ # Need to restart each to to make sure objects are not loaded
+ # Also cross check the address with what is actually in the
+ # object file (call the executable ${symaddrfile} to retrieve the
+ # information).
+
+ set exec_output [lindex [remote_exec build "${symaddrfile} ${binfile}${filenum} acomm"] 1]
+ regsub -all "\[\r\n\]" ${exec_output} "" exec_output
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+ gdb_test "p &acomm" "..* = \\(int \[*\]\\) 0x${exec_output}.*"
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+ gdb_test "b main" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file ..*/x1.cc, line 20."
+ gdb_test "run" "Starting program:.*Breakpoint \[0-9\]+, main .*/x1.cc:20.*20.*acomm.*=.*1.*"
+ gdb_test "s 1" "21.*"
+ gdb_test "p acomm" ".* = 1.*"
+ gdb_test "p &acomm" "..* = \\(int \[*\]\\) 0x${exec_output}.*"
+
+ # Step through each line.
+ # Do this three times.
+ # First round: Test that things are okay after printing commons
+ # above.
+ # Second round: Restart gdb and make sure we can walk through
+ # Third round: Do NOT restrart gdb to verify that the debug information
+ # was not messed up by loading additional object files from
+ # the first run through.
+ for {set i 0} {$i < 3} {incr i 1} {
+ if $i==1 then {
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+ }
+ if $i!=2 then {
+ gdb_test "b main" \
+ "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file ..*/x1.cc, line 20."
+ }
+ if $i!=0 then {
+ gdb_test "run" \
+ "Starting program:.*Breakpoint \[0-9\]+, main .*/x1.cc:20.*"
+ gdb_test "s 1" "21.*"
+ }
+ gdb_test "s 1" "Info<PP>::p .*/x3.h:11.*"
+ gdb_test "s 1" "PP::print .*/x2.cc:8.*"
+ gdb_test "s 1" ".*9.*"
+ gdb_test "s 1" "Info<PP>::p .*/x3.h:12.*"
+ gdb_test "s 1" "main .*/x1.cc:22.*"
+ gdb_test "s 1" "foo .*/x3.cc:5.*"
+ gdb_test "s 1" "Info<PP>::p .*/x3.h:11.*"
+ gdb_test "s 1" "PP::print .*/x2.cc:8.*"
+ gdb_test "s 1" ".*9.*"
+ gdb_test "s 1" "Info<PP>::p .*/x3.h:12.*"
+ gdb_test "s 1" "foo .*/x3.cc:6.*"
+ gdb_test "s 1" "Info<QQ>::p .*/x3.h:11.*"
+ gdb_test "s 1" "QQ::print .*/x2.cc:13.*"
+ gdb_test "s 1" ".*14.*"
+ gdb_test "s 1" "Info<QQ>::p .*/x3.h:12.*"
+ gdb_test "s 1" "foo .*/x3.cc:7.*"
+ gdb_test "s 1" "main .*/x1.cc:24.*"
+ gdb_test "s 1" ".*25.*"
+ if [istarget "hppa64-*-*"] {
+ gdb_test "s 1" "0x\[0-9a-f\]+ in .*"
+ gdb_test "c" ".*Program exited normally.*"
+ } else {
+ gdb_test "s 1" "0x\[0-9a-f\]+ in _start .*"
+ gdb_test "s 1" ".*Program exited normally.*"
+ }
+ }
+
+ # Test various ptypes, and combinations of them
+ # Test things multiple times in each set to make sure that the debug
+ # information did not get messed up.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+ gdb_test "ptype QQ" "type = (class |)QQ {..*void print( |)..*}.*"
+ gdb_test "ptype PP" "type = (class |)PP {..*void print( |)..*}.*"
+ gdb_test "ptype QQ" "type = (class |)QQ {..*void print( |)..*}.*"
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+ gdb_test "ptype PP" "type = (class |)PP {..*void print( |)..*}.*"
+ gdb_test "ptype QQ" "type = (class |)QQ {..*void print( |)..*}.*"
+ gdb_test "ptype PP" "type = (class |)PP {..*void print( |)..*}.*"
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+ gdb_test "ptype Info<QQ>" "type = (class |)Info<QQ> {..*void p( |)..*}.*"
+ gdb_test "ptype Info<PP>" "type = (class |)Info<PP> {..*void p( |)..*}.*"
+ gdb_test "ptype Info<QQ>" "type = (class |)Info<QQ> {..*void p( |)..*}.*"
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+ gdb_test "ptype Info<PP>" "type = (class |)Info<PP> {..*void p( |)..*}.*"
+ gdb_test "ptype Info<QQ>" "type = (class |)Info<QQ> {..*void p( |)..*}.*"
+ gdb_test "ptype Info<PP>" "type = (class |)Info<PP> {..*void p( |)..*}.*"
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+ gdb_test "ptype Info" "type = template <..*> (class |)Info {..*}.*"
+ gdb_test "ptype Info<PP>" "type = (class |)Info<PP> {..*void p( |)..*}.*"
+ gdb_test "ptype Info<QQ>" "type = (class |)Info<QQ> {..*void p( |)..*}.*"
+ gdb_test "ptype Info" "type = template <..*> (class |)Info {..*}.*"
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+ gdb_test "ptype class QQ" "type = (class |)QQ {..*void print( |)..*}.*"
+ gdb_test "ptype class PP" "type = (class |)PP {..*void print( |)..*}.*"
+ gdb_test "ptype class QQ" "type = (class |)QQ {..*void print( |)..*}.*"
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+ gdb_test "ptype class PP" "type = (class |)PP {..*void print( |)..*}.*"
+ gdb_test "ptype class QQ" "type = (class |)QQ {..*void print( |)..*}.*"
+ gdb_test "ptype class PP" "type = (class |)PP {..*void print( |)..*}.*"
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+ gdb_test "ptype class Info<QQ>" \
+ "type = (class |)Info<QQ> {..*void p( |)..*}.*"
+ gdb_test "ptype class Info<PP>" \
+ "type = (class |)Info<PP> {..*void p( |)..*}.*"
+ gdb_test "ptype class Info<QQ>" \
+ "type = (class |)Info<QQ> {..*void p( |)..*}.*"
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+ gdb_test "ptype class Info<PP>" \
+ "type = (class |)Info<PP> {..*void p( |)..*}.*"
+ gdb_test "ptype class Info<QQ>" \
+ "type = (class |)Info<QQ> {..*void p( |)..*}.*"
+ gdb_test "ptype class Info<PP>" \
+ "type = (class |)Info<PP> {..*void p( |)..*}.*"
+}
+
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x1.cc b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x1.cc
new file mode 100644
index 00000000000..0de3153d9cc
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x1.cc
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include "x3.h"
+
+extern void foo();
+
+extern int acomm;
+
+int main3()
+{
+ return 1;
+}
+
+int main2()
+{
+ return 0;
+}
+
+int main()
+{
+ acomm = 1;
+ (new Info<PP>)->p(new PP);
+ foo();
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x2.cc b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x2.cc
new file mode 100644
index 00000000000..af588fbc00a
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x2.cc
@@ -0,0 +1,14 @@
+#include "x3.h"
+#include <stdio.h>
+
+int acomm;
+
+void PP::print()
+{
+ printf("In PP::print()\n");
+}
+
+void QQ::print()
+{
+ printf("In QQ::print()\n");
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x3.cc b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x3.cc
new file mode 100644
index 00000000000..88fe5453ec6
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x3.cc
@@ -0,0 +1,7 @@
+#include "x3.h"
+
+void foo()
+{
+ (new Info<PP>)->p(new PP);
+ (new Info<QQ>)->p(new QQ);
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x3.h b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x3.h
new file mode 100644
index 00000000000..d03a5503c5e
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg01/x3.h
@@ -0,0 +1,22 @@
+
+template <class T>
+class Info {
+public:
+ void p(T *x);
+};
+
+template <class T>
+void Info<T>::p(T *x)
+{
+ x->print();
+}
+
+class PP {
+public:
+ void print();
+};
+
+class QQ {
+public:
+ void print();
+};
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02.exp b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02.exp
new file mode 100644
index 00000000000..fcd0fdc9b44
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02.exp
@@ -0,0 +1,85 @@
+# Test reading debug information from in object files.
+
+if { [skip_hp_tests] } { continue }
+
+if { ![istarget "hppa*-*-hpux*"] } {
+ verbose "HPUX test ignored for non-hppa targets."
+ return 0
+}
+
+set testfile "test"
+set srcsubdir ${srcdir}/${subdir}/objdbg02
+set objdbgdir ${objdir}/${subdir}/objdbg02
+set binfile ${objdbgdir}/${testfile}
+set toolssubdir ${srcdir}/${subdir}/tools
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+if {!$hp_aCC_compiler && !$hp_cc_compiler} {
+ return 0
+}
+
+if { [gdb_compile "${toolssubdir}/test-objdbg.cc" "${objdbgdir}/test-objdbg.o" object "debug c++ {additional_flags=-I${toolssubdir} +objdebug}"] != "" } {
+ gdb_suppress_entire_file "WARNING: +objdebug option is not supported in this compiler version, test ignored."
+}
+
+if { [gdb_compile "${srcsubdir}/x1.cc" "${objdbgdir}/x1.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x1.cc"
+ return -1
+}
+
+if { [gdb_compile "${srcsubdir}/x2.cc" "${objdbgdir}/x2.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x2.cc"
+ return -1
+}
+
+if { [gdb_compile "${srcsubdir}/x3.cc" "${objdbgdir}/x3.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x3.cc"
+ return -1
+}
+
+remote_exec build "rm -f ${objdbgdir}/test.a"
+set status [remote_exec build "ar cr ${objdbgdir}/test.a ${objdbgdir}/x2.o ${objdbgdir}/x3.o"]
+if { [lindex $status 0] != 0 } {
+ perror "Couldn't compile test.a"
+ return -1
+}
+remote_exec build "rm -f ${objdbgdir}/x2.o ${objdbgdir}/x3.o"
+
+if { [gdb_compile "${objdbgdir}/x1.o ${objdbgdir}/test.a" "$binfile" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile ${binfile}"
+ return -1
+}
+
+# Test loading debug information from an archive file
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir ${srcsubdir}
+gdb_load ${binfile}
+
+gdb_test "b main" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file ..*/x1.cc, line 12."
+gdb_test "run" "Starting program:.*Breakpoint \[0-9\]+, main .*/x1.cc:12.*"
+gdb_test "s 1" ".*13.*"
+gdb_test "s 1" "foo1 .*/x2.cc:15.*"
+gdb_test "s 1" ".*16.*"
+gdb_test "s 1" "foo2 .*/x2.cc:10.*"
+gdb_test "s 1" ".*11.*"
+gdb_test "s 1" "foo1 .*/x2.cc:17.*"
+gdb_test "s 1" "main .*/x1.cc:14.*"
+gdb_test "s 1" "foo3 .*/x3.cc:5.*"
+gdb_test "s 1" ".*6.*"
+gdb_test "s 1" "main .*/x1.cc:15.*"
+gdb_test "s 1" ".*16.*"
+if [istarget "hppa64-*-*"] {
+ gdb_test "s 1" "0x\[0-9a-f\]+ in .*START.*"
+ gdb_test "c" ".*Program exited normally.*"
+} else {
+ gdb_test "s 1" "0x\[0-9a-f\]+ in _start .*"
+ gdb_test "s 1" ".*Program exited normally.*"
+}
+
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x1.cc b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x1.cc
new file mode 100644
index 00000000000..7ec0cf18405
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x1.cc
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+extern void foo1();
+extern void foo3();
+
+struct foo_type;
+
+int main()
+{
+ struct foo_type *x;
+
+ printf("In main.\n");
+ foo1();
+ foo3();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x2.cc b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x2.cc
new file mode 100644
index 00000000000..627f02d2baf
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x2.cc
@@ -0,0 +1,17 @@
+#include <stdio.h>
+
+struct foo_type {
+ int t1;
+ int t2;
+};
+
+static void foo2()
+{
+ printf("In foo2.\n");
+}
+
+void foo1()
+{
+ printf("In foo1.\n");
+ foo2();
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x3.cc b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x3.cc
new file mode 100644
index 00000000000..d03ea5146a9
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg02/x3.cc
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void foo3()
+{
+ printf("In foo3.\n");
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03.exp b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03.exp
new file mode 100644
index 00000000000..1e549476f31
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03.exp
@@ -0,0 +1,164 @@
+# Test reading debug information from in object files.
+
+if { [skip_hp_tests] } { continue }
+
+if { ![istarget "hppa*-*-hpux*"] } {
+ verbose "HPUX test ignored for non-hppa targets."
+ return 0
+}
+
+set testfile "test"
+set srcsubdir ${srcdir}/${subdir}/objdbg03
+set objdbgdir ${objdir}/${subdir}/objdbg03
+set binfile ${objdbgdir}/${testfile}
+set toolssubdir ${srcdir}/${subdir}/tools
+if [istarget "hppa64-*-*"] {
+ set symaddrfile ${toolssubdir}/symaddr.pa64
+} else {
+ set symaddrfile ${toolssubdir}/symaddr
+}
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+if {!$hp_aCC_compiler && !$hp_cc_compiler} {
+ return 0
+}
+
+if { [gdb_compile "${toolssubdir}/test-objdbg.cc" "${objdbgdir}/test-objdbg.o" object "debug c++ {additional_flags=-I${toolssubdir} +objdebug}"] != "" } {
+ gdb_suppress_entire_file "WARNING: +objdebug option is not supported in this compiler version, test ignored."
+}
+
+if { [gdb_compile "${srcsubdir}/x1.cc" "${objdbgdir}/x1.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x1.cc"
+ return -1
+}
+
+if { [gdb_compile "${srcsubdir}/x2.cc" "${objdbgdir}/x2.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x2.cc"
+ return -1
+}
+
+if { [gdb_compile "${srcsubdir}/x3.cc" "${objdbgdir}/x3.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x3.cc"
+ return -1
+}
+
+if { [gdb_compile "${objdbgdir}/x1.o ${objdbgdir}/x2.o ${objdbgdir}/x3.o" "${binfile}" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile ${binfile}"
+ return -1
+}
+
+#
+# Test some normal commons
+#
+
+# Print the types
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir ${srcsubdir}
+gdb_load ${binfile}
+
+gdb_test "ptype common1" "type = int"
+gdb_test "ptype common2" "type = int"
+gdb_test "ptype common3" "type = int"
+gdb_test "ptype data1" "type = int"
+gdb_test "ptype data2" "type = int"
+gdb_test "ptype data3" "type = int"
+gdb_test "ptype common11" "type = int"
+gdb_test "ptype common10" "type = int"
+gdb_test "ptype data10" "type = int"
+gdb_test "ptype data11" "type = int"
+
+# Print the values
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir ${srcsubdir}
+gdb_load ${binfile}
+
+gdb_test "b main" "Breakpoint \[0-9\]+ at 0x\[0-9a-f\]+: file ..*/x1.cc, line 11."
+gdb_test "run" "Starting program:.*Breakpoint \[0-9\]+, main .*/x1.cc:11.*"
+gdb_test "p data1" "..* = 1"
+gdb_test "p data2" "..* = 2"
+gdb_test "p data3" "..* = 3"
+gdb_test "p data10" "..* = 10"
+gdb_test "p data11" "..* = 11"
+gdb_test "n" ".*12.*"
+gdb_test "p common11" "..* = 11"
+
+gdb_test "s 1" "foo .*/x3.cc:15.*"
+gdb_test "s 4" ".*20.*"
+gdb_test "p data4" "..* = 4"
+gdb_test "p common4" "..* = 4"
+gdb_test "n" ".*21.*"
+
+gdb_test "n" "main .*/x1.cc:14.*"
+gdb_test "p common1" "..* = 1"
+gdb_test "p common2" "..* = 2"
+gdb_test "p common3" "..* = 3"
+
+# Verify that addresses match those in the executable
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir ${srcsubdir}
+gdb_load ${binfile}
+
+set exec_output_data1 [lindex [remote_exec build "${symaddrfile} ${binfile} data1"] 1]
+regsub -all "\[\r\n\]" ${exec_output_data1} "" exec_output_data1
+
+set exec_output_data2 [lindex [remote_exec build "${symaddrfile} ${binfile} data2"] 1]
+regsub -all "\[\r\n\]" ${exec_output_data2} "" exec_output_data2
+
+set exec_output_data3 [lindex [remote_exec build "${symaddrfile} ${binfile} data3"] 1]
+regsub -all "\[\r\n\]" ${exec_output_data3} "" exec_output_data3
+
+set exec_output_data10 [lindex [remote_exec build "${symaddrfile} ${binfile} data10"] 1]
+regsub -all "\[\r\n\]" ${exec_output_data10} "" exec_output_data10
+
+set exec_output_data11 [lindex [remote_exec build "${symaddrfile} ${binfile} data11"] 1]
+regsub -all "\[\r\n\]" ${exec_output_data11} "" exec_output_data11
+
+set exec_output_common1 [lindex [remote_exec build "${symaddrfile} ${binfile} common1"] 1]
+regsub -all "\[\r\n\]" ${exec_output_common1} "" exec_output_common1
+
+set exec_output_common2 [lindex [remote_exec build "${symaddrfile} ${binfile} common2"] 1]
+regsub -all "\[\r\n\]" ${exec_output_common2} "" exec_output_common2
+
+set exec_output_common3 [lindex [remote_exec build "${symaddrfile} ${binfile} common3"] 1]
+regsub -all "\[\r\n\]" ${exec_output_common3} "" exec_output_common3
+
+set exec_output_common10 [lindex [remote_exec build "${symaddrfile} ${binfile} common10"] 1]
+regsub -all "\[\r\n\]" ${exec_output_common10} "" exec_output_common10
+
+set exec_output_common11 [lindex [remote_exec build "${symaddrfile} ${binfile} common11"] 1]
+regsub -all "\[\r\n\]" ${exec_output_common11} "" exec_output_common11
+
+if [istarget "hppa64-*-*"] {
+ gdb_test "p &data1" "..* = \\(int \[*\]\\) ${exec_output_data1}"
+ gdb_test "p &data2" "..* = \\(int \[*\]\\) ${exec_output_data2}"
+ gdb_test "p &data3" "..* = \\(int \[*\]\\) ${exec_output_data3}"
+ gdb_test "p &data10" "..* = \\(int \[*\]\\) ${exec_output_data10}"
+ gdb_test "p &data11" "..* = \\(int \[*\]\\) ${exec_output_data11}"
+ gdb_test "p &common1" "..* = \\(int \[*\]\\) ${exec_output_common1}"
+ gdb_test "p &common2" "..* = \\(int \[*\]\\) ${exec_output_common2}"
+ gdb_test "p &common3" "..* = \\(int \[*\]\\) ${exec_output_common3}"
+ gdb_test "p &common10" "..* = \\(int \[*\]\\) ${exec_output_common10}"
+ gdb_test "p &common11" "..* = \\(int \[*\]\\) ${exec_output_common11}"
+} else {
+ gdb_test "p &data1" "..* = \\(int \[*\]\\) 0x${exec_output_data1}"
+ gdb_test "p &data2" "..* = \\(int \[*\]\\) 0x${exec_output_data2}"
+ gdb_test "p &data3" "..* = \\(int \[*\]\\) 0x${exec_output_data3}"
+ gdb_test "p &data10" "..* = \\(int \[*\]\\) 0x${exec_output_data10}"
+ gdb_test "p &data11" "..* = \\(int \[*\]\\) 0x${exec_output_data11}"
+ gdb_test "p &common1" "..* = \\(int \[*\]\\) 0x${exec_output_common1}"
+ gdb_test "p &common2" "..* = \\(int \[*\]\\) 0x${exec_output_common2}"
+ gdb_test "p &common3" "..* = \\(int \[*\]\\) 0x${exec_output_common3}"
+ gdb_test "p &common10" "..* = \\(int \[*\]\\) 0x${exec_output_common10}"
+ gdb_test "p &common11" "..* = \\(int \[*\]\\) 0x${exec_output_common11}"
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x1.cc b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x1.cc
new file mode 100644
index 00000000000..84231b08bea
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x1.cc
@@ -0,0 +1,15 @@
+#include <stdio.h>
+
+extern int foo();
+extern int common3;
+extern int data3;
+extern int common11;
+extern int data11;
+
+int main()
+{
+ common11 = 11;
+ printf("In main: %d %d %d\n", data3, common3, foo(), common11, data11);
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x2.cc b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x2.cc
new file mode 100644
index 00000000000..165cb85d2e3
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x2.cc
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int common10;
+int common11;
+
+int data10 = 10;
+int data11 = 11;
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x3.cc b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x3.cc
new file mode 100644
index 00000000000..80d38c75e38
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg03/x3.cc
@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+int common1;
+int common2;
+int common3;
+static int common4;
+
+int data1 = 1;
+int data2 = 2;
+int data3 = 3;
+static int data4 = 4;
+
+int foo()
+{
+ common1 = 1;
+ common2 = 2;
+ common3 = 3;
+ common4 = 4;
+
+ return data1 + data2 + data3 + data4 + common1 + common2 + common3 + common4;
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04.exp b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04.exp
new file mode 100644
index 00000000000..c57f4c0e056
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04.exp
@@ -0,0 +1,65 @@
+# Test reading debug information from in object files.
+
+if { [skip_hp_tests] } { continue }
+
+if { ![istarget "hppa*-*-hpux*"] } {
+ verbose "HPUX test ignored for non-hppa targets."
+ return 0
+}
+
+set testfile "test"
+set srcsubdir ${srcdir}/${subdir}/objdbg04
+set objdbgdir ${objdir}/${subdir}/objdbg04
+set binfile ${objdbgdir}/${testfile}
+set toolssubdir ${srcdir}/${subdir}/tools
+set symaddrfile ${toolssubdir}/symaddr
+
+# Create and source the file that provides information about the compiler
+# used to compile the test case.
+if [get_compiler_info ${binfile}] {
+ return -1
+}
+
+if {!$hp_aCC_compiler && !$hp_cc_compiler} {
+ return 0
+}
+
+if { [gdb_compile "${toolssubdir}/test-objdbg.cc" "${objdbgdir}/test-objdbg.o" object "debug c++ {additional_flags=-I${toolssubdir} +objdebug}"] != "" } {
+ gdb_suppress_entire_file "WARNING: +objdebug option is not supported in this compiler version, test ignored."
+}
+
+if { [gdb_compile "${srcsubdir}/x1.cc" "${objdbgdir}/x1.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x1.cc"
+ return -1
+}
+
+if { [gdb_compile "${srcsubdir}/x2.cc" "${objdbgdir}/x2.o" object "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x2.cc"
+ return -1
+}
+
+if { [gdb_compile "${objdbgdir}/x1.o ${objdbgdir}/x2.o" "${binfile}0" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x1.cc"
+ return -1
+}
+
+if { [gdb_compile "${objdbgdir}/x2.o ${objdbgdir}/x1.o" "${binfile}1" executable "debug c++ {additional_flags=-I${srcsubdir} +objdebug}"] != "" } {
+ perror "Couldn't compile x1.cc"
+ return -1
+}
+
+# Test two executables. The first has x1.cc linked first, the second
+# has x2.cc linked first. The difference is which COMDAT section was
+# picked.
+
+for {set filenum 0} {$filenum < 2} {incr filenum 1} {
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir ${srcsubdir}
+ gdb_load ${binfile}${filenum}
+
+ gdb_test "ptype Adder" "type = template <class T> (class |)Adder {..*T val.*;.*}(.*template instantiations:.*Adder<int>|)"
+ gdb_test "ptype Adder<int>" "type = (class |)Adder<int> {.*private:.*int val;.*public:.*void set( |)\\(int\\);.*int get( |)\\(void\\);.*int add( |)\\(int\\);.*}"
+ gdb_test "ptype Adder" "type = template <class T> (class |)Adder {..*T val.*;.*}(.*template instantiations:.*Adder<int>|)"
+
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x.h b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x.h
new file mode 100644
index 00000000000..9df8ef98556
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x.h
@@ -0,0 +1,30 @@
+template <class T>
+class Adder {
+public:
+ void set(T);
+ T get();
+ T add(T);
+
+private:
+ T val;
+};
+
+template <class T>
+void Adder<T>::set(T new_val)
+{
+ val = new_val;
+}
+
+template <class T>
+T Adder<T>::get()
+{
+ return val;
+}
+
+template <class T>
+T Adder<T>::add(T new_val)
+{
+ val += new_val;
+ return val;
+}
+
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x1.cc b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x1.cc
new file mode 100644
index 00000000000..1f284b2ab0e
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x1.cc
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include "x.h"
+
+template class Adder<int>;
+
+int main()
+{
+ Adder<int> add;
+
+ add.set(3);
+ add.add(3);
+ printf("In main: %d\n", add.get());
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x2.cc b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x2.cc
new file mode 100644
index 00000000000..29eea75d233
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/objdbg04/x2.cc
@@ -0,0 +1,3 @@
+#include "x.h"
+
+template class Adder<int>;
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/tools/symaddr b/gdb/testsuite/gdb.hp/gdb.objdbg/tools/symaddr
new file mode 100755
index 00000000000..032bb9fdd7e
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/tools/symaddr
@@ -0,0 +1,8 @@
+#!/bin/ksh
+
+# Get the address of a symbol in Hex.
+# $1 = object/executable file name
+# $2 = symbol name
+${srcdir}/gdb.hp/tools/odump -sym "$1" | grep "$2"$ | awk '{print $1}'
+
+exit 0
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/tools/symaddr.pa64 b/gdb/testsuite/gdb.hp/gdb.objdbg/tools/symaddr.pa64
new file mode 100755
index 00000000000..43fd793c5d9
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/tools/symaddr.pa64
@@ -0,0 +1,8 @@
+#!/bin/ksh
+
+# Get the address of a symbol in Hex.
+# $1 = object/executable file name
+# $2 = symbol name
+/usr/ccs/bin/elfdump -t +s .symtab "$1" | grep "$2"$ | awk '{print $6}'
+
+exit 0
diff --git a/gdb/testsuite/gdb.hp/gdb.objdbg/tools/test-objdbg.cc b/gdb/testsuite/gdb.hp/gdb.objdbg/tools/test-objdbg.cc
new file mode 100644
index 00000000000..f8b643afbf2
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.objdbg/tools/test-objdbg.cc
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.hp/gdb.threads-hp/Makefile.in b/gdb/testsuite/gdb.hp/gdb.threads-hp/Makefile.in
new file mode 100644
index 00000000000..240b627a2d2
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.threads-hp/Makefile.in
@@ -0,0 +1,27 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = usrthbasic usrthcore usrthfork
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ *.o *.ci
+ -rm -f core $(EXECUTABLES)
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+ -rm -f *-init.exp
+ -rm -fr *.log summary detail *.plog *.sum *.psum site.*
+
+Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.hp/gdb.threads-hp/configure b/gdb/testsuite/gdb.hp/gdb.threads-hp/configure
new file mode 100755
index 00000000000..90fa7554234
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.threads-hp/configure
@@ -0,0 +1,899 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=usrthbasic.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../../.. $srcdir/`cd $srcdir;pwd`/../../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../../.. $srcdir/`cd $srcdir;pwd`/../../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:573: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:594: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:612: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.hp/gdb.threads-hp/configure.in b/gdb/testsuite/gdb.hp/gdb.threads-hp/configure.in
new file mode 100644
index 00000000000..87fd81b51c8
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/gdb.threads-hp/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(usrthbasic.exp)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.hp/tools/odump b/gdb/testsuite/gdb.hp/tools/odump
new file mode 100755
index 00000000000..c96abed64db
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/tools/odump
@@ -0,0 +1,7 @@
+#!/bin/ksh
+
+# First source /app/appserver
+. /app/appserver
+
+# Exec the executable.
+exec $APPROOT/usr/contrib/bin/$(basename $0) "$@"
diff --git a/gdb/testsuite/gdb.java/Makefile.in b/gdb/testsuite/gdb.java/Makefile.in
new file mode 100644
index 00000000000..0954369c092
--- /dev/null
+++ b/gdb/testsuite/gdb.java/Makefile.in
@@ -0,0 +1,26 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+all:
+ @echo "Nothing to be done for all..."
+
+#### host, target, and site specific Makefile frags come in here.
+
+.SUFFIXES: .java .class .o .exe .exp .check
+
+# Do 'make javamisc.check' to run just the javamisc.exp test.
+
+.exp.check:
+ rootme=`pwd`/; export rootme; \
+ cd .. ; \
+ $(MAKE) just-check RUNTESTFLAGS="${RUNTESTFLAGS} $*.exp" \
+ EXPECT=${EXPECT}
+
+clean mostlyclean:
+ -rm -f *.o ${OBJS} *.class *.exe *~ core
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+
+Makefile: $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.java/configure b/gdb/testsuite/gdb.java/configure
new file mode 100755
index 00000000000..6a417911735
--- /dev/null
+++ b/gdb/testsuite/gdb.java/configure
@@ -0,0 +1,913 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+sitefile=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --site-file=FILE use FILE as the site file
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -site-file | --site-file | --site-fil | --site-fi | --site-f)
+ ac_prev=sitefile ;;
+ -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+ sitefile="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=jmisc.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$sitefile"; then
+ if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+ fi
+else
+ CONFIG_SITE="$sitefile"
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:586: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:607: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:625: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.java/configure.in b/gdb/testsuite/gdb.java/configure.in
new file mode 100644
index 00000000000..12fd4c7be50
--- /dev/null
+++ b/gdb/testsuite/gdb.java/configure.in
@@ -0,0 +1,11 @@
+dnl Process this file file with autoconf to produce a configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(jmisc.exp)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.java/jmisc.exp b/gdb/testsuite/gdb.java/jmisc.exp
new file mode 100644
index 00000000000..8f6c6fbc2b7
--- /dev/null
+++ b/gdb/testsuite/gdb.java/jmisc.exp
@@ -0,0 +1,91 @@
+# Copyright 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Anthony Green. (green@redhat.com)
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+load_lib "java.exp"
+
+set testfile "jmisc"
+set srcfile ${srcdir}/$subdir/${testfile}.java
+set binfile ${objdir}/${subdir}/${testfile}
+if { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
+ untested "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to java. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_java {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+
+ send_gdb "set language java\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language java (timeout)" ; return 0 }
+ }
+
+ return [gdb_test "show language" ".* source language is \"java\".*" \
+ "set language to \"java\""]
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if ![set_lang_java] then {
+ runto ${testfile}.main
+
+ send_gdb "ptype jmisc\n"
+ gdb_expect {
+ -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+void <init>\\(void\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $" { pass "ptype jmisc" }
+ -re ".*$gdb_prompt $" { fail "ptype jmisc" }
+ timeout { fail "ptype jmisc (timeout)" ; return }
+ }
+
+ send_gdb "p args\n"
+ gdb_expect {
+ -re "\\\$1 = java\.lang\.String\\\[]@\[a-f0-9]+\[\r\n\ \t]+$gdb_prompt $" { pass "p args" }
+ -re ".*$gdb_prompt $" { fail "p args" }
+ timeout { fail "p args (timeout)" ; return }
+ }
+
+ send_gdb "p *args\n"
+ gdb_expect {
+ -re "\\\$2 = \{length: 0\}\[\r\n\ \t]+$gdb_prompt $" { pass "p *args" }
+ -re ".*$gdb_prompt $" { fail "p *args" }
+ timeout { fail "p *args (timeout)" ; return }
+ }
+}
diff --git a/gdb/testsuite/gdb.java/jmisc.java b/gdb/testsuite/gdb.java/jmisc.java
new file mode 100644
index 00000000000..a11ba5447ec
--- /dev/null
+++ b/gdb/testsuite/gdb.java/jmisc.java
@@ -0,0 +1,7 @@
+public class jmisc
+{
+ public static void main (String[] args)
+ {
+ return;
+ }
+}
diff --git a/gdb/testsuite/gdb.java/jmisc1.exp b/gdb/testsuite/gdb.java/jmisc1.exp
new file mode 100644
index 00000000000..eea559e11b9
--- /dev/null
+++ b/gdb/testsuite/gdb.java/jmisc1.exp
@@ -0,0 +1,91 @@
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Anthony Green. (green@redhat.com)
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+load_lib "java.exp"
+
+set testfile "jmisc"
+set srcfile ${srcdir}/$subdir/${testfile}.java
+set binfile ${objdir}/${subdir}/${testfile}
+if { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
+ untested "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to java. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_java {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+
+ send_gdb "set language java\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language java (timeout)" ; return 0 }
+ }
+
+ return [gdb_test "show language" ".* source language is \"java\".*" \
+ "set language to \"java\""]
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if ![set_lang_java] then {
+ runto ${testfile}.main(java.lang.String\[\])
+
+ send_gdb "ptype jmisc\n"
+ gdb_expect {
+ -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+void <init>\\(void\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $" { pass "ptype jmisc" }
+ -re ".*$gdb_prompt $" { fail "ptype jmisc" }
+ timeout { fail "ptype jmisc (timeout)" ; return }
+ }
+
+ send_gdb "p args\n"
+ gdb_expect {
+ -re "\\\$1 = java\.lang\.String\\\[]@\[a-f0-9]+\[\r\n\ \t]+$gdb_prompt $" { pass "p args" }
+ -re ".*$gdb_prompt $" { fail "p args" }
+ timeout { fail "p args (timeout)" ; return }
+ }
+
+ send_gdb "p *args\n"
+ gdb_expect {
+ -re "\\\$2 = \{length: 0\}\[\r\n\ \t]+$gdb_prompt $" { pass "p *args" }
+ -re ".*$gdb_prompt $" { fail "p *args" }
+ timeout { fail "p *args (timeout)" ; return }
+ }
+}
diff --git a/gdb/testsuite/gdb.java/jmisc2.exp b/gdb/testsuite/gdb.java/jmisc2.exp
new file mode 100644
index 00000000000..2eeb99df7ad
--- /dev/null
+++ b/gdb/testsuite/gdb.java/jmisc2.exp
@@ -0,0 +1,91 @@
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Anthony Green. (green@redhat.com)
+#
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+load_lib "java.exp"
+
+set testfile "jmisc"
+set srcfile ${srcdir}/$subdir/${testfile}.java
+set binfile ${objdir}/${subdir}/${testfile}
+if { [compile_java_from_source ${srcfile} ${binfile} "-g"] != "" } {
+ untested "Couldn't compile ${srcfile}"
+ return -1
+}
+
+# Set the current language to java. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_java {} {
+ global gdb_prompt
+ global binfile objdir subdir
+
+ verbose "loading file '$binfile'"
+ gdb_load $binfile
+
+ send_gdb "set language java\n"
+ gdb_expect {
+ -re ".*$gdb_prompt $" {}
+ timeout { fail "set language java (timeout)" ; return 0 }
+ }
+
+ return [gdb_test "show language" ".* source language is \"java\".*" \
+ "set language to \"java\""]
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ".*"
+
+if ![set_lang_java] then {
+ send_gdb "ptype jmisc\n"
+ gdb_expect {
+ -re "type = class jmisc extends java.lang.Object \{\[\r\n\ \t]+void main\\(java\.lang\.String\\\[]\\);\[\r\n\ \t]+void <init>\\(void\\);\[\r\n\ \t]+\}\[\r\n\ \t]+$gdb_prompt $" { pass "ptype jmisc" }
+ -re ".*$gdb_prompt $" { fail "ptype jmisc" }
+ timeout { fail "ptype jmisc (timeout)" ; return }
+ }
+
+ runto ${testfile}.main(java.lang.String\[\])
+
+ send_gdb "p args\n"
+ gdb_expect {
+ -re "\\\$1 = java\.lang\.String\\\[]@\[a-f0-9]+\[\r\n\ \t]+$gdb_prompt $" { pass "p args" }
+ -re ".*$gdb_prompt $" { fail "p args" }
+ timeout { fail "p args (timeout)" ; return }
+ }
+
+ send_gdb "p *args\n"
+ gdb_expect {
+ -re "\\\$2 = \{length: 0\}\[\r\n\ \t]+$gdb_prompt $" { pass "p *args" }
+ -re ".*$gdb_prompt $" { fail "p *args" }
+ timeout { fail "p *args (timeout)" ; return }
+ }
+}
diff --git a/gdb/testsuite/gdb.java/jv-exp.exp b/gdb/testsuite/gdb.java/jv-exp.exp
new file mode 100644
index 00000000000..1ee9bd33975
--- /dev/null
+++ b/gdb/testsuite/gdb.java/jv-exp.exp
@@ -0,0 +1,66 @@
+# Copyright 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# Set the current language to Java. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_java {} {
+ global gdb_prompt
+
+ if [gdb_test "set language java" "" "set language java"] {
+ return 0
+ }
+
+ if [gdb_test "show language" ".* source language is \"java\".*"] {
+ return 0
+ }
+ return 1;
+}
+
+proc test_comparisons {} {
+ global gdb_prompt
+
+ # Test various comparisons.
+
+ gdb_test "p 1 > 2" " = false"
+ gdb_test "p 1 < 2" " = true"
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "set print sevenbit-strings" ""
+gdb_test "set print address off" "" ""
+gdb_test "set width 0" ""
+
+if [set_lang_java] then {
+ test_comparisons
+} else {
+ fail "Java expression tests suppressed"
+}
diff --git a/gdb/testsuite/gdb.java/jv-print.exp b/gdb/testsuite/gdb.java/jv-print.exp
new file mode 100644
index 00000000000..fb5dad73a28
--- /dev/null
+++ b/gdb/testsuite/gdb.java/jv-print.exp
@@ -0,0 +1,141 @@
+# Copyright 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# Set the current language to Java. This counts as a test. If it
+# fails, then we skip the other tests.
+
+proc set_lang_java {} {
+ global gdb_prompt
+
+ if [gdb_test "set language java" "" "set language java"] {
+ return 0
+ }
+
+ if [gdb_test "show language" ".* source language is \"java\".*"] {
+ return 0
+ }
+ return 1;
+}
+
+proc test_integer_literals_accepted {} {
+ global gdb_prompt
+
+ # Test various decimal values.
+
+ gdb_test "p 123" " = 123"
+ gdb_test "p -123" " = -123"
+ gdb_test "p/d 123" " = 123"
+
+ # Test various octal values.
+
+ gdb_test "p 0123" " = 83"
+ gdb_test "p 00123" " = 83"
+ gdb_test "p -0123" " = -83"
+ gdb_test "p/o 0123" " = 0123"
+
+ # Test various hexadecimal values.
+
+ gdb_test "p 0x123" " = 291"
+ gdb_test "p -0x123" " = -291"
+ gdb_test "p 0x0123" " = 291"
+ gdb_test "p -0x0123" " = -291"
+ gdb_test "p 0xABCDEF" " = 11259375"
+ gdb_test "p 0xabcdef" " = 11259375"
+ gdb_test "p 0xAbCdEf" " = 11259375"
+ gdb_test "p/x 0x123" " = 0x123"
+}
+
+proc test_character_literals_accepted {} {
+ global gdb_prompt
+
+ gdb_test "p 'a'" " = 'a'"
+ gdb_test "p/c 'a'" " = 'a'"
+ gdb_test "p/c 70" " = 'F'"
+ gdb_test "p/x 'a'" " = 0x61"
+ gdb_test "p/d 'a'" " = 97"
+ gdb_test "p/t 'a'" " = 1100001"
+ gdb_test "p/x '\\377'" " = 0xff"
+ gdb_test "p '\\''" " = '\\\\''"
+ # Note "p '\\'" => "= 92 '\\'"
+ gdb_test "p '\\\\'" " = '\\\\\\\\'"
+
+ # Test the /c print format.
+}
+
+proc test_integer_literals_rejected {} {
+ global gdb_prompt
+
+ test_print_reject "p 0x"
+ gdb_test "p ''" "Empty character constant\\."
+ gdb_test "p '''" "Empty character constant\\."
+ test_print_reject "p '\\'"
+
+ # Note that this turns into "p '\\\'" at gdb's input.
+ test_print_reject "p '\\\\\\'"
+
+ # Test various decimal values.
+
+ test_print_reject "p DEADBEEF"
+
+ test_print_reject "p 123DEADBEEF"
+ test_print_reject "p 123foobar.bazfoo3"
+ test_print_reject "p 123EEEEEEEEEEEEEEEEE33333k333"
+ gdb_test "p 123.4+56.7" "180.(099\[0-9]*|100\[0-9\]*)" "check for floating addition"
+
+ # Test various octal values.
+
+ test_print_reject "p 09"
+ test_print_reject "p 079"
+
+ # Test various hexadecimal values.
+
+ test_print_reject "p 0xG"
+ test_print_reject "p 0xAG"
+}
+
+
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+gdb_test "print \$pc" "No registers\\."
+# FIXME: should also test "print $pc" when there is an execfile but no
+# remote debugging target, process or corefile.
+
+gdb_test "set print sevenbit-strings" ""
+gdb_test "set print address off" "" ""
+gdb_test "set width 0" ""
+
+if [set_lang_java] then {
+ test_integer_literals_accepted
+ test_character_literals_accepted
+ test_integer_literals_rejected
+} else {
+ fail "Java print command tests suppressed"
+}
diff --git a/gdb/testsuite/gdb.mi/ChangeLog b/gdb/testsuite/gdb.mi/ChangeLog
new file mode 100644
index 00000000000..26d662c1ee6
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/ChangeLog
@@ -0,0 +1,624 @@
+2002-03-04 Michael Chastain <mec@shout.net>
+
+ * mi-var-cmd.exp: In test "create local variable func",
+ accommodate gcc v3 function signature.
+ * mi0-var-cmd-exp: Ditto.
+
+2002-02-05 Jim Blandy <jimb@redhat.com>
+
+ * mi-regs.exp: Various cleanups for SPARC-only tests.
+ (test_breakpoints_creation_and_listing): Format of breakpoint
+ table has changed.
+ (sparc_register_tests): Expand floating-point number regexp to
+ recognize NaN values, too. Replace ineffectual single backslash
+ before a hyphen with a double backslash. Don't check the exact
+ numbers of the registers which have changed, since there's no way
+ to know which registers changed, exactly; just check that the
+ result is well-formed.
+ * mi0-regs.exp: (sparc_register_tests): Same as for
+ sparc_register_tests in mi-regs.exp.
+
+ * mi-var-child.exp ("get children of struct_declarations", "get
+ children of struct_declarations.s2.u2.u1s2", "get children of
+ weird"): Tolerate argument types when they appear in function
+ types. (Dwarf 2 includes prototype info; STABS does not.)
+ * mi0-var-child.exp: Same.
+
+2001-12-19 Keith Seitz <keiths@redhat.com>
+
+ * mi-var-display.exp: char* variables have a child. Update all
+ occurences.
+ * mi0-var-display.exp: Likewise.
+
+2001-08-29 Andrew Cagney <cagney@redhat.com>
+
+ * mi-var-cmd.exp, mi0-var-cmd.exp: Variable lpcharacter has one
+ child. Soften floating point tests.
+
+2001-08-09 Andrew Cagney <ac131313@redhat.com>
+
+ * mi0-var-block.exp, mi0-stack.exp, mi0-simplerun.exp,
+ mi0-regs.exp, mi0-watch.exp, mi0-stepi.exp, mi0-until.exp,
+ mi0-return.exp, mi0-read-memory.exp, mi0-eval.exp,
+ mi0-disassemble.exp, mi0-console.exp, mi-watch.exp,
+ mi-var-display.exp, mi-var-cmd.exp, mi-var-child.exp,
+ mi-until.exp, mi-var-block.exp, mi-stepi.exp, mi-stack.exp,
+ mi-simplerun.exp, mi-return.exp, mi-regs.exp, mi-read-memory.exp,
+ mi-disassemble.exp, mi-eval.exp, mi-console.exp: Replace pattern
+ matching thread=0 with one to also match thread=1.
+ Fix PR gdb/190.
+
+2001-08-18 Andrew Cagney <ac131313@redhat.com>
+
+ * mi0-until.exp, mi-until.exp, mi0-stepi.exp, mi-stepi.exp,
+ mi-simplerun.exp, mi0-simplerun.exp, mi0-return.exp,
+ mi-return.exp, mi0-console.exp, mi-console.exp: Recognize an
+ unexpected run-to-main response. Report as a fail.
+
+2001-06-27 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-disassemble.exp: Update to accept mi1 breakpoint tables.
+ * mi-basics.exp: Ditto.
+ * mi-simplerun.exp: Ditto.
+ * mi-watch.exp: Ditto. Add check for full header.
+ * mi-break.exp: Ditto. Add check for full header.
+
+2001-06-26 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-stack.exp: Update. Output for args=... and
+ locals=... changed to a list.
+
+2001-06-26 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-stack.exp: Update. Output for stack=..., args=... and
+ stack-args=... changed to a list.
+
+2001-06-25 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-console.exp: Update args=... part of stop-reason
+ patterns. Output changed to a list of arguments.
+ * mi-disassemble.exp: Ditto.
+ * mi-simplerun.exp: Ditto.
+ * mi-return.exp: Ditto.
+ * mi-read-memory.exp: Ditto.
+ * mi-eval.exp: Ditto.
+ * mi-watch.exp: Ditto.
+ * mi-var-display.exp: Ditto.
+ * mi-var-cmd.exp: Ditto.
+ * mi-var-child.exp: Ditto.
+ * mi-var-block.exp: Ditto.
+ * mi-until.exp: Ditto.
+ * mi-stepi.exp: Ditto.
+ * mi-stack.exp: Ditto.
+ * mi-regs.exp: Ditto.
+
+2001-06-25 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-read-memory.exp: Update patterns matching data-read-memory.
+ Outputs a list.
+
+2001-06-25 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-regs.exp: Update patterns matching register-values. Outputs a
+ list.
+
+2001-06-25 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-regs.exp: Update patters matching register-names. Now
+ outputs a list.
+
+2001-06-25 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-regs.exp: Update patterns matching changed-registers. Now
+ outputs a list.
+
+2001-06-23 Andrew Cagney <ac131313@redhat.com>
+
+ * ChangeLog-mi: Rename to ChangeLog.
+ * mi-basics.exp: Remove local emacs variable defining
+ change-log-default-name.
+ * mi-break.exp, mi-console.exp, mi-disassemble.exp: Ditto.
+ * mi-eval.exp, mi-hack-cli.exp, mi-read-memory.exp: Ditto.
+ * mi-regs.exp, mi-return.exp, mi-simplerun.exp: Ditto.
+ * mi-stack.exp, mi-stepi.exp, mi-until.exp: Ditto.
+ * mi-var-block.exp, mi-var-child.exp, mi-var-cmd.exp: Ditto.
+ * mi-var-display.exp, mi-watch.exp, mi0-basics.exp: Ditto.
+ * mi0-break.exp, mi0-console.exp, mi0-disassemble.exp: Ditto.
+ * mi0-eval.exp, mi0-hack-cli.exp, mi0-read-memory.exp: Ditto.
+ * mi0-regs.exp, mi0-return.exp, mi0-simplerun.exp: Ditto.
+ * mi0-stack.exp, mi0-stepi.exp, mi0-until.exp: Ditto.
+ * mi0-var-block.exp, mi0-var-child.exp, mi0-var-cmd.exp: Ditto.
+ * mi0-var-display.exp, mi0-watch.exp: Ditto.
+
+2001-06-23 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-disassemble.exp: Update patterns matching data-disassemble
+ output. Now produces a list of instructions and a list of
+ source/assembly lines.
+
+2001-06-18 Andrew Cagney <ac131313@redhat.com>
+
+ * mi-basics.exp, mi-break.exp, mi-console.exp, mi-disassemble.exp,
+ mi-eval.exp, mi-hack-cli.exp, mi-read-memory.exp, mi-regs.exp,
+ mi-return.exp, mi-simplerun.exp, mi-stack.exp, mi-stepi.exp,
+ mi-until.exp, mi-var-block.exp, mi-var-child.exp, mi-var-cmd.exp,
+ mi-var-display.exp, mi-watch.exp, mi0-basics.exp, mi0-break.exp,
+ mi0-console.exp, mi0-disassemble.exp, mi0-eval.exp,
+ mi0-hack-cli.exp, mi0-read-memory.exp, mi0-regs.exp,
+ mi0-return.exp, mi0-simplerun.exp, mi0-stack.exp, mi0-stepi.exp,
+ mi0-until.exp, mi0-var-block.exp, mi0-var-child.exp,
+ mi0-var-cmd.exp, mi0-var-display.exp, mi0-watch.exp: Use MIFLAGS
+ to explictly select an interpreter.
+
+2001-06-16 Andrew Cagney <ac131313@redhat.com>
+
+ MI0 was the never enabled MI interface included in GDB 5.0.
+ * mi0-basics.exp: Copy mi-basics.exp.
+ * mi0-break.exp: Copy mi-break.exp.
+ * mi0-console.exp: Copy mi-console.exp.
+ * mi0-disassemble.exp: Copy mi-disassemble.exp.
+ * mi0-eval.exp: Copy mi-eval.exp.
+ * mi0-hack-cli.exp: Copy mi-hack-cli.exp.
+ * mi0-read-memory.exp: Copy mi-read-memory.exp.
+ * mi0-regs.exp: Copy mi-regs.exp.
+ * mi0-return.exp: Copy mi-return.exp.
+ * mi0-simplerun.exp: Copy mi-simplerun.exp.
+ * mi0-stack.exp: Copy mi-stack.exp.
+ * mi0-stepi.exp: Copy mi-stepi.exp.
+ * mi0-until.exp: Copy mi-until.exp.
+ * mi0-var-block.exp: Copy mi-var-block.exp.
+ * mi0-var-child.exp: Copy mi-var-child.exp.
+ * mi0-var-cmd.exp: Copy mi-var-cmd.exp.
+ * mi0-var-display.exp: Copy mi-var-display.exp.
+ * mi0-watch.exp: Copy mi-watch.exp.
+
+2001-05-11 Fernando Nasser <fnasser@redhat.com>
+
+ * mi-var-child.exp: Adjust for the fact that now (char *) can be
+ dereferenced.
+
+2001-03-06 Kevin Buettner <kevinb@redhat.com>
+
+ * mi-basics.exp, mi-break.exp, mi-disassemble.exp,
+ mi-eval.exp, mi-hack-cli.exp, mi-read-memory.exp, mi-regs.exp,
+ mi-return.exp, mi-simplerun.exp, mi-stack.exp, mi-stepi.exp,
+ mi-until.exp, mi-watch.exp: Update/correct copyright notices.
+
+2001-01-20 Mark Kettenis <kettenis@gnu.org>
+
+ * mi-support.exp (mi_gdb_start): Skip mi tests if -i flag is
+ recognized (i.e. if GDB was compiled with UI_OUT, but the mi
+ interpreter wasn't recognized (because it wasn't compiled in).
+
+Tue Apr 18 15:36:07 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * Makefile.in (clean mostlyclean): Do not delete $(MISCELLANEOUS).
+
+Tue Mar 14 15:54:57 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * basics.c: Add EMACS local variable pointing change-log at this
+ file.
+ * Makefile.in: Ditto
+
+2000-03-13 James Ingham <jingham@leda.cygnus.com>
+
+ * mi-var-block.exp: The error report from varobj_create changed
+ since I am now trapping parse_exp_1 errors. Change the tests to
+ match the new error message.
+ * mi-var-child.exp: Ditto.
+ * mi-var-cmd.exp: Ditto.
+
+2000-03-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-disassemble.exp: Don't assume numbers for the offset
+ values. They can be different depending on the architecture.
+
+ * mi-watch.exp (test_watchpoint_triggering): In same cases the
+ type can be 'hw wathcpoint' not just 'watchpoint'. Adjust for that.
+
+ * basics.c (callee4): Make the function return something,
+ otherwise the return value is undefined.
+
+2000-03-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-basics.exp: Comment out test for a still unimplemented operation.
+
+ * mi-disassemble.exp: Rewrite most of the tests to conform to new
+ disassemble interface.
+
+Sat Mar 4 13:55:08 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ From Fri 3 Mar 2000 Peter Schauer:
+ * mi-support.exp (mi_gdb_start): When GDB doesn't recongize -i=mi
+ option, assume no MI support present.
+
+2000-02-01 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-support.exp (mi_gdb_start): Update to recognize start up
+ message with 'UI_OUT' instead of 'HEADLESS'.
+
+2000-01-27 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-regs.exp (test_running_the_program): Add global var 'hex'.
+
+ * mi-stack.exp, mi-stepi.exp, mi-until.exp, mi-watch.exp,
+ mi-var-display.exp, mi-var-cmd.exp, mi-var-child.exp,
+ mi-var-block.exp: Update all stopped messages.
+
+2000-01-17 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-console.exp, mi-disassemble.exp, mi-eval.exp,
+ mi-read-memory.exp, mi-regs.exp, mi-return.exp, mi-simplerun.exp:
+ Update stopped messages, update copyright.
+
+ * mi-disassemble.exp: Update error messages output.
+
+ * mi-support.exp (proc mi_step): Make gdb do a 'step' command, not
+ a 'next'. Update stopped message.
+ (proc mi_next): Update stop message.
+ (proc mi_run_to_main): Update stopped message.
+ Update copyright.
+
+2000-01-11 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-simplerun.exp: Remove stack frames tests from here, to:
+
+ * mi-stack.exp: New file, tests for stack commands.
+
+ * mi-support.exp (mi_run_to_main, mi_next, mi_step) : Update to
+ include thread-id in stopped message.
+
+ * mi-regs.exp: Update break-insert output.
+
+ * (mi-console.exp, mi-disassemble.exp, mi-eval.exp,
+ mi-read-memory.exp, mi-regs.exp, mi-return.exp, mi-simplerun.exp,
+ mi-stepi.exp, mi-until.exp, mi-var-block.exp, mi-var-child.exp,
+ mi-var-cmd.exp, mi-var-display.exp, mi-watch.exp): Update stopped
+ message to include thread-id.
+
+Wed Dec 29 22:06:05 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-watch.exp, mi-var-display.exp, mi-var-cmd.exp,
+ mi-var-child.exp, mi-var-block.exp, mi-until.exp, mi-stepi.exp,
+ mi-simplerun.exp, mi-return.exp, mi-support.exp, mi-eval.exp,
+ mi-console.exp, mi-disassemble.exp, mi-break.exp: Update to
+ reflect extended output from -break-insert command.
+
+ * mi-break.exp (test_rbreak_creation_and_listing): XFAIL regexp
+ tests. -r flag broken by above.
+
+Sun Dec 19 19:28:13 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * cpp_variable.cc, cpp_variable.h, c_variable.c: Delete.
+
+Fri Dec 17 20:59:55 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-read-memory.exp: Test of ``-o <offset>'' now works.
+
+1999-12-16 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-var-cmd.exp: Fix 2 tests outputs.
+
+ * mi-var-child.exp: Add many more tests.
+
+ * mi-var-display.exp: Add many more tests.
+
+ * var-cmd.c: Change type of incr_a parameter to char.
+
+1999-12-15 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-var-block.exp: Set up xfails fro known problems.
+
+ * mi-var-display.exp: Set up printing of values of 'e' and 'anone'
+ as xfails.
+
+ * mi-var-child.exp: Fix typos.
+
+1999-12-15 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-var-child.exp: Space was missing before ``[10]''.
+
+Wed Dec 15 19:23:38 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-read-memory.exp: Add test for ``-o <offset>''. Update checks
+ and match next-row et.al.
+
+1999-12-14 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-var-display.exp : New file. Tests for format and type, with
+ unions, structs and enums.
+
+ * mi-var-cmd.exp: Add some var-assign tests.
+
+1999-12-14 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-var-cmd.exp, mi-var-block.exp, mi-var-child.exp: New files
+ some tests for -var* commands.
+
+ * var-cmd.c: New source file for var-* commands tests.
+ * gdb.mi/Makefile.in (PROGS): Add var-cmd.
+
+Mon Dec 13 18:06:09 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-break.exp: Fix quoting. Changed "srcfile.c":6 to
+ "\"srcfile.c\":6".
+ * mi-simplerun.exp: Fix quoting.
+
+Sat Dec 11 21:33:37 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-simplerun.exp (exec-finish): Fix return value was zero,
+ should have been three.
+
+ * mi-disassemble.exp: Reduce number of wild card matches in
+ * patterns. Remove all numeric constants.
+
+1999-12-09 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-eval.exp: New file. Some initial tests for
+ -data-evaluate-expression.
+
+1999-12-09 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * c_variable.c, cpp_variable.cc, cpp_variable.h: New files. Used
+ for testing "var" operations.
+ * Makefile.in: Add reference to the above files.
+
+1999-12-08 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-regs.exp: Fix test for format 'N' for
+ data-list-register-values.
+
+1999-12-07 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-disassemble.exp: Update expected output. Break test of
+ disassembly in mixed mode into 2 functions.
+
+ * mi-regs.exp: Initial register tests. Works only on sparc right
+ now.
+
+1999-12-02 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-stepi.exp: New file. Tests exec-step-instruction and
+ exec-next-instruction.
+ * mi-until.exp: New file. Tests exec-until.
+ * until.c: New file.
+ * mi-return.exp: New file. Tests exec-return.
+
+Thu Dec 2 09:38:23 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-hack-cli.exp: New test. Check the hacked up access to the
+ CLI.
+
+Wed Dec 1 16:47:40 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-basics.exp: Delete calls to mi_delete_breakpoints,
+ mi_gdb_reinitialize_dir and mi_gdb_load. This test is checking
+ that these can work.
+
+ * mi-support.exp (mi_step, mi_next, mi_run_to_main): New
+ procedures.
+
+ * mi-read-memory.exp, mi-read-memory.c: New files. Test
+ data-read-memory command.
+
+Tue Nov 30 23:54:16 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-support.exp: Don't start SID until after GDB has been started
+ and verified.
+
+Tue Nov 30 22:21:33 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-support.exp (mi_uncatched_gdb_exit): When SID, call sid_exit.
+ (mi_gdb_start): When SID, call sid_start.
+ (mi_gdb_start): Add MIFLAGS to spawn-GDB command. Check for
+ HEADLESS gdb. Return non-zero when GDB fails to start.
+ (mi_gdb_load): When SID or SIM, download program.
+ (mi_run_cmd): Don't do download here. Assume target supports the
+ 00-exec-run command.
+ (skip_mi_tests, setup_gdbmi, unset_gdbmi): Delete. Merged into
+ mi_gdb_start.
+
+ * mi-basics.exp, mi-break.exp, mi-console.exp, mi-disassemble.exp,
+ mi-simplerun.exp, mi-watch.exp: Update. Check status from
+ mi_gdb_start indicating that GDB started correctly.
+
+Tue Nov 30 15:22:08 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-support.exp (setup_gdbmi, unset_gdbmi): New
+ procedures. Setup/unset dejagnu for mi tests.
+ * mi-basics.exp, mi-console.exp, mi-simplerun.exp, mi-break.exp,
+ mi-disassemble.exp, mi-watch.exp: Update.
+
+1999-11-29 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-simplerun.exp (test_running_the_program): Remove XFAIL. The
+ output is fixed now.
+ (test_program_termination): Update output pattern.
+
+Tue Nov 30 00:19:10 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-console.c, mi-console.exp: New files. Test console output.
+
+Mon Nov 29 17:59:13 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-support.exp (mi_run_command): Check for exec-run command
+ failure due to MI not having an active target.
+ (mi_run_command): Check for and handle a builtin simulator target.
+ (mi_run_command): Don't check/handle for ``The program has been
+ started already'', not a valid MI response.
+
+ * mi-simplerun.exp (test_running_the_program): Update all patterns
+ to match async output.
+ (test_running_the_program): Mark ``step to callee4'' as XFAIL. MI
+ output contains {,reason="end-stepping-range"}+.
+
+ * mi-simplerun.exp: Limit the timeout for ``step to callee4'' to
+ 30 seconds.
+
+Mon Nov 29 17:30:00 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * mi-support.exp (skip_mi_tests): Print UNTESTED when MI interface
+ isn't available. Start/stop instead of assuming GDB is running.
+ (MIFLAGS): Define.
+ * mi-simplerun.exp, mi-disassemble.exp, mi-break.exp,
+ mi-basics.exp, mi-watch.exp: Update.
+
+1999-11-26 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * mi-simplerun.exp: Move break-insert {-t, -r} from here.
+ * mi-break.exp: To here. New file.
+ * mi-watch.exp: New file. Tests for watchpoints.
+
+Wed Nov 24 17:42:07 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.mi/ChangeLog-mi: MI entries moved to here.
+
+Wed Nov 24 17:31:04 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * gdb.mi/mi-basics.exp, gdb.mi/mi-disassemble.exp,
+ gdb.mi/mi-simplerun.exp: Print warning message when test isn't
+ run.
+
+1999-11-23 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.mi/mi-simplerun.exp: Update output of break-list to account for
+ "times" field.
+
+1999-11-05 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.mi/mi-simplerun.exp: Add tests for temporary breakpoints
+ and bp based on regular expressions.
+ * gdb.mi/mi-disassemble.exp: Fix typo.
+
+1999-11-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.mi/mi-disassemble.exp: Update output of execution commands
+ to reflect new 'reason' field.
+ * gdb.mi/mi-simplerun.exp: Ditto.
+
+1999-10-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.mi/mi-simplerun.exp: Add more stack-list-frames tests.
+
+ * gdb.mi/mi-disassemble.exp: Update 'run to main' output.
+
+ * gdb.mi/mi-simplerun.exp: Update execution commands
+ output. Update backtrace output.
+
+1999-10-18 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.mi/mi-disassemble.exp: Add new tests for the new
+ disassembly command parameter, number of lines.
+
+Mon Oct 11 13:57:21 1999 Andrew Cagney <cagney@amy.cygnus.com>
+
+ * lib/mi-support.exp: Break complicated gdb_expect containing
+ exp_continue into a while within an expect. Don't attempt a start
+ more than three times. Check return value from gdb_load.
+
+1999-10-06 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
+
+ * gdb.mi/mi-disassemble.exp: New file.
+
+Wed Oct 6 12:05:58 1999 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * lib/mi-support.exp (mi_run_cmd): Give up after two restart
+ attempts.
+
+1999-09290 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.mi/mi-basics.exp: Update to current syntax and output formats.
+ * gdb.mi/mi-simplerun.exp: Ditto.
+ * lib/mi-support.exp (mi_delete_breakpoints): Ditto.
+
+1999-06-30 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.mi/basics.c (main): Fix return code. Add a print "Hello,
+ World".
+ * gdb.mi/mi-basics.exp: Fix message texts and numbering.
+ * gdb.mi/mi-simplerun.exp: Ditto. Also, add new tests and improve
+ some patterns.
+
+1999-06-30 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * lib/mi-support.exp (mi_gdb_reinitialize_dir): Remove query as an
+ acceptable response to the environment-dir command.
+
+1999-06-30 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * lib/mi-support.exp (mi_delete_breakpoints): Remove references to
+ gdb-cli.
+ (mi_run_cmd): Ditto.
+
+1999-06-25 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * lib/mi-support.exp (skip_mi_tests): Use gdb-version to check for
+ headless output format.
+
+1999-06-24 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.mi/mi-simplerun.exp (test_controlled_execution): Add global
+ spec for hex.
+
+1999-06-24 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * lib/mi-support.exp (mi_run_cmd): Fix pattern and add a timeout
+ clause.
+
+1999-06-24 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * lib/mi-support.exp: Use mi_gdb_prompt instead of a modified
+ gdb_prompt. Remove uneeded loading of libgloss.
+ (mi_gdb_exit): Remove prompt argument.
+ (mi_uncatched_gdb_exit): Ditto.
+ (mi_run_cmd): New proc. MI version of gdb_run.
+ (skip_mi_tests): New proc. Check if gdb is capable of producing
+ headless formatted output.
+ * gdb.mi/mi-basics.exp: Use mi_gdb_prompt instead of a modified
+ gdb_prompt. Eliminate parameter to mi_gdb_exit (as a result of
+ the above). Test for skip_mi_tests before running.
+ Note: The above changes are interelated (need each other).
+ * gdb.mi/mi-simplerun.exp: Same changes as for mi-basics.exe
+ above.
+ (test_breakpoint_creation_and_listing): Remove insertion of
+ breakpoint at callee1 (and renumber tokens). Add tests for
+ break-list, break-disable and break-info.
+ (test_running_the_program): Use mi_run_cmd so it can run on remote
+ targets.
+ (test_controlled_execution): Fix broken test.
+ (test_program_termination): Test implemented.
+ * gdb.mi/basic.c (main): Small change to allow for testing of both
+ exec-next and exec-step operations.
+
+1999-06-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * lib/mi-support.exp (mi_gdb_test): New proc. MI version of gdb_test.
+ * gdb.mi/mi-basics.exp: Use the above instead of gdb_test.
+ * gdb.mi/mi-simplerun.exp: Ditto.
+
+1999-06-22 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.mi/mi-simplerun.exp: New file. Tests simple debugging tasks.
+ * gdb.mi/mi-basics.exp: Remove tests moved to above new file.
+ * lib/mi-support.exp: New file. Support procedures for mi tests.
+
+1999-06-08 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.mi/mi-basics.exp: Skip all tests if the MI interpreter is
+ not active.
+
+1999-06-03 Fernando Nasser <fnasser@totem.to.cygnus.com>
+
+ * gdb.mi: New directory.
+ * configure.in: Configure it.
+ * configure: Regenerate.
+ * gdb.mi/{Makefile.in,configure.in,configure}: New files.
+ * gdb.mi/{mi-basics.exp,basics.c,testcmds}: New files.
+
+
+Local Variables:
+mode: indented-text
+left-margin: 8
+fill-column: 74
+version-control: never
+End:
diff --git a/gdb/testsuite/gdb.mi/Makefile.in b/gdb/testsuite/gdb.mi/Makefile.in
new file mode 100644
index 00000000000..67a0f5d39b5
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/Makefile.in
@@ -0,0 +1,24 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+PROGS = basics c_variable cpp_variable var-cmd
+
+MISCELLANEOUS = testcmds
+
+all:
+ @echo "Nothing to be done for all..."
+
+#### host, target, and site specific Makefile frags come in here.
+
+clean mostlyclean:
+ -rm -f *.ci *.o $(OBJS) $(PROGS) *~ core
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+
+Makefile: $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
+
+# Local variables:
+# change-log-default-name: "ChangeLog-mi"
+# End:
diff --git a/gdb/testsuite/gdb.mi/basics.c b/gdb/testsuite/gdb.mi/basics.c
new file mode 100644
index 00000000000..9a61aa2dc39
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/basics.c
@@ -0,0 +1,45 @@
+/*
+ * This simple program that passes different types of arguments
+ * on function calls. Useful to test printing frames, stepping, etc.
+ */
+
+int callee4 (void)
+{
+ int A=1;
+ int B=2;
+ int C;
+
+ C = A + B;
+ return 0;
+}
+callee3 (char *strarg)
+{
+ callee4 ();
+}
+
+callee2 (int intarg, char *strarg)
+{
+ callee3 (strarg);
+}
+
+callee1 (int intarg, char *strarg, double fltarg)
+{
+ callee2 (intarg, strarg);
+}
+
+main ()
+{
+ callee1 (2, "A string argument.", 3.5);
+ callee1 (2, "A string argument.", 3.5);
+
+ printf ("Hello, World!");
+
+ return 0;
+}
+
+/*
+Local variables:
+change-log-default-name: "ChangeLog-mi"
+End:
+*/
+
diff --git a/gdb/testsuite/gdb.mi/configure b/gdb/testsuite/gdb.mi/configure
new file mode 100755
index 00000000000..fd5d1467f1a
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/configure
@@ -0,0 +1,902 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.13"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=mi-basics.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:575: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:596: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:614: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.mi/configure.in b/gdb/testsuite/gdb.mi/configure.in
new file mode 100644
index 00000000000..94278273f13
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(mi-basics.exp)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.mi/mi-basics.exp b/gdb/testsuite/gdb.mi/mi-basics.exp
new file mode 100644
index 00000000000..4913d8f8b35
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-basics.exp
@@ -0,0 +1,174 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# test basic Machine interface (MI) operations
+#
+# Verify that, using the MI, we can load a program and do
+# other basic things that are used by all test files through mi_gdb_exit,
+# mi_gdb_start, mi_delete_breakpoints, mi_gdb_reinitialize_dir and
+# mi_gdb_load, so we can safely use those.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but the command syntax and correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# In this file we want to test if the operations needed by the following
+# procedures work, so it makes no sense using them here.
+
+# mi_delete_breakpoints
+# mi_gdb_reinitialize_dir $srcdir/$subdir
+# mi_gdb_load ${binfile}
+
+# Test if the MI interpreter has been configured
+
+proc test_mi_interpreter_selection {} {
+ global mi_gdb_prompt
+ global gdb_prompt
+
+ # All this test expects is to get the prompt back
+ # with no syntax error message
+ send_gdb "-gdb-version\n"
+ gdb_expect {
+ -re "GNU gdb .*\r\n$mi_gdb_prompt$" \
+ { pass "acceptance of MI operations"
+ return 1}
+ -re ".*\r\n$mi_gdb_prompt$" \
+ { fail "acceptance of MI operations"
+ note "Skipping all other MI tests." }
+ -re "Undefined command.*$gdb_prompt $" \
+ { fail "acceptance of MI operations"
+ note "Skipping all other MI tests." }
+ -re ".*$gdb_prompt $" \
+ { fail "acceptance of MI operations"
+ note "Skipping all other MI tests." }
+ timeout { fail "acceptance of MI operations (timeout)"
+ note "Skipping all other MI tests." }
+ }
+ return 0
+}
+
+proc test_exec_and_symbol_mi_operatons {} {
+ global mi_gdb_prompt
+ global binfile
+
+ # Load symbols and specify executable on a single operation
+ # Tests:
+ # -file-exec-and-symbols
+
+ # Can't use mi_gdb_test as if this doesn't work,
+ # we must give up on the whole test file
+ send_gdb "-file-exec-and-symbols ${binfile}\n"
+ gdb_expect {
+ -re "\[\r\n\]*\\\^done\r\n$mi_gdb_prompt$" \
+ { pass "file-exec-and-symbols operation" }
+ timeout { fail "file-exec-and-symbols operation (timeout)"
+ note "Skipping all other MI tests."
+ return 0}
+ }
+
+ # The following is not used by mi-support.exp, but we test here so
+ # we get done with loading a program basics.
+
+ # Do it again, but now load symbols and specify executable with
+ # two separate operations
+ # Tests:
+ # -file-clear
+ # -file-exec-file
+ # -file-symbol-file
+
+ # FIXME: file-clear is not implemented yet.
+# mi_gdb_test "-file-clear" \
+# "\\\^done" \
+# "file-clear operation"
+
+ mi_gdb_test "-file-exec-file ${binfile}" \
+ "\\\^done" \
+ "file-exec-file operation"
+
+ mi_gdb_test "-file-symbol-file ${binfile}" \
+ "\\\^done" \
+ "file-symbol-file operation"
+
+ # FIXME: if we cannot load we have to skip all other tests.
+}
+
+proc test_breakpoints_deletion {} {
+ global mi_gdb_prompt
+ global srcfile
+
+ # Clear all breakpoints and list to confirm
+ # Tests:
+ # -break-delete (all)
+ # -break-list
+
+ # The all parameter is actually no parameter.
+ mi_gdb_test "200-break-delete" \
+ "\\\^done" \
+ "break-delete (all) operation"
+
+ mi_gdb_test "201-break-list" \
+ ".*\\\^done,BreakpointTable=\\\{.*,body=\\\[\\\]\\\}" \
+ "all breakpoints removed"
+}
+
+proc test_dir_specification {} {
+ global mi_gdb_prompt
+ global srcdir
+ global subdir
+
+ # Clear the search directories, then specify one to be searched
+ # Tests:
+ # -environment-directory
+ # -environment-directory arg
+
+#exp_internal 1
+ mi_gdb_test "202-environment-directory" \
+ "\\\^done" \
+ "environment-directory operation"
+
+ mi_gdb_test "203-environment-directory ${srcdir}/${subdir}" \
+ "\\\^done" \
+ "environment-directory arg operation"
+#exp_internal 0
+}
+
+if [test_mi_interpreter_selection] {
+ test_exec_and_symbol_mi_operatons
+ test_breakpoints_deletion
+ test_dir_specification
+}
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp
new file mode 100644
index 00000000000..5cbe4e40d2e
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-break.exp
@@ -0,0 +1,138 @@
+# Copyright 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_tbreak_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert -t main
+ # -break-insert -t basics.c:callee2
+ # -break-insert -t basics.c:15
+ # -break-insert -t srcfile:6
+ # -break-list
+
+ mi_gdb_test "222-break-insert -t main" \
+ "222\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert -t operation"
+
+ mi_gdb_test "333-break-insert -t basics.c:callee2" \
+ "333\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \
+ "insert temp breakpoint at basics.c:callee2"
+
+ mi_gdb_test "444-break-insert -t basics.c:15" \
+ "444\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \
+ "insert temp breakpoint at basics.c:15 (callee3)"
+
+ # Getting the quoting right is tricky. That is "\"<file>\":6"
+ mi_gdb_test "555-break-insert -t \"\\\"${srcfile}\\\":6\"" \
+ "555\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \
+ "insert temp breakpoint at \"<fullfilename>\":6 (callee4)"
+
+ mi_gdb_test "666-break-list" \
+ "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}.*\\\]\}" \
+ "list of breakpoints"
+
+ mi_gdb_test "777-break-delete" \
+ "777\\^done" \
+ "delete temp breakpoints"
+}
+
+proc test_rbreak_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert -r main
+ # -break-insert -r callee2
+ # -break-insert -r callee
+ # -break-insert -r .*llee
+ # -break-list
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "122-break-insert -r main" \
+ "122\\^done,bkpt=\{number=\"5\",addr=\"$hex\",file=\".*basics.c\",line=\"32\"\}" \
+ "break-insert -r operation"
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "133-break-insert -r callee2" \
+ "133\\^done,bkpt=\{number=\"6\",addr=\"$hex\",file=\".*basics.c\",line=\"22\"\}" \
+ "insert breakpoint with regexp callee2"
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "144-break-insert -r callee" \
+ "144\\^done,bkpt=\{number=\"7\",addr=\"$hex\",file=\".*basics.c\",line=\"27\"\},bkpt=\{number=\"8\",addr=\"$hex\",file=\".*basics.c\",line=\"22\"\},bkpt=\{number=\"9\",addr=\"$hex\",file=\".*basics.c\",line=\"17\"\},bkpt=\{number=\"10\",addr=\"$hex\",file=\".*basics.c\",line=\"8\"\}" \
+ "insert breakpoint with regexp callee"
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "155-break-insert -r \.\*llee" \
+ "155\\^done,bkpt=\{number=\"11\",addr=\"$hex\",file=\".*basics.c\",line=\"27\"\},bkpt=\{number=\"12\",addr=\"$hex\",file=\".*basics.c\",line=\"22\"\},bkpt=\{number=\"13\",addr=\"$hex\",file=\".*basics.c\",line=\"17\"\},bkpt=\{number=\"14\",addr=\"$hex\",file=\".*basics.c\",line=\"8\"\}" \
+ "insert breakpoint with regexp .*llee"
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "166-break-list" \
+ "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\\\]\}" \
+ "list of breakpoints"
+
+ mi_gdb_test "177-break-delete" \
+ "177\\^done" \
+ "delete temp breakpoints"
+}
+
+test_tbreak_creation_and_listing
+test_rbreak_creation_and_listing
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-console.c b/gdb/testsuite/gdb.mi/mi-console.c
new file mode 100644
index 00000000000..f0f2016efdf
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-console.c
@@ -0,0 +1,20 @@
+void
+hello ()
+{
+ char *hello = "Hello \\\"!\r\n";
+ int i;
+ for (i = 0; hello[i]; i++)
+ write (1, hello + i, 1);
+}
+
+int
+main ()
+{
+ hello ();
+}
+/*
+Local variables:
+change-log-default-name: "ChangeLog-mi"
+End:
+*/
+
diff --git a/gdb/testsuite/gdb.mi/mi-console.exp b/gdb/testsuite/gdb.mi/mi-console.exp
new file mode 100644
index 00000000000..f6a249c77df
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-console.exp
@@ -0,0 +1,112 @@
+# Copyright 1999, 2000, 2001 Cygnus Solutions.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+# This test only works when talking to a target that routes its output
+# through GDB. Check that we're either talking to a simulator or a
+# remote target.
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "mi-console"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+# Halt in main
+mi_gdb_test "200-break-insert main" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*mi-console.c\",line=\"13\",times=\"0\"\}" \
+ "break-insert operation"
+mi_run_cmd
+gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*mi-console.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "run to main (2)"
+ }
+ timeout {
+ fail "run to main (timeout)"
+ }
+}
+
+# Next over the hello() call which will produce lots of output
+send_gdb "47-exec-next\n"
+gdb_expect {
+ -re "47\\^running\r\n$mi_gdb_prompt" {
+ pass "Started step over hello"
+ }
+ timeout {
+ fail "Started step over hello (timeout)"
+ }
+}
+
+gdb_expect {
+ -re "@\"H\"\r\n.*@\"e\"\r\n.*@\"l\"\r\n.*@\"l\"\r\n.*@\"o\"\r\n.*@\" \"\r\n.*@\"\\\\\\\\\"\r\n.*@\"\\\\\"\"\r\n.*@\"!\"\r\n.*@\"\\\\r\"\r\n.*@\"\\\\n\"\r\n" {
+ pass "Hello message"
+ }
+ -re "Hello" {
+
+ # Probably a native system where GDB doesn't have direct
+ # control over the inferior console.
+ # For this to work, GDB would need to run the inferior process
+ # under a PTY and then use the even-loops ability to wait on
+ # multiple event sources to channel the output back through the
+ # MI.
+
+ fail "Hello message (known bug)"
+ }
+ timeout {
+ fail "Hello message (timeout)"
+ }
+}
+
+gdb_expect {
+ -re "47\\*stopped.*$mi_gdb_prompt$" {
+ pass "Finished step over hello"
+ }
+ timeout {
+ fail "Finished step over hello (timeout)"
+ }
+}
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-disassemble.exp b/gdb/testsuite/gdb.mi/mi-disassemble.exp
new file mode 100644
index 00000000000..6f33d67ac6e
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-disassemble.exp
@@ -0,0 +1,224 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test Machine interface (MI) operations for disassembly.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_breakpoints_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert
+ # -break-list
+ # -break-disable
+ # -break-info
+
+ mi_gdb_test "200-break-insert main" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_gdb_test "204-break-list" \
+ "204\\^done,BreakpointTable=\{.*,body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}\\\]\}" \
+ "list of breakpoints"
+}
+
+proc test_running_the_program {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Run the program without args
+ # Tests:
+ # -exec-run
+
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ # FIXME: We are accepting a duplicate file and line info temporarely.
+ # The following is equivalent to a send_gdb "000-exec-run\n"
+ mi_run_cmd
+ # The running part has been checked already by mi_run_cmd
+ gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to main (2)"}
+ timeout {fail "run to main (timeout 2)"}
+ }
+}
+
+proc test_disassembly_only {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+
+ # Test disassembly more only for the current function.
+ # Tests:
+ # -data-disassemble -s $pc -e "$pc+8" -- 0
+ # -data-disassembly -f basics.c -l 32 -- 0
+
+ mi_gdb_test "print/x \$pc" "" ""
+ mi_gdb_test "111-data-disassemble -s \$pc -e \"\$pc + 12\" -- 0" \
+ "111\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\]" \
+ "data-disassemble from pc to pc+12 assembly only"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -- 0" \
+ "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \
+ "data-disassemble file & line, assembly only"
+}
+
+proc test_disassembly_lines_limit {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+
+ # Test disassembly more only for the current function.
+ # Tests:
+ # -data-disassembly -f basics.c -l 32 -n 20 -- 0
+ # -data-disassembly -f basics.c -l 32 -n 0 -- 0
+ # -data-disassembly -f basics.c -l 32 -n 50 -- 0
+
+ mi_gdb_test "print/x \$pc" "" ""
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 0" \
+ "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \
+ "data-disassemble file, line, number assembly only"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 0" \
+ "222\\^done,asm_insns=\\\[\\\]" \
+ "data-disassemble file, line, number (zero lines) assembly only"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 0" \
+ "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \
+ "data-disassemble file, line, number (more than main lines) assembly only"
+}
+
+
+proc test_disassembly_mixed {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+
+ # Test disassembly more only for the current function.
+ # Tests:
+ # -data-disassembly -f basics.c -l 21 -- 1
+ # -data-disassembly -s $pc -e "$pc+8" -- 1
+
+ mi_gdb_test "002-data-disassemble -f basics.c -l 21 -- 1" \
+ "002\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"21\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",inst=\".*\"\}.*\\\]\}.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\\\]" \
+ "data-disassemble file, line assembly mixed"
+
+ #
+ # In mixed mode, the lowest level of granularity is the source line.
+ # So we are going to get the disassembly for the source line at
+ # which we are now, even if we have specified that the range is only 2 insns.
+ #
+ mi_gdb_test "003-data-disassemble -s \$pc -e \"\$pc+4\" -- 1" \
+ "003\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\\\]" \
+ "data-disassemble range assembly mixed"
+}
+
+proc test_disassembly_mixed_lines_limit {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+
+ # Test disassembly more only for the current function.
+ # Tests:
+ # -data-disassembly -f basics.c -l 32 -n 20 -- 1
+ # -data-disassembly -f basics.c -l 32 -n 0 -- 1
+ # -data-disassembly -f basics.c -l 32 -n 50 -- 1
+
+ mi_gdb_test "print/x \$pc" "" ""
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 1" \
+ "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\]" \
+ "data-disassemble file, line, number assembly mixed"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 1" \
+ "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"31\",file=\".*basics.c\",line_asm_insn=\\\[\\\]\}\\\]" \
+ "data-disassemble file, line, number (zero lines) assembly mixed"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 1" \
+ "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\}.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\]" \
+ "data-disassemble file, line, number (more than main lines) assembly mixed"
+}
+
+proc test_disassembly_bogus_args {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Test that bogus input to disassembly command is rejected.
+ # Tests:
+ # -data-disassembly -f foo -l abc -n 0 -- 0
+ # -data-disassembly -s foo -e bar -- 0
+ # -data-disassembly -s $pc -f basics.c -- 0
+ # -data-disassembly -f basics.c -l 32 -- 9
+
+ mi_gdb_test "123-data-disassemble -f foo -l abc -n 0 -- 0" \
+ ".*123\\^error,msg=\"mi_cmd_disassemble: Invalid filename.\"" \
+ "data-disassemble bogus filename"
+
+ mi_gdb_test "321-data-disassemble -s foo -e bar -- 0" \
+ "321\\^error,msg=\"No symbol \\\\\"foo\\\\\" in current context.\"" \
+ "data-disassemble bogus address"
+
+ mi_gdb_test "456-data-disassemble -s \$pc -f basics.c -- 0" \
+ "456\\^error,msg=\"mi_cmd_disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. | .-s startaddr -e endaddr.\\) .--. mixed_mode.\"" \
+ "data-disassemble mix different args"
+
+ mi_gdb_test "789-data-disassemble -f basics.c -l 32 -- 9" \
+ "789\\^error,msg=\"mi_cmd_disassemble: Mixed_mode argument must be 0 or 1.\"" \
+ "data-disassemble wrong mode arg"
+
+}
+
+test_breakpoints_creation_and_listing
+test_running_the_program
+test_disassembly_only
+test_disassembly_mixed
+test_disassembly_bogus_args
+test_disassembly_lines_limit
+test_disassembly_mixed_lines_limit
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-eval.exp b/gdb/testsuite/gdb.mi/mi-eval.exp
new file mode 100644
index 00000000000..2c0141069ad
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-eval.exp
@@ -0,0 +1,101 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify -data-evaluate-expression. There are really minimal tests.
+
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_running_the_program {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Run the program without args, then specify srgs and rerun the program
+ # Tests:
+ # -exec-run
+
+ mi_gdb_test "300-break-insert callee4" \
+ "300\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
+ "insert breakpoint at callee4"
+
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ # The following is equivalent to a send_gdb "000-exec-run\n"
+ mi_run_cmd
+ # The running part has been checked already by mi_run_cmd
+ gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \
+ { pass "run to callee4" }
+ -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"}
+ timeout {fail "run to callee4 (timeout 2)"}
+ }
+
+ send_gdb "101-exec-next\n"
+ gdb_expect {
+ -re "101\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"9\"\}\r\n$mi_gdb_prompt$" \
+ { pass "next in callee4" }
+ -re ".*$mi_gdb_prompt$" {fail "next in callee4 (2)"}
+ timeout {fail "next in callee4 (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "next in callee4 (1)"}
+ timeout {fail "next in callee4 (timeout 1)"}
+ }
+
+}
+
+test_running_the_program
+
+mi_gdb_test "211-data-evaluate-expression A" "211\\^done,value=\"1\"" "eval A"
+
+mi_gdb_test "311-data-evaluate-expression &A" "311\\^done,value=\"$hex\"" "eval &A"
+
+mi_gdb_test "411-data-evaluate-expression A+3" "411\\^done,value=\"4\"" "eval A+3"
+
+mi_gdb_test "511-data-evaluate-expression \"A + 3\"" "511\\^done,value=\"4\"" "eval A + 3"
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-hack-cli.exp b/gdb/testsuite/gdb.mi/mi-hack-cli.exp
new file mode 100644
index 00000000000..a0489431a2e
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-hack-cli.exp
@@ -0,0 +1,40 @@
+# Copyright 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+
+# Some basic checks for the CLI.
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+mi_gdb_test "show architecture" \
+ "&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n\\^done" \
+ "show architecture"
+
+mi_gdb_test "47show architecture" \
+ "&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n47\\^done" \
+ "47show architecture"
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-read-memory.c b/gdb/testsuite/gdb.mi/mi-read-memory.c
new file mode 100644
index 00000000000..7a87c641856
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-read-memory.c
@@ -0,0 +1,20 @@
+static char bytes[256];
+
+static short shorts[256];
+
+static void
+initialize (void)
+{
+ int i;
+ for (i = 0; i < sizeof (bytes); i++)
+ {
+ bytes[i] = i;
+ shorts[i] = i * 2;
+ }
+}
+
+int
+main ()
+{
+ initialize ();
+}
diff --git a/gdb/testsuite/gdb.mi/mi-read-memory.exp b/gdb/testsuite/gdb.mi/mi-read-memory.exp
new file mode 100644
index 00000000000..b4f0c35955f
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-read-memory.exp
@@ -0,0 +1,100 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# test basic Machine interface (MI) operations
+#
+# Verify that, using the MI, we can load a program and do
+# other basic things that are used by all test files through mi_gdb_exit,
+# mi_gdb_start, mi_delete_breakpoints, mi_gdb_reinitialize_dir and
+# mi_gdb_load, so we can safely use those.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but the command syntax and correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "mi-read-memory"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+mi_run_to_main
+
+#mi_next "do initialization"
+send_gdb "101-exec-next\n"
+gdb_expect {
+ -re "101\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*mi-read-memory.c\",line=\"20\"\}.*$mi_gdb_prompt$" \
+ { pass "do initialization" }
+ -re ".*$mi_gdb_prompt$" {fail "do initialization (2)"}
+ timeout {fail "do initialization (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "do initialization (1)"}
+ timeout {fail "do initialization (timeout 1)"}
+}
+
+mi_gdb_test "1-data-read-memory" \
+ "1\\^error,msg=\".*\"" \
+ "no arguments"
+
+
+mi_gdb_test "2-data-read-memory bytes x 1 3 2" \
+ "2\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x00\",\"0x01\"\\\]},{addr=\"$hex\",data=\\\[\"0x02\",\"0x03\"\\\]},{addr=\"$hex\",data=\\\[\"0x04\",\"0x05\"\\\]}\\\]" \
+ "3x2, one byte"
+
+
+mi_gdb_test "9-data-read-memory -o -6 -- -0+bytes+6 x 1 3 2" \
+ "9\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x00\",\"0x01\"\\\]},{addr=\"$hex\",data=\\\[\"0x02\",\"0x03\"\\\]},{addr=\"$hex\",data=\\\[\"0x04\",\"0x05\"\\\]}\\\]" \
+ "3x2, one byte offset by -6"
+
+
+mi_gdb_test "3-data-read-memory \"(shorts + 128)\" x 2 1 2" \
+ "3\\^done,addr=\"$hex\",nr-bytes=\"4\",total-bytes=\"4\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x0100\",\"0x0102\"\\\]}\\\]" \
+ "expression in quotes"
+
+
+mi_gdb_test "4-data-read-memory bytes+16 x 1 8 4 x" \
+ "4\\^done,addr=\"$hex\",nr-bytes=\"32\",total-bytes=\"32\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x10\",\"0x11\",\"0x12\",\"0x13\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x14\",\"0x15\",\"0x16\",\"0x17\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x18\",\"0x19\",\"0x1a\",\"0x1b\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x1c\",\"0x1d\",\"0x1e\",\"0x1f\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x20\",\"0x21\",\"0x22\",\"0x23\"\\\],ascii=\" !\\\\\"#\"},{addr=\"$hex\",data=\\\[\"0x24\",\"0x25\",\"0x26\",\"0x27\"\\\],ascii=\"\\$%&'\"},{addr=\"$hex\",data=\\\[\"0x28\",\"0x29\",\"0x2a\",\"0x2b\"\\\],ascii=\"().+\"},{addr=\"$hex\",data=\\\[\"0x2c\",\"0x2d\",\"0x2e\",\"0x2f\"\\\],ascii=\",-\./\"}\\\]" \
+ "ascii and data"
+
+
+mi_gdb_test "5-data-read-memory shorts+64 d 2 1 1" \
+ "5\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"128\"\\\]}\\\]" \
+ "decimal"
+
+mi_gdb_test "6-data-read-memory shorts+64 o 2 1 1" \
+ "6\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0200\"\\\]}\\\]" \
+ "octal"
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-regs.exp b/gdb/testsuite/gdb.mi/mi-regs.exp
new file mode 100644
index 00000000000..c427677a41b
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-regs.exp
@@ -0,0 +1,175 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and look at registers.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_breakpoints_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert
+ # -break-list
+ # -break-disable
+ # -break-info
+
+ mi_gdb_test "200-break-insert main" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_gdb_test "204-break-list" \
+ "204\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}\\\]\}" \
+ "list of breakpoints"
+}
+
+proc test_running_the_program {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Run the program without args
+ # Tests:
+ # -exec-run
+
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ # FIXME: We are accepting a duplicate file and line info temporarely.
+ # The following is equivalent to a send_gdb "000-exec-run\n"
+ mi_run_cmd
+ # The running part has been checked already by mi_run_cmd
+ gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to main (2)"}
+ timeout {fail "run to main (timeout 2)"}
+ }
+}
+
+proc sparc_register_tests_no_exec { } {
+ # Test the generic IDT chip.
+ mi_gdb_test "111-data-list-register-values" \
+ ".*111\\^error,msg=\"mi_cmd_data_list_register_values: Usage: -data-list-register-values <format> \\\[<regnum1>...<regnumN>\\\]\"" \
+ "wrong arguments"
+
+ mi_gdb_test "111-data-list-register-values x" \
+ ".*111\\^error,msg=\"mi_cmd_data_list_register_values: No registers\.\"" \
+ "no executable"
+}
+
+# These tests exercise IDT-specific MIPS registers for several
+# different processor models.
+
+# This should detect the actual processor in use and change
+# the expected results appropriately. FIXME
+
+proc sparc_register_tests { } {
+ global hex
+ global decimal
+ set octal "\[0-7\]+"
+ set binary "\[0-1\]+"
+ set float "\\-?((\[0-9\]+(\\.\[0-9\]+)?(e\[-+\]\[0-9\]+)?)|(nan\\($hex\\)))"
+ set float2 "\\-?\[0-9\]+"
+
+ mi_gdb_test "111-data-list-register-names" \
+ "111\\^done,register-names=\\\[\"g0\",\"g1\",\"g2\",\"g3\",\"g4\",\"g5\",\"g6\",\"g7\",\"o0\",\"o1\",\"o2\",\"o3\",\"o4\",\"o5\",\"sp\",\"o7\",\"l0\",\"l1\",\"l2\",\"l3\",\"l4\",\"l5\",\"l6\",\"l7\",\"i0\",\"i1\",\"i2\",\"i3\",\"i4\",\"i5\",\"fp\",\"i7\",\"f0\",\"f1\",\"f2\",\"f3\",\"f4\",\"f5\",\"f6\",\"f7\",\"f8\",\"f9\",\"f10\",\"f11\",\"f12\",\"f13\",\"f14\",\"f15\",\"f16\",\"f17\",\"f18\",\"f19\",\"f20\",\"f21\",\"f22\",\"f23\",\"f24\",\"f25\",\"f26\",\"f27\",\"f28\",\"f29\",\"f30\",\"f31\",\"y\",\"psr\",\"wim\",\"tbr\",\"pc\",\"npc\",\"fpsr\",\"cpsr\"\\\]" \
+ "list register names"
+
+ mi_gdb_test "222-data-list-register-values x" \
+ "222\\^done,register-values=\\\[\{number=\"0\",value=\"$hex\"\}.*\{number=\"71\",value=\"$hex\"\}\\\]" \
+ "register values x"
+
+ mi_gdb_test "333-data-list-register-values f" \
+ "333\\^done,register-values=\\\[\{number=\"0\",value=\"$float\"\},\{number=\"1\",value=\"$float\"\},.*\{number=\"71\",value=\"$float\"\}\\\]" \
+ "register values f"
+
+ mi_gdb_test "444-data-list-register-values d" \
+ "444\\^done,register-values=\\\[\{number=\"0\",value=\"$decimal\"\}.*\{number=\"71\",value=\"$decimal\"\}\\\]" \
+ "register values d"
+
+ mi_gdb_test "555-data-list-register-values o" \
+ "555\\^done,register-values=\\\[\{number=\"0\",value=\"$octal\"\}.*\{number=\"71\",value=\"$octal\"\}\\\]" \
+ "register values o"
+
+ mi_gdb_test "666-data-list-register-values t" \
+ "666\\^done,register-values=\\\[\{number=\"0\",value=\"$binary\"\}.*\{number=\"71\",value=\"$binary\"\}\\\]" \
+ "register values t"
+
+ # On the sparc, registers 0-31 are int, 32-63 float, 64-71 int
+
+ mi_gdb_test "777-data-list-register-values N" \
+ "777\\^done,register-values=\\\[\{number=\"0\",value=\"$decimal\"\}.*\{number=\"31\",value=\"$decimal\"\},\{number=\"32\",value=\"$float\"\}.*\{number=\"63\",value=\"$float\"\},\{number=\"64\",value=\"$decimal\"\}.*\{number=\"71\",value=\"$decimal\"\}\\\]" \
+ "register values N"
+
+ mi_gdb_test "888-data-list-register-values r" \
+ "888\\^done,register-values=\\\[\{number=\"0\",value=\"$hex\"\}.*\{number=\"71\",value=\"$hex\"\}\\\]" \
+ "register values r"
+
+ mi_gdb_test "999-data-list-register-names 68 69 70 71" \
+ "999\\^done,register-names=\\\[\"pc\",\"npc\",\"fpsr\",\"cpsr\"\\\]" \
+ "list names of some regs"
+
+ mi_gdb_test "001-data-list-register-values x 68 69 70 71" \
+ "001\\^done,register-values=\\\[\{number=\"68\",value=\"$hex\"\},\{number=\"69\",value=\"$hex\"\},\{number=\"70\",value=\"$hex\"\},\{number=\"71\",value=\"$hex\"\}\\\]" \
+ "list values of some regs"
+
+ mi_gdb_test "002-data-list-changed-registers" \
+ "002\\^done,changed-registers=\\\[(\"${decimal}\"(,\"${decimal}\")*)?\\\]" \
+ "list changed registers"
+}
+
+if [istarget "sparc-*-*"] then {
+ sparc_register_tests_no_exec
+ test_breakpoints_creation_and_listing
+ test_running_the_program
+ sparc_register_tests
+} else {
+ verbose "mi-regs.exp tests ignored for this target"
+}
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-return.exp b/gdb/testsuite/gdb.mi/mi-return.exp
new file mode 100644
index 00000000000..318fa8e9d45
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-return.exp
@@ -0,0 +1,94 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test Machine interface (MI) operations
+# Verify that, using the MI, we can run a simple program and perform
+# exec-return.
+
+# The goal is not to
+# test gdb functionality, which is done by other tests, but to verify
+# the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_running_to_callee4 {} {
+ global mi_gdb_prompt
+ global hex
+
+ mi_gdb_test "200-break-insert callee4" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_run_cmd
+
+ gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to callee4"
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "run to callee4 (2)"
+ }
+ timeout {
+ fail "run to callee4 (timeout)"
+ }
+ }
+
+ mi_gdb_test "205-break-delete" \
+ "205\\^done.*" \
+ "delete all breakpoints"
+
+}
+
+proc test_return_simple {} {
+ global mi_gdb_prompt
+ global hex
+
+ send_gdb "111-exec-return\n"
+ gdb_expect {
+ -re "111\\^done,frame=\{level=\"0 \",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
+ -re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
+ timeout { fail "return from callee4 now (timeout)"
+ }
+ }
+}
+
+test_running_to_callee4
+test_return_simple
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-simplerun.exp b/gdb/testsuite/gdb.mi/mi-simplerun.exp
new file mode 100644
index 00000000000..a6f82fcca81
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-simplerun.exp
@@ -0,0 +1,199 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_breakpoints_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert
+ # -break-list
+ # -break-disable
+ # -break-info
+
+ mi_gdb_test "200-break-insert main" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_gdb_test "201-break-insert basics.c:callee2" \
+ "201\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \
+ "insert breakpoint at basics.c:callee2"
+
+ mi_gdb_test "202-break-insert basics.c:15" \
+ "202\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \
+ "insert breakpoint at basics.c:15 (callee3)"
+
+ mi_gdb_test "203-break-insert \"\\\"${srcfile}\\\":6\"" \
+ "203\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \
+ "insert breakpoint at \"<fullfilename>\":6 (callee4)"
+
+ mi_gdb_test "204-break-list" \
+ "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\\\]\}" \
+ "list of breakpoints"
+
+ mi_gdb_test "205-break-disable 2 3 4" \
+ "205\\^done.*" \
+ "disabling of breakpoints"
+
+ mi_gdb_test "206-break-info 2" \
+ "206\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"2\",.*,enabled=\"n\",.*\}\\\]\}" \
+ "list of breakpoints, 16 disabled"
+}
+
+proc test_running_the_program {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Run the program without args, then specify srgs and rerun the program
+ # Tests:
+ # -exec-run
+ # -gdb-set
+
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ # The following is equivalent to a send_gdb "000-exec-run\n"
+ mi_run_cmd
+ gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "run to main (2)"
+ }
+ timeout {
+ fail "run to main (timeout)"
+ }
+ }
+}
+
+proc test_controlled_execution {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Continue execution until a breakpoint is reached, step into calls, verifying
+ # if the arguments are correctly shown, continue to the end of a called
+ # function, step over a call (next).
+ # Tests:
+ # -exec-continue
+ # -exec-next
+ # -exec-step
+ # -exec-finish
+
+ mi_next_to "main" "" "basics.c" "33" "next at main"
+
+ # FIXME: A string argument is not printed right; should be fixed and
+ # we should look for the right thing here.
+ # NOTE: The ``\\\\\"'' is for \".
+ mi_step_to "callee1" \
+ "\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}" \
+ "basics.c" "27" "step at main"
+
+ # FIXME: A string argument is not printed right; should be fixed and
+ # we should look for the right thing here.
+ mi_run_to "exec-step 3" "end-stepping-range" "callee4" "" \
+ "basics.c" "8" "" "step to callee4"
+
+ # FIXME: A string argument is not printed right; should be fixed and
+ # we should look for the right thing here.
+ # NOTE: The ``.'' is part of ``gdb-result-var="$1"''
+ mi_finish_to "callee3" ".*" "basics.c" "18" ".1" "0" "exec-finish"
+}
+
+proc test_controlling_breakpoints {} {
+ global mi_gdb_prompt
+
+ # Enable, delete, set ignore counts in breakpoints
+ # (disable was already tested above)
+ # Tests:
+ # -break-delete
+ # -break-enable
+ # -break-after
+ # -break-condition
+
+}
+
+proc test_program_termination {} {
+ global mi_gdb_prompt
+
+ # Run to completion: normal and forced
+ # Tests:
+ # -exec-abort
+ # (normal termination of inferior)
+
+ # FIXME: "stopped" doesn't seem appropriate.
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ send_gdb "999-exec-continue\n"
+ gdb_expect {
+ -re "999\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "999\\*stopped,reason=\"exited-normally\"\r\n$mi_gdb_prompt$" {
+ pass "continue to end"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "continue to end (2)"}
+ timeout {fail "continue to end (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "continue to end (1)"}
+ timeout {fail "continue to end (timeout 1)"}
+ }
+}
+
+test_breakpoints_creation_and_listing
+test_running_the_program
+test_controlled_execution
+test_controlling_breakpoints
+test_program_termination
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-stack.exp b/gdb/testsuite/gdb.mi/mi-stack.exp
new file mode 100644
index 00000000000..7af458e348d
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-stack.exp
@@ -0,0 +1,218 @@
+# Copyright 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that stack commands work.
+
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+
+mi_gdb_test "200-break-insert callee4" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
+ "break-insert operation"
+
+mi_run_cmd
+# The running part has been checked already by mi_run_cmd
+gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to callee4"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"}
+ timeout {fail "run to callee4 (timeout 2)"}
+}
+
+
+proc test_stack_frame_listing {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Obtain a stack trace
+ # Tests:
+ # -stack-list-frames
+ # -stack-list-frames 1 1
+ # -stack-list-frames 1 3
+
+ mi_gdb_test "231-stack-list-frames" \
+ "231\\^done,stack=\\\[frame=\{level=\"0 \",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4 \",addr=\"$hex\",func=\"main\",.*\}\\\]" \
+ "stack frame listing"
+ mi_gdb_test "232-stack-list-frames 1 1" \
+ "232\\^done,stack=\\\[frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\}\\\]" \
+ "stack frame listing 1 1"
+ mi_gdb_test "233-stack-list-frames 1 3" \
+ "233\\^done,stack=\\\[frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\}\\\]" \
+ "stack frame listing 1 3"
+
+ mi_gdb_test "234-stack-list-frames 1" \
+ "234\\^error,msg=\"mi_cmd_stack_list_frames: Usage.*FRAME_LOW FRAME_HIGH.*\"" \
+ "stack frame listing wrong"
+}
+
+proc test_stack_args_listing {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Obtain lists for args for the stack frames
+ # Tests:
+ # -stack-list-arguments 0
+ # -stack-list-arguments 0 1 1
+ # -stack-list-arguments 0 1 3
+ # -stack-list-arguments 1
+ # -stack-list-arguments 1 1 1
+ # -stack-list-arguments 1 1 3
+ # -stack-list-arguments
+
+ mi_gdb_test "231-stack-list-arguments 0" \
+ "231\\^done,stack-args=\\\[frame=\{level=\"0\",args=\\\[\\\]\},frame=\{level=\"1\",args=\\\[name=\"strarg\"\\\]\},frame=\{level=\"2\",args=\\\[name=\"intarg\",name=\"strarg\"\\\]\},frame=\{level=\"3\",args=\\\[name=\"intarg\",name=\"strarg\",name=\"fltarg\"\\\]\},frame=\{level=\"4\",args=\\\[\\\]\}\\\]" \
+ "stack args listing 0"
+
+ mi_gdb_test "232-stack-list-arguments 0 1 1" \
+ "232\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[name=\"strarg\"\\\]\}\\\]" \
+ "stack args listing 0 1 1"
+
+ mi_gdb_test "233-stack-list-arguments 0 1 3" \
+ "233\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[name=\"strarg\"\\\]\},frame=\{level=\"2\",args=\\\[name=\"intarg\",name=\"strarg\"\\\]\},frame=\{level=\"3\",args=\\\[name=\"intarg\",name=\"strarg\",name=\"fltarg\"\\\]\}\\\]" \
+ "stack args listing 0 1 3"
+
+ mi_gdb_test "231-stack-list-arguments 1" \
+ "231\\^done,stack-args=\\\[frame=\{level=\"0\",args=\\\[\\\]\},frame=\{level=\"1\",args=\\\[\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"2\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"3\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\\\]\},frame=\{level=\"4\",args=\\\[\\\]\}\\\]" \
+ "stack args listing 1"
+
+ mi_gdb_test "232-stack-list-arguments 1 1 1" \
+ "232\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\}\\\]" \
+ "stack args listing 1 1 1"
+
+ mi_gdb_test "233-stack-list-arguments 1 1 3" \
+ "233\\^done,stack-args=\\\[frame=\{level=\"1\",args=\\\[\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"2\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\\\]\},frame=\{level=\"3\",args=\\\[\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\\\]\}\\\]" \
+ "stack args listing 1 1 3"
+
+ mi_gdb_test "234-stack-list-arguments" \
+ "234\\^error,msg=\"mi_cmd_stack_list_args: Usage.*PRINT_VALUES.*FRAME_LOW FRAME_HIGH.*\"" \
+ "stack args listing wrong"
+}
+
+proc test_stack_info_depth {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Obtain depth of stack
+ # Tests:
+ # -stack-info-depth
+ # -stack-info-depth 3
+ # -stack-info-depth 99
+
+ mi_gdb_test "231-stack-info-depth" \
+ "231\\^done,depth=\"5\"" \
+ "stack info-depth"
+
+ mi_gdb_test "231-stack-info-depth 3" \
+ "231\\^done,depth=\"3\"" \
+ "stack info-depth 3"
+
+ mi_gdb_test "231-stack-info-depth 99" \
+ "231\\^done,depth=\"5\"" \
+ "stack info-depth 99"
+
+ mi_gdb_test "231-stack-info-depth 99 99" \
+ "231\\^error,msg=\"mi_cmd_stack_info_depth: Usage: .MAX_DEPTH.\"" \
+ "stack info-depth wrong usage"
+}
+
+proc test_stack_locals_listing {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Obtain lists for locals for the stack frames
+ # Tests:
+ # -stack-list-locals 0
+ # -stack-list-locals 1
+ # -stack-list-arguments
+
+ mi_gdb_test "232-stack-list-locals 0" \
+ "232\\^done,locals=\\\[name=\"A\",name=\"B\",name=\"C\"\\\]" \
+ "stack locals listing 0"
+
+# step until A, B, C, have some reasonable values.
+send_gdb "-exec-next 3\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
+ pass "next's in callee4"
+ }
+ timeout { fail "next in callee4 (timeout)" }
+}
+
+ mi_gdb_test "232-stack-list-locals 1" \
+ "232\\^done,locals=\\\[\{name=\"A\",value=\"1\"\},\{name=\"B\",value=\"2\"\},\{name=\"C\",value=\"3\"\}\\\]" \
+ "stack locals listing 1"
+
+ mi_gdb_test "234-stack-list-locals" \
+ "234\\^error,msg=\"mi_cmd_stack_list_locals: Usage.*PRINT_VALUES.*\"" \
+ "stack locals listing wrong"
+
+ mi_gdb_test "232-stack-select-frame 1" \
+ "232\\^done" \
+ "stack select frame 1"
+
+ mi_gdb_test "232-stack-list-locals 1" \
+ "232\\^done,locals=\\\[\\\]" \
+ "stack locals listing for new frame"
+
+# this should be a no-op
+
+ mi_gdb_test "232-stack-select-frame" \
+ "232\\^done" \
+ "stack select same frame"
+
+ mi_gdb_test "232-stack-list-locals 1" \
+ "232\\^done,locals=\\\[\\\]" \
+ "stack locals for same frame (level 1)"
+
+}
+
+test_stack_frame_listing
+test_stack_args_listing
+test_stack_locals_listing
+test_stack_info_depth
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-stepi.exp b/gdb/testsuite/gdb.mi/mi-stepi.exp
new file mode 100644
index 00000000000..e0de2f2ccd1
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-stepi.exp
@@ -0,0 +1,109 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test Machine interface (MI) operations
+# Verify that, using the MI, we can run a simple program and perform
+# exec-step-instruction and exec-next-instruction.
+
+# The goal is not to
+# test gdb functionality, which is done by other tests, but to verify
+# the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_running_to_main {} {
+ global mi_gdb_prompt
+ global hex
+
+ mi_gdb_test "200-break-insert main" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_run_cmd
+
+ gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "run to main (2)"
+ }
+ timeout {
+ fail "run to main (timeout)"
+ }
+ }
+}
+
+proc test_stepi_nexti {} {
+ global mi_gdb_prompt
+ global hex
+
+ send_gdb "111-exec-step-instruction\n"
+ gdb_expect {
+ -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" {
+ pass "step-instruction at main"
+ }
+ timeout {
+ fail "step-instruction at main (timeout)"
+ }
+ }
+ send_gdb "222-exec-next-instruction\n"
+ gdb_expect {
+ -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" {
+ pass "next-instruction at main"
+ }
+ timeout {
+ fail "next-instruction at main (timeout)"
+ }
+ }
+ send_gdb "333-exec-next-instruction\n"
+ gdb_expect {
+ -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" {
+ pass "next-instruction at main"
+ }
+ timeout {
+ fail "next-instruction at main (timeout)"
+ }
+ }
+}
+
+test_running_to_main
+test_stepi_nexti
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-until.exp b/gdb/testsuite/gdb.mi/mi-until.exp
new file mode 100644
index 00000000000..ac276cc5229
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-until.exp
@@ -0,0 +1,127 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test Machine interface (MI) operations
+# Verify that, using the MI, we can run a simple program and perform
+# exec-until.
+
+# The goal is not to
+# test gdb functionality, which is done by other tests, but to verify
+# the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "until"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_running_to_foo {} {
+ global mi_gdb_prompt
+ global hex
+
+ mi_gdb_test "200-break-insert 10" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*until.c\",line=\"10\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_run_cmd
+
+ gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"10\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "run to main (2)"
+ }
+ timeout {
+ fail "run to main (timeout)"
+ }
+ }
+
+ mi_gdb_test "100-break-delete 1" "100\\^done" "break-delete 1"
+
+}
+
+proc test_until {} {
+ global mi_gdb_prompt
+ global hex
+
+ send_gdb "111-exec-until\n"
+ gdb_expect {
+ -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
+ pass "until after while loop"
+ }
+ timeout {
+ fail "until after while loop (timeout)"
+ }
+ }
+
+ send_gdb "222-exec-until 15\n"
+ gdb_expect {
+ -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
+ pass "until line number"
+ }
+ timeout {
+ fail "until line number (timeout)"
+ }
+ }
+
+ send_gdb "333-exec-until until.c:17\n"
+ gdb_expect {
+ -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
+ pass "until line number:file"
+ }
+ timeout {
+ fail "until line number:file (timeout)"
+ }
+ }
+
+ # This is supposed to NOT stop at line 25. It stops right after foo is over.
+
+ send_gdb "444-exec-until until.c:25\n"
+ gdb_expect {
+ -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
+ pass "until after current function"
+ }
+ timeout {
+ fail "until after current function (timeout)"
+ }
+ }
+
+}
+
+test_running_to_foo
+test_until
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-var-block.exp b/gdb/testsuite/gdb.mi/mi-var-block.exp
new file mode 100644
index 00000000000..ce10041d9e1
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-var-block.exp
@@ -0,0 +1,228 @@
+# Copyright (C) 1999 2000 s Solutions
+#
+# This Program Is Free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can create, update, delete variables.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "var-cmd"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+mi_gdb_test "200-break-insert do_block_tests" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_block_tests\",file=\".*var-cmd.c\",line=\"154\",times=\"0\"\}" \
+ "break-insert operation"
+
+mi_run_cmd
+# The running part has been checked already by mi_run_cmd
+gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"154\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to do_block_tests"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to do_block_tests (2)"}
+ timeout {fail "run to do_block_tests (timeout 2)"}
+}
+
+# Test: c_variable-3.2
+# Desc: create cb and foo
+mi_gdb_test "-var-create cb * cb" \
+ "\\^done,name=\"cb\",numchild=\"0\",type=\"int\"" \
+ "create local variable cb"
+
+mi_gdb_test "-var-create foo * foo" \
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create local variable foo"
+
+# step to "foo = 123;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"158\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_block_tests"
+ }
+ timeout {
+ fail "step at do_block_tests (timeout)"
+ }
+}
+
+
+# Be paranoid and assume 3.2 created foo
+mi_gdb_test "-var-delete foo" \
+ "&\"Variable object not found\\\\n\".*\\^error,msg=\"Variable object not found\"" \
+ "delete var foo"
+
+
+# Test: c_variable-3.3
+# Desc: create foo
+mi_gdb_test "-var-create foo * foo" \
+ "\\^done,name=\"foo\",numchild=\"0\",type=\"int\"" \
+ "create local variable foo"
+
+# step to "foo2 = 123;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"161\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_block_tests"
+ }
+ timeout {
+ fail "step at do_block_tests (timeout)"
+ }
+}
+
+# Test: c_variable-3.4
+# Desc: check foo, cb changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"foo\",in_scope=\"true\",type_changed=\"false\",name=\"cb\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: cb foo changed"
+
+# step to "foo = 321;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"164\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_block_tests"
+ }
+ timeout {
+ fail "step at do_block_tests (timeout)"
+ }
+}
+
+# Test: c_variable-3.5
+# Desc: create inner block foo
+mi_gdb_test "-var-create inner_foo * foo" \
+ "\\^done,name=\"inner_foo\",numchild=\"0\",type=\"int\"" \
+ "create local variable inner_foo"
+
+# step to "foo2 = 0;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"166\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_block_tests"
+ }
+ timeout { fail "step at do_block_tests (timeout)" }
+}
+
+# Test: c_variable-3.6
+# Desc: create foo2
+mi_gdb_test "-var-create foo2 * foo2" \
+ "\\^done,name=\"foo2\",numchild=\"0\",type=\"int\"" \
+ "create local variable foo2"
+
+# Test: c_variable-3.7
+# Desc: check that outer foo in scope and inner foo out of scope
+# Note: also a known gdb problem
+setup_xfail *-*-*
+mi_gdb_test "-var-update inner_foo" \
+ "\\^done,changelist=\{FIXME\}" \
+ "update inner_foo: should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+
+setup_xfail *-*-*
+mi_gdb_test "-var-evaluate-expression inner_foo" \
+ "\\^done,value=\{FIXME\}" \
+ "evaluate inner_foo: should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+
+mi_gdb_test "-var-update foo" \
+ "\\^done,changelist=\{\}" \
+ "update foo: did not change"
+
+mi_gdb_test "-var-delete inner_foo" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var inner_foo"
+
+# step to "foo = 0;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"168\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_block_tests"
+ }
+ timeout { fail "step at do_block_tests (timeout)" }
+}
+
+# Test: c_variable-3.8
+# Desc: check that foo2 out of scope (known gdb problem)
+setup_xfail *-*-*
+mi_gdb_test "-var-update foo2" \
+ "\\^done,changelist=\{FIXME\}" \
+ "update foo2: should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+
+# step to "cb = 21;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"171\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_block_tests"
+ }
+ timeout { fail "step at do_block_tests (timeout)" }
+}
+
+
+# Test: c_variable-3.9
+# Desc: check that only cb is in scope (known gdb problem)
+setup_xfail *-*-*
+mi_gdb_test "-var-update foo2" \
+ "\\^done,changelist=\{FIXME\}" \
+ "update foo2 should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+setup_xfail *-*-*
+mi_gdb_test "-var-update foo" \
+ "\\^done,changelist=\{FIXME\}" \
+ "update foo should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+mi_gdb_test "-var-update cb" \
+ "\\^done,changelist=\{\}" \
+ "update cb"
+
+# Test: c_variable-3.10
+# Desc: names of editable variables
+#gdbtk_test c_variable-3.10 {names of editable variables} {
+# editable_variables
+#} {{foo cb foo2} {}}
+
+# Done with block tests
+mi_gdb_test "-var-delete foo" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var foo"
+
+mi_gdb_test "-var-delete foo2" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var foo2"
+
+mi_gdb_test "-var-delete cb" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var cb"
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-var-child.exp b/gdb/testsuite/gdb.mi/mi-var-child.exp
new file mode 100644
index 00000000000..ba3ad16d616
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-var-child.exp
@@ -0,0 +1,1333 @@
+# Copyright (C) 1999 2000 Cygnus Solutions
+#
+# This Program Is Free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can create, update, delete variables.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "var-cmd"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+mi_gdb_test "200-break-insert do_children_tests" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"190\",times=\"0\"\}" \
+ "break-insert operation"
+
+mi_run_cmd
+# The running part has been checked already by mi_run_cmd
+gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"190\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to do_children_tests"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
+ timeout {fail "run to do_children_tests (timeout 2)"}
+}
+
+##### #####
+# #
+# children tests #
+# #
+##### #####
+
+
+# Test: c_variable-4.2
+# Desc: create variable "struct_declarations"
+mi_gdb_test "-var-create struct_declarations * struct_declarations" \
+ "\\^done,name=\"struct_declarations\",numchild=\"11\",type=\"struct _struct_decl\"" \
+ "create local variable struct_declarations"
+
+# Test: c_variable-4.3
+# Desc: children of struct_declarations
+# STABS doesn't give us argument types for the func ptr structs, but
+# Dwarf 2 does.
+mi_gdb_test "-var-list-children struct_declarations" \
+ "\\^done,numchild=\"11\",children=\{child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
+ "get children of struct_declarations"
+
+#gdbtk_test c_variable-4.3 {children of struct_declarations} {
+# get_children struct_declarations
+#} {integer character char_ptr long_int int_ptr_ptr long_array func_ptr func_ptr_struct func_ptr_ptr u1 s2}
+
+# Test: c_variable-4.4
+# Desc: number of children of struct_declarations
+mi_gdb_test "-var-info-num-children struct_declarations" \
+ "\\^done,numchild=\"11\"" \
+ "get number of children of struct_declarations"
+
+# Test: c_variable-4.5
+# Desc: children of struct_declarations.integer
+mi_gdb_test "-var-list-children struct_declarations.integer" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.integer"
+
+# Test: c_variable-4.6
+# Desc: number of children of struct_declarations.integer
+mi_gdb_test "-var-info-num-children struct_declarations.integer" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.integer"
+
+# Test: c_variable-4.7
+# Desc: children of struct_declarations.character
+mi_gdb_test "-var-list-children struct_declarations.character" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.character"
+
+# Test: c_variable-4.8
+# Desc: number of children of struct_declarations.character
+mi_gdb_test "-var-info-num-children struct_declarations.character" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.character"
+
+# Test: c_variable-4.9
+# Desc: children of struct_declarations.char_ptr
+mi_gdb_test "-var-list-children struct_declarations.char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of struct_declarations.char_ptr"
+
+# Test: c_variable-4.10
+# Desc: number of children of struct_declarations.char_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of struct_declarations.char_ptr"
+
+# Test: c_variable-4.11
+# Desc: children of struct_declarations.long_int
+mi_gdb_test "-var-list-children struct_declarations.long_int" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_int"
+
+# Test: c_variable-4.12
+# Desc: number of children of struct_declarations.long_int
+mi_gdb_test "-var-info-num-children struct_declarations.long_int" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_int"
+
+# Test: c_variable-4.13
+# Desc: children of int_ptr_ptr
+mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \
+ "get children of struct_declarations.int_ptr_ptr"
+
+#gdbtk_test c_variable-4.13 {children of int_ptr_ptr} {
+# get_children struct_declarations.int_ptr_ptr
+#} {*int_ptr_ptr}
+
+# Test: c_variable-4.14
+# Desc: number of children of int_ptr_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of struct_declarations.int_ptr_ptr"
+
+
+# Test: c_variable-4.15
+# Desc: children of struct_declarations.long_array
+mi_gdb_test "-var-list-children struct_declarations.long_array" \
+ "\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \
+ "get children of struct_declarations.long_array"
+
+# Test: c_variable-4.16
+# Desc: number of children of struct_declarations.long_array
+mi_gdb_test "-var-info-num-children struct_declarations.long_array" \
+ "\\^done,numchild=\"10\"" \
+ "get number of children of struct_declarations.long_array"
+
+# Test: c_variable-4.17
+# Desc: children of struct_declarations.func_ptr
+mi_gdb_test "-var-list-children struct_declarations.func_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.func_ptr"
+
+
+# Test: c_variable-4.18
+# Desc: number of children of struct_declarations.func_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.func_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.func_ptr"
+
+
+# Test: c_variable-4.19
+# Desc: children of struct_declarations.func_ptr_struct
+mi_gdb_test "-var-list-children struct_declarations.func_ptr_struct" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.func_ptr_struct"
+
+# Test: c_variable-4.20
+# Desc: number of children of struct_declarations.func_ptr_struct
+mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_struct" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.func_ptr_struct"
+
+
+# Test: c_variable-4.21
+# Desc: children of struct_declarations.func_ptr_ptr
+mi_gdb_test "-var-list-children struct_declarations.func_ptr_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.func_ptr_ptr"
+
+# Test: c_variable-4.22
+# Desc: number of children of struct_declarations.func_ptr_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.func_ptr_ptr"
+
+
+# Test: c_variable-4.23
+# Desc: children of struct_declarations.u1
+mi_gdb_test "-var-list-children struct_declarations.u1" \
+ "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.u1.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.u1.b\",exp=\"b\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.u1.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.u1.d\",exp=\"d\",numchild=\"0\",type=\"enum foo\"\}\}" \
+ "get children of struct_declarations.u1"
+
+# Test: c_variable-4.24
+# Desc: number of children of struct_declarations.u1
+mi_gdb_test "-var-info-num-children struct_declarations.u1" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of struct_declarations.u1"
+
+# Test: c_variable-4.25
+# Desc: children of struct_declarations.s2
+mi_gdb_test "-var-list-children struct_declarations.s2" \
+ "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.s2.u2\",exp=\"u2\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.g\",exp=\"g\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.h\",exp=\"h\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.i\",exp=\"i\",numchild=\"10\",type=\"long int \\\[10\\\]\"\}\}" \
+ "get children of struct_declarations.s2"
+#gdbtk_test c_variable-4.25 {children of struct_declarations.s2} {
+# get_children struct_declarations.s2
+#} {u2 g h i}
+
+# Test: c_variable-4.26
+# Desc: number of children of struct_declarations.s2
+mi_gdb_test "-var-info-num-children struct_declarations.s2" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of struct_declarations.s2"
+
+
+# Test: c_variable-4.27
+# Desc: children of struct_declarations.long_array.1
+mi_gdb_test "-var-list-children struct_declarations.long_array.1" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.1"
+
+# Test: c_variable-4.28
+# Desc: number of children of struct_declarations.long_array.1
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.1" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.1"
+
+# Test: c_variable-4.29
+# Desc: children of struct_declarations.long_array.2
+mi_gdb_test "-var-list-children struct_declarations.long_array.2" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.2"
+
+# Test: c_variable-4.30
+# Desc: number of children of struct_declarations.long_array.2
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.2" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.2"
+
+# Test: c_variable-4.31
+# Desc: children of struct_declarations.long_array.3
+mi_gdb_test "-var-list-children struct_declarations.long_array.3" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.3"
+
+# Test: c_variable-4.32
+# Desc: number of children of struct_declarations.long_array.3
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.3" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.3"
+
+# Test: c_variable-4.33
+# Desc: children of struct_declarations.long_array.4
+mi_gdb_test "-var-list-children struct_declarations.long_array.4" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.4"
+
+# Test: c_variable-4.34
+# Desc: number of children of struct_declarations.long_array.4
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.4" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.4"
+
+# Test: c_variable-4.35
+# Desc: children of struct_declarations.long_array.5
+mi_gdb_test "-var-list-children struct_declarations.long_array.5" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.5"
+
+# Test: c_variable-4.36
+# Desc: number of children of struct_declarations.long_array.5
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.5" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.5"
+
+# Test: c_variable-4.37
+# Desc: children of struct_declarations.long_array.6
+mi_gdb_test "-var-list-children struct_declarations.long_array.6" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.6"
+
+# Test: c_variable-4.38
+# Desc: number of children of struct_declarations.long_array.6
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.6" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.6"
+
+# Test: c_variable-4.39
+# Desc: children of struct_declarations.long_array.7
+mi_gdb_test "-var-list-children struct_declarations.long_array.7" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.7"
+
+# Test: c_variable-4.40
+# Desc: number of children of struct_declarations.long_array.7
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.7" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.7"
+
+# Test: c_variable-4.41
+# Desc: children of struct_declarations.long_array.8
+mi_gdb_test "-var-list-children struct_declarations.long_array.8" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.8"
+
+# Test: c_variable-4.42
+# Desc: number of children of struct_declarations.long_array.8
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.8" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.8"
+
+
+# Test: c_variable-4.43
+# Desc: children of struct_declarations.long_array.9
+mi_gdb_test "-var-list-children struct_declarations.long_array.9" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.9"
+
+# Test: c_variable-4.44
+# Desc: number of children of struct_declarations.long_array.9
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.9" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.9"
+
+# Test: c_variable-4.45
+# Desc: children of struct_declarations.u1.a
+mi_gdb_test "-var-list-children struct_declarations.u1.a" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.u1.a"
+
+# Test: c_variable-4.46
+# Desc: number of children of struct_declarations.u1.a
+mi_gdb_test "-var-info-num-children struct_declarations.u1.a" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.u1.a"
+
+# Test: c_variable-4.47
+# Desc: children of struct_declarations.u1.b
+mi_gdb_test "-var-list-children struct_declarations.u1.b" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.u1.b.\\*b\",exp=\"\\*b\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of struct_declarations.u1.b"
+
+# Test: c_variable-4.48
+# Desc: number of children of struct_declarations.u1.b
+mi_gdb_test "-var-info-num-children struct_declarations.u1.b" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of struct_declarations.u1.b"
+
+# Test: c_variable-4.49
+# Desc: children of struct_declarations.u1.c
+mi_gdb_test "-var-list-children struct_declarations.u1.c" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.u1.c"
+
+# Test: c_variable-4.50
+# Desc: number of children of struct_declarations.u1.c
+mi_gdb_test "-var-info-num-children struct_declarations.u1.c" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.u1.c"
+
+# Test: c_variable-4.51
+# Desc: children of struct_declarations.u1.d
+mi_gdb_test "-var-list-children struct_declarations.u1.d" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.u1.d"
+
+
+# Test: c_variable-4.52
+# Desc: number of children of struct_declarations.u1.d
+mi_gdb_test "-var-info-num-children struct_declarations.u1.d" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.u1.d"
+
+
+# Test: c_variable-4.53
+# Desc: children of struct_declarations.s2.u2
+mi_gdb_test "-var-list-children struct_declarations.s2.u2" \
+ "\\^done,numchild=\"3\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1\",exp=\"u1s1\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.u2.f\",exp=\"f\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.u2.u1s2\",exp=\"u1s2\",numchild=\"2\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
+ "get children of struct_declarations.s2.u2"
+
+# Test: c_variable-4.54
+# Desc: number of children of struct_declarations.s2.u2
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2" \
+ "\\^done,numchild=\"3\"" \
+ "get number of children of struct_declarations.s2.u2"
+
+# Test: c_variable-4.55
+# Desc: children of struct_declarations.s2.g
+mi_gdb_test "-var-list-children struct_declarations.s2.g" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.g"
+
+# Test: c_variable-4.56
+# Desc: number of children of struct_declarations.s2.g
+mi_gdb_test "-var-info-num-children struct_declarations.s2.g" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.g"
+
+
+# Test: c_variable-4.57
+# Desc: children of struct_declarations.s2.h
+mi_gdb_test "-var-list-children struct_declarations.s2.h" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.h"
+
+# Test: c_variable-4.58
+# Desc: number of children of struct_declarations.s2.h
+mi_gdb_test "-var-info-num-children struct_declarations.s2.h" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.h"
+
+
+# Test: c_variable-4.59
+# Desc: children of struct_declarations.s2.i
+mi_gdb_test "-var-list-children struct_declarations.s2.i" \
+ "\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.s2.i.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \
+ "get children of struct_declarations.s2.i"
+
+# Test: c_variable-4.60
+# Desc: number of children of struct_declarations.s2.i
+mi_gdb_test "-var-info-num-children struct_declarations.s2.i" \
+ "\\^done,numchild=\"10\"" \
+ "get number of children of struct_declarations.s2.i"
+
+# Test: c_variable-4.61
+# Desc: children of struct_declarations.s2.u2.u1s1
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1" \
+ "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1.d\",exp=\"d\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e\",exp=\"e\",numchild=\"10\",type=\"char \\\[10\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.func\",exp=\"func\",numchild=\"0\",type=\"int \\*\\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.foo\",exp=\"foo\",numchild=\"0\",type=\"efoo\"\}\}" \
+ "get children of struct_declarations.s2.u2.u1s1"
+
+# Test: c_variable-4.62
+# Desc: number of children of struct_declarations.s2.u2.u1s1
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1"
+
+# Test: c_variable-4.63
+# Desc: children of struct_declarations.s2.u2.f
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.f" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.f"
+
+# Test: c_variable-4.64
+# Desc: number of children of struct_declarations.s2.u2.f
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.f" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.f"
+
+# Test: c_variable-4.65
+# Desc: children of struct_declarations.s2.u2.u1s2
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2" \
+ "\\^done,numchild=\"2\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr\",exp=\"array_ptr\",numchild=\"2\",type=\"char \\\[2\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s2.func\",exp=\"func\",numchild=\"0\",type=\"int \\(\\*\\)\\((int, char \\*)?\\)\"\}\}" \
+ "get children of struct_declarations.s2.u2.u1s2"
+
+# Test: c_variable-4.66
+# Desc: number of children of struct_declarations.s2.u2.u1s2
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2" \
+ "\\^done,numchild=\"2\"" \
+ "get number of children of struct_declarations.s2.u2.u1s2"
+
+# Test: c_variable-4.67
+# Desc: children of struct_declarations.s2.u2.u1s1.d
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.d" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.u1s1.d"
+
+# Test: c_variable-4.68
+# Desc: number of children of struct_declarations.s2.u2.u1s1.d
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.d" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1.d"
+
+# Test: c_variable-4.69
+# Desc: children of struct_declarations.s2.u2.u1s1.e
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.e" \
+ "\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1.e.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.1\",exp=\"1\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.2\",exp=\"2\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s1.e.3\",exp=\"3\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.4\",exp=\"4\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.5\",exp=\"5\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.6\",exp=\"6\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.7\",exp=\"7\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.8\",exp=\"8\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.9\",exp=\"9\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of struct_declarations.s2.u2.u1s1.e"
+
+# Test: c_variable-4.70
+# Desc: number of children of struct_declarations.s2.u2.u1s1.e
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.e" \
+ "\\^done,numchild=\"10\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1.e"
+
+
+# Test: c_variable-4.71
+# Desc: children of struct_declarations.s2.u2.u1s1.func
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.func" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.u1s1.func"
+
+# Test: c_variable-4.72
+# Desc: number of children of struct_declarations.s2.u2.u1s1.func
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.func" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1.func"
+
+
+# Test: c_variable-4.73
+# Desc: children of struct_declarations.s2.u2.u1s1.foo
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.foo" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.u1s1.foo"
+
+# Test: c_variable-4.74
+# Desc: number of children of struct_declarations.s2.u2.u1s1.foo
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.foo" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1.foo"
+
+
+# Test: c_variable-4.75
+# Desc: children of struct_declarations.s2.u2.u1s2.array_ptr
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.array_ptr" \
+ "\\^done,numchild=\"2\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s2.array_ptr.1\",exp=\"1\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of struct_declarations.s2.u2.u1s2.array_ptr"
+
+# Test: c_variable-4.76
+# Desc: number of children of struct_declarations.s2.u2.u1s2.array_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.array_ptr" \
+ "\\^done,numchild=\"2\"" \
+ "get number of children of struct_declarations.s2.u2.u1s2.array_ptr"
+
+# Test: c_variable-4.77
+# Desc: children of struct_declarations.s2.u2.u1s2.func
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.func" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.u1s2.func"
+
+# Test: c_variable-4.78
+# Desc: number of children of struct_declarations.s2.u2.u1s2.func
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.func" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.u1s2.func"
+
+# Test: c_variable-4.79
+# Desc: children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
+mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \
+ "get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
+#} {**int_ptr_ptr}
+
+# Test: c_variable-4.80
+# Desc: Number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
+
+
+# Step to "struct_declarations.integer = 123;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"192\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+
+# Test: c_variable-4.81
+# Desc: create local variable "weird"
+mi_gdb_test "-var-create weird * weird" \
+ "\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
+ "create local variable weird"
+
+# Test: c_variable-4.82
+# Desc: children of weird
+mi_gdb_test "-var-list-children weird" \
+ "\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
+ "get children of weird"
+
+# Test: c_variable-4.83
+# Desc: number of children of weird
+mi_gdb_test "-var-info-num-children weird" \
+ "\\^done,numchild=\"11\"" \
+ "get number of children of weird"
+
+
+# Test: c_variable-4.84
+# Desc: children of weird->long_array
+mi_gdb_test "-var-list-children weird.long_array" \
+ "\\^done,numchild=\"10\",children=\{child=\{name=\"weird.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \
+ "get children of weird.long_array"
+#gdbtk_test c_variable-4.84 {children of weird->long_array} {
+# get_children weird.long_array
+#} {0 1 2 3 4 5 6 7 8 9}
+
+# Test: c_variable-4.85
+# Desc: number of children of weird.long_array
+mi_gdb_test "-var-info-num-children weird.long_array" \
+ "\\^done,numchild=\"10\"" \
+ "get number of children of weird.long_array"
+
+# Test: c_variable-4.86
+# Desc: children of weird.int_ptr_ptr
+mi_gdb_test "-var-list-children weird.int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \
+ "get children of weird.int_ptr_ptr"
+#gdbtk_test c_variable-4.86 {children of weird->int_ptr_ptr} {
+# get_children weird.int_ptr_ptr
+#} {*int_ptr_ptr}
+
+# Test: c_variable-4.87
+# Desc: number of children of weird.int_ptr_ptr
+mi_gdb_test "-var-info-num-children weird.int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of weird.int_ptr_ptr"
+
+# Test: c_variable-4.88
+# Desc: children of *weird->int_ptr_ptr
+mi_gdb_test "-var-list-children weird.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \
+ "get children of weird.int_ptr_ptr.*int_ptr_ptr"
+#gdbtk_test c_variable-4.88 {children of *weird->int_ptr_ptr} {
+# get_children weird.int_ptr_ptr.*int_ptr_ptr
+#} {**int_ptr_ptr}
+
+# Test: c_variable-4.89
+# Desc: number of children *weird->int_ptr_ptr
+mi_gdb_test "-var-info-num-children weird.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of weird.int_ptr_ptr.*int_ptr_ptr"
+
+# Test: c_variable-4.90
+# Desc: create weird->int_ptr_ptr
+mi_gdb_test "-var-create weird->int_ptr_ptr * weird->int_ptr_ptr" \
+ "\\^done,name=\"weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"" \
+ "create local variable weird->int_ptr_ptr"
+
+# Test: c_variable-4.91
+# Desc: children of weird->int_ptr_ptr
+mi_gdb_test "-var-list-children weird->int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",exp=\"\\*weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \
+ "get children of weird->int_ptr_ptr"
+
+
+# Test: c_variable-4.92
+# Desc: number of children of (weird->int_ptr_ptr)
+mi_gdb_test "-var-info-num-children weird->int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of weird->int_ptr_ptr"
+
+# Test: c_variable-4.93
+# Desc: children of *(weird->int_ptr_ptr)
+mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",exp=\"\\*\\*weird->int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \
+ "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
+
+# Test: c_variable-4.94
+# Desc: number of children of *(weird->int_ptr_ptr)
+mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
+
+# Test: c_variable-4.95
+# Desc: children of *(*(weird->int_ptr_ptr))
+mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"
+
+# Test: c_variable-4.96
+# Desc: number of children of *(*(weird->int_ptr_ptr))
+mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"
+
+# Test: c_variable-4.97
+# Desc: is weird editable
+mi_gdb_test "-var-show-attributes weird" \
+ "\\^done,attr=\"editable\"" \
+ "is weird editable"
+
+# Test: c_variable-4.98
+# Desc: is weird->int_ptr_ptr editable
+mi_gdb_test "-var-show-attributes weird->int_ptr_ptr" \
+ "\\^done,attr=\"editable\"" \
+ "is weird->int_ptr_ptr editable"
+
+# Test: c_variable-4.99
+# Desc: is *(weird->int_ptr_ptr) editable
+mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,attr=\"editable\"" \
+ "is weird.int_ptr_ptr.*int_ptr_ptr editable"
+
+# Test: c_variable-4.100
+# Desc: is *(*(weird->int_ptr_ptr)) editable
+mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr" \
+ "\\^done,attr=\"editable\"" \
+ "is weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr editable"
+
+# Test: c_variable-4.101
+# Desc: is weird->u1 editable
+mi_gdb_test "-var-show-attributes weird.u1" \
+ "\\^done,attr=\"noneditable\"" \
+ "is weird.u1 editable"
+
+# Test: c_variable-4.102
+# Desc: is weird->s2 editable
+mi_gdb_test "-var-show-attributes weird.s2" \
+ "\\^done,attr=\"noneditable\"" \
+ "is weird.s2 editable"
+
+# Test: c_variable-4.103
+# Desc: is struct_declarations.u1.a editable
+mi_gdb_test "-var-show-attributes struct_declarations.u1.a" \
+ "\\^done,attr=\"editable\"" \
+ "is struct_declarations.u1.a editable"
+
+# Test: c_variable-4.104
+# Desc: is struct_declarations.u1.b editable
+mi_gdb_test "-var-show-attributes struct_declarations.u1.b" \
+ "\\^done,attr=\"editable\"" \
+ "is struct_declarations.u1.b editable"
+
+# Test: c_variable-4.105
+# Desc: is struct_declarations.u1.c editable
+mi_gdb_test "-var-show-attributes struct_declarations.u1.c" \
+ "\\^done,attr=\"editable\"" \
+ "is struct_declarations.u1.c editable"
+
+# Test: c_variable-4.106
+# Desc: is struct_declarations.long_array editable
+mi_gdb_test "-var-show-attributes struct_declarations.long_array" \
+ "\\^done,attr=\"noneditable\"" \
+ "is struct_declarations.long_array editable"
+
+# Test: c_variable-4.107
+# Desc: is struct_declarations.long_array[0] editable
+mi_gdb_test "-var-show-attributes struct_declarations.long_array.0" \
+ "\\^done,attr=\"editable\"" \
+ "is struct_declarations.long_array.0 editable"
+
+# Test: c_variable-4.108
+# Desc: is struct_declarations editable
+mi_gdb_test "-var-show-attributes struct_declarations" \
+ "\\^done,attr=\"noneditable\"" \
+ "is struct_declarations editable"
+
+mi_gdb_test "-var-delete weird" \
+ "\\^done,ndeleted=\"24\"" \
+ "delete var weird"
+
+##### #####
+# #
+# children and update tests #
+# #
+##### #####
+
+# Test: c_variable-5.1
+# Desc: check that nothing changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{\}" \
+ "update all vars. None changed"
+
+# Step over "struct_declarations.integer = 123;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"193\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.2
+# Desc: check that integer changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.integer"
+
+# Step over:
+# weird->char_ptr = "hello";
+# bar = 2121;
+# foo = &bar;
+
+send_gdb "-exec-step 3\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"196\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.3
+# Desc: check that char_ptr changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.char_ptr"
+
+# Step over "struct_declarations.int_ptr_ptr = &foo;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"197\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.4
+# Desc: check that int_ptr_ptr and children changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars int_ptr_ptr and children changed"
+
+# Step over "weird->long_array[0] = 1234;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"198\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.5
+# Desc: check that long_array[0] changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.long_array.0 changed"
+
+# Step over "struct_declarations.long_array[1] = 2345;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"199\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.6
+# Desc: check that long_array[1] changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.long_array.1 changed"
+
+# Step over "weird->long_array[2] = 3456;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"200\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.7
+# Desc: check that long_array[2] changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.long_array.2 changed"
+
+# Step over:
+# struct_declarations.long_array[3] = 4567;
+# weird->long_array[4] = 5678;
+# struct_declarations.long_array[5] = 6789;
+# weird->long_array[6] = 7890;
+# struct_declarations.long_array[7] = 8901;
+# weird->long_array[8] = 9012;
+# struct_declarations.long_array[9] = 1234;
+send_gdb "-exec-step 7\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"208\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.8
+# Desc: check that long_array[3-9] changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.long_array.3-9 changed"
+
+
+# Step over "weird->func_ptr = nothing;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"211\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.9
+# Desc: check that func_ptr changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.func_ptr changed"
+
+# Delete all variables
+mi_gdb_test "-var-delete struct_declarations" \
+ "\\^done,ndeleted=\"65\"" \
+ "delete var struct_declarations"
+
+mi_gdb_test "-var-delete weird->int_ptr_ptr" \
+ "\\^done,ndeleted=\"3\"" \
+ "delete var weird->int_ptr_ptr"
+
+# Step over all lines:
+# ...
+# psnp = &snp0;
+send_gdb "-exec-step 43\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"254\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.10
+# Desc: create psnp->char_ptr
+mi_gdb_test "-var-create psnp->char_ptr * psnp->char_ptr" \
+ "\\^done,name=\"psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"" \
+ "create local variable psnp->char_ptr"
+
+# Test: c_variable-5.11
+# Desc: children of psnp->char_ptr
+mi_gdb_test "-var-list-children psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",exp=\"\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\}" \
+ "get children of psnp->char_ptr"
+
+# Test: c_variable-5.12
+# Desc: number of children of psnp->char_ptr
+mi_gdb_test "-var-info-num-children psnp->char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->char_ptr"
+
+# Test: c_variable-5.13
+# Desc: children of *(psnp->char_ptr)
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",exp=\"\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\}" \
+ "get children of psnp->char_ptr.*psnp->char_ptr"
+
+# Test: c_variable-5.14
+# Desc: number of children of *(psnp->char_ptr)
+mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->char_ptr.*psnp->char_ptr"
+
+# Test: c_variable-5.15
+# Desc: children of *(*(psnp->char_ptr))
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \
+ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+
+# Test: c_variable-5.15B
+# Desc: children of *(*(*(psnp->char_ptr)))
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+
+# Test: c_variable-5.16
+# Desc: number of children of *(*(psnp->char_ptr))
+mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+
+# Test: c_variable-5.17
+# Desc: children of *(*(*(psnp->char_ptr)))
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
+
+# Test: c_variable-5.18
+# Desc: number of children of *(*(*(psnp->char_ptr)))
+mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
+
+# Test: c_variable-5.17B
+# Desc: children of *(*(*(*(psnp->char_ptr))))
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
+
+# Test: c_variable-5.18B
+# Desc: number of children of *(*(*(*(psnp->char_ptr))))
+mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
+
+
+# Test: c_variable-5.19
+# Desc: create psnp->long_ptr
+mi_gdb_test "-var-create psnp->long_ptr * psnp->long_ptr" \
+ "\\^done,name=\"psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"" \
+ "create local variable psnp->long_ptr"
+
+# Test: c_variable-5.20
+# Desc: children of psnp->long_ptr
+mi_gdb_test "-var-list-children psnp->long_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",exp=\"\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\"\}\}" \
+ "get children of psnp->long_ptr"
+
+# Test: c_variable-5.21
+# Desc: number of children of psnp->long_ptr
+mi_gdb_test "-var-info-num-children psnp->long_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->long_ptr"
+
+# Test: c_variable-5.22
+# Desc: children of *(psnp->long_ptr)
+mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",exp=\"\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\"\}\}" \
+ "get children of psnp->long_ptr.*psnp->long_ptr"
+
+
+# Test: c_variable-5.23
+# Desc: number of children of *(psnp->long_ptr)
+mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->long_ptr.*psnp->long_ptr"
+
+# Test: c_variable-5.24
+# Desc: children of *(*(psnp->long_ptr))
+mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\"\}\}" \
+ "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
+
+# Test: c_variable-5.25
+# Desc: number of children of *(*(psnp->long_ptr))
+mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
+
+# Test: c_variable-5.26
+# Desc: children of *(*(*(psnp->long_ptr)))
+mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*\\*psnp->long_ptr\",numchild=\"0\",type=\"long int\"\}\}" \
+ "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
+
+# Test: c_variable-5.27
+# Desc: number of children of *(*(*(psnp->long_ptr)))
+mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
+
+# Test: c_variable-5.28
+# Desc: children of *(*(*(*(psnp->long_ptr))))
+mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr"
+
+# Test: c_variable-5.29
+# Desc: number of children of *(*(*(*(psnp->long_ptr))))
+mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr"
+
+# Test: c_variable-5.30
+# Desc: create psnp->ptrs
+mi_gdb_test "-var-create psnp->ptrs * psnp->ptrs" \
+ "\\^done,name=\"psnp->ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"" \
+ "create local variable psnp->ptrs"
+
+# Test: c_variable-5.31
+# Desc: children of psnp->ptrs
+mi_gdb_test "-var-list-children psnp->ptrs" \
+ "\\^done,numchild=\"3\",children=\{child=\{name=\"psnp->ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
+ "get children of psnp->ptrs"
+
+# Test: c_variable-5.32
+# Desc: number of children of psnp->ptrs
+mi_gdb_test "-var-info-num-children psnp->ptrs" \
+ "\\^done,numchild=\"3\"" \
+ "get number of children of psnp->ptrs"
+
+# Test: c_variable-5.33
+# Desc: children of psnp->ptrs[0]
+mi_gdb_test "-var-list-children psnp->ptrs.0" \
+ "\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
+ "get children of psnp->ptrs.0"
+
+# Test: c_variable-5.34
+# Desc: number of children of psnp->ptrs[0]
+mi_gdb_test "-var-info-num-children psnp->ptrs.0" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of psnp->ptrs.0"
+
+# Test: c_variable-5.35
+# Desc: children of psnp->ptrs[0]->next
+mi_gdb_test "-var-list-children psnp->ptrs.0.next" \
+ "\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
+ "get children of psnp->ptrs.0.next"
+
+#} {char_ptr long_ptr ptrs next}
+
+# Test: c_variable-5.36
+# Desc: number of children of psnp->ptrs[0]->next
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of psnp->ptrs.0.next"
+
+
+# Test: c_variable-5.37
+# Desc: children of psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\}" \
+ "get children of psnp->ptrs.0.next.char_ptr"
+
+#gdbtk_test c_variable-5.37 {children of psnp->ptrs[0]->next->char_ptr} {
+# get_children psnp->ptrs.0.next.char_ptr
+#} {*char_ptr}
+
+# Test: c_variable-5.38
+# Desc: number of children of psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr"
+
+# Test: c_variable-5.39
+# Desc: children of *psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",exp=\"\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\}" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr"
+
+# Test: c_variable-5.40
+# Desc: number of children of *psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr"
+
+# Test: c_variable-5.41
+# Desc: children of **psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+
+# Test: c_variable-5.41B
+# Desc: children of ***psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+
+# Test: c_variable-5.42
+# Desc: number of children of **psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+
+# Test: c_variable-5.43
+# Desc: children of ***psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+
+# Test: c_variable-5.44
+# Desc: number of children of ***psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+
+# Test: c_variable-5.43B
+# Desc: children of ****psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+
+# Test: c_variable-5.44B
+# Desc: number of children of ****psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+
+# Test: c_variable-5.45
+# Desc: children of psnp->ptrs[0]->next->next
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.next" \
+ "\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.next.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
+ "get children of psnp->ptrs.0.next.next"
+
+# Test: c_variable-5.46
+# Desc: children of psnp->ptrs[0]->next->next->ptrs
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \
+ "\\^done,numchild=\"3\",children=\{child=\{name=\"psnp->ptrs.0.next.next.ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
+ "get children of psnp->ptrs.0.next.next.ptrs"
+
+# Step over "snp0.char_ptr = &b3;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"255\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.47
+# Desc: check that psnp->char_ptr (and [0].char_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars psnp->char_ptr (and 0.char_ptr) changed"
+
+# Step over "snp1.char_ptr = &c3;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"256\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+
+# Test: c_variable-5.48
+# Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars psnp->next->char_ptr (and 1.char_ptr) changed"
+
+
+# Step over "snp2.char_ptr = &a3;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"257\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+
+# Test: c_variable-5.49
+# Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars psnp->next->next->char_ptr (and 2.char_ptr) changed"
+
+
+# Step over "snp0.long_ptr = &y3;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"258\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.50
+# Desc: check that psnp->long_ptr (and [0].long_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars psnp->long_ptr (and 0.long_ptr) changed"
+
+
+# Step over "snp1.long_ptr = &x3;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"259\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+
+# Test: c_variable-5.51
+# Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed
+# Why does this have a FIXME?
+setup_xfail *-*-*
+mi_gdb_test "-var-update *" \
+ "FIXME\\^done,changelist=\{name=\"psnp->ptrs.0.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars psnp->next->long_ptr (and 1.long_ptr) changed"
+clear_xfail *-*-*
+
+# This command produces this error message:
+# &"warning: varobj_list: assertion failed - mycount <> 0\n"
+#
+
+# Step over "snp2.long_ptr = &z3;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+
+# Test: c_variable-5.52
+# Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed"
+
+
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-var-cmd.exp b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
new file mode 100644
index 00000000000..b157aa3e7a6
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-var-cmd.exp
@@ -0,0 +1,523 @@
+# Copyright (C) 1999, 2000, 2002 Cygnus Solutions
+#
+# This Program Is Free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can create, update, delete variables.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "var-cmd"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+
+##### #####
+# #
+# Variable Creation tests #
+# #
+##### #####
+
+# Test: c_variable-1.1
+# Desc: Create global variable
+
+mi_gdb_test "111-var-create global_simple * global_simple" \
+ "111\\^done,name=\"global_simple\",numchild=\"6\",type=\"simpleton\"" \
+ "create global variable"
+
+# Test: c_variable-1.2
+# Desc: Create non-existent variable
+
+mi_gdb_test "112-var-create bogus_unknown_variable * bogus_unknown_variable" \
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*112\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create non-existent variable"
+
+# Test: c_variable-1.3
+# Desc: Create out of scope variable
+
+mi_gdb_test "113-var-create argc * argc" \
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*113\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create out of scope variable"
+
+mi_gdb_test "200-break-insert do_locals_tests" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_locals_tests\",file=\".*var-cmd.c\",line=\"106\",times=\"0\"\}" \
+ "break-insert operation"
+
+mi_run_cmd
+# The running part has been checked already by mi_run_cmd
+gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"106\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to do_locals_tests"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to do_locals_tests (2)"}
+ timeout {fail "run to do_locals_tests (timeout 2)"}
+}
+
+# Test: c_variable-1.4
+# Desc: create local variables
+
+mi_gdb_test "-var-create linteger * linteger" \
+ "\\^done,name=\"linteger\",numchild=\"0\",type=\"int\"" \
+ "create local variable linteger"
+
+mi_gdb_test "-var-create lpinteger * lpinteger" \
+ "\\^done,name=\"lpinteger\",numchild=\"1\",type=\"int \\*\"" \
+ "create local variable lpinteger"
+
+mi_gdb_test "-var-create lcharacter * lcharacter" \
+ "\\^done,name=\"lcharacter\",numchild=\"0\",type=\"char\"" \
+ "create local variablelcharacter "
+
+mi_gdb_test "-var-create lpcharacter * lpcharacter" \
+ "\\^done,name=\"lpcharacter\",numchild=\"1\",type=\"char \\*\"" \
+ "create local variable lpcharacter"
+
+mi_gdb_test "-var-create llong * llong" \
+ "\\^done,name=\"llong\",numchild=\"0\",type=\"long int\"" \
+ "create local variable llong"
+
+mi_gdb_test "-var-create lplong * lplong" \
+ "\\^done,name=\"lplong\",numchild=\"1\",type=\"long int \\*\"" \
+ "create local variable lplong"
+
+mi_gdb_test "-var-create lfloat * lfloat" \
+ "\\^done,name=\"lfloat\",numchild=\"0\",type=\"float\"" \
+ "create local variable lfloat"
+
+mi_gdb_test "-var-create lpfloat * lpfloat" \
+ "\\^done,name=\"lpfloat\",numchild=\"1\",type=\"float \\*\"" \
+ "create local variable lpfloat"
+
+mi_gdb_test "-var-create ldouble * ldouble" \
+ "\\^done,name=\"ldouble\",numchild=\"0\",type=\"double\"" \
+ "create local variable ldouble"
+
+mi_gdb_test "-var-create lpdouble * lpdouble" \
+ "\\^done,name=\"lpdouble\",numchild=\"1\",type=\"double \\*\"" \
+ "create local variable lpdouble"
+
+mi_gdb_test "-var-create lsimple * lsimple" \
+ "\\^done,name=\"lsimple\",numchild=\"6\",type=\"struct _simple_struct\"" \
+ "create local variable lsimple"
+
+mi_gdb_test "-var-create lpsimple * lpsimple" \
+ "\\^done,name=\"lpsimple\",numchild=\"6\",type=\"struct _simple_struct \\*\"" \
+ "create local variable lpsimple"
+
+mi_gdb_test "-var-create func * func" \
+ "\\^done,name=\"func\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"" \
+ "create local variable func"
+
+# Test: c_variable-1.5
+# Desc: create lsimple.character
+mi_gdb_test "-var-create lsimple.character * lsimple.character" \
+ "\\^done,name=\"lsimple.character\",numchild=\"0\",type=\"char\"" \
+ "create lsimple.character"
+
+# Test: c_variable-1.6
+# Desc: create lpsimple->integer
+mi_gdb_test "-var-create lsimple->integer * lsimple->integer" \
+ "\\^done,name=\"lsimple->integer\",numchild=\"0\",type=\"int\"" \
+ "create lsimple->integer"
+
+# Test: c_variable-1.7
+# Desc: ceate lsimple.integer
+mi_gdb_test "-var-create lsimple.integer * lsimple.integer" \
+ "\\^done,name=\"lsimple.integer\",numchild=\"0\",type=\"int\"" \
+ "create lsimple->integer"
+
+
+# Test: c_variable-1.9
+# Desc: create type name
+# Type names (like int, long, etc..) are all proper expressions to gdb.
+# make sure variable code does not allow users to create variables, though.
+mi_gdb_test "-var-create int * int" \
+ "&\"Attempt to use a type name as an expression.mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create int"
+
+
+##### #####
+# #
+# Value changed tests #
+# #
+##### #####
+
+# Test: c_variable-2.1
+# Desc: check whether values changed at do_block_tests
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{\}" \
+ "update all vars"
+
+# Step over "linteger = 1234;"
+mi_step_to "do_locals_tests" "" "var-cmd.c" "107" "step at do_locals_test"
+
+# Test: c_variable-2.2
+# Desc: check whether only linteger changed values
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: linteger changed"
+
+# Step over "lpinteger = &linteger;"
+mi_step_to "do_locals_tests" "" "var-cmd.c" 108 "step at do_locals_tests (2)"
+
+# Test: c_variable-2.3
+# Desc: check whether only lpinteger changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: lpinteger changed"
+
+# Step over "lcharacter = 'a';"
+mi_step_to "do_locals_tests" "" "var-cmd.c" "109" "step at do_locals_tests (3)"
+
+# Test: c_variable-2.4
+# Desc: check whether only lcharacter changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: lcharacter changed"
+
+# Step over "lpcharacter = &lcharacter;"
+mi_step_to "do_locals_tests" "" "var-cmd.c" "110" "step at do_locals_tests (4)"
+
+# Test: c_variable-2.5
+# Desc: check whether only lpcharacter changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: lpcharacter changed"
+
+
+# Step over:
+# llong = 2121L;
+# lplong = &llong;
+# lfloat = 2.1;
+# lpfloat = &lfloat;
+# ldouble = 2.718281828459045;
+# lpdouble = &ldouble;
+# lsimple.integer = 1234;
+# lsimple.unsigned_integer = 255;
+# lsimple.character = 'a';
+
+mi_run_to "exec-step 9" "end-stepping-range" "do_locals_tests" "" \
+ "var-cmd.c" "119" "" "step at do_locals_tests (5)"
+
+# Test: c_variable-2.6
+# Desc: check whether llong, lplong, lfloat, lpfloat, ldouble, lpdouble, lsimple.integer,
+# lsimple.unsigned_character lsimple.integer lsimple.character changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\",name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\",name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",name=\"lplong\",in_scope=\"true\",type_changed=\"false\",name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: many changed"
+
+# Step over:
+# lsimple.signed_character = 21;
+# lsimple.char_ptr = &lcharacter;
+# lpsimple = &lsimple;
+# func = nothing;
+
+mi_run_to "exec-step 4" "end-stepping-range" "do_locals_tests" "" \
+ "var-cmd.c" "125" "" "step at do_locals_tests (6)"
+
+# Test: c_variable-2.7
+# Desc: check whether (lsimple.signed_character, lsimple.char_ptr) lpsimple, func changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"func\",in_scope=\"true\",type_changed=\"false\",name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: func and lpsimple changed"
+
+# Step over
+# linteger = 4321;
+# lcharacter = 'b';
+# llong = 1212L;
+# lfloat = 1.2;
+# ldouble = 5.498548281828172;
+# lsimple.integer = 255;
+# lsimple.unsigned_integer = 4321;
+# lsimple.character = 'b';
+
+mi_run_to "exec-step 8" "end-stepping-range" "do_locals_tests" "" \
+ "var-cmd.c" "133" "" "step at do_locals_tests (7)"
+
+# Test: c_variable-2.8
+# Desc: check whether linteger, lcharacter, llong, lfoat, ldouble, lsimple.integer,
+# lpsimple.integer lsimple.character changed
+# Note: this test also checks that lpsimple->integer and lsimple.integer have
+# changed (they are the same)
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",name=\"llong\",in_scope=\"true\",type_changed=\"false\",name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\",name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: func and lpsimple changed"
+
+
+###
+#
+# Test assignment to variables. More tests on assignment are in other files.
+#
+###
+mi_gdb_test "-var-assign global_simple 0" \
+ "&\"mi_cmd_var_assign: Variable object is not editable\\\\n\".*\\^error,msg=\"mi_cmd_var_assign: Variable object is not editable\"" \
+ "assign to global_simple"
+
+mi_gdb_test "-var-assign linteger 3333" \
+ "\\^done,value=\"3333\"" \
+ "assign to linteger"
+
+mi_gdb_test "-var-evaluate-expression linteger" \
+ "\\^done,value=\"3333\"" \
+ "eval linteger"
+
+mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lpinteger"
+
+mi_gdb_test "-var-evaluate-expression lpinteger" \
+ "\\^done,value=\"$hex\"" \
+ "eval lpinteger"
+
+# reset the values to the original ones so that the rest of the file doesn't suffer.
+
+mi_gdb_test "-var-assign linteger 4321" \
+ "\\^done,value=\"4321\"" \
+ "assign to linteger"
+
+mi_gdb_test "-var-assign lpinteger &linteger" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lpinteger"
+
+mi_gdb_test "-var-assign lcharacter 'z'" \
+ "\\^done,value=\"122 'z'\"" \
+ "assign to lcharacter"
+
+mi_gdb_test "-var-evaluate-expression lcharacter" \
+ "\\^done,value=\"122 'z'\"" \
+ "eval lcharacter"
+
+mi_gdb_test "-var-assign llong 1313L" \
+ "\\^done,value=\"1313\"" \
+ "assign to llong"
+mi_gdb_test "-var-evaluate-expression llong" \
+ "\\^done,value=\"1313\"" \
+ "eval llong"
+mi_gdb_test "-var-assign llong 1212L" \
+ "\\^done,value=\"1212\"" \
+ "assign to llong"
+
+mi_gdb_test "-var-assign lplong &llong+4" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lplong"
+mi_gdb_test "-var-evaluate-expression lplong" \
+ "\\^done,value=\"$hex\"" \
+ "eval lplong"
+mi_gdb_test "-var-assign lplong &llong" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lplong"
+
+mi_gdb_test "-var-assign lfloat 3.4567" \
+ "\\^done,value=\"3.45.*\"" \
+ "assign to lfloat"
+mi_gdb_test "-var-evaluate-expression lfloat" \
+ "\\^done,value=\"3.45.*\"" \
+ "eval lfloat"
+mi_gdb_test "-var-assign lfloat 1.2345" \
+ "\\^done,value=\"1.23.*\"" \
+ "assign to lfloat"
+
+mi_gdb_test "-var-assign lpfloat &lfloat+4" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lpfloat"
+
+mi_gdb_test "-var-assign ldouble 5.333318284590435" \
+ "\\^done,value=\"5.333318284590435\"" \
+ "assign to ldouble"
+
+mi_gdb_test "-var-assign func do_block_tests" \
+ "\\^done,value=\"$hex <do_block_tests>\"" \
+ "assign to func"
+
+mi_gdb_test "-var-assign lsimple.character 'd'" \
+ "\\^done,value=\"100 'd'\"" \
+ "assign to lsimple.character"
+
+mi_gdb_test "-var-assign lsimple->integer 222" \
+ "\\^done,value=\"222\"" \
+ "assign to lsimple->integer"
+
+mi_gdb_test "-var-assign lsimple.integer 333" \
+ "\\^done,value=\"333\"" \
+ "assign to lsimple.integer"
+
+######
+# End of assign tests
+#####
+
+mi_gdb_test "-break-insert subroutine1" \
+ "\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine1\",file=\".*var-cmd.c\",line=\"146\",times=\"0\"\}" \
+ "break-insert subroutine1"
+mi_continue_to "2" "subroutine1" \
+ "\{name=\"i\",value=\"4321\"\},\{name=\"l\",value=\"$hex\"\}" \
+ "var-cmd.c" "146" "continue to subroutine1"
+
+# Test: c_variable-2.10
+# Desc: create variable for locals i,l in subroutine1
+mi_gdb_test "-var-create i * i" \
+ "\\^done,name=\"i\",numchild=\"0\",type=\"int\"" \
+ "create i"
+
+mi_gdb_test "-var-create l * l" \
+ "\\^done,name=\"l\",numchild=\"1\",type=\"long int \\*\"" \
+ "create l"
+
+# Test: c_variable-2.11
+# Desc: create do_locals_tests local in subroutine1
+mi_gdb_test "-var-create linteger * linteger" \
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create linteger"
+
+mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \
+ "var-cmd.c" "147" "step at subroutine1"
+
+# Test: c_variable-2.12
+# Desc: change global_simple.integer
+# Note: This also tests whether we are reporting changes in structs properly.
+# gdb normally would say that global_simple has changed, but we
+# special case that, since it is not what a human expects to
+# see.
+
+setup_xfail *-*-*
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{FIXME: WHAT IS CORRECT HERE\}" \
+ "update all vars: changed FIXME"
+clear_xfail *-*-*
+
+mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \
+ "var-cmd.c" "148" "step at subroutine1 (2)"
+
+# Test: c_variable-2.13
+# Desc: change subroutine1 local i
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"i\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: i changed"
+
+mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \
+ "var-cmd.c" "149" "step at subroutine1 (3)"
+
+# Test: c_variable-2.14
+# Desc: change do_locals_tests local llong
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: llong changed"
+
+mi_next_to "do_locals_tests" "" "var-cmd.c" "136" "next out of subroutine1"
+
+# Test: c_variable-2.15
+# Desc: check for out of scope subroutine1 locals
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"l\",in_scope=\"false\",name=\"i\",in_scope=\"false\"\}" \
+ "update all vars: all now out of scope"
+
+# Done with locals/globals tests. Erase all variables
+#delete_all_variables
+mi_gdb_test "-var-delete global_simple" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var"
+
+mi_gdb_test "-var-delete linteger" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var linteger"
+
+mi_gdb_test "-var-delete lpinteger" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpinteger"
+
+mi_gdb_test "-var-delete lcharacter" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lcharacter"
+
+mi_gdb_test "-var-delete lpcharacter" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpcharacter"
+
+mi_gdb_test "-var-delete llong" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var llong"
+
+mi_gdb_test "-var-delete lplong" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lplong"
+
+mi_gdb_test "-var-delete lfloat" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lfloat"
+
+mi_gdb_test "-var-delete lpfloat" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpfloat"
+
+mi_gdb_test "-var-delete ldouble" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var ldouble"
+
+mi_gdb_test "-var-delete lpdouble" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpdouble"
+
+mi_gdb_test "-var-delete lsimple" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lsimple"
+
+mi_gdb_test "-var-delete lpsimple" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpsimple"
+
+mi_gdb_test "-var-delete func" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var func"
+
+mi_gdb_test "-var-delete lsimple.character" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lsimple.character"
+
+mi_gdb_test "-var-delete lsimple->integer" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lsimple->integer"
+
+mi_gdb_test "-var-delete lsimple.integer" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lsimple.integer"
+
+mi_gdb_test "-var-delete i" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var i"
+
+mi_gdb_test "-var-delete l" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var l"
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp
new file mode 100644
index 00000000000..9eed4d796d6
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-var-display.exp
@@ -0,0 +1,627 @@
+# Copyright (C) 1999 2000 Cygnus Solutions
+#
+# This Program Is Free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can create, update, delete variables.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "var-cmd"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+mi_gdb_test "200-break-insert 260" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"260\",times=\"0\"\}" \
+ "break-insert operation"
+
+mi_run_cmd
+# The running part has been checked already by mi_run_cmd
+gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to do_children_tests"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
+ timeout {fail "run to do_children_tests (timeout 2)"}
+}
+
+##### #####
+# #
+# Display tests #
+# #
+##### #####
+
+# Test: c_variable-6.1
+# Desc: create variable bar
+mi_gdb_test "-var-create bar * bar" \
+ "\\^done,name=\"bar\",numchild=\"0\",type=\"int\"" \
+ "create local variable bar"
+
+# Test: c_variable-6.2
+# Desc: type of variable bar
+mi_gdb_test "-var-info-type bar" \
+ "\\^done,type=\"int\"" \
+ "info type variable bar"
+
+# Test: c_variable-6.3
+# Desc: format of variable bar
+mi_gdb_test "-var-show-format bar" \
+ "\\^done,format=\"natural\"" \
+ "show format variable bar"
+
+# Test: c_variable-6.4
+# Desc: value of variable bar
+mi_gdb_test "-var-evaluate-expression bar" \
+ "\\^done,value=\"2121\"" \
+ "eval variable bar"
+
+# Test: c_variable-6.5
+# Desc: change format of bar to hex
+mi_gdb_test "-var-set-format bar hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable bar"
+
+# Test: c_variable-6.6
+# Desc: value of bar with new format
+mi_gdb_test "-var-evaluate-expression bar" \
+ "\\^done,value=\"0x849\"" \
+ "eval variable bar with new format"
+
+# Test: c_variable-6.7
+# Desc: change value of bar
+mi_gdb_test "-var-assign bar 3" \
+ "\\^done,value=\"0x3\"" \
+ "assing to variable bar"
+
+mi_gdb_test "-var-set-format bar decimal" \
+ "\\^done,format=\"decimal\"" \
+ "set format variable bar"
+
+mi_gdb_test "-var-evaluate-expression bar" \
+ "\\^done,value=\"3\"" \
+ "eval variable bar with new value"
+
+mi_gdb_test "-var-delete bar" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var bar"
+
+# Test: c_variable-6.11
+# Desc: create variable foo
+mi_gdb_test "-var-create foo * foo" \
+ "\\^done,name=\"foo\",numchild=\"1\",type=\"int \\*\"" \
+ "create local variable foo"
+
+# Test: c_variable-6.12
+# Desc: type of variable foo
+mi_gdb_test "-var-info-type foo" \
+ "\\^done,type=\"int \\*\"" \
+ "info type variable foo"
+
+# Test: c_variable-6.13
+# Desc: format of variable foo
+mi_gdb_test "-var-show-format foo" \
+ "\\^done,format=\"natural\"" \
+ "show format variable foo"
+
+# Test: c_variable-6.14
+# Desc: value of variable foo
+mi_gdb_test "-var-evaluate-expression foo" \
+ "\\^done,value=\"$hex\"" \
+ "eval variable foo"
+
+# Test: c_variable-6.15
+# Desc: change format of var to octal
+mi_gdb_test "-var-set-format foo octal" \
+ "\\^done,format=\"octal\"" \
+ "set format variable foo"
+
+mi_gdb_test "-var-show-format foo" \
+ "\\^done,format=\"octal\"" \
+ "show format variable foo"
+
+# Test: c_variable-6.16
+# Desc: value of foo with new format
+mi_gdb_test "-var-evaluate-expression foo" \
+ "\\^done,value=\"\[0-7\]+\"" \
+ "eval variable foo"
+
+# Test: c_variable-6.17
+# Desc: change value of foo
+mi_gdb_test "-var-assign foo 3" \
+ "\\^done,value=\"03\"" \
+ "assing to variable foo"
+
+mi_gdb_test "-var-set-format foo decimal" \
+ "\\^done,format=\"decimal\"" \
+ "set format variable foo"
+
+# Test: c_variable-6.18
+# Desc: check new value of foo
+mi_gdb_test "-var-evaluate-expression foo" \
+ "\\^done,value=\"3\"" \
+ "eval variable foo"
+
+mi_gdb_test "-var-delete foo" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var foo"
+
+# Test: c_variable-6.21
+# Desc: create variable weird and children
+mi_gdb_test "-var-create weird * weird" \
+ "\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
+ "create local variable weird"
+
+mi_gdb_test "-var-list-children weird" \
+ "\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
+ "get children local variable weird"
+
+
+# Test: c_variable-6.23
+# Desc: change format of weird.func_ptr and weird.func_ptr_ptr
+mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable weird.func_ptr"
+
+mi_gdb_test "-var-show-format weird.func_ptr" \
+ "\\^done,format=\"hexadecimal\"" \
+ "show format variable weird.func_ptr"
+
+mi_gdb_test "-var-set-format weird.func_ptr_ptr hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable weird.func_ptr_ptr"
+
+mi_gdb_test "-var-show-format weird.func_ptr_ptr" \
+ "\\^done,format=\"hexadecimal\"" \
+ "show format variable weird.func_ptr_ptr"
+
+# Test: c_variable-6.24
+# Desc: format of weird and children
+mi_gdb_test "-var-set-format weird natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird"
+
+mi_gdb_test "-var-set-format weird.integer natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.integer"
+
+mi_gdb_test "-var-set-format weird.character natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.character"
+
+mi_gdb_test "-var-set-format weird.char_ptr natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.char_ptr"
+
+mi_gdb_test "-var-set-format weird.long_int natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.long_int"
+
+mi_gdb_test "-var-set-format weird.int_ptr_ptr natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.int_ptr_ptr"
+
+mi_gdb_test "-var-set-format weird.long_array natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.long_array"
+
+mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable weird.func_ptr"
+
+mi_gdb_test "-var-set-format weird.func_ptr_struct hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable weird.func_ptr_struct"
+
+mi_gdb_test "-var-set-format weird.func_ptr_ptr natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.func_ptr_ptr"
+
+mi_gdb_test "-var-set-format weird.u1 natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.u1"
+
+mi_gdb_test "-var-set-format weird.s2 natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.s2"
+
+# Test: c_variable-6.25
+# Desc: value of weird and children
+#gdbtk_test c_variable-6.25 {value of weird and children} {
+# set values {}
+# foreach v [lsort [array names var]] f [list x "" "" x x x x d d d d d] {
+# lappend values [value $v $f]
+# }
+
+# set values
+#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
+
+# Test: c_variable-6.26
+# Desc: change format of weird and children to octal
+#gdbtk_test c_variable-6.26 {change format of weird and children to octal} {
+# set formats {}
+# foreach v [lsort [array names var]] {
+# $var($v) format octal
+# lappend formats [$var($v) format]
+# }
+
+# set formats
+#} {octal octal octal octal octal octal octal octal octal octal octal octal}
+
+# Test: c_variable-6.27
+# Desc: value of weird and children with new format
+#gdbtk_test c_variable-6.27 {value of foo with new format} {
+# set values {}
+# foreach v [lsort [array names var]] {
+# lappend values [value $v o]
+# }
+
+# set values
+#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
+
+# Test: c_variable-6.30
+# Desc: create more children of weird
+#gdbtk_test c_variable-6.30 {create more children of weird} {
+# foreach v [array names var] {
+# get_children $v
+# }
+
+# # Do it twice to get more children
+# foreach v [array names var] {
+# get_children $v
+# }
+
+# lsort [array names var]
+#} {weird weird.char_ptr weird.character weird.func_ptr weird.func_ptr_ptr weird.func_ptr_struct weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.integer weird.long_array weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.long_int weird.s2 weird.s2.g weird.s2.h weird.s2.i weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9 weird.s2.u2 weird.s2.u2.f weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.u1 weird.u1.a weird.u1.b weird.u1.c weird.u1.d}
+
+# Test: c_variable-6.31
+# Desc: check that all children of weird change
+# Ok, obviously things like weird.s2 and weird.u1 will not change!
+#gdbtk_test *c_variable-6.31 {check that all children of weird change (ops, we are now reporting array names as changed in this case - seems harmless though)} {
+# $var(weird) value 0x2121
+# check_update
+#} {{weird.integer weird.character weird.char_ptr weird.long_int weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.func_ptr weird.func_ptr_struct weird.func_ptr_ptr weird.u1.a weird.u1.b weird.u1.c weird.u1.d weird.s2.u2.f weird.s2.g weird.s2.h weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9} {weird.s2.i weird.s2.u2 weird weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.s2 weird.long_array weird.u1} {}}
+
+mi_gdb_test "-var-delete weird" \
+ "\\^done,ndeleted=\"12\"" \
+ "delete var weird"
+
+
+##### #####
+# #
+# Special Display Tests #
+# #
+##### #####
+
+# Stop in "do_special_tests"
+mi_gdb_test "200-break-insert do_special_tests" \
+ "200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"282\",times=\"0\"\}" \
+ "break-insert operation"
+
+send_gdb "-exec-continue\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\\\[\\\],file=\".*var-cmd.c\",line=\"282\"\}\r\n$mi_gdb_prompt$" {
+ pass "continue to do_special_tests"
+ }
+ timeout {
+ fail "continue to do_special_tests (timeout)"
+ }
+}
+
+# Test: c_variable-7.10
+# Desc: create union u
+mi_gdb_test "-var-create u * u" \
+ "\\^done,name=\"u\",numchild=\"2\",type=\"union named_union\"" \
+ "create local variable u"
+
+# Test: c_variable-7.11
+# Desc: value of u
+mi_gdb_test "-var-evaluate-expression u" \
+ "\\^done,value=\"\{\\.\\.\\.\}\"" \
+ "eval variable u"
+
+# Test: c_variable-7.12
+# Desc: type of u
+mi_gdb_test "-var-info-type u" \
+ "\\^done,type=\"union named_union\"" \
+ "info type variable u"
+
+# Test: c_variable-7.13
+# Desc: is u editable
+mi_gdb_test "-var-show-attributes u" \
+ "\\^done,attr=\"noneditable\"" \
+ "is u editable"
+
+# Test: c_variable-7.14
+# Desc: number of children of u
+mi_gdb_test "-var-info-num-children u" \
+ "\\^done,numchild=\"2\"" \
+ "get number of children of u"
+
+# Test: c_variable-7.15
+# Desc: children of u
+mi_gdb_test "-var-list-children u" \
+ "\\^done,numchild=\"2\",children=\{child=\{name=\"u.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"u.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \
+ "get children of u"
+
+# Test: c_variable-7.20
+# Desc: create anonu
+mi_gdb_test "-var-create anonu * anonu" \
+ "\\^done,name=\"anonu\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"" \
+ "create local variable anonu"
+
+# Test: c_variable-7.21
+# Desc: value of anonu
+mi_gdb_test "-var-evaluate-expression anonu" \
+ "\\^done,value=\"\{\\.\\.\\.\}\"" \
+ "eval variable anonu"
+
+# Test: c_variable-7.22
+# Desc: type of anonu
+mi_gdb_test "-var-info-type anonu" \
+ "\\^done,type=\"union \{\\.\\.\\.\}\"" \
+ "info type variable anonu"
+
+# Test: c_variable-7.23
+# Desc: is anonu editable
+mi_gdb_test "-var-show-attributes anonu" \
+ "\\^done,attr=\"noneditable\"" \
+ "is anonu editable"
+
+# Test: c_variable-7.24
+# Desc: number of children of anonu
+mi_gdb_test "-var-info-num-children anonu" \
+ "\\^done,numchild=\"3\"" \
+ "get number of children of anonu"
+
+# Test: c_variable-7.25
+# Desc: children of anonu
+mi_gdb_test "-var-list-children anonu" \
+ "\\^done,numchild=\"3\",children=\{child=\{name=\"anonu.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anonu.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anonu.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\}" \
+ "get children of anonu"
+
+# Test: c_variable-7.30
+# Desc: create struct s
+mi_gdb_test "-var-create s * s" \
+ "\\^done,name=\"s\",numchild=\"6\",type=\"struct _simple_struct\"" \
+ "create local variable s"
+
+
+# Test: c_variable-7.31
+# Desc: value of s
+mi_gdb_test "-var-evaluate-expression s" \
+ "\\^done,value=\"\{\\.\\.\\.\}\"" \
+ "eval variable s"
+
+# Test: c_variable-7.32
+# Desc: type of s
+mi_gdb_test "-var-info-type s" \
+ "\\^done,type=\"struct _simple_struct\"" \
+ "info type variable s"
+
+# Test: c_variable-7.33
+# Desc: is s editable
+mi_gdb_test "-var-show-attributes s" \
+ "\\^done,attr=\"noneditable\"" \
+ "is s editable"
+
+# Test: c_variable-7.34
+# Desc: number of children of s
+mi_gdb_test "-var-info-num-children s" \
+ "\\^done,numchild=\"6\"" \
+ "get number of children of s"
+
+# Test: c_variable-7.35
+# Desc: children of s
+mi_gdb_test "-var-list-children s" \
+ "\\^done,numchild=\"6\",children=\{child=\{name=\"s.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"s.unsigned_integer\",exp=\"unsigned_integer\",numchild=\"0\",type=\"unsigned int\"\},child=\{name=\"s.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"s.signed_character\",exp=\"signed_character\",numchild=\"0\",type=\"signed char\"\},child=\{name=\"s.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"s.array_of_10\",exp=\"array_of_10\",numchild=\"10\",type=\"int \\\[10\\\]\"\}\}" \
+ "get children of s"
+#} {integer unsigned_integer character signed_character char_ptr array_of_10}
+
+# Test: c_variable-7.40
+# Desc: create anons
+mi_gdb_test "-var-create anons * anons" \
+ "\\^done,name=\"anons\",numchild=\"3\",type=\"struct \{\\.\\.\\.\}\"" \
+ "create local variable anons"
+
+# Test: c_variable-7.41
+# Desc: value of anons
+mi_gdb_test "-var-evaluate-expression anons" \
+ "\\^done,value=\"\{\\.\\.\\.\}\"" \
+ "eval variable anons"
+
+# Test: c_variable-7.42
+# Desc: type of anons
+mi_gdb_test "-var-info-type anons" \
+ "\\^done,type=\"struct \{\\.\\.\\.\}\"" \
+ "info type variable anons"
+
+# Test: c_variable-7.43
+# Desc: is anons editable
+mi_gdb_test "-var-show-attributes anons" \
+ "\\^done,attr=\"noneditable\"" \
+ "is anons editable"
+
+# Test: c_variable-7.44
+# Desc: number of children of anons
+mi_gdb_test "-var-info-num-children anons" \
+ "\\^done,numchild=\"3\"" \
+ "get number of children of anons"
+
+# Test: c_variable-7.45
+# Desc: children of anons
+mi_gdb_test "-var-list-children anons" \
+ "\\^done,numchild=\"3\",children=\{child=\{name=\"anons.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anons.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anons.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\}" \
+ "get children of anons"
+
+
+# Test: c_variable-7.50
+# Desc: create enum e
+mi_gdb_test "-var-create e * e" \
+ "\\^done,name=\"e\",numchild=\"0\",type=\"enum foo\"" \
+ "create local variable e"
+
+setup_xfail "*-*-*"
+# Test: c_variable-7.51
+# Desc: value of e
+mi_gdb_test "-var-evaluate-expression e" \
+ "\\^done,value=\"FIXME\"" \
+ "eval variable e"
+clear_xfail "*-*-*"
+
+# Test: c_variable-7.52
+# Desc: type of e
+mi_gdb_test "-var-info-type e" \
+ "\\^done,type=\"enum foo\"" \
+ "info type variable e"
+
+# Test: c_variable-7.53
+# Desc: is e editable
+mi_gdb_test "-var-show-attributes e" \
+ "\\^done,attr=\"editable\"" \
+ "is e editable"
+
+# Test: c_variable-7.54
+# Desc: number of children of e
+mi_gdb_test "-var-info-num-children e" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of e"
+
+# Test: c_variable-7.55
+# Desc: children of e
+mi_gdb_test "-var-list-children e" \
+ "\\^done,numchild=\"0\"" \
+ "get children of e"
+
+# Test: c_variable-7.60
+# Desc: create anone
+mi_gdb_test "-var-create anone * anone" \
+ "\\^done,name=\"anone\",numchild=\"0\",type=\"enum \{\\.\\.\\.\}\"" \
+ "create local variable anone"
+
+setup_xfail "*-*-*"
+# Test: c_variable-7.61
+# Desc: value of anone
+mi_gdb_test "-var-evaluate-expression anone" \
+ "\\^done,value=\"A\"" \
+ "eval variable anone"
+clear_xfail "*-*-*"
+
+
+# Test: c_variable-7.70
+# Desc: create anone
+mi_gdb_test "-var-create anone * anone" \
+ "&\"Duplicate variable object name\\\\n\".*\\^error,msg=\"Duplicate variable object name\"" \
+ "create duplicate local variable anone"
+
+
+# Test: c_variable-7.72
+# Desc: type of anone
+mi_gdb_test "-var-info-type anone" \
+ "\\^done,type=\"enum \{\\.\\.\\.\}\"" \
+ "info type variable anone"
+
+
+# Test: c_variable-7.73
+# Desc: is anone editable
+mi_gdb_test "-var-show-attributes anone" \
+ "\\^done,attr=\"editable\"" \
+ "is anone editable"
+
+# Test: c_variable-7.74
+# Desc: number of children of anone
+mi_gdb_test "-var-info-num-children anone" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of anone"
+
+# Test: c_variable-7.75
+# Desc: children of anone
+mi_gdb_test "-var-list-children anone" \
+ "\\^done,numchild=\"0\"" \
+ "get children of anone"
+
+
+# Record fp
+
+send_gdb "p/x \$fp\n"
+gdb_expect {
+ -re ".*($hex).*\\^done\r\n$mi_gdb_prompt$" {
+ pass "print FP register"
+ set fp $expect_out(1,string)
+ }
+# -re ".*" { fail "print FP register"}
+ timeout { fail "print FP register (timeout)"}
+}
+
+mi_gdb_test "200-break-insert incr_a" \
+ "200\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"incr_a\",file=\".*var-cmd.c\",line=\"85\",times=\"0\"\}" \
+ "break-insert operation"
+send_gdb "-exec-continue\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"2\.*\"\}\\\],file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" {
+ pass "continue to incr_a"
+ }
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\\\[\{name=\"a\",value=\"\.*\"\}\\\],file=\".*var-cmd.c\",line=\"8\[345\]\"\}\r\n$mi_gdb_prompt$" {
+ fail "continue to incr_a (compiler debug info incorrect)"
+ }
+ -re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
+ fail "continue to incr_a (unknown output)"
+ }
+ timeout {
+ fail "continue to incr_a (timeout)"
+ }
+}
+
+# Test: c_variable-7.81
+# Desc: Create variables in different scopes
+mi_gdb_test "-var-create a1 * a" \
+ "\\^done,name=\"a1\",numchild=\"0\",type=\"char\"" \
+ "create local variable a1"
+
+mi_gdb_test "-var-create a2 $fp a" \
+ "\\^done,name=\"a2\",numchild=\"0\",type=\"int\"" \
+ "create variable a2 in different scope"
+
+#gdbtk_test c_variable-7.81 {create variables in different scopes} {
+# set a1 [gdb_variable create -expr a]
+# set a2 [gdb_variable create -expr a -frame $fp]
+
+# set vals {}
+# lappend vals [$a1 value]
+# lappend vals [$a2 value]
+# set vals
+#} {2 1}
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp
new file mode 100644
index 00000000000..25db59869be
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi-watch.exp
@@ -0,0 +1,191 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_watchpoint_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert a watchpoint and list
+ # Tests:
+ # -break-watch C
+ # -break-list
+
+ mi_gdb_test "111-break-watch C" \
+ "111\\^done,wpt=\{number=\"2\",exp=\"C\"\}" \
+ "break-watch operation"
+
+ mi_gdb_test "222-break-list" \
+ "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"1\"\},bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\\\]\}" \
+ "list of watchpoints"
+
+}
+
+# UNUSED at the time
+proc test_awatch_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert an access watchpoint and list it
+ # Tests:
+ # -break-watch -a A
+ # -break-list
+
+ mi_gdb_test "333-break-watch -a A" \
+ "333\\^done,bkpt=\{number=\"1\",addr=\"$hex\",file=\".*basics.c\",line=\"32\"\}" \
+ "break-watch -a operation"
+
+ mi_gdb_test "444-break-list" \
+ "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\\\]\}" \
+ "list of watchpoints awatch"
+
+ mi_gdb_test "777-break-delete 3" \
+ "777\\^done" \
+ "delete access watchpoint"
+}
+
+# UNUSED at the time
+proc test_rwatch_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert a read watchpoint and list it.
+ # Tests:
+ # -break-insert -r B
+ # -break-list
+
+ mi_gdb_test "200-break-watch -r C" \
+ "200\\^done,bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert -r operation"
+
+ mi_gdb_test "300-break-list" \
+ "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\\\}\}" \
+ "list of breakpoints"
+
+ mi_gdb_test "177-break-delete 4" \
+ "177\\^done" \
+ "delete read watchpoint"
+}
+
+proc test_running_the_program {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Run the program without args, then specify srgs and rerun the program
+ # Tests:
+ # -exec-run
+
+ mi_gdb_test "300-break-insert callee4" \
+ "300\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
+ "insert breakpoint at callee4"
+
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ # The following is equivalent to a send_gdb "000-exec-run\n"
+ mi_run_cmd
+ # The running part has been checked already by mi_run_cmd
+ gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \
+ { pass "run to callee4" }
+ -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"}
+ timeout {fail "run to callee4 (timeout 2)"}
+ }
+}
+
+proc test_watchpoint_triggering {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Continue execution until the watchpoint is reached, continue again,
+ # to see the watchpoint go out of scope.
+ # Does:
+ # -exec-continue (Here wp triggers)
+ # -exec-continue (Here wp goes out of scope)
+
+ send_gdb "222-exec-continue\n"
+ gdb_expect {
+ -re "222\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
+ pass "watchpoint trigger"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (2)"}
+ timeout {fail "watchpoint trigger (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (1)"}
+ timeout {fail "watchpoint trigger (timeout 1)"}
+ }
+
+ send_gdb "223-exec-continue\n"
+ gdb_expect {
+ -re "223\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {
+ pass "wp out of scope"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "wp out of scope (2)"}
+ timeout {fail "wp out of scope (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "wp out of scope (1)"}
+ timeout {fail "wp out of scope (timeout 1)"}
+ }
+}
+
+test_running_the_program
+test_watchpoint_creation_and_listing
+#test_rwatch_creation_and_listing
+#test_awatch_creation_and_listing
+test_watchpoint_triggering
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-basics.exp b/gdb/testsuite/gdb.mi/mi0-basics.exp
new file mode 100644
index 00000000000..d463244b816
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-basics.exp
@@ -0,0 +1,174 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# test basic Machine interface (MI) operations
+#
+# Verify that, using the MI, we can load a program and do
+# other basic things that are used by all test files through mi_gdb_exit,
+# mi_gdb_start, mi_delete_breakpoints, mi_gdb_reinitialize_dir and
+# mi_gdb_load, so we can safely use those.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but the command syntax and correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# In this file we want to test if the operations needed by the following
+# procedures work, so it makes no sense using them here.
+
+# mi_delete_breakpoints
+# mi_gdb_reinitialize_dir $srcdir/$subdir
+# mi_gdb_load ${binfile}
+
+# Test if the MI interpreter has been configured
+
+proc test_mi_interpreter_selection {} {
+ global mi_gdb_prompt
+ global gdb_prompt
+
+ # All this test expects is to get the prompt back
+ # with no syntax error message
+ send_gdb "-gdb-version\n"
+ gdb_expect {
+ -re "GNU gdb .*\r\n$mi_gdb_prompt$" \
+ { pass "acceptance of MI operations"
+ return 1}
+ -re ".*\r\n$mi_gdb_prompt$" \
+ { fail "acceptance of MI operations"
+ note "Skipping all other MI tests." }
+ -re "Undefined command.*$gdb_prompt $" \
+ { fail "acceptance of MI operations"
+ note "Skipping all other MI tests." }
+ -re ".*$gdb_prompt $" \
+ { fail "acceptance of MI operations"
+ note "Skipping all other MI tests." }
+ timeout { fail "acceptance of MI operations (timeout)"
+ note "Skipping all other MI tests." }
+ }
+ return 0
+}
+
+proc test_exec_and_symbol_mi_operatons {} {
+ global mi_gdb_prompt
+ global binfile
+
+ # Load symbols and specify executable on a single operation
+ # Tests:
+ # -file-exec-and-symbols
+
+ # Can't use mi_gdb_test as if this doesn't work,
+ # we must give up on the whole test file
+ send_gdb "-file-exec-and-symbols ${binfile}\n"
+ gdb_expect {
+ -re "\[\r\n\]*\\\^done\r\n$mi_gdb_prompt$" \
+ { pass "file-exec-and-symbols operation" }
+ timeout { fail "file-exec-and-symbols operation (timeout)"
+ note "Skipping all other MI tests."
+ return 0}
+ }
+
+ # The following is not used by mi-support.exp, but we test here so
+ # we get done with loading a program basics.
+
+ # Do it again, but now load symbols and specify executable with
+ # two separate operations
+ # Tests:
+ # -file-clear
+ # -file-exec-file
+ # -file-symbol-file
+
+ # FIXME: file-clear is not implemented yet.
+# mi_gdb_test "-file-clear" \
+# "\\\^done" \
+# "file-clear operation"
+
+ mi_gdb_test "-file-exec-file ${binfile}" \
+ "\\\^done" \
+ "file-exec-file operation"
+
+ mi_gdb_test "-file-symbol-file ${binfile}" \
+ "\\\^done" \
+ "file-symbol-file operation"
+
+ # FIXME: if we cannot load we have to skip all other tests.
+}
+
+proc test_breakpoints_deletion {} {
+ global mi_gdb_prompt
+ global srcfile
+
+ # Clear all breakpoints and list to confirm
+ # Tests:
+ # -break-delete (all)
+ # -break-list
+
+ # The all parameter is actually no parameter.
+ mi_gdb_test "200-break-delete" \
+ "\\\^done" \
+ "break-delete (all) operation"
+
+ mi_gdb_test "201-break-list" \
+ ".*\\\^done,BreakpointTable=\\\{\\\}" \
+ "all breakpoints removed"
+}
+
+proc test_dir_specification {} {
+ global mi_gdb_prompt
+ global srcdir
+ global subdir
+
+ # Clear the search directories, then specify one to be searched
+ # Tests:
+ # -environment-directory
+ # -environment-directory arg
+
+#exp_internal 1
+ mi_gdb_test "202-environment-directory" \
+ "\\\^done" \
+ "environment-directory operation"
+
+ mi_gdb_test "203-environment-directory ${srcdir}/${subdir}" \
+ "\\\^done" \
+ "environment-directory arg operation"
+#exp_internal 0
+}
+
+if [test_mi_interpreter_selection] {
+ test_exec_and_symbol_mi_operatons
+ test_breakpoints_deletion
+ test_dir_specification
+}
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-break.exp b/gdb/testsuite/gdb.mi/mi0-break.exp
new file mode 100644
index 00000000000..b763587ae69
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-break.exp
@@ -0,0 +1,138 @@
+# Copyright 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_tbreak_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert -t main
+ # -break-insert -t basics.c:callee2
+ # -break-insert -t basics.c:15
+ # -break-insert -t srcfile:6
+ # -break-list
+
+ mi_gdb_test "222-break-insert -t main" \
+ "222\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert -t operation"
+
+ mi_gdb_test "333-break-insert -t basics.c:callee2" \
+ "333\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \
+ "insert temp breakpoint at basics.c:callee2"
+
+ mi_gdb_test "444-break-insert -t basics.c:15" \
+ "444\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \
+ "insert temp breakpoint at basics.c:15 (callee3)"
+
+ # Getting the quoting right is tricky. That is "\"<file>\":6"
+ mi_gdb_test "555-break-insert -t \"\\\"${srcfile}\\\":6\"" \
+ "555\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \
+ "insert temp breakpoint at \"<fullfilename>\":6 (callee4)"
+
+ mi_gdb_test "666-break-list" \
+ "666\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \
+ "list of breakpoints"
+
+ mi_gdb_test "777-break-delete" \
+ "777\\^done" \
+ "delete temp breakpoints"
+}
+
+proc test_rbreak_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert -r main
+ # -break-insert -r callee2
+ # -break-insert -r callee
+ # -break-insert -r .*llee
+ # -break-list
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "122-break-insert -r main" \
+ "122\\^done,bkpt=\{number=\"5\",addr=\"$hex\",file=\".*basics.c\",line=\"32\"\}" \
+ "break-insert -r operation"
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "133-break-insert -r callee2" \
+ "133\\^done,bkpt=\{number=\"6\",addr=\"$hex\",file=\".*basics.c\",line=\"22\"\}" \
+ "insert breakpoint with regexp callee2"
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "144-break-insert -r callee" \
+ "144\\^done,bkpt=\{number=\"7\",addr=\"$hex\",file=\".*basics.c\",line=\"27\"\},bkpt=\{number=\"8\",addr=\"$hex\",file=\".*basics.c\",line=\"22\"\},bkpt=\{number=\"9\",addr=\"$hex\",file=\".*basics.c\",line=\"17\"\},bkpt=\{number=\"10\",addr=\"$hex\",file=\".*basics.c\",line=\"8\"\}" \
+ "insert breakpoint with regexp callee"
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "155-break-insert -r \.\*llee" \
+ "155\\^done,bkpt=\{number=\"11\",addr=\"$hex\",file=\".*basics.c\",line=\"27\"\},bkpt=\{number=\"12\",addr=\"$hex\",file=\".*basics.c\",line=\"22\"\},bkpt=\{number=\"13\",addr=\"$hex\",file=\".*basics.c\",line=\"17\"\},bkpt=\{number=\"14\",addr=\"$hex\",file=\".*basics.c\",line=\"8\"\}" \
+ "insert breakpoint with regexp .*llee"
+
+ setup_xfail "*-*-*"
+ mi_gdb_test "166-break-list" \
+ "166\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \
+ "list of breakpoints"
+
+ mi_gdb_test "177-break-delete" \
+ "177\\^done" \
+ "delete temp breakpoints"
+}
+
+test_tbreak_creation_and_listing
+test_rbreak_creation_and_listing
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-console.exp b/gdb/testsuite/gdb.mi/mi0-console.exp
new file mode 100644
index 00000000000..a2343db9c59
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-console.exp
@@ -0,0 +1,112 @@
+# Copyright 1999, 2000, 2001 Cygnus Solutions.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+# This test only works when talking to a target that routes its output
+# through GDB. Check that we're either talking to a simulator or a
+# remote target.
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "mi-console"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+# Halt in main
+mi_gdb_test "200-break-insert main" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*mi-console.c\",line=\"13\",times=\"0\"\}" \
+ "break-insert operation"
+mi_run_cmd
+gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*mi-console.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "run to main (2)"
+ }
+ timeout {
+ fail "run to main (timeout)"
+ }
+}
+
+# Next over the hello() call which will produce lots of output
+send_gdb "47-exec-next\n"
+gdb_expect {
+ -re "47\\^running\r\n$mi_gdb_prompt" {
+ pass "Started step over hello"
+ }
+ timeout {
+ fail "Started step over hello (timeout)"
+ }
+}
+
+gdb_expect {
+ -re "@\"H\"\r\n.*@\"e\"\r\n.*@\"l\"\r\n.*@\"l\"\r\n.*@\"o\"\r\n.*@\" \"\r\n.*@\"\\\\\\\\\"\r\n.*@\"\\\\\"\"\r\n.*@\"!\"\r\n.*@\"\\\\r\"\r\n.*@\"\\\\n\"\r\n" {
+ pass "Hello message"
+ }
+ -re "Hello" {
+
+ # Probably a native system where GDB doesn't have direct
+ # control over the inferior console.
+ # For this to work, GDB would need to run the inferior process
+ # under a PTY and then use the even-loops ability to wait on
+ # multiple event sources to channel the output back through the
+ # MI.
+
+ fail "Hello message (known bug)"
+ }
+ timeout {
+ fail "Hello message (timeout)"
+ }
+}
+
+gdb_expect {
+ -re "47\\*stopped.*$mi_gdb_prompt$" {
+ pass "Finished step over hello"
+ }
+ timeout {
+ fail "Finished step over hello (timeout)"
+ }
+}
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-disassemble.exp b/gdb/testsuite/gdb.mi/mi0-disassemble.exp
new file mode 100644
index 00000000000..ca0b3a61a3b
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-disassemble.exp
@@ -0,0 +1,224 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test Machine interface (MI) operations for disassembly.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_breakpoints_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert
+ # -break-list
+ # -break-disable
+ # -break-info
+
+ mi_gdb_test "200-break-insert main" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_gdb_test "204-break-list" \
+ "204\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}\}" \
+ "list of breakpoints"
+}
+
+proc test_running_the_program {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Run the program without args
+ # Tests:
+ # -exec-run
+
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ # FIXME: We are accepting a duplicate file and line info temporarely.
+ # The following is equivalent to a send_gdb "000-exec-run\n"
+ mi_run_cmd
+ # The running part has been checked already by mi_run_cmd
+ gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to main (2)"}
+ timeout {fail "run to main (timeout 2)"}
+ }
+}
+
+proc test_disassembly_only {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+
+ # Test disassembly more only for the current function.
+ # Tests:
+ # -data-disassemble -s $pc -e "$pc+8" -- 0
+ # -data-disassembly -f basics.c -l 32 -- 0
+
+ mi_gdb_test "print/x \$pc" "" ""
+ mi_gdb_test "111-data-disassemble -s \$pc -e \"\$pc + 12\" -- 0" \
+ "111\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \
+ "data-disassemble from pc to pc+12 assembly only"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -- 0" \
+ "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \
+ "data-disassemble file & line, assembly only"
+}
+
+proc test_disassembly_lines_limit {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+
+ # Test disassembly more only for the current function.
+ # Tests:
+ # -data-disassembly -f basics.c -l 32 -n 20 -- 0
+ # -data-disassembly -f basics.c -l 32 -n 0 -- 0
+ # -data-disassembly -f basics.c -l 32 -n 50 -- 0
+
+ mi_gdb_test "print/x \$pc" "" ""
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 0" \
+ "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \
+ "data-disassemble file, line, number assembly only"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 0" \
+ "222\\^done,asm_insns=\{\}" \
+ "data-disassemble file, line, number (zero lines) assembly only"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 0" \
+ "222\\^done,asm_insns=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}" \
+ "data-disassemble file, line, number (more than main lines) assembly only"
+}
+
+
+proc test_disassembly_mixed {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+
+ # Test disassembly more only for the current function.
+ # Tests:
+ # -data-disassembly -f basics.c -l 21 -- 1
+ # -data-disassembly -s $pc -e "$pc+8" -- 1
+
+ mi_gdb_test "002-data-disassemble -f basics.c -l 21 -- 1" \
+ "002\\^done,asm_insns=\{src_and_asm_line=\{line=\"21\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",inst=\".*\"\}.*\}\},.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",inst=\".*\"\}\}\}\}" \
+ "data-disassemble file, line assembly mixed"
+
+ #
+ # In mixed mode, the lowest level of granularity is the source line.
+ # So we are going to get the disassembly for the source line at
+ # which we are now, even if we have specified that the range is only 2 insns.
+ #
+ mi_gdb_test "003-data-disassemble -s \$pc -e \"\$pc+4\" -- 1" \
+ "003\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\}\}\}" \
+ "data-disassemble range assembly mixed"
+}
+
+proc test_disassembly_mixed_lines_limit {} {
+ global mi_gdb_prompt
+ global hex
+ global decimal
+
+ # Test disassembly more only for the current function.
+ # Tests:
+ # -data-disassembly -f basics.c -l 32 -n 20 -- 1
+ # -data-disassembly -f basics.c -l 32 -n 0 -- 1
+ # -data-disassembly -f basics.c -l 32 -n 50 -- 1
+
+ mi_gdb_test "print/x \$pc" "" ""
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 20 -- 1" \
+ "222\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \
+ "data-disassemble file, line, number assembly mixed"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 0 -- 1" \
+ "222\\^done,asm_insns=\{src_and_asm_line=\{line=\"31\",file=\".*basics.c\",line_asm_insn=\{\}\}\}" \
+ "data-disassemble file, line, number (zero lines) assembly mixed"
+
+ mi_gdb_test "222-data-disassemble -f basics.c -l 32 -n 50 -- 1" \
+ "222\\^done,asm_insns=\{src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\{\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\}" \
+ "data-disassemble file, line, number (more than main lines) assembly mixed"
+}
+
+proc test_disassembly_bogus_args {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Test that bogus input to disassembly command is rejected.
+ # Tests:
+ # -data-disassembly -f foo -l abc -n 0 -- 0
+ # -data-disassembly -s foo -e bar -- 0
+ # -data-disassembly -s $pc -f basics.c -- 0
+ # -data-disassembly -f basics.c -l 32 -- 9
+
+ mi_gdb_test "123-data-disassemble -f foo -l abc -n 0 -- 0" \
+ ".*123\\^error,msg=\"mi_cmd_disassemble: Invalid filename.\"" \
+ "data-disassemble bogus filename"
+
+ mi_gdb_test "321-data-disassemble -s foo -e bar -- 0" \
+ "321\\^error,msg=\"No symbol \\\\\"foo\\\\\" in current context.\"" \
+ "data-disassemble bogus address"
+
+ mi_gdb_test "456-data-disassemble -s \$pc -f basics.c -- 0" \
+ "456\\^error,msg=\"mi_cmd_disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. | .-s startaddr -e endaddr.\\) .--. mixed_mode.\"" \
+ "data-disassemble mix different args"
+
+ mi_gdb_test "789-data-disassemble -f basics.c -l 32 -- 9" \
+ "789\\^error,msg=\"mi_cmd_disassemble: Mixed_mode argument must be 0 or 1.\"" \
+ "data-disassemble wrong mode arg"
+
+}
+
+test_breakpoints_creation_and_listing
+test_running_the_program
+test_disassembly_only
+test_disassembly_mixed
+test_disassembly_bogus_args
+test_disassembly_lines_limit
+test_disassembly_mixed_lines_limit
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-eval.exp b/gdb/testsuite/gdb.mi/mi0-eval.exp
new file mode 100644
index 00000000000..0b0ea083488
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-eval.exp
@@ -0,0 +1,101 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify -data-evaluate-expression. There are really minimal tests.
+
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_running_the_program {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Run the program without args, then specify srgs and rerun the program
+ # Tests:
+ # -exec-run
+
+ mi_gdb_test "300-break-insert callee4" \
+ "300\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
+ "insert breakpoint at callee4"
+
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ # The following is equivalent to a send_gdb "000-exec-run\n"
+ mi_run_cmd
+ # The running part has been checked already by mi_run_cmd
+ gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \
+ { pass "run to callee4" }
+ -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"}
+ timeout {fail "run to callee4 (timeout 2)"}
+ }
+
+ send_gdb "101-exec-next\n"
+ gdb_expect {
+ -re "101\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"9\"\}\r\n$mi_gdb_prompt$" \
+ { pass "next in callee4" }
+ -re ".*$mi_gdb_prompt$" {fail "next in callee4 (2)"}
+ timeout {fail "next in callee4 (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "next in callee4 (1)"}
+ timeout {fail "next in callee4 (timeout 1)"}
+ }
+
+}
+
+test_running_the_program
+
+mi_gdb_test "211-data-evaluate-expression A" "211\\^done,value=\"1\"" "eval A"
+
+mi_gdb_test "311-data-evaluate-expression &A" "311\\^done,value=\"$hex\"" "eval &A"
+
+mi_gdb_test "411-data-evaluate-expression A+3" "411\\^done,value=\"4\"" "eval A+3"
+
+mi_gdb_test "511-data-evaluate-expression \"A + 3\"" "511\\^done,value=\"4\"" "eval A + 3"
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-hack-cli.exp b/gdb/testsuite/gdb.mi/mi0-hack-cli.exp
new file mode 100644
index 00000000000..3fc6c26c290
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-hack-cli.exp
@@ -0,0 +1,40 @@
+# Copyright 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+
+# Some basic checks for the CLI.
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+mi_gdb_test "show architecture" \
+ "&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n\\^done" \
+ "show architecture"
+
+mi_gdb_test "47show architecture" \
+ "&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n47\\^done" \
+ "47show architecture"
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-read-memory.exp b/gdb/testsuite/gdb.mi/mi0-read-memory.exp
new file mode 100644
index 00000000000..0bc294970b6
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-read-memory.exp
@@ -0,0 +1,100 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# test basic Machine interface (MI) operations
+#
+# Verify that, using the MI, we can load a program and do
+# other basic things that are used by all test files through mi_gdb_exit,
+# mi_gdb_start, mi_delete_breakpoints, mi_gdb_reinitialize_dir and
+# mi_gdb_load, so we can safely use those.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but the command syntax and correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "mi-read-memory"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+
+mi_run_to_main
+
+#mi_next "do initialization"
+send_gdb "101-exec-next\n"
+gdb_expect {
+ -re "101\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "\[\r\n\]*101\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*mi-read-memory.c\",line=\"20\"\}.*$mi_gdb_prompt$" \
+ { pass "do initialization" }
+ -re ".*$mi_gdb_prompt$" {fail "do initialization (2)"}
+ timeout {fail "do initialization (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "do initialization (1)"}
+ timeout {fail "do initialization (timeout 1)"}
+}
+
+mi_gdb_test "1-data-read-memory" \
+ "1\\^error,msg=\".*\"" \
+ "no arguments"
+
+
+mi_gdb_test "2-data-read-memory bytes x 1 3 2" \
+ "2\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0x00\",\"0x01\"}},{addr=\"$hex\",data={\"0x02\",\"0x03\"}},{addr=\"$hex\",data={\"0x04\",\"0x05\"}}}" \
+ "3x2, one byte"
+
+
+mi_gdb_test "9-data-read-memory -o -6 -- -0+bytes+6 x 1 3 2" \
+ "9\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0x00\",\"0x01\"}},{addr=\"$hex\",data={\"0x02\",\"0x03\"}},{addr=\"$hex\",data={\"0x04\",\"0x05\"}}}" \
+ "3x2, one byte offset by -6"
+
+
+mi_gdb_test "3-data-read-memory \"(shorts + 128)\" x 2 1 2" \
+ "3\\^done,addr=\"$hex\",nr-bytes=\"4\",total-bytes=\"4\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0x0100\",\"0x0102\"}}}" \
+ "expression in quotes"
+
+
+mi_gdb_test "4-data-read-memory bytes+16 x 1 8 4 x" \
+ "4\\^done,addr=\"$hex\",nr-bytes=\"32\",total-bytes=\"32\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0x10\",\"0x11\",\"0x12\",\"0x13\"},ascii=\"xxxx\"},{addr=\"$hex\",data={\"0x14\",\"0x15\",\"0x16\",\"0x17\"},ascii=\"xxxx\"},{addr=\"$hex\",data={\"0x18\",\"0x19\",\"0x1a\",\"0x1b\"},ascii=\"xxxx\"},{addr=\"$hex\",data={\"0x1c\",\"0x1d\",\"0x1e\",\"0x1f\"},ascii=\"xxxx\"},{addr=\"$hex\",data={\"0x20\",\"0x21\",\"0x22\",\"0x23\"},ascii=\" !\\\\\"#\"},{addr=\"$hex\",data={\"0x24\",\"0x25\",\"0x26\",\"0x27\"},ascii=\"\\$%&'\"},{addr=\"$hex\",data={\"0x28\",\"0x29\",\"0x2a\",\"0x2b\"},ascii=\"().+\"},{addr=\"$hex\",data={\"0x2c\",\"0x2d\",\"0x2e\",\"0x2f\"},ascii=\",-\./\"}}" \
+ "ascii and data"
+
+
+mi_gdb_test "5-data-read-memory shorts+64 d 2 1 1" \
+ "5\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"128\"}}}" \
+ "decimal"
+
+mi_gdb_test "6-data-read-memory shorts+64 o 2 1 1" \
+ "6\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory={{addr=\"$hex\",data={\"0200\"}}}" \
+ "octal"
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-regs.exp b/gdb/testsuite/gdb.mi/mi0-regs.exp
new file mode 100644
index 00000000000..b6db903593d
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-regs.exp
@@ -0,0 +1,177 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and look at registers.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_breakpoints_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert
+ # -break-list
+ # -break-disable
+ # -break-info
+
+ mi_gdb_test "200-break-insert main" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_gdb_test "204-break-list" \
+ "204\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}\}" \
+ "list of breakpoints"
+}
+
+proc test_running_the_program {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Run the program without args
+ # Tests:
+ # -exec-run
+
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ # FIXME: We are accepting a duplicate file and line info temporarely.
+ # The following is equivalent to a send_gdb "000-exec-run\n"
+ mi_run_cmd
+ # The running part has been checked already by mi_run_cmd
+ gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to main (2)"}
+ timeout {fail "run to main (timeout 2)"}
+ }
+}
+
+proc sparc_register_tests_no_exec { } {
+ # Test the generic IDT chip.
+ mi_gdb_test "111-data-list-register-values" \
+ ".*111\\^error,msg=\"mi_cmd_data_list_register_values: Usage: -data-list-register-values <format> \\\[<regnum1>...<regnumN>\\\]\"" \
+ "wrong arguments"
+
+ mi_gdb_test "111-data-list-register-values x" \
+ ".*111\\^error,msg=\"mi_cmd_data_list_register_values: No registers\.\"" \
+ "no executable"
+}
+
+# These tests exercise IDT-specific MIPS registers for several
+# different processor models.
+
+# This should detect the actual processor in use and change
+# the expected results appropriately. FIXME
+
+proc sparc_register_tests { } {
+ global hex
+ global decimal
+ set octal "\[0-7\]+"
+ set binary "\[0-1\]+"
+ set float "\\-?((\[0-9\]+(\\.\[0-9\]+)?(e\[-+\]\[0-9\]+)?)|(nan\\($hex\\)))"
+ set float2 "\\-?\[0-9\]+"
+
+ mi_gdb_test "111-data-list-register-names" \
+ "111\\^done,register-names=\{\"g0\",\"g1\",\"g2\",\"g3\",\"g4\",\"g5\",\"g6\",\"g7\",\"o0\",\"o1\",\"o2\",\"o3\",\"o4\",\"o5\",\"sp\",\"o7\",\"l0\",\"l1\",\"l2\",\"l3\",\"l4\",\"l5\",\"l6\",\"l7\",\"i0\",\"i1\",\"i2\",\"i3\",\"i4\",\"i5\",\"fp\",\"i7\",\"f0\",\"f1\",\"f2\",\"f3\",\"f4\",\"f5\",\"f6\",\"f7\",\"f8\",\"f9\",\"f10\",\"f11\",\"f12\",\"f13\",\"f14\",\"f15\",\"f16\",\"f17\",\"f18\",\"f19\",\"f20\",\"f21\",\"f22\",\"f23\",\"f24\",\"f25\",\"f26\",\"f27\",\"f28\",\"f29\",\"f30\",\"f31\",\"y\",\"psr\",\"wim\",\"tbr\",\"pc\",\"npc\",\"fpsr\",\"cpsr\"\}" \
+ "list register names"
+
+ mi_gdb_test "222-data-list-register-values x" \
+ "222\\^done,register-values=\{\{number=\"0\",value=\"$hex\"\}.*\{number=\"71\",value=\"$hex\"\}\}" \
+ "register values x"
+
+ mi_gdb_test "333-data-list-register-values f" \
+ "333\\^done,register-values=\{\{number=\"0\",value=\"$float\"\},\{number=\"1\",value=\"$float\"\},.*\{number=\"71\",value=\"$float\"\}\}" \
+ "register values f"
+
+ mi_gdb_test "444-data-list-register-values d" \
+ "444\\^done,register-values=\{\{number=\"0\",value=\"$decimal\"\}.*\{number=\"71\",value=\"$decimal\"\}\}" \
+ "register values d"
+
+ mi_gdb_test "555-data-list-register-values o" \
+ "555\\^done,register-values=\{\{number=\"0\",value=\"$octal\"\}.*\{number=\"71\",value=\"$octal\"\}\}" \
+ "register values o"
+
+ mi_gdb_test "666-data-list-register-values t" \
+ "666\\^done,register-values=\{\{number=\"0\",value=\"$binary\"\}.*\{number=\"71\",value=\"$binary\"\}\}" \
+ "register values t"
+
+ # On the sparc, registers 0-31 are int, 32-63 float, 64-71 int
+
+ mi_gdb_test "777-data-list-register-values N" \
+ "777\\^done,register-values=\{\{number=\"0\",value=\"$decimal\"\}.*\{number=\"31\",value=\"$decimal\"\},\{number=\"32\",value=\"$float\"\}.*\{number=\"63\",value=\"$float\"\},\{number=\"64\",value=\"$decimal\"\}.*\{number=\"71\",value=\"$decimal\"\}\}" \
+ "register values N"
+
+ mi_gdb_test "888-data-list-register-values r" \
+ "888\\^done,register-values=\{\{number=\"0\",value=\"$hex\"\}.*\{number=\"71\",value=\"$hex\"\}\}" \
+ "register values r"
+
+ mi_gdb_test "999-data-list-register-names 68 69 70 71" \
+ "999\\^done,register-names=\{\"pc\",\"npc\",\"fpsr\",\"cpsr\"\}" \
+ "list names of some regs"
+
+ mi_gdb_test "001-data-list-register-values x 68 69 70 71" \
+ "001\\^done,register-values=\{\{number=\"68\",value=\"$hex\"\},\{number=\"69\",value=\"$hex\"\},\{number=\"70\",value=\"$hex\"\},\{number=\"71\",value=\"$hex\"\}\}" \
+ "list values of some regs"
+
+ # Don't know how useful this test is
+
+ mi_gdb_test "002-data-list-changed-registers" \
+ "002\\^done,changed-registers=\{(\"${decimal}\"(,\"${decimal}\")*)?\}" \
+ "list changed registers"
+}
+
+if [istarget "sparc-*-*"] then {
+ sparc_register_tests_no_exec
+ test_breakpoints_creation_and_listing
+ test_running_the_program
+ sparc_register_tests
+} else {
+ verbose "mi-regs.exp tests ignored for this target"
+}
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-return.exp b/gdb/testsuite/gdb.mi/mi0-return.exp
new file mode 100644
index 00000000000..b396fe8d163
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-return.exp
@@ -0,0 +1,94 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test Machine interface (MI) operations
+# Verify that, using the MI, we can run a simple program and perform
+# exec-return.
+
+# The goal is not to
+# test gdb functionality, which is done by other tests, but to verify
+# the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_running_to_callee4 {} {
+ global mi_gdb_prompt
+ global hex
+
+ mi_gdb_test "200-break-insert callee4" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_run_cmd
+
+ gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to callee4"
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "run to callee4 (2)"
+ }
+ timeout {
+ fail "run to callee4 (timeout)"
+ }
+ }
+
+ mi_gdb_test "205-break-delete" \
+ "205\\^done.*" \
+ "delete all breakpoints"
+
+}
+
+proc test_return_simple {} {
+ global mi_gdb_prompt
+ global hex
+
+ send_gdb "111-exec-return\n"
+ gdb_expect {
+ -re "111\\^done,frame=\{level=\"0 \",addr=\"$hex\",func=\"callee3\",args=\{.*\},file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {pass "return from callee4 now"}
+ -re ".*\r\n$mi_gdb_prompt$" { fail "return from callee4 now" }
+ timeout { fail "return from callee4 now (timeout)"
+ }
+ }
+}
+
+test_running_to_callee4
+test_return_simple
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-simplerun.exp b/gdb/testsuite/gdb.mi/mi0-simplerun.exp
new file mode 100644
index 00000000000..9113e1fa30b
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-simplerun.exp
@@ -0,0 +1,201 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_breakpoints_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert some breakpoints and list them
+ # Also, disable some so they do not interfere with other tests
+ # Tests:
+ # -break-insert
+ # -break-list
+ # -break-disable
+ # -break-info
+
+ mi_gdb_test "200-break-insert main" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_gdb_test "201-break-insert basics.c:callee2" \
+ "201\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",line=\"22\",times=\"0\"\}" \
+ "insert breakpoint at basics.c:callee2"
+
+ mi_gdb_test "202-break-insert basics.c:15" \
+ "202\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee3\",file=\".*basics.c\",line=\"15\",times=\"0\"\}" \
+ "insert breakpoint at basics.c:15 (callee3)"
+
+ mi_gdb_test "203-break-insert \"\\\"${srcfile}\\\":6\"" \
+ "203\\^done,bkpt=\{number=\"4\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"6\",times=\"0\"\}" \
+ "insert breakpoint at \"<fullfilename>\":6 (callee4)"
+
+ mi_gdb_test "204-break-list" \
+ "204\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \
+ "list of breakpoints"
+
+ mi_gdb_test "205-break-disable 2 3 4" \
+ "205\\^done.*" \
+ "disabling of breakpoints"
+
+ mi_gdb_test "206-break-info 2" \
+ "206\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"2\",.*,enabled=\"n\",.*\}\}" \
+ "list of breakpoints, 16 disabled"
+}
+
+proc test_running_the_program {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Run the program without args, then specify srgs and rerun the program
+ # Tests:
+ # -exec-run
+ # -gdb-set
+
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ # The following is equivalent to a send_gdb "000-exec-run\n"
+ mi_run_cmd
+ gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "run to main (2)"
+ }
+ timeout {
+ fail "run to main (timeout)"
+ }
+ }
+}
+
+proc test_controlled_execution {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Continue execution until a breakpoint is reached, step into calls, verifying
+ # if the arguments are correctly shown, continue to the end of a called
+ # function, step over a call (next).
+ # Tests:
+ # -exec-continue
+ # -exec-next
+ # -exec-step
+ # -exec-finish
+
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ mi0_next_to "main" "" "basics.c" "33" "next at main"
+
+ # FIXME: A string argument is not printed right; should be fixed and
+ # we should look for the right thing here.
+ # NOTE: The ``\\\\\"'' is for \".
+ mi0_step_to "callee1" \
+ "\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}" \
+ "basics.c" "27" "step at main"
+
+ # FIXME: A string argument is not printed right; should be fixed and
+ # we should look for the right thing here.
+ mi0_run_to "exec-step 3" "end-stepping-range" "callee4" "" \
+ "basics.c" "8" "" "step to callee4"
+
+ # FIXME: A string argument is not printed right; should be fixed and
+ # we should look for the right thing here.
+ # NOTE: The ``.'' is part of ``gdb-result-var="$1"''
+ mi0_finish_to "callee3" ".*" "basics.c" "18" ".1" "0" "exec-finish"
+}
+
+proc test_controlling_breakpoints {} {
+ global mi_gdb_prompt
+
+ # Enable, delete, set ignore counts in breakpoints
+ # (disable was already tested above)
+ # Tests:
+ # -break-delete
+ # -break-enable
+ # -break-after
+ # -break-condition
+
+}
+
+proc test_program_termination {} {
+ global mi_gdb_prompt
+
+ # Run to completion: normal and forced
+ # Tests:
+ # -exec-abort
+ # (normal termination of inferior)
+
+ # FIXME: "stopped" doesn't seem appropriate.
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ send_gdb "999-exec-continue\n"
+ gdb_expect {
+ -re "999\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "999\\*stopped,reason=\"exited-normally\"\r\n$mi_gdb_prompt$" {
+ pass "continue to end"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "continue to end (2)"}
+ timeout {fail "continue to end (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "continue to end (1)"}
+ timeout {fail "continue to end (timeout 1)"}
+ }
+}
+
+test_breakpoints_creation_and_listing
+test_running_the_program
+test_controlled_execution
+test_controlling_breakpoints
+test_program_termination
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-stack.exp b/gdb/testsuite/gdb.mi/mi0-stack.exp
new file mode 100644
index 00000000000..270aa84ff6f
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-stack.exp
@@ -0,0 +1,218 @@
+# Copyright 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that stack commands work.
+
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+
+mi_gdb_test "200-break-insert callee4" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
+ "break-insert operation"
+
+mi_run_cmd
+# The running part has been checked already by mi_run_cmd
+gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to callee4"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"}
+ timeout {fail "run to callee4 (timeout 2)"}
+}
+
+
+proc test_stack_frame_listing {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Obtain a stack trace
+ # Tests:
+ # -stack-list-frames
+ # -stack-list-frames 1 1
+ # -stack-list-frames 1 3
+
+ mi_gdb_test "231-stack-list-frames" \
+ "231\\^done,stack=\{frame=\{level=\"0 \",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\"\},frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\},frame=\{level=\"4 \",addr=\"$hex\",func=\"main\",.*\}\}" \
+ "stack frame listing"
+ mi_gdb_test "232-stack-list-frames 1 1" \
+ "232\\^done,stack=\{frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\}\}" \
+ "stack frame listing 1 1"
+ mi_gdb_test "233-stack-list-frames 1 3" \
+ "233\\^done,stack=\{frame=\{level=\"1 \",addr=\"$hex\",func=\"callee3\",.*\},frame=\{level=\"2 \",addr=\"$hex\",func=\"callee2\",.*\},frame=\{level=\"3 \",addr=\"$hex\",func=\"callee1\",.*\}\}" \
+ "stack frame listing 1 3"
+
+ mi_gdb_test "234-stack-list-frames 1" \
+ "234\\^error,msg=\"mi_cmd_stack_list_frames: Usage.*FRAME_LOW FRAME_HIGH.*\"" \
+ "stack frame listing wrong"
+}
+
+proc test_stack_args_listing {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Obtain lists for args for the stack frames
+ # Tests:
+ # -stack-list-arguments 0
+ # -stack-list-arguments 0 1 1
+ # -stack-list-arguments 0 1 3
+ # -stack-list-arguments 1
+ # -stack-list-arguments 1 1 1
+ # -stack-list-arguments 1 1 3
+ # -stack-list-arguments
+
+ mi_gdb_test "231-stack-list-arguments 0" \
+ "231\\^done,stack-args=\{frame=\{level=\"0\",args=\{\}\},frame=\{level=\"1\",args=\{name=\"strarg\"\}\},frame=\{level=\"2\",args=\{name=\"intarg\",name=\"strarg\"\}\},frame=\{level=\"3\",args=\{name=\"intarg\",name=\"strarg\",name=\"fltarg\"\}\},frame=\{level=\"4\",args=\{\}\}\}" \
+ "stack args listing 0"
+
+ mi_gdb_test "232-stack-list-arguments 0 1 1" \
+ "232\\^done,stack-args=\{frame=\{level=\"1\",args=\{name=\"strarg\"\}\}\}" \
+ "stack args listing 0 1 1"
+
+ mi_gdb_test "233-stack-list-arguments 0 1 3" \
+ "233\\^done,stack-args=\{frame=\{level=\"1\",args=\{name=\"strarg\"\}\},frame=\{level=\"2\",args=\{name=\"intarg\",name=\"strarg\"\}\},frame=\{level=\"3\",args=\{name=\"intarg\",name=\"strarg\",name=\"fltarg\"\}\}\}" \
+ "stack args listing 0 1 3"
+
+ mi_gdb_test "231-stack-list-arguments 1" \
+ "231\\^done,stack-args=\{frame=\{level=\"0\",args=\{\}\},frame=\{level=\"1\",args=\{\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"2\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"3\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\}\},frame=\{level=\"4\",args=\{\}\}\}" \
+ "stack args listing 1"
+
+ mi_gdb_test "232-stack-list-arguments 1 1 1" \
+ "232\\^done,stack-args=\{frame=\{level=\"1\",args=\{\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\}\}" \
+ "stack args listing 1 1 1"
+
+ mi_gdb_test "233-stack-list-arguments 1 1 3" \
+ "233\\^done,stack-args=\{frame=\{level=\"1\",args=\{\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"2\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\}\}\},frame=\{level=\"3\",args=\{\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}\}\}\}" \
+ "stack args listing 1 1 3"
+
+ mi_gdb_test "234-stack-list-arguments" \
+ "234\\^error,msg=\"mi_cmd_stack_list_args: Usage.*PRINT_VALUES.*FRAME_LOW FRAME_HIGH.*\"" \
+ "stack args listing wrong"
+}
+
+proc test_stack_info_depth {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Obtain depth of stack
+ # Tests:
+ # -stack-info-depth
+ # -stack-info-depth 3
+ # -stack-info-depth 99
+
+ mi_gdb_test "231-stack-info-depth" \
+ "231\\^done,depth=\"5\"" \
+ "stack info-depth"
+
+ mi_gdb_test "231-stack-info-depth 3" \
+ "231\\^done,depth=\"3\"" \
+ "stack info-depth 3"
+
+ mi_gdb_test "231-stack-info-depth 99" \
+ "231\\^done,depth=\"5\"" \
+ "stack info-depth 99"
+
+ mi_gdb_test "231-stack-info-depth 99 99" \
+ "231\\^error,msg=\"mi_cmd_stack_info_depth: Usage: .MAX_DEPTH.\"" \
+ "stack info-depth wrong usage"
+}
+
+proc test_stack_locals_listing {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Obtain lists for locals for the stack frames
+ # Tests:
+ # -stack-list-locals 0
+ # -stack-list-locals 1
+ # -stack-list-arguments
+
+ mi_gdb_test "232-stack-list-locals 0" \
+ "232\\^done,locals=\{name=\"A\",name=\"B\",name=\"C\"\}" \
+ "stack locals listing 0"
+
+# step until A, B, C, have some reasonable values.
+send_gdb "-exec-next 3\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
+ pass "next's in callee4"
+ }
+ timeout { fail "next in callee4 (timeout)" }
+}
+
+ mi_gdb_test "232-stack-list-locals 1" \
+ "232\\^done,locals=\{\{name=\"A\",value=\"1\"\},\{name=\"B\",value=\"2\"\},\{name=\"C\",value=\"3\"\}\}" \
+ "stack locals listing 1"
+
+ mi_gdb_test "234-stack-list-locals" \
+ "234\\^error,msg=\"mi_cmd_stack_list_locals: Usage.*PRINT_VALUES.*\"" \
+ "stack locals listing wrong"
+
+ mi_gdb_test "232-stack-select-frame 1" \
+ "232\\^done" \
+ "stack select frame 1"
+
+ mi_gdb_test "232-stack-list-locals 1" \
+ "232\\^done,locals=\{\}" \
+ "stack locals listing for new frame"
+
+# this should be a no-op
+
+ mi_gdb_test "232-stack-select-frame" \
+ "232\\^done" \
+ "stack select same frame"
+
+ mi_gdb_test "232-stack-list-locals 1" \
+ "232\\^done,locals=\{\}" \
+ "stack locals for same frame (level 1)"
+
+}
+
+test_stack_frame_listing
+test_stack_args_listing
+test_stack_locals_listing
+test_stack_info_depth
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-stepi.exp b/gdb/testsuite/gdb.mi/mi0-stepi.exp
new file mode 100644
index 00000000000..456b2a1a9bc
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-stepi.exp
@@ -0,0 +1,109 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test Machine interface (MI) operations
+# Verify that, using the MI, we can run a simple program and perform
+# exec-step-instruction and exec-next-instruction.
+
+# The goal is not to
+# test gdb functionality, which is done by other tests, but to verify
+# the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_running_to_main {} {
+ global mi_gdb_prompt
+ global hex
+
+ mi_gdb_test "200-break-insert main" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_run_cmd
+
+ gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "run to main (2)"
+ }
+ timeout {
+ fail "run to main (timeout)"
+ }
+ }
+}
+
+proc test_stepi_nexti {} {
+ global mi_gdb_prompt
+ global hex
+
+ send_gdb "111-exec-step-instruction\n"
+ gdb_expect {
+ -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" {
+ pass "step-instruction at main"
+ }
+ timeout {
+ fail "step-instruction at main (timeout)"
+ }
+ }
+ send_gdb "222-exec-next-instruction\n"
+ gdb_expect {
+ -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" {
+ pass "next-instruction at main"
+ }
+ timeout {
+ fail "next-instruction at main (timeout)"
+ }
+ }
+ send_gdb "333-exec-next-instruction\n"
+ gdb_expect {
+ -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"3.\"\}\r\n$mi_gdb_prompt$" {
+ pass "next-instruction at main"
+ }
+ timeout {
+ fail "next-instruction at main (timeout)"
+ }
+ }
+}
+
+test_running_to_main
+test_stepi_nexti
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-until.exp b/gdb/testsuite/gdb.mi/mi0-until.exp
new file mode 100644
index 00000000000..1cf58a80971
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-until.exp
@@ -0,0 +1,127 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test Machine interface (MI) operations
+# Verify that, using the MI, we can run a simple program and perform
+# exec-until.
+
+# The goal is not to
+# test gdb functionality, which is done by other tests, but to verify
+# the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "until"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_running_to_foo {} {
+ global mi_gdb_prompt
+ global hex
+
+ mi_gdb_test "200-break-insert 10" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"foo\",file=\".*until.c\",line=\"10\",times=\"0\"\}" \
+ "break-insert operation"
+
+ mi_run_cmd
+
+ gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"10\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to main"
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "run to main (2)"
+ }
+ timeout {
+ fail "run to main (timeout)"
+ }
+ }
+
+ mi_gdb_test "100-break-delete 1" "100\\^done" "break-delete 1"
+
+}
+
+proc test_until {} {
+ global mi_gdb_prompt
+ global hex
+
+ send_gdb "111-exec-until\n"
+ gdb_expect {
+ -re "111\\^running\r\n${mi_gdb_prompt}111\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"12\"\}\r\n$mi_gdb_prompt$" {
+ pass "until after while loop"
+ }
+ timeout {
+ fail "until after while loop (timeout)"
+ }
+ }
+
+ send_gdb "222-exec-until 15\n"
+ gdb_expect {
+ -re "222\\^running\r\n${mi_gdb_prompt}222\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"15\"\}\r\n$mi_gdb_prompt$" {
+ pass "until line number"
+ }
+ timeout {
+ fail "until line number (timeout)"
+ }
+ }
+
+ send_gdb "333-exec-until until.c:17\n"
+ gdb_expect {
+ -re "333\\^running\r\n${mi_gdb_prompt}333\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"17\"\}\r\n$mi_gdb_prompt$" {
+ pass "until line number:file"
+ }
+ timeout {
+ fail "until line number:file (timeout)"
+ }
+ }
+
+ # This is supposed to NOT stop at line 25. It stops right after foo is over.
+
+ send_gdb "444-exec-until until.c:25\n"
+ gdb_expect {
+ -re "444\\^running\r\n${mi_gdb_prompt}444\\*stopped,reason=\"location-reached\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*until.c\",line=\"24\"\}\r\n$mi_gdb_prompt$" {
+ pass "until after current function"
+ }
+ timeout {
+ fail "until after current function (timeout)"
+ }
+ }
+
+}
+
+test_running_to_foo
+test_until
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-var-block.exp b/gdb/testsuite/gdb.mi/mi0-var-block.exp
new file mode 100644
index 00000000000..023213912d8
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-var-block.exp
@@ -0,0 +1,228 @@
+# Copyright (C) 1999 2000 s Solutions
+#
+# This Program Is Free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can create, update, delete variables.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "var-cmd"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+mi_gdb_test "200-break-insert do_block_tests" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_block_tests\",file=\".*var-cmd.c\",line=\"154\",times=\"0\"\}" \
+ "break-insert operation"
+
+mi_run_cmd
+# The running part has been checked already by mi_run_cmd
+gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"154\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to do_block_tests"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to do_block_tests (2)"}
+ timeout {fail "run to do_block_tests (timeout 2)"}
+}
+
+# Test: c_variable-3.2
+# Desc: create cb and foo
+mi_gdb_test "-var-create cb * cb" \
+ "\\^done,name=\"cb\",numchild=\"0\",type=\"int\"" \
+ "create local variable cb"
+
+mi_gdb_test "-var-create foo * foo" \
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create local variable foo"
+
+# step to "foo = 123;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"158\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_block_tests"
+ }
+ timeout {
+ fail "step at do_block_tests (timeout)"
+ }
+}
+
+
+# Be paranoid and assume 3.2 created foo
+mi_gdb_test "-var-delete foo" \
+ "&\"Variable object not found\\\\n\".*\\^error,msg=\"Variable object not found\"" \
+ "delete var foo"
+
+
+# Test: c_variable-3.3
+# Desc: create foo
+mi_gdb_test "-var-create foo * foo" \
+ "\\^done,name=\"foo\",numchild=\"0\",type=\"int\"" \
+ "create local variable foo"
+
+# step to "foo2 = 123;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"161\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_block_tests"
+ }
+ timeout {
+ fail "step at do_block_tests (timeout)"
+ }
+}
+
+# Test: c_variable-3.4
+# Desc: check foo, cb changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"foo\",in_scope=\"true\",type_changed=\"false\",name=\"cb\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: cb foo changed"
+
+# step to "foo = 321;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"164\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_block_tests"
+ }
+ timeout {
+ fail "step at do_block_tests (timeout)"
+ }
+}
+
+# Test: c_variable-3.5
+# Desc: create inner block foo
+mi_gdb_test "-var-create inner_foo * foo" \
+ "\\^done,name=\"inner_foo\",numchild=\"0\",type=\"int\"" \
+ "create local variable inner_foo"
+
+# step to "foo2 = 0;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"166\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_block_tests"
+ }
+ timeout { fail "step at do_block_tests (timeout)" }
+}
+
+# Test: c_variable-3.6
+# Desc: create foo2
+mi_gdb_test "-var-create foo2 * foo2" \
+ "\\^done,name=\"foo2\",numchild=\"0\",type=\"int\"" \
+ "create local variable foo2"
+
+# Test: c_variable-3.7
+# Desc: check that outer foo in scope and inner foo out of scope
+# Note: also a known gdb problem
+setup_xfail *-*-*
+mi_gdb_test "-var-update inner_foo" \
+ "\\^done,changelist=\{FIXME\}" \
+ "update inner_foo: should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+
+setup_xfail *-*-*
+mi_gdb_test "-var-evaluate-expression inner_foo" \
+ "\\^done,value=\{FIXME\}" \
+ "evaluate inner_foo: should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+
+mi_gdb_test "-var-update foo" \
+ "\\^done,changelist=\{\}" \
+ "update foo: did not change"
+
+mi_gdb_test "-var-delete inner_foo" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var inner_foo"
+
+# step to "foo = 0;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"168\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_block_tests"
+ }
+ timeout { fail "step at do_block_tests (timeout)" }
+}
+
+# Test: c_variable-3.8
+# Desc: check that foo2 out of scope (known gdb problem)
+setup_xfail *-*-*
+mi_gdb_test "-var-update foo2" \
+ "\\^done,changelist=\{FIXME\}" \
+ "update foo2: should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+
+# step to "cb = 21;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_block_tests\",args=\{\},file=\".*var-cmd.c\",line=\"171\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_block_tests"
+ }
+ timeout { fail "step at do_block_tests (timeout)" }
+}
+
+
+# Test: c_variable-3.9
+# Desc: check that only cb is in scope (known gdb problem)
+setup_xfail *-*-*
+mi_gdb_test "-var-update foo2" \
+ "\\^done,changelist=\{FIXME\}" \
+ "update foo2 should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+setup_xfail *-*-*
+mi_gdb_test "-var-update foo" \
+ "\\^done,changelist=\{FIXME\}" \
+ "update foo should be out of scope: KNOWN PROBLEM"
+clear_xfail *-*-*
+mi_gdb_test "-var-update cb" \
+ "\\^done,changelist=\{\}" \
+ "update cb"
+
+# Test: c_variable-3.10
+# Desc: names of editable variables
+#gdbtk_test c_variable-3.10 {names of editable variables} {
+# editable_variables
+#} {{foo cb foo2} {}}
+
+# Done with block tests
+mi_gdb_test "-var-delete foo" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var foo"
+
+mi_gdb_test "-var-delete foo2" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var foo2"
+
+mi_gdb_test "-var-delete cb" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var cb"
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-var-child.exp b/gdb/testsuite/gdb.mi/mi0-var-child.exp
new file mode 100644
index 00000000000..bd7462206fc
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-var-child.exp
@@ -0,0 +1,1333 @@
+# Copyright (C) 1999 2000 Cygnus Solutions
+#
+# This Program Is Free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can create, update, delete variables.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "var-cmd"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+mi_gdb_test "200-break-insert do_children_tests" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"190\",times=\"0\"\}" \
+ "break-insert operation"
+
+mi_run_cmd
+# The running part has been checked already by mi_run_cmd
+gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"190\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to do_children_tests"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
+ timeout {fail "run to do_children_tests (timeout 2)"}
+}
+
+##### #####
+# #
+# children tests #
+# #
+##### #####
+
+
+# Test: c_variable-4.2
+# Desc: create variable "struct_declarations"
+mi_gdb_test "-var-create struct_declarations * struct_declarations" \
+ "\\^done,name=\"struct_declarations\",numchild=\"11\",type=\"struct _struct_decl\"" \
+ "create local variable struct_declarations"
+
+# Test: c_variable-4.3
+# Desc: children of struct_declarations
+# STABS doesn't give us argument types for the func ptr structs, but
+# Dwarf 2 does.
+mi_gdb_test "-var-list-children struct_declarations" \
+ "\\^done,numchild=\"11\",children=\{child=\{name=\"struct_declarations.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"struct_declarations.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"struct_declarations.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"struct_declarations.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
+ "get children of struct_declarations"
+
+#gdbtk_test c_variable-4.3 {children of struct_declarations} {
+# get_children struct_declarations
+#} {integer character char_ptr long_int int_ptr_ptr long_array func_ptr func_ptr_struct func_ptr_ptr u1 s2}
+
+# Test: c_variable-4.4
+# Desc: number of children of struct_declarations
+mi_gdb_test "-var-info-num-children struct_declarations" \
+ "\\^done,numchild=\"11\"" \
+ "get number of children of struct_declarations"
+
+# Test: c_variable-4.5
+# Desc: children of struct_declarations.integer
+mi_gdb_test "-var-list-children struct_declarations.integer" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.integer"
+
+# Test: c_variable-4.6
+# Desc: number of children of struct_declarations.integer
+mi_gdb_test "-var-info-num-children struct_declarations.integer" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.integer"
+
+# Test: c_variable-4.7
+# Desc: children of struct_declarations.character
+mi_gdb_test "-var-list-children struct_declarations.character" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.character"
+
+# Test: c_variable-4.8
+# Desc: number of children of struct_declarations.character
+mi_gdb_test "-var-info-num-children struct_declarations.character" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.character"
+
+# Test: c_variable-4.9
+# Desc: children of struct_declarations.char_ptr
+mi_gdb_test "-var-list-children struct_declarations.char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of struct_declarations.char_ptr"
+
+# Test: c_variable-4.10
+# Desc: number of children of struct_declarations.char_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of struct_declarations.char_ptr"
+
+# Test: c_variable-4.11
+# Desc: children of struct_declarations.long_int
+mi_gdb_test "-var-list-children struct_declarations.long_int" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_int"
+
+# Test: c_variable-4.12
+# Desc: number of children of struct_declarations.long_int
+mi_gdb_test "-var-info-num-children struct_declarations.long_int" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_int"
+
+# Test: c_variable-4.13
+# Desc: children of int_ptr_ptr
+mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \
+ "get children of struct_declarations.int_ptr_ptr"
+
+#gdbtk_test c_variable-4.13 {children of int_ptr_ptr} {
+# get_children struct_declarations.int_ptr_ptr
+#} {*int_ptr_ptr}
+
+# Test: c_variable-4.14
+# Desc: number of children of int_ptr_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of struct_declarations.int_ptr_ptr"
+
+
+# Test: c_variable-4.15
+# Desc: children of struct_declarations.long_array
+mi_gdb_test "-var-list-children struct_declarations.long_array" \
+ "\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \
+ "get children of struct_declarations.long_array"
+
+# Test: c_variable-4.16
+# Desc: number of children of struct_declarations.long_array
+mi_gdb_test "-var-info-num-children struct_declarations.long_array" \
+ "\\^done,numchild=\"10\"" \
+ "get number of children of struct_declarations.long_array"
+
+# Test: c_variable-4.17
+# Desc: children of struct_declarations.func_ptr
+mi_gdb_test "-var-list-children struct_declarations.func_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.func_ptr"
+
+
+# Test: c_variable-4.18
+# Desc: number of children of struct_declarations.func_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.func_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.func_ptr"
+
+
+# Test: c_variable-4.19
+# Desc: children of struct_declarations.func_ptr_struct
+mi_gdb_test "-var-list-children struct_declarations.func_ptr_struct" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.func_ptr_struct"
+
+# Test: c_variable-4.20
+# Desc: number of children of struct_declarations.func_ptr_struct
+mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_struct" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.func_ptr_struct"
+
+
+# Test: c_variable-4.21
+# Desc: children of struct_declarations.func_ptr_ptr
+mi_gdb_test "-var-list-children struct_declarations.func_ptr_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.func_ptr_ptr"
+
+# Test: c_variable-4.22
+# Desc: number of children of struct_declarations.func_ptr_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.func_ptr_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.func_ptr_ptr"
+
+
+# Test: c_variable-4.23
+# Desc: children of struct_declarations.u1
+mi_gdb_test "-var-list-children struct_declarations.u1" \
+ "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.u1.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.u1.b\",exp=\"b\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"struct_declarations.u1.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.u1.d\",exp=\"d\",numchild=\"0\",type=\"enum foo\"\}\}" \
+ "get children of struct_declarations.u1"
+
+# Test: c_variable-4.24
+# Desc: number of children of struct_declarations.u1
+mi_gdb_test "-var-info-num-children struct_declarations.u1" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of struct_declarations.u1"
+
+# Test: c_variable-4.25
+# Desc: children of struct_declarations.s2
+mi_gdb_test "-var-list-children struct_declarations.s2" \
+ "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.s2.u2\",exp=\"u2\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.g\",exp=\"g\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.h\",exp=\"h\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.i\",exp=\"i\",numchild=\"10\",type=\"long int \\\[10\\\]\"\}\}" \
+ "get children of struct_declarations.s2"
+#gdbtk_test c_variable-4.25 {children of struct_declarations.s2} {
+# get_children struct_declarations.s2
+#} {u2 g h i}
+
+# Test: c_variable-4.26
+# Desc: number of children of struct_declarations.s2
+mi_gdb_test "-var-info-num-children struct_declarations.s2" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of struct_declarations.s2"
+
+
+# Test: c_variable-4.27
+# Desc: children of struct_declarations.long_array.1
+mi_gdb_test "-var-list-children struct_declarations.long_array.1" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.1"
+
+# Test: c_variable-4.28
+# Desc: number of children of struct_declarations.long_array.1
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.1" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.1"
+
+# Test: c_variable-4.29
+# Desc: children of struct_declarations.long_array.2
+mi_gdb_test "-var-list-children struct_declarations.long_array.2" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.2"
+
+# Test: c_variable-4.30
+# Desc: number of children of struct_declarations.long_array.2
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.2" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.2"
+
+# Test: c_variable-4.31
+# Desc: children of struct_declarations.long_array.3
+mi_gdb_test "-var-list-children struct_declarations.long_array.3" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.3"
+
+# Test: c_variable-4.32
+# Desc: number of children of struct_declarations.long_array.3
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.3" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.3"
+
+# Test: c_variable-4.33
+# Desc: children of struct_declarations.long_array.4
+mi_gdb_test "-var-list-children struct_declarations.long_array.4" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.4"
+
+# Test: c_variable-4.34
+# Desc: number of children of struct_declarations.long_array.4
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.4" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.4"
+
+# Test: c_variable-4.35
+# Desc: children of struct_declarations.long_array.5
+mi_gdb_test "-var-list-children struct_declarations.long_array.5" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.5"
+
+# Test: c_variable-4.36
+# Desc: number of children of struct_declarations.long_array.5
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.5" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.5"
+
+# Test: c_variable-4.37
+# Desc: children of struct_declarations.long_array.6
+mi_gdb_test "-var-list-children struct_declarations.long_array.6" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.6"
+
+# Test: c_variable-4.38
+# Desc: number of children of struct_declarations.long_array.6
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.6" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.6"
+
+# Test: c_variable-4.39
+# Desc: children of struct_declarations.long_array.7
+mi_gdb_test "-var-list-children struct_declarations.long_array.7" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.7"
+
+# Test: c_variable-4.40
+# Desc: number of children of struct_declarations.long_array.7
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.7" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.7"
+
+# Test: c_variable-4.41
+# Desc: children of struct_declarations.long_array.8
+mi_gdb_test "-var-list-children struct_declarations.long_array.8" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.8"
+
+# Test: c_variable-4.42
+# Desc: number of children of struct_declarations.long_array.8
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.8" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.8"
+
+
+# Test: c_variable-4.43
+# Desc: children of struct_declarations.long_array.9
+mi_gdb_test "-var-list-children struct_declarations.long_array.9" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.long_array.9"
+
+# Test: c_variable-4.44
+# Desc: number of children of struct_declarations.long_array.9
+mi_gdb_test "-var-info-num-children struct_declarations.long_array.9" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.long_array.9"
+
+# Test: c_variable-4.45
+# Desc: children of struct_declarations.u1.a
+mi_gdb_test "-var-list-children struct_declarations.u1.a" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.u1.a"
+
+# Test: c_variable-4.46
+# Desc: number of children of struct_declarations.u1.a
+mi_gdb_test "-var-info-num-children struct_declarations.u1.a" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.u1.a"
+
+# Test: c_variable-4.47
+# Desc: children of struct_declarations.u1.b
+mi_gdb_test "-var-list-children struct_declarations.u1.b" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.u1.b.\\*b\",exp=\"\\*b\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of struct_declarations.u1.b"
+
+# Test: c_variable-4.48
+# Desc: number of children of struct_declarations.u1.b
+mi_gdb_test "-var-info-num-children struct_declarations.u1.b" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of struct_declarations.u1.b"
+
+# Test: c_variable-4.49
+# Desc: children of struct_declarations.u1.c
+mi_gdb_test "-var-list-children struct_declarations.u1.c" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.u1.c"
+
+# Test: c_variable-4.50
+# Desc: number of children of struct_declarations.u1.c
+mi_gdb_test "-var-info-num-children struct_declarations.u1.c" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.u1.c"
+
+# Test: c_variable-4.51
+# Desc: children of struct_declarations.u1.d
+mi_gdb_test "-var-list-children struct_declarations.u1.d" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.u1.d"
+
+
+# Test: c_variable-4.52
+# Desc: number of children of struct_declarations.u1.d
+mi_gdb_test "-var-info-num-children struct_declarations.u1.d" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.u1.d"
+
+
+# Test: c_variable-4.53
+# Desc: children of struct_declarations.s2.u2
+mi_gdb_test "-var-list-children struct_declarations.s2.u2" \
+ "\\^done,numchild=\"3\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1\",exp=\"u1s1\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\},child=\{name=\"struct_declarations.s2.u2.f\",exp=\"f\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.u2.u1s2\",exp=\"u1s2\",numchild=\"2\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
+ "get children of struct_declarations.s2.u2"
+
+# Test: c_variable-4.54
+# Desc: number of children of struct_declarations.s2.u2
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2" \
+ "\\^done,numchild=\"3\"" \
+ "get number of children of struct_declarations.s2.u2"
+
+# Test: c_variable-4.55
+# Desc: children of struct_declarations.s2.g
+mi_gdb_test "-var-list-children struct_declarations.s2.g" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.g"
+
+# Test: c_variable-4.56
+# Desc: number of children of struct_declarations.s2.g
+mi_gdb_test "-var-info-num-children struct_declarations.s2.g" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.g"
+
+
+# Test: c_variable-4.57
+# Desc: children of struct_declarations.s2.h
+mi_gdb_test "-var-list-children struct_declarations.s2.h" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.h"
+
+# Test: c_variable-4.58
+# Desc: number of children of struct_declarations.s2.h
+mi_gdb_test "-var-info-num-children struct_declarations.s2.h" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.h"
+
+
+# Test: c_variable-4.59
+# Desc: children of struct_declarations.s2.i
+mi_gdb_test "-var-list-children struct_declarations.s2.i" \
+ "\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.s2.i.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"struct_declarations.s2.i.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \
+ "get children of struct_declarations.s2.i"
+
+# Test: c_variable-4.60
+# Desc: number of children of struct_declarations.s2.i
+mi_gdb_test "-var-info-num-children struct_declarations.s2.i" \
+ "\\^done,numchild=\"10\"" \
+ "get number of children of struct_declarations.s2.i"
+
+# Test: c_variable-4.61
+# Desc: children of struct_declarations.s2.u2.u1s1
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1" \
+ "\\^done,numchild=\"4\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1.d\",exp=\"d\",numchild=\"0\",type=\"int\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e\",exp=\"e\",numchild=\"10\",type=\"char \\\[10\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.func\",exp=\"func\",numchild=\"0\",type=\"int \\*\\(\\*\\)\\((void)?\\)\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.foo\",exp=\"foo\",numchild=\"0\",type=\"efoo\"\}\}" \
+ "get children of struct_declarations.s2.u2.u1s1"
+
+# Test: c_variable-4.62
+# Desc: number of children of struct_declarations.s2.u2.u1s1
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1"
+
+# Test: c_variable-4.63
+# Desc: children of struct_declarations.s2.u2.f
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.f" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.f"
+
+# Test: c_variable-4.64
+# Desc: number of children of struct_declarations.s2.u2.f
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.f" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.f"
+
+# Test: c_variable-4.65
+# Desc: children of struct_declarations.s2.u2.u1s2
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2" \
+ "\\^done,numchild=\"2\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr\",exp=\"array_ptr\",numchild=\"2\",type=\"char \\\[2\\\]\"\},child=\{name=\"struct_declarations.s2.u2.u1s2.func\",exp=\"func\",numchild=\"0\",type=\"int \\(\\*\\)\\((int, char \\*)?\\)\"\}\}" \
+ "get children of struct_declarations.s2.u2.u1s2"
+
+# Test: c_variable-4.66
+# Desc: number of children of struct_declarations.s2.u2.u1s2
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2" \
+ "\\^done,numchild=\"2\"" \
+ "get number of children of struct_declarations.s2.u2.u1s2"
+
+# Test: c_variable-4.67
+# Desc: children of struct_declarations.s2.u2.u1s1.d
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.d" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.u1s1.d"
+
+# Test: c_variable-4.68
+# Desc: number of children of struct_declarations.s2.u2.u1s1.d
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.d" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1.d"
+
+# Test: c_variable-4.69
+# Desc: children of struct_declarations.s2.u2.u1s1.e
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.e" \
+ "\\^done,numchild=\"10\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s1.e.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.1\",exp=\"1\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.2\",exp=\"2\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s1.e.3\",exp=\"3\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.4\",exp=\"4\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.5\",exp=\"5\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.6\",exp=\"6\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.7\",exp=\"7\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.8\",exp=\"8\",numchild=\"0\",type=\"char\"\},child=\{name=\"struct_declarations.s2.u2.u1s1.e.9\",exp=\"9\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of struct_declarations.s2.u2.u1s1.e"
+
+# Test: c_variable-4.70
+# Desc: number of children of struct_declarations.s2.u2.u1s1.e
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.e" \
+ "\\^done,numchild=\"10\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1.e"
+
+
+# Test: c_variable-4.71
+# Desc: children of struct_declarations.s2.u2.u1s1.func
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.func" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.u1s1.func"
+
+# Test: c_variable-4.72
+# Desc: number of children of struct_declarations.s2.u2.u1s1.func
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.func" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1.func"
+
+
+# Test: c_variable-4.73
+# Desc: children of struct_declarations.s2.u2.u1s1.foo
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s1.foo" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.u1s1.foo"
+
+# Test: c_variable-4.74
+# Desc: number of children of struct_declarations.s2.u2.u1s1.foo
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s1.foo" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.u1s1.foo"
+
+
+# Test: c_variable-4.75
+# Desc: children of struct_declarations.s2.u2.u1s2.array_ptr
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.array_ptr" \
+ "\\^done,numchild=\"2\",children=\{child=\{name=\"struct_declarations.s2.u2.u1s2.array_ptr.0\",exp=\"0\",numchild=\"0\",type=\"char\"\},child={name=\"struct_declarations.s2.u2.u1s2.array_ptr.1\",exp=\"1\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of struct_declarations.s2.u2.u1s2.array_ptr"
+
+# Test: c_variable-4.76
+# Desc: number of children of struct_declarations.s2.u2.u1s2.array_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.array_ptr" \
+ "\\^done,numchild=\"2\"" \
+ "get number of children of struct_declarations.s2.u2.u1s2.array_ptr"
+
+# Test: c_variable-4.77
+# Desc: children of struct_declarations.s2.u2.u1s2.func
+mi_gdb_test "-var-list-children struct_declarations.s2.u2.u1s2.func" \
+ "\\^done,numchild=\"0\"" \
+ "get children of struct_declarations.s2.u2.u1s2.func"
+
+# Test: c_variable-4.78
+# Desc: number of children of struct_declarations.s2.u2.u1s2.func
+mi_gdb_test "-var-info-num-children struct_declarations.s2.u2.u1s2.func" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of struct_declarations.s2.u2.u1s2.func"
+
+# Test: c_variable-4.79
+# Desc: children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
+mi_gdb_test "-var-list-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \
+ "get children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
+#} {**int_ptr_ptr}
+
+# Test: c_variable-4.80
+# Desc: Number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr
+mi_gdb_test "-var-info-num-children struct_declarations.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of struct_declarations.int_ptr_ptr.*int_ptr_ptr"
+
+
+# Step to "struct_declarations.integer = 123;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"192\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+
+# Test: c_variable-4.81
+# Desc: create local variable "weird"
+mi_gdb_test "-var-create weird * weird" \
+ "\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
+ "create local variable weird"
+
+# Test: c_variable-4.82
+# Desc: children of weird
+mi_gdb_test "-var-list-children weird" \
+ "\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\((void)?\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\((int, char \\*, long int)?\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
+ "get children of weird"
+
+# Test: c_variable-4.83
+# Desc: number of children of weird
+mi_gdb_test "-var-info-num-children weird" \
+ "\\^done,numchild=\"11\"" \
+ "get number of children of weird"
+
+
+# Test: c_variable-4.84
+# Desc: children of weird->long_array
+mi_gdb_test "-var-list-children weird.long_array" \
+ "\\^done,numchild=\"10\",children=\{child=\{name=\"weird.long_array.0\",exp=\"0\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.1\",exp=\"1\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.2\",exp=\"2\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.3\",exp=\"3\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.4\",exp=\"4\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.5\",exp=\"5\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.6\",exp=\"6\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.7\",exp=\"7\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.8\",exp=\"8\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.long_array.9\",exp=\"9\",numchild=\"0\",type=\"long int\"\}\}" \
+ "get children of weird.long_array"
+#gdbtk_test c_variable-4.84 {children of weird->long_array} {
+# get_children weird.long_array
+#} {0 1 2 3 4 5 6 7 8 9}
+
+# Test: c_variable-4.85
+# Desc: number of children of weird.long_array
+mi_gdb_test "-var-info-num-children weird.long_array" \
+ "\\^done,numchild=\"10\"" \
+ "get number of children of weird.long_array"
+
+# Test: c_variable-4.86
+# Desc: children of weird.int_ptr_ptr
+mi_gdb_test "-var-list-children weird.int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr\",exp=\"\\*int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \
+ "get children of weird.int_ptr_ptr"
+#gdbtk_test c_variable-4.86 {children of weird->int_ptr_ptr} {
+# get_children weird.int_ptr_ptr
+#} {*int_ptr_ptr}
+
+# Test: c_variable-4.87
+# Desc: number of children of weird.int_ptr_ptr
+mi_gdb_test "-var-info-num-children weird.int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of weird.int_ptr_ptr"
+
+# Test: c_variable-4.88
+# Desc: children of *weird->int_ptr_ptr
+mi_gdb_test "-var-list-children weird.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"weird.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",exp=\"\\*\\*int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \
+ "get children of weird.int_ptr_ptr.*int_ptr_ptr"
+#gdbtk_test c_variable-4.88 {children of *weird->int_ptr_ptr} {
+# get_children weird.int_ptr_ptr.*int_ptr_ptr
+#} {**int_ptr_ptr}
+
+# Test: c_variable-4.89
+# Desc: number of children *weird->int_ptr_ptr
+mi_gdb_test "-var-info-num-children weird.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of weird.int_ptr_ptr.*int_ptr_ptr"
+
+# Test: c_variable-4.90
+# Desc: create weird->int_ptr_ptr
+mi_gdb_test "-var-create weird->int_ptr_ptr * weird->int_ptr_ptr" \
+ "\\^done,name=\"weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"" \
+ "create local variable weird->int_ptr_ptr"
+
+# Test: c_variable-4.91
+# Desc: children of weird->int_ptr_ptr
+mi_gdb_test "-var-list-children weird->int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",exp=\"\\*weird->int_ptr_ptr\",numchild=\"1\",type=\"int \\*\"\}\}" \
+ "get children of weird->int_ptr_ptr"
+
+
+# Test: c_variable-4.92
+# Desc: number of children of (weird->int_ptr_ptr)
+mi_gdb_test "-var-info-num-children weird->int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of weird->int_ptr_ptr"
+
+# Test: c_variable-4.93
+# Desc: children of *(weird->int_ptr_ptr)
+mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",exp=\"\\*\\*weird->int_ptr_ptr\",numchild=\"0\",type=\"int\"\}\}" \
+ "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
+
+# Test: c_variable-4.94
+# Desc: number of children of *(weird->int_ptr_ptr)
+mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr"
+
+# Test: c_variable-4.95
+# Desc: children of *(*(weird->int_ptr_ptr))
+mi_gdb_test "-var-list-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"
+
+# Test: c_variable-4.96
+# Desc: number of children of *(*(weird->int_ptr_ptr))
+mi_gdb_test "-var-info-num-children weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of weird->int_ptr_ptr.*weird->int_ptr_ptr.**weird->int_ptr_ptr"
+
+# Test: c_variable-4.97
+# Desc: is weird editable
+mi_gdb_test "-var-show-attributes weird" \
+ "\\^done,attr=\"editable\"" \
+ "is weird editable"
+
+# Test: c_variable-4.98
+# Desc: is weird->int_ptr_ptr editable
+mi_gdb_test "-var-show-attributes weird->int_ptr_ptr" \
+ "\\^done,attr=\"editable\"" \
+ "is weird->int_ptr_ptr editable"
+
+# Test: c_variable-4.99
+# Desc: is *(weird->int_ptr_ptr) editable
+mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr" \
+ "\\^done,attr=\"editable\"" \
+ "is weird.int_ptr_ptr.*int_ptr_ptr editable"
+
+# Test: c_variable-4.100
+# Desc: is *(*(weird->int_ptr_ptr)) editable
+mi_gdb_test "-var-show-attributes weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr" \
+ "\\^done,attr=\"editable\"" \
+ "is weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr editable"
+
+# Test: c_variable-4.101
+# Desc: is weird->u1 editable
+mi_gdb_test "-var-show-attributes weird.u1" \
+ "\\^done,attr=\"noneditable\"" \
+ "is weird.u1 editable"
+
+# Test: c_variable-4.102
+# Desc: is weird->s2 editable
+mi_gdb_test "-var-show-attributes weird.s2" \
+ "\\^done,attr=\"noneditable\"" \
+ "is weird.s2 editable"
+
+# Test: c_variable-4.103
+# Desc: is struct_declarations.u1.a editable
+mi_gdb_test "-var-show-attributes struct_declarations.u1.a" \
+ "\\^done,attr=\"editable\"" \
+ "is struct_declarations.u1.a editable"
+
+# Test: c_variable-4.104
+# Desc: is struct_declarations.u1.b editable
+mi_gdb_test "-var-show-attributes struct_declarations.u1.b" \
+ "\\^done,attr=\"editable\"" \
+ "is struct_declarations.u1.b editable"
+
+# Test: c_variable-4.105
+# Desc: is struct_declarations.u1.c editable
+mi_gdb_test "-var-show-attributes struct_declarations.u1.c" \
+ "\\^done,attr=\"editable\"" \
+ "is struct_declarations.u1.c editable"
+
+# Test: c_variable-4.106
+# Desc: is struct_declarations.long_array editable
+mi_gdb_test "-var-show-attributes struct_declarations.long_array" \
+ "\\^done,attr=\"noneditable\"" \
+ "is struct_declarations.long_array editable"
+
+# Test: c_variable-4.107
+# Desc: is struct_declarations.long_array[0] editable
+mi_gdb_test "-var-show-attributes struct_declarations.long_array.0" \
+ "\\^done,attr=\"editable\"" \
+ "is struct_declarations.long_array.0 editable"
+
+# Test: c_variable-4.108
+# Desc: is struct_declarations editable
+mi_gdb_test "-var-show-attributes struct_declarations" \
+ "\\^done,attr=\"noneditable\"" \
+ "is struct_declarations editable"
+
+mi_gdb_test "-var-delete weird" \
+ "\\^done,ndeleted=\"24\"" \
+ "delete var weird"
+
+##### #####
+# #
+# children and update tests #
+# #
+##### #####
+
+# Test: c_variable-5.1
+# Desc: check that nothing changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{\}" \
+ "update all vars. None changed"
+
+# Step over "struct_declarations.integer = 123;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"193\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.2
+# Desc: check that integer changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.integer"
+
+# Step over:
+# weird->char_ptr = "hello";
+# bar = 2121;
+# foo = &bar;
+
+send_gdb "-exec-step 3\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"196\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.3
+# Desc: check that char_ptr changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.char_ptr"
+
+# Step over "struct_declarations.int_ptr_ptr = &foo;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"197\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.4
+# Desc: check that int_ptr_ptr and children changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"weird->int_ptr_ptr.\\*weird->int_ptr_ptr.\\*\\*weird->int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.int_ptr_ptr.\\*int_ptr_ptr.\\*\\*int_ptr_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars int_ptr_ptr and children changed"
+
+# Step over "weird->long_array[0] = 1234;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"198\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.5
+# Desc: check that long_array[0] changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.long_array.0\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.long_array.0 changed"
+
+# Step over "struct_declarations.long_array[1] = 2345;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"199\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.6
+# Desc: check that long_array[1] changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.long_array.1\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.long_array.1 changed"
+
+# Step over "weird->long_array[2] = 3456;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"200\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.7
+# Desc: check that long_array[2] changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.long_array.2\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.long_array.2 changed"
+
+# Step over:
+# struct_declarations.long_array[3] = 4567;
+# weird->long_array[4] = 5678;
+# struct_declarations.long_array[5] = 6789;
+# weird->long_array[6] = 7890;
+# struct_declarations.long_array[7] = 8901;
+# weird->long_array[8] = 9012;
+# struct_declarations.long_array[9] = 1234;
+send_gdb "-exec-step 7\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"208\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.8
+# Desc: check that long_array[3-9] changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.long_array.3\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.4\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.5\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.6\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.7\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.8\",in_scope=\"true\",type_changed=\"false\",name=\"struct_declarations.long_array.9\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.long_array.3-9 changed"
+
+
+# Step over "weird->func_ptr = nothing;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"211\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.9
+# Desc: check that func_ptr changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars struct_declarations.func_ptr changed"
+
+# Delete all variables
+mi_gdb_test "-var-delete struct_declarations" \
+ "\\^done,ndeleted=\"65\"" \
+ "delete var struct_declarations"
+
+mi_gdb_test "-var-delete weird->int_ptr_ptr" \
+ "\\^done,ndeleted=\"3\"" \
+ "delete var weird->int_ptr_ptr"
+
+# Step over all lines:
+# ...
+# psnp = &snp0;
+send_gdb "-exec-step 43\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"254\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.10
+# Desc: create psnp->char_ptr
+mi_gdb_test "-var-create psnp->char_ptr * psnp->char_ptr" \
+ "\\^done,name=\"psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"" \
+ "create local variable psnp->char_ptr"
+
+# Test: c_variable-5.11
+# Desc: children of psnp->char_ptr
+mi_gdb_test "-var-list-children psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr\",exp=\"\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\}" \
+ "get children of psnp->char_ptr"
+
+# Test: c_variable-5.12
+# Desc: number of children of psnp->char_ptr
+mi_gdb_test "-var-info-num-children psnp->char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->char_ptr"
+
+# Test: c_variable-5.13
+# Desc: children of *(psnp->char_ptr)
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",exp=\"\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\}" \
+ "get children of psnp->char_ptr.*psnp->char_ptr"
+
+# Test: c_variable-5.14
+# Desc: number of children of *(psnp->char_ptr)
+mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->char_ptr.*psnp->char_ptr"
+
+# Test: c_variable-5.15
+# Desc: children of *(*(psnp->char_ptr))
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*psnp->char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \
+ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+
+# Test: c_variable-5.15B
+# Desc: children of *(*(*(psnp->char_ptr)))
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+
+# Test: c_variable-5.16
+# Desc: number of children of *(*(psnp->char_ptr))
+mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr"
+
+# Test: c_variable-5.17
+# Desc: children of *(*(*(psnp->char_ptr)))
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",exp=\"\\*\\*\\*\\*psnp->char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
+
+# Test: c_variable-5.18
+# Desc: number of children of *(*(*(psnp->char_ptr)))
+mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr"
+
+# Test: c_variable-5.17B
+# Desc: children of *(*(*(*(psnp->char_ptr))))
+mi_gdb_test "-var-list-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
+
+# Test: c_variable-5.18B
+# Desc: number of children of *(*(*(*(psnp->char_ptr))))
+mi_gdb_test "-var-info-num-children psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of psnp->char_ptr.*psnp->char_ptr.**psnp->char_ptr.***psnp->char_ptr.****psnp->char_ptr"
+
+
+# Test: c_variable-5.19
+# Desc: create psnp->long_ptr
+mi_gdb_test "-var-create psnp->long_ptr * psnp->long_ptr" \
+ "\\^done,name=\"psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"" \
+ "create local variable psnp->long_ptr"
+
+# Test: c_variable-5.20
+# Desc: children of psnp->long_ptr
+mi_gdb_test "-var-list-children psnp->long_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr\",exp=\"\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\"\}\}" \
+ "get children of psnp->long_ptr"
+
+# Test: c_variable-5.21
+# Desc: number of children of psnp->long_ptr
+mi_gdb_test "-var-info-num-children psnp->long_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->long_ptr"
+
+# Test: c_variable-5.22
+# Desc: children of *(psnp->long_ptr)
+mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",exp=\"\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\\*\"\}\}" \
+ "get children of psnp->long_ptr.*psnp->long_ptr"
+
+
+# Test: c_variable-5.23
+# Desc: number of children of *(psnp->long_ptr)
+mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->long_ptr.*psnp->long_ptr"
+
+# Test: c_variable-5.24
+# Desc: children of *(*(psnp->long_ptr))
+mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*psnp->long_ptr\",numchild=\"1\",type=\"long int \\*\"\}\}" \
+ "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
+
+# Test: c_variable-5.25
+# Desc: number of children of *(*(psnp->long_ptr))
+mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr"
+
+# Test: c_variable-5.26
+# Desc: children of *(*(*(psnp->long_ptr)))
+mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",exp=\"\\*\\*\\*\\*psnp->long_ptr\",numchild=\"0\",type=\"long int\"\}\}" \
+ "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
+
+# Test: c_variable-5.27
+# Desc: number of children of *(*(*(psnp->long_ptr)))
+mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr"
+
+# Test: c_variable-5.28
+# Desc: children of *(*(*(*(psnp->long_ptr))))
+mi_gdb_test "-var-list-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr"
+
+# Test: c_variable-5.29
+# Desc: number of children of *(*(*(*(psnp->long_ptr))))
+mi_gdb_test "-var-info-num-children psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of psnp->long_ptr.*psnp->long_ptr.**psnp->long_ptr.***psnp->long_ptr.****psnp->long_ptr"
+
+# Test: c_variable-5.30
+# Desc: create psnp->ptrs
+mi_gdb_test "-var-create psnp->ptrs * psnp->ptrs" \
+ "\\^done,name=\"psnp->ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"" \
+ "create local variable psnp->ptrs"
+
+# Test: c_variable-5.31
+# Desc: children of psnp->ptrs
+mi_gdb_test "-var-list-children psnp->ptrs" \
+ "\\^done,numchild=\"3\",children=\{child=\{name=\"psnp->ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
+ "get children of psnp->ptrs"
+
+# Test: c_variable-5.32
+# Desc: number of children of psnp->ptrs
+mi_gdb_test "-var-info-num-children psnp->ptrs" \
+ "\\^done,numchild=\"3\"" \
+ "get number of children of psnp->ptrs"
+
+# Test: c_variable-5.33
+# Desc: children of psnp->ptrs[0]
+mi_gdb_test "-var-list-children psnp->ptrs.0" \
+ "\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
+ "get children of psnp->ptrs.0"
+
+# Test: c_variable-5.34
+# Desc: number of children of psnp->ptrs[0]
+mi_gdb_test "-var-info-num-children psnp->ptrs.0" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of psnp->ptrs.0"
+
+# Test: c_variable-5.35
+# Desc: children of psnp->ptrs[0]->next
+mi_gdb_test "-var-list-children psnp->ptrs.0.next" \
+ "\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
+ "get children of psnp->ptrs.0.next"
+
+#} {char_ptr long_ptr ptrs next}
+
+# Test: c_variable-5.36
+# Desc: number of children of psnp->ptrs[0]->next
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next" \
+ "\\^done,numchild=\"4\"" \
+ "get number of children of psnp->ptrs.0.next"
+
+
+# Test: c_variable-5.37
+# Desc: children of psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",exp=\"\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\"\}\}" \
+ "get children of psnp->ptrs.0.next.char_ptr"
+
+#gdbtk_test c_variable-5.37 {children of psnp->ptrs[0]->next->char_ptr} {
+# get_children psnp->ptrs.0.next.char_ptr
+#} {*char_ptr}
+
+# Test: c_variable-5.38
+# Desc: number of children of psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr"
+
+# Test: c_variable-5.39
+# Desc: children of *psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",exp=\"\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\\*\"\}\}" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr"
+
+# Test: c_variable-5.40
+# Desc: number of children of *psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr"
+
+# Test: c_variable-5.41
+# Desc: children of **psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+
+# Test: c_variable-5.41B
+# Desc: children of ***psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+
+# Test: c_variable-5.42
+# Desc: number of children of **psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr"
+
+# Test: c_variable-5.43
+# Desc: children of ***psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
+ "\\^done,numchild=\"1\",children=\{child=\{name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",exp=\"\\*\\*\\*\\*char_ptr\",numchild=\"0\",type=\"char\"\}\}" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+
+# Test: c_variable-5.44
+# Desc: number of children of ***psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr" \
+ "\\^done,numchild=\"1\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+
+# Test: c_variable-5.43B
+# Desc: children of ****psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+
+# Test: c_variable-5.44B
+# Desc: number of children of ****psnp->ptrs[0]->next->char_ptr
+mi_gdb_test "-var-info-num-children psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr.****char_ptr" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of psnp->ptrs.0.next.char_ptr.*char_ptr.**char_ptr.***char_ptr"
+
+# Test: c_variable-5.45
+# Desc: children of psnp->ptrs[0]->next->next
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.next" \
+ "\\^done,numchild=\"4\",children=\{child=\{name=\"psnp->ptrs.0.next.next.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.long_ptr\",exp=\"long_ptr\",numchild=\"1\",type=\"long int \\*\\*\\*\\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs\",exp=\"ptrs\",numchild=\"3\",type=\"struct _struct_n_pointer \\*\\\[3\\\]\"\},child=\{name=\"psnp->ptrs.0.next.next.next\",exp=\"next\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
+ "get children of psnp->ptrs.0.next.next"
+
+# Test: c_variable-5.46
+# Desc: children of psnp->ptrs[0]->next->next->ptrs
+mi_gdb_test "-var-list-children psnp->ptrs.0.next.next.ptrs" \
+ "\\^done,numchild=\"3\",children=\{child=\{name=\"psnp->ptrs.0.next.next.ptrs.0\",exp=\"0\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.1\",exp=\"1\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\},child=\{name=\"psnp->ptrs.0.next.next.ptrs.2\",exp=\"2\",numchild=\"4\",type=\"struct _struct_n_pointer \\*\"\}\}" \
+ "get children of psnp->ptrs.0.next.next.ptrs"
+
+# Step over "snp0.char_ptr = &b3;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"255\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.47
+# Desc: check that psnp->char_ptr (and [0].char_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"psnp->ptrs.0.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->char_ptr.\\*psnp->char_ptr.\\*\\*psnp->char_ptr.\\*\\*\\*psnp->char_ptr.\\*\\*\\*\\*psnp->char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars psnp->char_ptr (and 0.char_ptr) changed"
+
+# Step over "snp1.char_ptr = &c3;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"256\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+
+# Test: c_variable-5.48
+# Desc: check that psnp->next->char_ptr (and [1].char_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"psnp->ptrs.0.next.char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->ptrs.0.next.char_ptr.\\*char_ptr.\\*\\*char_ptr.\\*\\*\\*char_ptr.\\*\\*\\*\\*char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars psnp->next->char_ptr (and 1.char_ptr) changed"
+
+
+# Step over "snp2.char_ptr = &a3;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"257\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+
+# Test: c_variable-5.49
+# Desc: check that psnp->next->next->char_ptr (and [2].char_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"psnp->ptrs.0.next.next.char_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars psnp->next->next->char_ptr (and 2.char_ptr) changed"
+
+
+# Step over "snp0.long_ptr = &y3;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"258\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+# Test: c_variable-5.50
+# Desc: check that psnp->long_ptr (and [0].long_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"psnp->ptrs.0.long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\",name=\"psnp->long_ptr.\\*psnp->long_ptr.\\*\\*psnp->long_ptr.\\*\\*\\*psnp->long_ptr.\\*\\*\\*\\*psnp->long_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars psnp->long_ptr (and 0.long_ptr) changed"
+
+
+# Step over "snp1.long_ptr = &x3;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"259\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+
+# Test: c_variable-5.51
+# Desc: check that psnp->next->long_ptr (and [1].long_ptr) changed
+# Why does this have a FIXME?
+setup_xfail *-*-*
+mi_gdb_test "-var-update *" \
+ "FIXME\\^done,changelist=\{name=\"psnp->ptrs.0.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars psnp->next->long_ptr (and 1.long_ptr) changed"
+clear_xfail *-*-*
+
+# This command produces this error message:
+# &"warning: varobj_list: assertion failed - mycount <> 0\n"
+#
+
+# Step over "snp2.long_ptr = &z3;"
+send_gdb "-exec-step\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"end-stepping-range\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" {
+ pass "step at do_children_tests"
+ }
+ timeout {
+ fail "step at do_children_tests (timeout)"
+ }
+}
+
+
+# Test: c_variable-5.52
+# Desc: check that psnp->next->next->long_ptr (and [2].long_ptr) changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed"
+
+
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-var-cmd.exp b/gdb/testsuite/gdb.mi/mi0-var-cmd.exp
new file mode 100644
index 00000000000..d28186c8c6d
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-var-cmd.exp
@@ -0,0 +1,523 @@
+# Copyright (C) 1999, 2000, 2002 Cygnus Solutions
+#
+# This Program Is Free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can create, update, delete variables.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "var-cmd"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+
+##### #####
+# #
+# Variable Creation tests #
+# #
+##### #####
+
+# Test: c_variable-1.1
+# Desc: Create global variable
+
+mi_gdb_test "111-var-create global_simple * global_simple" \
+ "111\\^done,name=\"global_simple\",numchild=\"6\",type=\"simpleton\"" \
+ "create global variable"
+
+# Test: c_variable-1.2
+# Desc: Create non-existent variable
+
+mi_gdb_test "112-var-create bogus_unknown_variable * bogus_unknown_variable" \
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*112\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create non-existent variable"
+
+# Test: c_variable-1.3
+# Desc: Create out of scope variable
+
+mi_gdb_test "113-var-create argc * argc" \
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*113\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create out of scope variable"
+
+mi_gdb_test "200-break-insert do_locals_tests" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_locals_tests\",file=\".*var-cmd.c\",line=\"106\",times=\"0\"\}" \
+ "break-insert operation"
+
+mi_run_cmd
+# The running part has been checked already by mi_run_cmd
+gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_locals_tests\",args=\{\},file=\".*var-cmd.c\",line=\"106\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to do_locals_tests"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run todo_locals_tests (2)"}
+ timeout {fail "run to do_locals_tests (timeout 2)"}
+}
+
+# Test: c_variable-1.4
+# Desc: create local variables
+
+mi_gdb_test "-var-create linteger * linteger" \
+ "\\^done,name=\"linteger\",numchild=\"0\",type=\"int\"" \
+ "create local variable linteger"
+
+mi_gdb_test "-var-create lpinteger * lpinteger" \
+ "\\^done,name=\"lpinteger\",numchild=\"1\",type=\"int \\*\"" \
+ "create local variable lpinteger"
+
+mi_gdb_test "-var-create lcharacter * lcharacter" \
+ "\\^done,name=\"lcharacter\",numchild=\"0\",type=\"char\"" \
+ "create local variablelcharacter "
+
+mi_gdb_test "-var-create lpcharacter * lpcharacter" \
+ "\\^done,name=\"lpcharacter\",numchild=\"1\",type=\"char \\*\"" \
+ "create local variable lpcharacter"
+
+mi_gdb_test "-var-create llong * llong" \
+ "\\^done,name=\"llong\",numchild=\"0\",type=\"long int\"" \
+ "create local variable llong"
+
+mi_gdb_test "-var-create lplong * lplong" \
+ "\\^done,name=\"lplong\",numchild=\"1\",type=\"long int \\*\"" \
+ "create local variable lplong"
+
+mi_gdb_test "-var-create lfloat * lfloat" \
+ "\\^done,name=\"lfloat\",numchild=\"0\",type=\"float\"" \
+ "create local variable lfloat"
+
+mi_gdb_test "-var-create lpfloat * lpfloat" \
+ "\\^done,name=\"lpfloat\",numchild=\"1\",type=\"float \\*\"" \
+ "create local variable lpfloat"
+
+mi_gdb_test "-var-create ldouble * ldouble" \
+ "\\^done,name=\"ldouble\",numchild=\"0\",type=\"double\"" \
+ "create local variable ldouble"
+
+mi_gdb_test "-var-create lpdouble * lpdouble" \
+ "\\^done,name=\"lpdouble\",numchild=\"1\",type=\"double \\*\"" \
+ "create local variable lpdouble"
+
+mi_gdb_test "-var-create lsimple * lsimple" \
+ "\\^done,name=\"lsimple\",numchild=\"6\",type=\"struct _simple_struct\"" \
+ "create local variable lsimple"
+
+mi_gdb_test "-var-create lpsimple * lpsimple" \
+ "\\^done,name=\"lpsimple\",numchild=\"6\",type=\"struct _simple_struct \\*\"" \
+ "create local variable lpsimple"
+
+mi_gdb_test "-var-create func * func" \
+ "\\^done,name=\"func\",numchild=\"0\",type=\"void \\(\\*\\)\\((void|)\\)\"" \
+ "create local variable func"
+
+# Test: c_variable-1.5
+# Desc: create lsimple.character
+mi_gdb_test "-var-create lsimple.character * lsimple.character" \
+ "\\^done,name=\"lsimple.character\",numchild=\"0\",type=\"char\"" \
+ "create lsimple.character"
+
+# Test: c_variable-1.6
+# Desc: create lpsimple->integer
+mi_gdb_test "-var-create lsimple->integer * lsimple->integer" \
+ "\\^done,name=\"lsimple->integer\",numchild=\"0\",type=\"int\"" \
+ "create lsimple->integer"
+
+# Test: c_variable-1.7
+# Desc: ceate lsimple.integer
+mi_gdb_test "-var-create lsimple.integer * lsimple.integer" \
+ "\\^done,name=\"lsimple.integer\",numchild=\"0\",type=\"int\"" \
+ "create lsimple->integer"
+
+
+# Test: c_variable-1.9
+# Desc: create type name
+# Type names (like int, long, etc..) are all proper expressions to gdb.
+# make sure variable code does not allow users to create variables, though.
+mi_gdb_test "-var-create int * int" \
+ "&\"Attempt to use a type name as an expression.mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create int"
+
+
+##### #####
+# #
+# Value changed tests #
+# #
+##### #####
+
+# Test: c_variable-2.1
+# Desc: check whether values changed at do_block_tests
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{\}" \
+ "update all vars"
+
+# Step over "linteger = 1234;"
+mi0_step_to "do_locals_tests" "" "var-cmd.c" "107" "step at do_locals_test"
+
+# Test: c_variable-2.2
+# Desc: check whether only linteger changed values
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: linteger changed"
+
+# Step over "lpinteger = &linteger;"
+mi0_step_to "do_locals_tests" "" "var-cmd.c" 108 "step at do_locals_tests (2)"
+
+# Test: c_variable-2.3
+# Desc: check whether only lpinteger changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: lpinteger changed"
+
+# Step over "lcharacter = 'a';"
+mi0_step_to "do_locals_tests" "" "var-cmd.c" "109" "step at do_locals_tests (3)"
+
+# Test: c_variable-2.4
+# Desc: check whether only lcharacter changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: lcharacter changed"
+
+# Step over "lpcharacter = &lcharacter;"
+mi0_step_to "do_locals_tests" "" "var-cmd.c" "110" "step at do_locals_tests (4)"
+
+# Test: c_variable-2.5
+# Desc: check whether only lpcharacter changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: lpcharacter changed"
+
+
+# Step over:
+# llong = 2121L;
+# lplong = &llong;
+# lfloat = 2.1;
+# lpfloat = &lfloat;
+# ldouble = 2.718281828459045;
+# lpdouble = &ldouble;
+# lsimple.integer = 1234;
+# lsimple.unsigned_integer = 255;
+# lsimple.character = 'a';
+
+mi0_run_to "exec-step 9" "end-stepping-range" "do_locals_tests" "" \
+ "var-cmd.c" "119" "" "step at do_locals_tests (5)"
+
+# Test: c_variable-2.6
+# Desc: check whether llong, lplong, lfloat, lpfloat, ldouble, lpdouble, lsimple.integer,
+# lsimple.unsigned_character lsimple.integer lsimple.character changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",name=\"lpdouble\",in_scope=\"true\",type_changed=\"false\",name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",name=\"lpfloat\",in_scope=\"true\",type_changed=\"false\",name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",name=\"lplong\",in_scope=\"true\",type_changed=\"false\",name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: many changed"
+
+# Step over:
+# lsimple.signed_character = 21;
+# lsimple.char_ptr = &lcharacter;
+# lpsimple = &lsimple;
+# func = nothing;
+
+mi0_run_to "exec-step 4" "end-stepping-range" "do_locals_tests" "" \
+ "var-cmd.c" "125" "" "step at do_locals_tests (6)"
+
+# Test: c_variable-2.7
+# Desc: check whether (lsimple.signed_character, lsimple.char_ptr) lpsimple, func changed
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"func\",in_scope=\"true\",type_changed=\"false\",name=\"lpsimple\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: func and lpsimple changed"
+
+# Step over
+# linteger = 4321;
+# lcharacter = 'b';
+# llong = 1212L;
+# lfloat = 1.2;
+# ldouble = 5.498548281828172;
+# lsimple.integer = 255;
+# lsimple.unsigned_integer = 4321;
+# lsimple.character = 'b';
+
+mi0_run_to "exec-step 8" "end-stepping-range" "do_locals_tests" "" \
+ "var-cmd.c" "133" "" "step at do_locals_tests (7)"
+
+# Test: c_variable-2.8
+# Desc: check whether linteger, lcharacter, llong, lfoat, ldouble, lsimple.integer,
+# lpsimple.integer lsimple.character changed
+# Note: this test also checks that lpsimple->integer and lsimple.integer have
+# changed (they are the same)
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"lsimple.integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple->integer\",in_scope=\"true\",type_changed=\"false\",name=\"lsimple.character\",in_scope=\"true\",type_changed=\"false\",name=\"ldouble\",in_scope=\"true\",type_changed=\"false\",name=\"lfloat\",in_scope=\"true\",type_changed=\"false\",name=\"llong\",in_scope=\"true\",type_changed=\"false\",name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\",name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: func and lpsimple changed"
+
+
+###
+#
+# Test assignment to variables. More tests on assignment are in other files.
+#
+###
+mi_gdb_test "-var-assign global_simple 0" \
+ "&\"mi_cmd_var_assign: Variable object is not editable\\\\n\".*\\^error,msg=\"mi_cmd_var_assign: Variable object is not editable\"" \
+ "assign to global_simple"
+
+mi_gdb_test "-var-assign linteger 3333" \
+ "\\^done,value=\"3333\"" \
+ "assign to linteger"
+
+mi_gdb_test "-var-evaluate-expression linteger" \
+ "\\^done,value=\"3333\"" \
+ "eval linteger"
+
+mi_gdb_test "-var-assign lpinteger \"&linteger + 3\"" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lpinteger"
+
+mi_gdb_test "-var-evaluate-expression lpinteger" \
+ "\\^done,value=\"$hex\"" \
+ "eval lpinteger"
+
+# reset the values to the original ones so that the rest of the file doesn't suffer.
+
+mi_gdb_test "-var-assign linteger 4321" \
+ "\\^done,value=\"4321\"" \
+ "assign to linteger"
+
+mi_gdb_test "-var-assign lpinteger &linteger" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lpinteger"
+
+mi_gdb_test "-var-assign lcharacter 'z'" \
+ "\\^done,value=\"122 'z'\"" \
+ "assign to lcharacter"
+
+mi_gdb_test "-var-evaluate-expression lcharacter" \
+ "\\^done,value=\"122 'z'\"" \
+ "eval lcharacter"
+
+mi_gdb_test "-var-assign llong 1313L" \
+ "\\^done,value=\"1313\"" \
+ "assign to llong"
+mi_gdb_test "-var-evaluate-expression llong" \
+ "\\^done,value=\"1313\"" \
+ "eval llong"
+mi_gdb_test "-var-assign llong 1212L" \
+ "\\^done,value=\"1212\"" \
+ "assign to llong"
+
+mi_gdb_test "-var-assign lplong &llong+4" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lplong"
+mi_gdb_test "-var-evaluate-expression lplong" \
+ "\\^done,value=\"$hex\"" \
+ "eval lplong"
+mi_gdb_test "-var-assign lplong &llong" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lplong"
+
+mi_gdb_test "-var-assign lfloat 3.4567" \
+ "\\^done,value=\"3.45.*\"" \
+ "assign to lfloat"
+mi_gdb_test "-var-evaluate-expression lfloat" \
+ "\\^done,value=\"3.45.*\"" \
+ "eval lfloat"
+mi_gdb_test "-var-assign lfloat 1.2345" \
+ "\\^done,value=\"1.23.*\"" \
+ "assign to lfloat"
+
+mi_gdb_test "-var-assign lpfloat &lfloat+4" \
+ "\\^done,value=\"$hex\"" \
+ "assign to lpfloat"
+
+mi_gdb_test "-var-assign ldouble 5.333318284590435" \
+ "\\^done,value=\"5.333318284590435\"" \
+ "assign to ldouble"
+
+mi_gdb_test "-var-assign func do_block_tests" \
+ "\\^done,value=\"$hex <do_block_tests>\"" \
+ "assign to func"
+
+mi_gdb_test "-var-assign lsimple.character 'd'" \
+ "\\^done,value=\"100 'd'\"" \
+ "assign to lsimple.character"
+
+mi_gdb_test "-var-assign lsimple->integer 222" \
+ "\\^done,value=\"222\"" \
+ "assign to lsimple->integer"
+
+mi_gdb_test "-var-assign lsimple.integer 333" \
+ "\\^done,value=\"333\"" \
+ "assign to lsimple.integer"
+
+######
+# End of assign tests
+#####
+
+mi_gdb_test "-break-insert subroutine1" \
+ "\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"subroutine1\",file=\".*var-cmd.c\",line=\"146\",times=\"0\"\}" \
+ "break-insert subroutine1"
+mi0_continue_to "2" "subroutine1" \
+ "\{name=\"i\",value=\"4321\"\},\{name=\"l\",value=\"$hex\"\}" \
+ "var-cmd.c" "146" "continue to subroutine1"
+
+# Test: c_variable-2.10
+# Desc: create variable for locals i,l in subroutine1
+mi_gdb_test "-var-create i * i" \
+ "\\^done,name=\"i\",numchild=\"0\",type=\"int\"" \
+ "create i"
+
+mi_gdb_test "-var-create l * l" \
+ "\\^done,name=\"l\",numchild=\"1\",type=\"long int \\*\"" \
+ "create l"
+
+# Test: c_variable-2.11
+# Desc: create do_locals_tests local in subroutine1
+mi_gdb_test "-var-create linteger * linteger" \
+ "&\"mi_cmd_var_create: unable to create variable object\\\\n\".*\\^error,msg=\"mi_cmd_var_create: unable to create variable object\"" \
+ "create linteger"
+
+mi0_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \
+ "var-cmd.c" "147" "step at subroutine1"
+
+# Test: c_variable-2.12
+# Desc: change global_simple.integer
+# Note: This also tests whether we are reporting changes in structs properly.
+# gdb normally would say that global_simple has changed, but we
+# special case that, since it is not what a human expects to
+# see.
+
+setup_xfail *-*-*
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{FIXME: WHAT IS CORRECT HERE\}" \
+ "update all vars: changed FIXME"
+clear_xfail *-*-*
+
+mi0_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \
+ "var-cmd.c" "148" "step at subroutine1 (2)"
+
+# Test: c_variable-2.13
+# Desc: change subroutine1 local i
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"i\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: i changed"
+
+mi0_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\}" \
+ "var-cmd.c" "149" "step at subroutine1 (3)"
+
+# Test: c_variable-2.14
+# Desc: change do_locals_tests local llong
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"llong\",in_scope=\"true\",type_changed=\"false\"\}" \
+ "update all vars: llong changed"
+
+mi0_next_to "do_locals_tests" "" "var-cmd.c" "136" "next out of subroutine1"
+
+# Test: c_variable-2.15
+# Desc: check for out of scope subroutine1 locals
+mi_gdb_test "-var-update *" \
+ "\\^done,changelist=\{name=\"l\",in_scope=\"false\",name=\"i\",in_scope=\"false\"\}" \
+ "update all vars: all now out of scope"
+
+# Done with locals/globals tests. Erase all variables
+#delete_all_variables
+mi_gdb_test "-var-delete global_simple" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var"
+
+mi_gdb_test "-var-delete linteger" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var linteger"
+
+mi_gdb_test "-var-delete lpinteger" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpinteger"
+
+mi_gdb_test "-var-delete lcharacter" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lcharacter"
+
+mi_gdb_test "-var-delete lpcharacter" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpcharacter"
+
+mi_gdb_test "-var-delete llong" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var llong"
+
+mi_gdb_test "-var-delete lplong" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lplong"
+
+mi_gdb_test "-var-delete lfloat" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lfloat"
+
+mi_gdb_test "-var-delete lpfloat" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpfloat"
+
+mi_gdb_test "-var-delete ldouble" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var ldouble"
+
+mi_gdb_test "-var-delete lpdouble" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpdouble"
+
+mi_gdb_test "-var-delete lsimple" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lsimple"
+
+mi_gdb_test "-var-delete lpsimple" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lpsimple"
+
+mi_gdb_test "-var-delete func" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var func"
+
+mi_gdb_test "-var-delete lsimple.character" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lsimple.character"
+
+mi_gdb_test "-var-delete lsimple->integer" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lsimple->integer"
+
+mi_gdb_test "-var-delete lsimple.integer" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var lsimple.integer"
+
+mi_gdb_test "-var-delete i" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var i"
+
+mi_gdb_test "-var-delete l" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var l"
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-var-display.exp b/gdb/testsuite/gdb.mi/mi0-var-display.exp
new file mode 100644
index 00000000000..a0330ef788d
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-var-display.exp
@@ -0,0 +1,627 @@
+# Copyright (C) 1999 2000 Cygnus Solutions
+#
+# This Program Is Free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can create, update, delete variables.
+#
+
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "var-cmd"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+mi_gdb_test "200-break-insert 260" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_children_tests\",file=\".*var-cmd.c\",line=\"260\",times=\"0\"\}" \
+ "break-insert operation"
+
+mi_run_cmd
+# The running part has been checked already by mi_run_cmd
+gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_children_tests\",args=\{\},file=\".*var-cmd.c\",line=\"260\"\}\r\n$mi_gdb_prompt$" {
+ pass "run to do_children_tests"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "run to do_children_tests (2)"}
+ timeout {fail "run to do_children_tests (timeout 2)"}
+}
+
+##### #####
+# #
+# Display tests #
+# #
+##### #####
+
+# Test: c_variable-6.1
+# Desc: create variable bar
+mi_gdb_test "-var-create bar * bar" \
+ "\\^done,name=\"bar\",numchild=\"0\",type=\"int\"" \
+ "create local variable bar"
+
+# Test: c_variable-6.2
+# Desc: type of variable bar
+mi_gdb_test "-var-info-type bar" \
+ "\\^done,type=\"int\"" \
+ "info type variable bar"
+
+# Test: c_variable-6.3
+# Desc: format of variable bar
+mi_gdb_test "-var-show-format bar" \
+ "\\^done,format=\"natural\"" \
+ "show format variable bar"
+
+# Test: c_variable-6.4
+# Desc: value of variable bar
+mi_gdb_test "-var-evaluate-expression bar" \
+ "\\^done,value=\"2121\"" \
+ "eval variable bar"
+
+# Test: c_variable-6.5
+# Desc: change format of bar to hex
+mi_gdb_test "-var-set-format bar hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable bar"
+
+# Test: c_variable-6.6
+# Desc: value of bar with new format
+mi_gdb_test "-var-evaluate-expression bar" \
+ "\\^done,value=\"0x849\"" \
+ "eval variable bar with new format"
+
+# Test: c_variable-6.7
+# Desc: change value of bar
+mi_gdb_test "-var-assign bar 3" \
+ "\\^done,value=\"0x3\"" \
+ "assing to variable bar"
+
+mi_gdb_test "-var-set-format bar decimal" \
+ "\\^done,format=\"decimal\"" \
+ "set format variable bar"
+
+mi_gdb_test "-var-evaluate-expression bar" \
+ "\\^done,value=\"3\"" \
+ "eval variable bar with new value"
+
+mi_gdb_test "-var-delete bar" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var bar"
+
+# Test: c_variable-6.11
+# Desc: create variable foo
+mi_gdb_test "-var-create foo * foo" \
+ "\\^done,name=\"foo\",numchild=\"1\",type=\"int \\*\"" \
+ "create local variable foo"
+
+# Test: c_variable-6.12
+# Desc: type of variable foo
+mi_gdb_test "-var-info-type foo" \
+ "\\^done,type=\"int \\*\"" \
+ "info type variable foo"
+
+# Test: c_variable-6.13
+# Desc: format of variable foo
+mi_gdb_test "-var-show-format foo" \
+ "\\^done,format=\"natural\"" \
+ "show format variable foo"
+
+# Test: c_variable-6.14
+# Desc: value of variable foo
+mi_gdb_test "-var-evaluate-expression foo" \
+ "\\^done,value=\"$hex\"" \
+ "eval variable foo"
+
+# Test: c_variable-6.15
+# Desc: change format of var to octal
+mi_gdb_test "-var-set-format foo octal" \
+ "\\^done,format=\"octal\"" \
+ "set format variable foo"
+
+mi_gdb_test "-var-show-format foo" \
+ "\\^done,format=\"octal\"" \
+ "show format variable foo"
+
+# Test: c_variable-6.16
+# Desc: value of foo with new format
+mi_gdb_test "-var-evaluate-expression foo" \
+ "\\^done,value=\"\[0-7\]+\"" \
+ "eval variable foo"
+
+# Test: c_variable-6.17
+# Desc: change value of foo
+mi_gdb_test "-var-assign foo 3" \
+ "\\^done,value=\"03\"" \
+ "assing to variable foo"
+
+mi_gdb_test "-var-set-format foo decimal" \
+ "\\^done,format=\"decimal\"" \
+ "set format variable foo"
+
+# Test: c_variable-6.18
+# Desc: check new value of foo
+mi_gdb_test "-var-evaluate-expression foo" \
+ "\\^done,value=\"3\"" \
+ "eval variable foo"
+
+mi_gdb_test "-var-delete foo" \
+ "\\^done,ndeleted=\"1\"" \
+ "delete var foo"
+
+# Test: c_variable-6.21
+# Desc: create variable weird and children
+mi_gdb_test "-var-create weird * weird" \
+ "\\^done,name=\"weird\",numchild=\"11\",type=\"weird_struct \\*\"" \
+ "create local variable weird"
+
+mi_gdb_test "-var-list-children weird" \
+ "\\^done,numchild=\"11\",children=\{child=\{name=\"weird.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"weird.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child={name=\"weird.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"weird.long_int\",exp=\"long_int\",numchild=\"0\",type=\"long int\"\},child=\{name=\"weird.int_ptr_ptr\",exp=\"int_ptr_ptr\",numchild=\"1\",type=\"int \\*\\*\"\},child=\{name=\"weird.long_array\",exp=\"long_array\",numchild=\"10\",type=\"long int \\\[10\\\]\"\},child=\{name=\"weird.func_ptr\",exp=\"func_ptr\",numchild=\"0\",type=\"void \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_struct\",exp=\"func_ptr_struct\",numchild=\"0\",type=\"struct _struct_decl \\(\\*\\)\\(\\)\"\},child=\{name=\"weird.func_ptr_ptr\",exp=\"func_ptr_ptr\",numchild=\"0\",type=\"struct _struct_decl \\*\\(\\*\\)\\(\\)\"\},child=\{name=\"weird.u1\",exp=\"u1\",numchild=\"4\",type=\"union \{\\.\\.\\.\}\"\},child=\{name=\"weird.s2\",exp=\"s2\",numchild=\"4\",type=\"struct \{\\.\\.\\.\}\"\}\}" \
+ "get children local variable weird"
+
+
+# Test: c_variable-6.23
+# Desc: change format of weird.func_ptr and weird.func_ptr_ptr
+mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable weird.func_ptr"
+
+mi_gdb_test "-var-show-format weird.func_ptr" \
+ "\\^done,format=\"hexadecimal\"" \
+ "show format variable weird.func_ptr"
+
+mi_gdb_test "-var-set-format weird.func_ptr_ptr hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable weird.func_ptr_ptr"
+
+mi_gdb_test "-var-show-format weird.func_ptr_ptr" \
+ "\\^done,format=\"hexadecimal\"" \
+ "show format variable weird.func_ptr_ptr"
+
+# Test: c_variable-6.24
+# Desc: format of weird and children
+mi_gdb_test "-var-set-format weird natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird"
+
+mi_gdb_test "-var-set-format weird.integer natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.integer"
+
+mi_gdb_test "-var-set-format weird.character natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.character"
+
+mi_gdb_test "-var-set-format weird.char_ptr natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.char_ptr"
+
+mi_gdb_test "-var-set-format weird.long_int natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.long_int"
+
+mi_gdb_test "-var-set-format weird.int_ptr_ptr natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.int_ptr_ptr"
+
+mi_gdb_test "-var-set-format weird.long_array natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.long_array"
+
+mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable weird.func_ptr"
+
+mi_gdb_test "-var-set-format weird.func_ptr_struct hexadecimal" \
+ "\\^done,format=\"hexadecimal\"" \
+ "set format variable weird.func_ptr_struct"
+
+mi_gdb_test "-var-set-format weird.func_ptr_ptr natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.func_ptr_ptr"
+
+mi_gdb_test "-var-set-format weird.u1 natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.u1"
+
+mi_gdb_test "-var-set-format weird.s2 natural" \
+ "\\^done,format=\"natural\"" \
+ "set format variable weird.s2"
+
+# Test: c_variable-6.25
+# Desc: value of weird and children
+#gdbtk_test c_variable-6.25 {value of weird and children} {
+# set values {}
+# foreach v [lsort [array names var]] f [list x "" "" x x x x d d d d d] {
+# lappend values [value $v $f]
+# }
+
+# set values
+#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
+
+# Test: c_variable-6.26
+# Desc: change format of weird and children to octal
+#gdbtk_test c_variable-6.26 {change format of weird and children to octal} {
+# set formats {}
+# foreach v [lsort [array names var]] {
+# $var($v) format octal
+# lappend formats [$var($v) format]
+# }
+
+# set formats
+#} {octal octal octal octal octal octal octal octal octal octal octal octal}
+
+# Test: c_variable-6.27
+# Desc: value of weird and children with new format
+#gdbtk_test c_variable-6.27 {value of foo with new format} {
+# set values {}
+# foreach v [lsort [array names var]] {
+# lappend values [value $v o]
+# }
+
+# set values
+#} {ok ok ok ok ok ok ok ok weird.long_array ok weird.s2 weird.u1}
+
+# Test: c_variable-6.30
+# Desc: create more children of weird
+#gdbtk_test c_variable-6.30 {create more children of weird} {
+# foreach v [array names var] {
+# get_children $v
+# }
+
+# # Do it twice to get more children
+# foreach v [array names var] {
+# get_children $v
+# }
+
+# lsort [array names var]
+#} {weird weird.char_ptr weird.character weird.func_ptr weird.func_ptr_ptr weird.func_ptr_struct weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.integer weird.long_array weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.long_int weird.s2 weird.s2.g weird.s2.h weird.s2.i weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9 weird.s2.u2 weird.s2.u2.f weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.u1 weird.u1.a weird.u1.b weird.u1.c weird.u1.d}
+
+# Test: c_variable-6.31
+# Desc: check that all children of weird change
+# Ok, obviously things like weird.s2 and weird.u1 will not change!
+#gdbtk_test *c_variable-6.31 {check that all children of weird change (ops, we are now reporting array names as changed in this case - seems harmless though)} {
+# $var(weird) value 0x2121
+# check_update
+#} {{weird.integer weird.character weird.char_ptr weird.long_int weird.int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr weird.int_ptr_ptr.*int_ptr_ptr.**int_ptr_ptr weird.long_array.0 weird.long_array.1 weird.long_array.2 weird.long_array.3 weird.long_array.4 weird.long_array.5 weird.long_array.6 weird.long_array.7 weird.long_array.8 weird.long_array.9 weird.func_ptr weird.func_ptr_struct weird.func_ptr_ptr weird.u1.a weird.u1.b weird.u1.c weird.u1.d weird.s2.u2.f weird.s2.g weird.s2.h weird.s2.i.0 weird.s2.i.1 weird.s2.i.2 weird.s2.i.3 weird.s2.i.4 weird.s2.i.5 weird.s2.i.6 weird.s2.i.7 weird.s2.i.8 weird.s2.i.9} {weird.s2.i weird.s2.u2 weird weird.s2.u2.u1s1 weird.s2.u2.u1s2 weird.s2 weird.long_array weird.u1} {}}
+
+mi_gdb_test "-var-delete weird" \
+ "\\^done,ndeleted=\"12\"" \
+ "delete var weird"
+
+
+##### #####
+# #
+# Special Display Tests #
+# #
+##### #####
+
+# Stop in "do_special_tests"
+mi_gdb_test "200-break-insert do_special_tests" \
+ "200\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"do_special_tests\",file=\".*var-cmd.c\",line=\"282\",times=\"0\"\}" \
+ "break-insert operation"
+
+send_gdb "-exec-continue\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"do_special_tests\",args=\{\},file=\".*var-cmd.c\",line=\"282\"\}\r\n$mi_gdb_prompt$" {
+ pass "continue to do_special_tests"
+ }
+ timeout {
+ fail "continue to do_special_tests (timeout)"
+ }
+}
+
+# Test: c_variable-7.10
+# Desc: create union u
+mi_gdb_test "-var-create u * u" \
+ "\\^done,name=\"u\",numchild=\"2\",type=\"union named_union\"" \
+ "create local variable u"
+
+# Test: c_variable-7.11
+# Desc: value of u
+mi_gdb_test "-var-evaluate-expression u" \
+ "\\^done,value=\"\{\\.\\.\\.\}\"" \
+ "eval variable u"
+
+# Test: c_variable-7.12
+# Desc: type of u
+mi_gdb_test "-var-info-type u" \
+ "\\^done,type=\"union named_union\"" \
+ "info type variable u"
+
+# Test: c_variable-7.13
+# Desc: is u editable
+mi_gdb_test "-var-show-attributes u" \
+ "\\^done,attr=\"noneditable\"" \
+ "is u editable"
+
+# Test: c_variable-7.14
+# Desc: number of children of u
+mi_gdb_test "-var-info-num-children u" \
+ "\\^done,numchild=\"2\"" \
+ "get number of children of u"
+
+# Test: c_variable-7.15
+# Desc: children of u
+mi_gdb_test "-var-list-children u" \
+ "\\^done,numchild=\"2\",children=\{child=\{name=\"u.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"u.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\}\}" \
+ "get children of u"
+
+# Test: c_variable-7.20
+# Desc: create anonu
+mi_gdb_test "-var-create anonu * anonu" \
+ "\\^done,name=\"anonu\",numchild=\"3\",type=\"union \{\\.\\.\\.\}\"" \
+ "create local variable anonu"
+
+# Test: c_variable-7.21
+# Desc: value of anonu
+mi_gdb_test "-var-evaluate-expression anonu" \
+ "\\^done,value=\"\{\\.\\.\\.\}\"" \
+ "eval variable anonu"
+
+# Test: c_variable-7.22
+# Desc: type of anonu
+mi_gdb_test "-var-info-type anonu" \
+ "\\^done,type=\"union \{\\.\\.\\.\}\"" \
+ "info type variable anonu"
+
+# Test: c_variable-7.23
+# Desc: is anonu editable
+mi_gdb_test "-var-show-attributes anonu" \
+ "\\^done,attr=\"noneditable\"" \
+ "is anonu editable"
+
+# Test: c_variable-7.24
+# Desc: number of children of anonu
+mi_gdb_test "-var-info-num-children anonu" \
+ "\\^done,numchild=\"3\"" \
+ "get number of children of anonu"
+
+# Test: c_variable-7.25
+# Desc: children of anonu
+mi_gdb_test "-var-list-children anonu" \
+ "\\^done,numchild=\"3\",children=\{child=\{name=\"anonu.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anonu.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anonu.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\}" \
+ "get children of anonu"
+
+# Test: c_variable-7.30
+# Desc: create struct s
+mi_gdb_test "-var-create s * s" \
+ "\\^done,name=\"s\",numchild=\"6\",type=\"struct _simple_struct\"" \
+ "create local variable s"
+
+
+# Test: c_variable-7.31
+# Desc: value of s
+mi_gdb_test "-var-evaluate-expression s" \
+ "\\^done,value=\"\{\\.\\.\\.\}\"" \
+ "eval variable s"
+
+# Test: c_variable-7.32
+# Desc: type of s
+mi_gdb_test "-var-info-type s" \
+ "\\^done,type=\"struct _simple_struct\"" \
+ "info type variable s"
+
+# Test: c_variable-7.33
+# Desc: is s editable
+mi_gdb_test "-var-show-attributes s" \
+ "\\^done,attr=\"noneditable\"" \
+ "is s editable"
+
+# Test: c_variable-7.34
+# Desc: number of children of s
+mi_gdb_test "-var-info-num-children s" \
+ "\\^done,numchild=\"6\"" \
+ "get number of children of s"
+
+# Test: c_variable-7.35
+# Desc: children of s
+mi_gdb_test "-var-list-children s" \
+ "\\^done,numchild=\"6\",children=\{child=\{name=\"s.integer\",exp=\"integer\",numchild=\"0\",type=\"int\"\},child=\{name=\"s.unsigned_integer\",exp=\"unsigned_integer\",numchild=\"0\",type=\"unsigned int\"\},child=\{name=\"s.character\",exp=\"character\",numchild=\"0\",type=\"char\"\},child=\{name=\"s.signed_character\",exp=\"signed_character\",numchild=\"0\",type=\"signed char\"\},child=\{name=\"s.char_ptr\",exp=\"char_ptr\",numchild=\"1\",type=\"char \\*\"\},child=\{name=\"s.array_of_10\",exp=\"array_of_10\",numchild=\"10\",type=\"int \\\[10\\\]\"\}\}" \
+ "get children of s"
+#} {integer unsigned_integer character signed_character char_ptr array_of_10}
+
+# Test: c_variable-7.40
+# Desc: create anons
+mi_gdb_test "-var-create anons * anons" \
+ "\\^done,name=\"anons\",numchild=\"3\",type=\"struct \{\\.\\.\\.\}\"" \
+ "create local variable anons"
+
+# Test: c_variable-7.41
+# Desc: value of anons
+mi_gdb_test "-var-evaluate-expression anons" \
+ "\\^done,value=\"\{\\.\\.\\.\}\"" \
+ "eval variable anons"
+
+# Test: c_variable-7.42
+# Desc: type of anons
+mi_gdb_test "-var-info-type anons" \
+ "\\^done,type=\"struct \{\\.\\.\\.\}\"" \
+ "info type variable anons"
+
+# Test: c_variable-7.43
+# Desc: is anons editable
+mi_gdb_test "-var-show-attributes anons" \
+ "\\^done,attr=\"noneditable\"" \
+ "is anons editable"
+
+# Test: c_variable-7.44
+# Desc: number of children of anons
+mi_gdb_test "-var-info-num-children anons" \
+ "\\^done,numchild=\"3\"" \
+ "get number of children of anons"
+
+# Test: c_variable-7.45
+# Desc: children of anons
+mi_gdb_test "-var-list-children anons" \
+ "\\^done,numchild=\"3\",children=\{child=\{name=\"anons.a\",exp=\"a\",numchild=\"0\",type=\"int\"\},child=\{name=\"anons.b\",exp=\"b\",numchild=\"0\",type=\"char\"\},child=\{name=\"anons.c\",exp=\"c\",numchild=\"0\",type=\"long int\"\}\}" \
+ "get children of anons"
+
+
+# Test: c_variable-7.50
+# Desc: create enum e
+mi_gdb_test "-var-create e * e" \
+ "\\^done,name=\"e\",numchild=\"0\",type=\"enum foo\"" \
+ "create local variable e"
+
+setup_xfail "*-*-*"
+# Test: c_variable-7.51
+# Desc: value of e
+mi_gdb_test "-var-evaluate-expression e" \
+ "\\^done,value=\"FIXME\"" \
+ "eval variable e"
+clear_xfail "*-*-*"
+
+# Test: c_variable-7.52
+# Desc: type of e
+mi_gdb_test "-var-info-type e" \
+ "\\^done,type=\"enum foo\"" \
+ "info type variable e"
+
+# Test: c_variable-7.53
+# Desc: is e editable
+mi_gdb_test "-var-show-attributes e" \
+ "\\^done,attr=\"editable\"" \
+ "is e editable"
+
+# Test: c_variable-7.54
+# Desc: number of children of e
+mi_gdb_test "-var-info-num-children e" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of e"
+
+# Test: c_variable-7.55
+# Desc: children of e
+mi_gdb_test "-var-list-children e" \
+ "\\^done,numchild=\"0\"" \
+ "get children of e"
+
+# Test: c_variable-7.60
+# Desc: create anone
+mi_gdb_test "-var-create anone * anone" \
+ "\\^done,name=\"anone\",numchild=\"0\",type=\"enum \{\\.\\.\\.\}\"" \
+ "create local variable anone"
+
+setup_xfail "*-*-*"
+# Test: c_variable-7.61
+# Desc: value of anone
+mi_gdb_test "-var-evaluate-expression anone" \
+ "\\^done,value=\"A\"" \
+ "eval variable anone"
+clear_xfail "*-*-*"
+
+
+# Test: c_variable-7.70
+# Desc: create anone
+mi_gdb_test "-var-create anone * anone" \
+ "&\"Duplicate variable object name\\\\n\".*\\^error,msg=\"Duplicate variable object name\"" \
+ "create duplicate local variable anone"
+
+
+# Test: c_variable-7.72
+# Desc: type of anone
+mi_gdb_test "-var-info-type anone" \
+ "\\^done,type=\"enum \{\\.\\.\\.\}\"" \
+ "info type variable anone"
+
+
+# Test: c_variable-7.73
+# Desc: is anone editable
+mi_gdb_test "-var-show-attributes anone" \
+ "\\^done,attr=\"editable\"" \
+ "is anone editable"
+
+# Test: c_variable-7.74
+# Desc: number of children of anone
+mi_gdb_test "-var-info-num-children anone" \
+ "\\^done,numchild=\"0\"" \
+ "get number of children of anone"
+
+# Test: c_variable-7.75
+# Desc: children of anone
+mi_gdb_test "-var-list-children anone" \
+ "\\^done,numchild=\"0\"" \
+ "get children of anone"
+
+
+# Record fp
+
+send_gdb "p/x \$fp\n"
+gdb_expect {
+ -re ".*($hex).*\\^done\r\n$mi_gdb_prompt$" {
+ pass "print FP register"
+ set fp $expect_out(1,string)
+ }
+# -re ".*" { fail "print FP register"}
+ timeout { fail "print FP register (timeout)"}
+}
+
+mi_gdb_test "200-break-insert incr_a" \
+ "200\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"incr_a\",file=\".*var-cmd.c\",line=\"85\",times=\"0\"\}" \
+ "break-insert operation"
+send_gdb "-exec-continue\n"
+gdb_expect {
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\{\{name=\"a\",value=\"2\.*\"\}\},file=\".*var-cmd.c\",line=\"85\"\}\r\n$mi_gdb_prompt$" {
+ pass "continue to incr_a"
+ }
+ -re "\\^running\r\n${mi_gdb_prompt}\\*stopped,reason=\"breakpoint-hit\",bkptno=\"3\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"incr_a\",args=\{\{name=\"a\",value=\".*\"\}\},file=\".*var-cmd.c\",line=\"8\[345\]\"\}\r\n$mi_gdb_prompt$" {
+ fail "continue to incr_a (compiler debug info incorrect)"
+ }
+ -re "\\^running\r\n${mi_gdb_prompt}.*\r\n$mi_gdb_prompt$" {
+ fail "continue to incr_a (unknown output)"
+ }
+ timeout {
+ fail "continue to incr_a (timeout)"
+ }
+}
+
+# Test: c_variable-7.81
+# Desc: Create variables in different scopes
+mi_gdb_test "-var-create a1 * a" \
+ "\\^done,name=\"a1\",numchild=\"0\",type=\"char\"" \
+ "create local variable a1"
+
+mi_gdb_test "-var-create a2 $fp a" \
+ "\\^done,name=\"a2\",numchild=\"0\",type=\"int\"" \
+ "create variable a2 in different scope"
+
+#gdbtk_test c_variable-7.81 {create variables in different scopes} {
+# set a1 [gdb_variable create -expr a]
+# set a2 [gdb_variable create -expr a -frame $fp]
+
+# set vals {}
+# lappend vals [$a1 value]
+# lappend vals [$a2 value]
+# set vals
+#} {2 1}
+
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-watch.exp b/gdb/testsuite/gdb.mi/mi0-watch.exp
new file mode 100644
index 00000000000..8932cd9754c
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/mi0-watch.exp
@@ -0,0 +1,191 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+#
+# Test essential Machine interface (MI) operations
+#
+# Verify that, using the MI, we can run a simple program and perform basic
+# debugging activities like: insert breakpoints, run the program,
+# step, next, continue until it ends and, last but not least, quit.
+#
+# The goal is not to test gdb functionality, which is done by other tests,
+# but to verify the correct output response to MI operations.
+#
+
+load_lib mi-support.exp
+set MIFLAGS "-i=mi0"
+
+gdb_exit
+if [mi_gdb_start] {
+ continue
+}
+
+set testfile "basics"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+
+proc test_watchpoint_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert a watchpoint and list
+ # Tests:
+ # -break-watch C
+ # -break-list
+
+ mi_gdb_test "111-break-watch C" \
+ "111\\^done,wpt=\{number=\"2\",exp=\"C\"\}" \
+ "break-watch operation"
+
+ mi_gdb_test "222-break-list" \
+ "222\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"1\"\},bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",what=\"C\",times=\"0\"\}\}" \
+ "list of watchpoints"
+
+}
+
+# UNUSED at the time
+proc test_awatch_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert an access watchpoint and list it
+ # Tests:
+ # -break-watch -a A
+ # -break-list
+
+ mi_gdb_test "333-break-watch -a A" \
+ "333\\^done,bkpt=\{number=\"1\",addr=\"$hex\",file=\".*basics.c\",line=\"32\"\}" \
+ "break-watch -a operation"
+
+ mi_gdb_test "444-break-list" \
+ "444\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \
+ "list of watchpoints awatch"
+
+ mi_gdb_test "777-break-delete 3" \
+ "777\\^done" \
+ "delete access watchpoint"
+}
+
+# UNUSED at the time
+proc test_rwatch_creation_and_listing {} {
+ global mi_gdb_prompt
+ global srcfile
+ global hex
+
+ # Insert a read watchpoint and list it.
+ # Tests:
+ # -break-insert -r B
+ # -break-list
+
+ mi_gdb_test "200-break-watch -r C" \
+ "200\\^done,bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"32\",times=\"0\"\}" \
+ "break-insert -r operation"
+
+ mi_gdb_test "300-break-list" \
+ "300\\^done,BreakpointTable=\{hdr=\{.*\},bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"32\",times=\"0\"\},.*\}\}" \
+ "list of breakpoints"
+
+ mi_gdb_test "177-break-delete 4" \
+ "177\\^done" \
+ "delete read watchpoint"
+}
+
+proc test_running_the_program {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Run the program without args, then specify srgs and rerun the program
+ # Tests:
+ # -exec-run
+
+ mi_gdb_test "300-break-insert callee4" \
+ "300\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"8\",times=\"0\"\}" \
+ "insert breakpoint at callee4"
+
+ # mi_gdb_test cannot be used for asynchronous commands because there are
+ # two prompts involved and this can lead to a race condition.
+ # The following is equivalent to a send_gdb "000-exec-run\n"
+ mi_run_cmd
+ # The running part has been checked already by mi_run_cmd
+ gdb_expect {
+ -re "\[\r\n\]*000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" \
+ { pass "run to callee4" }
+ -re ".*$mi_gdb_prompt$" {fail "run to callee4 (2)"}
+ timeout {fail "run to callee4 (timeout 2)"}
+ }
+}
+
+proc test_watchpoint_triggering {} {
+ global mi_gdb_prompt
+ global hex
+
+ # Continue execution until the watchpoint is reached, continue again,
+ # to see the watchpoint go out of scope.
+ # Does:
+ # -exec-continue (Here wp triggers)
+ # -exec-continue (Here wp goes out of scope)
+
+ send_gdb "222-exec-continue\n"
+ gdb_expect {
+ -re "222\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "222\\*stopped,reason=\"watchpoint-trigger\",wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\},thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
+ pass "watchpoint trigger"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (2)"}
+ timeout {fail "watchpoint trigger (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "watchpoint trigger (1)"}
+ timeout {fail "watchpoint trigger (timeout 1)"}
+ }
+
+ send_gdb "223-exec-continue\n"
+ gdb_expect {
+ -re "223\\^running\r\n$mi_gdb_prompt" {
+ gdb_expect {
+ -re "\[\r\n\]*223\\*stopped,reason=\"watchpoint-scope\",wpnum=\"2\",thread-id=\"\[01\]\",frame=\{addr=\"$hex\",func=\"callee3\",args=\{.*\},file=\".*basics.c\",line=\"18\"\}\r\n$mi_gdb_prompt$" {
+ pass "wp out of scope"
+ }
+ -re ".*$mi_gdb_prompt$" {fail "wp out of scope (2)"}
+ timeout {fail "wp out of scope (timeout 2)"}
+ }
+ }
+ -re ".*$mi_gdb_prompt$" {fail "wp out of scope (1)"}
+ timeout {fail "wp out of scope (timeout 1)"}
+ }
+}
+
+test_running_the_program
+test_watchpoint_creation_and_listing
+#test_rwatch_creation_and_listing
+#test_awatch_creation_and_listing
+test_watchpoint_triggering
+
+mi_gdb_exit
+return 0
diff --git a/gdb/testsuite/gdb.mi/testcmds b/gdb/testsuite/gdb.mi/testcmds
new file mode 100644
index 00000000000..28fa524042f
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/testcmds
@@ -0,0 +1,25 @@
+# This is a (bogus) sample user command built to test the printing
+# of commands.
+define test
+set $a = 1
+set $b = 2
+if ($a > $b)
+ set $a = 1
+ set $b = 2
+ while ($a > $b)
+ set $a = 1
+ set $b = 2
+ end
+else
+ set $a = 1
+ set $b = 2
+end
+while ($a < $b)
+ set $a = $a + 1
+ set $c = $a
+ if ($a = $b)
+ set $c = 5
+ end
+ set $a = 1
+ set $b = 2
+end
diff --git a/gdb/testsuite/gdb.mi/until.c b/gdb/testsuite/gdb.mi/until.c
new file mode 100644
index 00000000000..df4a68d930f
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/until.c
@@ -0,0 +1,26 @@
+foo (void)
+{
+ int i, x, y, z;
+
+ x = 0;
+ y = 1;
+ i = 0;
+
+ while (i < 2)
+ i++;
+
+ x = i;
+ y = 2 * x;
+ z = x + y;
+ y = x + z;
+ x = 9;
+ y = 10;
+}
+
+main ()
+{
+ int a = 1;
+ foo ();
+ a += 2;
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.mi/var-cmd.c b/gdb/testsuite/gdb.mi/var-cmd.c
new file mode 100644
index 00000000000..42c2336fffc
--- /dev/null
+++ b/gdb/testsuite/gdb.mi/var-cmd.c
@@ -0,0 +1,296 @@
+struct _simple_struct {
+ int integer;
+ unsigned int unsigned_integer;
+ char character;
+ signed char signed_character;
+ char *char_ptr;
+ int array_of_10[10];
+};
+
+typedef struct _simple_struct simpleton;
+
+simpleton global_simple;
+
+enum foo {
+ bar = 1,
+ baz
+};
+
+typedef enum foo efoo;
+
+union named_union
+{
+ int integer;
+ char *char_ptr;
+};
+
+typedef struct _struct_decl {
+ int integer;
+ char character;
+ char *char_ptr;
+ long long_int;
+ int **int_ptr_ptr;
+ long long_array[10];
+
+ void (*func_ptr) (void);
+ struct _struct_decl (*func_ptr_struct) (int, char *, long);
+ struct _struct_decl *(*func_ptr_ptr) (int, char *, long);
+ union {
+ int a;
+ char *b;
+ long c;
+ enum foo d;
+ } u1;
+
+ struct {
+ union {
+ struct {
+ int d;
+ char e[10];
+ int *(*func) (void);
+ efoo foo;
+ } u1s1;
+
+ long f;
+ struct {
+ char array_ptr[2];
+ int (*func) (int, char *);
+ } u1s2;
+ } u2;
+
+ int g;
+ char h;
+ long i[10];
+ } s2;
+} weird_struct;
+
+struct _struct_n_pointer {
+ char ****char_ptr;
+ long ****long_ptr;
+ struct _struct_n_pointer *ptrs[3];
+ struct _struct_n_pointer *next;
+};
+
+void do_locals_tests (void);
+void do_block_tests (void);
+void subroutine1 (int, long *);
+void nothing (void);
+void do_children_tests (void);
+void do_special_tests (void);
+void incr_a (char);
+
+void incr_a (char a)
+{
+ int b;
+ b = a;
+}
+
+void
+do_locals_tests ()
+{
+ int linteger;
+ int *lpinteger;
+ char lcharacter;
+ char *lpcharacter;
+ long llong;
+ long *lplong;
+ float lfloat;
+ float *lpfloat;
+ double ldouble;
+ double *lpdouble;
+ struct _simple_struct lsimple;
+ struct _simple_struct *lpsimple;
+ void (*func) (void);
+
+ /* Simple assignments */
+ linteger = 1234;
+ lpinteger = &linteger;
+ lcharacter = 'a';
+ lpcharacter = &lcharacter;
+ llong = 2121L;
+ lplong = &llong;
+ lfloat = 2.1;
+ lpfloat = &lfloat;
+ ldouble = 2.718281828459045;
+ lpdouble = &ldouble;
+ lsimple.integer = 1234;
+ lsimple.unsigned_integer = 255;
+ lsimple.character = 'a';
+ lsimple.signed_character = 21;
+ lsimple.char_ptr = &lcharacter;
+ lpsimple = &lsimple;
+ func = nothing;
+
+ /* Check pointers */
+ linteger = 4321;
+ lcharacter = 'b';
+ llong = 1212L;
+ lfloat = 1.2;
+ ldouble = 5.498548281828172;
+ lsimple.integer = 255;
+ lsimple.unsigned_integer = 4321;
+ lsimple.character = 'b';
+ lsimple.signed_character = 0;
+
+ subroutine1 (linteger, &llong);
+}
+
+void
+nothing ()
+{
+}
+
+void
+subroutine1 (int i, long *l)
+{
+ global_simple.integer = i + 3;
+ i = 212;
+ *l = 12;
+}
+
+void
+do_block_tests ()
+{
+ int cb = 12;
+
+ {
+ int foo;
+ foo = 123;
+ {
+ int foo2;
+ foo2 = 123;
+ {
+ int foo;
+ foo = 321;
+ }
+ foo2 = 0;
+ }
+ foo = 0;
+ }
+
+ cb = 21;
+}
+
+void
+do_children_tests (void)
+{
+ weird_struct *weird;
+ struct _struct_n_pointer *psnp;
+ struct _struct_n_pointer snp0, snp1, snp2;
+ char a0, *a1, **a2, ***a3;
+ char b0, *b1, **b2, ***b3;
+ char c0, *c1, **c2, ***c3;
+ long z0, *z1, **z2, ***z3;
+ long y0, *y1, **y2, ***y3;
+ long x0, *x1, **x2, ***x3;
+ int *foo;
+ int bar;
+
+ struct _struct_decl struct_declarations;
+ weird = &struct_declarations;
+
+ struct_declarations.integer = 123;
+ weird->char_ptr = "hello";
+ bar = 2121;
+ foo = &bar;
+ struct_declarations.int_ptr_ptr = &foo;
+ weird->long_array[0] = 1234;
+ struct_declarations.long_array[1] = 2345;
+ weird->long_array[2] = 3456;
+ struct_declarations.long_array[3] = 4567;
+ weird->long_array[4] = 5678;
+ struct_declarations.long_array[5] = 6789;
+ weird->long_array[6] = 7890;
+ struct_declarations.long_array[7] = 8901;
+ weird->long_array[8] = 9012;
+ struct_declarations.long_array[9] = 1234;
+
+ weird->func_ptr = nothing;
+
+ /* Struct/pointer/array tests */
+ a0 = '0';
+ a1 = &a0;
+ a2 = &a1;
+ a3 = &a2;
+ b0 = '1';
+ b1 = &b0;
+ b2 = &b1;
+ b3 = &b2;
+ c0 = '2';
+ c1 = &c0;
+ c2 = &c1;
+ c3 = &c2;
+ z0 = 0xdead + 0;
+ z1 = &z0;
+ z2 = &z1;
+ z3 = &z2;
+ y0 = 0xdead + 1;
+ y1 = &y0;
+ y2 = &y1;
+ y3 = &y2;
+ x0 = 0xdead + 2;
+ x1 = &x0;
+ x2 = &x1;
+ x3 = &x2;
+ snp0.char_ptr = &a3;
+ snp0.long_ptr = &z3;
+ snp0.ptrs[0] = &snp0;
+ snp0.ptrs[1] = &snp1;
+ snp0.ptrs[2] = &snp2;
+ snp0.next = &snp1;
+ snp1.char_ptr = &b3;
+ snp1.long_ptr = &y3;
+ snp1.ptrs[0] = &snp0;
+ snp1.ptrs[1] = &snp1;
+ snp1.ptrs[2] = &snp2;
+ snp1.next = &snp2;
+ snp2.char_ptr = &c3;
+ snp2.long_ptr = &x3;
+ snp2.ptrs[0] = &snp0;
+ snp2.ptrs[1] = &snp1;
+ snp2.ptrs[2] = &snp2;
+ snp2.next = 0x0;
+ psnp = &snp0;
+ snp0.char_ptr = &b3;
+ snp1.char_ptr = &c3;
+ snp2.char_ptr = &a3;
+ snp0.long_ptr = &y3;
+ snp1.long_ptr = &x3;
+ snp2.long_ptr = &z3;
+}
+
+void
+do_special_tests (void)
+{
+ union named_union u;
+ union {
+ int a;
+ char b;
+ long c;
+ } anonu;
+ struct _simple_struct s;
+ struct {
+ int a;
+ char b;
+ long c;
+ } anons;
+ enum foo e;
+ enum { A, B, C } anone;
+ int array[21];
+ int a;
+
+ a = 1;
+ incr_a(2);
+}
+
+int
+main (int argc, char *argv [])
+{
+ do_locals_tests ();
+ do_block_tests ();
+ do_children_tests ();
+ do_special_tests ();
+ exit (0);
+}
+
+
diff --git a/gdb/testsuite/gdb.stabs/Makefile.in b/gdb/testsuite/gdb.stabs/Makefile.in
new file mode 100644
index 00000000000..5bf35ea76a1
--- /dev/null
+++ b/gdb/testsuite/gdb.stabs/Makefile.in
@@ -0,0 +1,16 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+all:
+ @echo "Nothing to be done for all..."
+
+#### host, target, and site specific Makefile frags come in here.
+
+clean mostlyclean:
+ -rm -f *.o *~ core tmp.c tmp.s weird.s errs
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+
+Makefile: $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
diff --git a/gdb/testsuite/gdb.stabs/aout.sed b/gdb/testsuite/gdb.stabs/aout.sed
new file mode 100644
index 00000000000..bbe38bc459a
--- /dev/null
+++ b/gdb/testsuite/gdb.stabs/aout.sed
@@ -0,0 +1,16 @@
+s/# Irix4 sed blows up if you have a sed command starting with "#"//
+s/# Avoid it by putting the comments within real sed commands.//
+s/# GDB legitimately expects a file name.//
+s/# The sun3 assembler bogusly requires that the value of this stab be a//
+s/# label. Placate it.//
+1i\
+ .stabs "weird.c",0x64,0,0,Label0\
+Label0:
+s/N_LSYM/0x80/
+s/N_GSYM/0x20/
+s/# Replace a single backslash with a doubled backslash//
+/\.stabs/s/\\/\\\\/
+s/\.begin_common\(.*\)/.stabs \1,0xe2,0,0,0/
+s/\.end_common\(.*\)/.stabs \1,0xe4,0,0,0/
+s/\.align_it/.align 2/
+/^#/d
diff --git a/gdb/testsuite/gdb.stabs/configure b/gdb/testsuite/gdb.stabs/configure
new file mode 100755
index 00000000000..698233dcc7d
--- /dev/null
+++ b/gdb/testsuite/gdb.stabs/configure
@@ -0,0 +1,899 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=weird.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:573: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:594: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:612: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.stabs/configure.in b/gdb/testsuite/gdb.stabs/configure.in
new file mode 100644
index 00000000000..aa494262bc1
--- /dev/null
+++ b/gdb/testsuite/gdb.stabs/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(weird.exp)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.stabs/ecoff.sed b/gdb/testsuite/gdb.stabs/ecoff.sed
new file mode 100644
index 00000000000..3411c294198
--- /dev/null
+++ b/gdb/testsuite/gdb.stabs/ecoff.sed
@@ -0,0 +1,17 @@
+# GDB legitimately expects a file name.
+1i\
+ .file 1 "weird.c"\
+\ #@stabs\
+\ #.stabs "weird.c",0x64,0,0,0
+/^#/d
+s/" *, */",/g
+s/\([0-9]\) *, */\1,/g
+s/ *$//
+s/N_LSYM/0x80/
+s/N_GSYM/0x20/
+s/\.begin_common\(.*\)/.stabs \1,0xe2,0,0,0/
+s/\.end_common\(.*\)/.stabs \1,0xe4,0,0,0/
+s/\.align_it/.align 2/
+/.if/d
+/.endif/d
+s/\.stabs/ #.stabs/
diff --git a/gdb/testsuite/gdb.stabs/hppa.sed b/gdb/testsuite/gdb.stabs/hppa.sed
new file mode 100644
index 00000000000..5ca1a003c37
--- /dev/null
+++ b/gdb/testsuite/gdb.stabs/hppa.sed
@@ -0,0 +1,20 @@
+s/# Old OSF sed blows up if you have a sed command starting with "#"//
+s/# Avoid it by putting the comments within real sed commands.//
+s/# GDB legitimately expects a file name.//
+s/# The sun3 assembler bogusly requires that the value of this stab be a//
+s/# label. Placate it.//
+1i\
+\ .stabs "weird.c",0x64,0,0,Label0\
+Label0:
+s/N_LSYM/0x80/
+s/N_GSYM/0x20/
+s/# Replace a single backslash with a doubled backslash//
+/\.stabs/s/\\/\\\\/
+s/# Only labels should be at the beginning of a line, assembler directives//
+s/# and instructions should start somewhere after column zero.//
+/^\./s/^\./ ./
+s/\.begin_common\(.*\)/.stabs \1,0xe2,0,0,0/
+s/\.end_common\(.*\)/.stabs \1,0xe4,0,0,0/
+s/\.align_it/.align 4/
+s/\.globl/.export/
+/^#/d
diff --git a/gdb/testsuite/gdb.stabs/weird.def b/gdb/testsuite/gdb.stabs/weird.def
new file mode 100644
index 00000000000..33116b4c5f3
--- /dev/null
+++ b/gdb/testsuite/gdb.stabs/weird.def
@@ -0,0 +1,882 @@
+# We'll need an integer type.
+.stabs "inttype:t1=bu4;0;32;",N_LSYM,0,0,0
+
+# There are several kinds of tests in here. We mix up the order to see
+# if we can test for poor handling of a stab affecting the next or previous
+# stab.
+
+# Try all possible symbol descriptors. Note that GDB should merely
+# complain() even though these strings are totally bogus. This allows
+# future compilers to define new syntaxes.
+.stabs "sym32: !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+
+# Type descriptors.
+.stabs "type32:t32= !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+
+# Note that a 'G', N_GSYM symbol needs no value. The name of the stab
+# is used to look up a non-stab symbol with the same name. On some
+# machines, the non-stab symbols will normally have underscores, but
+# if they lack the underscores, then GDB will simply put the symbol in
+# the minimal symbol table all the same. So we can use them without
+# underscores and that way we don't need to worry about which machines
+# need underscores.
+
+# Type attributes.
+.stabs "attr104:G404=@h !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr105:G405=@i !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+# A few real type attributes.
+# Alignment.
+.stabs "var0:G300=@a8;1",N_GSYM,0,0, 0
+.globl var0
+.data
+.align_it
+var0:
+.long 42
+
+.stabs "sym33:! !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym35:# !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym36:$ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym37:% !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym38:& !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym39:' !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym40:( !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym41:) !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym42:* !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym43:+ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym44:, !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym45:- !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+
+.globl attr122
+.data
+.align_it
+attr122:
+.long 42
+.globl attr123
+.data
+.align_it
+attr123:
+.long 42
+.globl attr124
+.data
+.align_it
+attr124:
+.long 42
+
+.stabs "sym46:. !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym47:/ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym48:0 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym49:1 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym50:2 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+
+.stabs "attr96:G396=@` !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr97:G397=@a !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr98:G398=@b !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr99:G399=@c !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+.stabs "sym51:3 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym52:4 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym53:5 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym54:6 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym55:7 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym56:8 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym57:9 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym58:: !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym59:; !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym60:< !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym61:= !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym62:> !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym63:? !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym64:@ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym65:A !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym66:B !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym67:C !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym68:D !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym69:E !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym70:F !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym71:G !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym72:H !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym73:I !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym74:J !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym75:K !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym76:L !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym77:M !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym78:N !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym79:O !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym80:P !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym81:Q !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym82:R !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym83:S !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym84:T !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym85:U !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym86:V !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym87:W !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym88:X !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym89:Y !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym90:Z !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym91:[ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+
+.stabs "sym93:] !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym94:^ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym95:_ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym96:` !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym97:a !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym98:b !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym99:c !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym100:d !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym101:e !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym102:f !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym103:g !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym104:h !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym105:i !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym106:j !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym107:k !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym108:l !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym109:m !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym110:n !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym111:o !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym112:p !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym113:q !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym114:r !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym115:s !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym116:t !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym117:u !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym118:v !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym119:w !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym120:x !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym121:y !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym122:z !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym123:{ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym124:| !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym125:} !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "sym126:~ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+
+.stabs "type33:t33=! !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type35:t35=# !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type36:t36=$ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type37:t37=% !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type38:t38=& !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type39:t39=' !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type40:t40=( !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type41:t41=) !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type42:t42=* !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type43:t43=+ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type44:t44=, !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type45:t45=- !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type46:t46=. !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type47:t47=/ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type48:t48=0 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type49:t49=1 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type50:t50=2 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type51:t51=3 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type52:t52=4 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type53:t53=5 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type54:t54=6 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type55:t55=7 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type56:t56=8 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type57:t57=9 !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type58:t58=: !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type59:t59=; !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type60:t60=< !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type61:t61== !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type62:t62=> !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type63:t63=? !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type64:t64=@ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type65:t65=A !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type66:t66=B !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type67:t67=C !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+
+.globl attr66
+.data
+.align_it
+attr66:
+.long 42
+.globl attr67
+.data
+.align_it
+attr67:
+.long 42
+.globl attr68
+.data
+.align_it
+attr68:
+.long 42
+.globl attr69
+.data
+.align_it
+attr69:
+.long 42
+
+.stabs "type68:t68=D !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type69:t69=E !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type70:t70=F !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type71:t71=G !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type72:t72=H !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type73:t73=I !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type74:t74=J !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type75:t75=K !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type76:t76=L !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type77:t77=M !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type78:t78=N !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type79:t79=O !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type80:t80=P !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type81:t81=Q !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type82:t82=R !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type83:t83=S !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type84:t84=T !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type85:t85=U !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type86:t86=V !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type87:t87=W !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+
+.stabs "attr69:G369=@E !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr70:G370=@F !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr71:G371=@G !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+.stabs "type88:t88=X !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type89:t89=Y !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type90:t90=Z !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type91:t91=[ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+
+.stabs "type93:t93=] !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type94:t94=^ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type95:t95=_ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type96:t96=` !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type97:t97=a !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type98:t98=b !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type99:t99=c !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type100:t100=d !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type101:t101=e !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type102:t102=f !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type103:t103=g !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type104:t104=h !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type105:t105=i !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type106:t106=j !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type107:t107=k !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type108:t108=l !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type109:t109=m !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type110:t110=n !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type111:t111=o !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type112:t112=p !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type113:t113=q !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type114:t114=r !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type115:t115=s !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type116:t116=t !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type117:t117=u !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type118:t118=v !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type119:t119=w !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type120:t120=x !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type121:t121=y !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type122:t122=z !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type123:t123={ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type124:t124=| !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type125:t125=} !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type126:t126=~ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+
+.stabs "attr32:G332=@ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr33:G333=@! !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr35:G334=@# !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+.stabs "attr36:G335=@$ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+.stabs "attr37:G337=@% !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+# Test 'e' constant on non-enum type.
+.stabs "const69:c=e1,69", N_LSYM,0,0, 0
+
+# Test constant with the type embedded.
+.stabs "const70:c=e190=bs2;0;16;,70", N_LSYM,0,0, 0
+
+.stabs "attr38:G338=@& !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+# Unrecognized negative type number.
+.stabs "bad_neg0type:t201=s16field0:1,0,32;field2:-534,32,64;field3:-1,96,32;;", N_LSYM,0,0, 0
+
+.stabs "bad_neg0:G201", N_GSYM,0,0, 0
+
+.globl bad_neg0
+.data
+.align_it
+bad_neg0:
+.long 42
+ .long 43, 44, 45
+
+.stabs "attr39:G339=@' !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr41:G341=@) !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr42:G342=@* !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr43:G343=@+ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr44:G344=@, !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr46:G346=@. !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr47:G347=@/ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr58:G358=@: !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+# Test two type attributes for one type.
+.stabs "attr59:G359=@;@ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+.stabs "attr60:G360=@< !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr61:G361=@= !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr62:G362=@> !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr63:G363=@? !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr64:G364=@@ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr65:G365=@A !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr66:G366=@B !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr67:G367=@C !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr68:G368=@D !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr72:G372=@H !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr73:G373=@I !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr74:G374=@J !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr75:G375=@K !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr76:G376=@L !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr77:G377=@M !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr78:G378=@N !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr79:G379=@O !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr80:G380=@P !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr81:G381=@Q !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr82:G382=@R !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr83:G383=@S !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr84:G384=@T !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr85:G385=@U !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr86:G386=@V !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr87:G387=@W !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr88:G388=@X !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr89:G389=@Y !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr90:G390=@Z !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr91:G391=@[ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+.stabs "attr93:G393=@] !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+# Do with and without underscore, so this wins regardless of whether
+# names have underscores.
+
+.globl _common0
+.data
+.align_it
+_common0:
+.long 42
+ .long 24
+ .long 22
+.globl common0
+.data
+.align_it
+common0:
+.long 42
+ .long 24
+ .long 22
+.begin_common "common0"
+.stabs "common0var0:S1", N_GSYM,0,0, 0
+.stabs "common0var1:S1", N_GSYM,0,0, 4
+.stabs "common0var2:S1", N_GSYM,0,0, 8
+.end_common "common0"
+
+.stabs "attr94:G394=@^ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr95:G395=@_ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr100:G400=@d !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr101:G401=@e !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr102:G402=@f !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr103:G403=@g !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr106:G406=@j !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr107:G407=@k !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr108:G408=@l !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr109:G409=@m !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr110:G410=@n !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr111:G411=@o !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr112:G412=@p !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr113:G413=@q !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr114:G414=@r !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr115:G415=@s !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr116:G416=@t !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr117:G417=@u !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr118:G418=@v !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr119:G419=@w !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr120:G420=@x !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr121:G421=@y !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr122:G422=@z !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr123:G423=@{ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr124:G424=@| !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr125:G425=@} !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+.stabs "attr126:G426=@~ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
+
+# Define a variable for all the above stabs.
+.globl attr32
+.data
+.align_it
+attr32:
+.long 42
+.globl attr33
+.data
+.align_it
+attr33:
+.long 42
+.globl attr35
+.data
+.align_it
+attr35:
+.long 42
+.globl attr36
+.data
+.align_it
+attr36:
+.long 42
+.globl attr37
+.data
+.align_it
+attr37:
+.long 42
+.globl attr38
+.data
+.align_it
+attr38:
+.long 42
+.globl attr39
+.data
+.align_it
+attr39:
+.long 42
+.globl attr41
+.data
+.align_it
+attr41:
+.long 42
+.globl attr42
+.data
+.align_it
+attr42:
+.long 42
+.globl attr43
+.data
+.align_it
+attr43:
+.long 42
+.globl attr44
+.data
+.align_it
+attr44:
+.long 42
+.globl attr46
+.data
+.align_it
+attr46:
+.long 42
+.globl attr47
+.data
+.align_it
+attr47:
+.long 42
+.globl attr58
+.data
+.align_it
+attr58:
+.long 42
+.globl attr59
+.data
+.align_it
+attr59:
+.long 42
+.globl attr60
+.data
+.align_it
+attr60:
+.long 42
+.globl attr61
+.data
+.align_it
+attr61:
+.long 42
+.globl attr62
+.data
+.align_it
+attr62:
+.long 42
+.globl attr63
+.data
+.align_it
+attr63:
+.long 42
+.globl attr64
+.data
+.align_it
+attr64:
+.long 42
+.globl attr65
+.data
+.align_it
+attr65:
+.long 42
+.globl attr70
+.data
+.align_it
+attr70:
+.long 42
+.globl attr71
+.data
+.align_it
+attr71:
+.long 42
+.globl attr72
+.data
+.align_it
+attr72:
+.long 42
+.globl attr73
+.data
+.align_it
+attr73:
+.long 42
+.globl attr74
+.data
+.align_it
+attr74:
+.long 42
+.globl attr75
+.data
+.align_it
+attr75:
+.long 42
+.globl attr76
+.data
+.align_it
+attr76:
+.long 42
+.globl attr77
+.data
+.align_it
+attr77:
+.long 42
+.globl attr78
+.data
+.align_it
+attr78:
+.long 42
+.globl attr79
+.data
+.align_it
+attr79:
+.long 42
+.globl attr80
+.data
+.align_it
+attr80:
+.long 42
+.globl attr81
+.data
+.align_it
+attr81:
+.long 42
+.globl attr82
+.data
+.align_it
+attr82:
+.long 42
+.globl attr83
+.data
+.align_it
+attr83:
+.long 42
+.globl attr84
+.data
+.align_it
+attr84:
+.long 42
+
+# Unrecognized floating point code.
+.stabs "float72type:t202=R87;9;", N_LSYM,0,0, 0
+
+# 256-bit integer. The point is obviously not that GDB should have a
+# special case for this size, but that an integer of any size should
+# work (at least for printing in hex, not necessarily for arithmetic.
+.stabs "int256var:G203=bu32;0;256;", N_GSYM,0,0, 0
+# The value is palindromic, so it works whether words are big or little
+# endian.
+.globl int256var
+.data
+.align_it
+ int256var:
+.long 42
+ .long 0x2b, 0x2c, 0x2d, 0x2d, 0x2c, 0x2b, 0x2a
+
+# Huge value in constant should at least get the type right.
+
+# This value is just big enough not to fit in 32 bits.
+.stabs "consth:c=e1,4294967296", N_LSYM,0,0, 0
+
+.stabs "consth2:c=e1,-734723985732642758928475678987234563284937456", N_LSYM,0,0, 0
+
+# Test a struct constant using S.
+.stabs "bad_neg0const:c=S201,128,128,11222211343434345656565677888877", N_LSYM,0,0, 0
+
+# Bad filenumbers.
+# This one is totally bogus.
+.stabs "bad_type0:t(-3,7)", N_LSYM,0,0, 0
+# This one probably gets interpreted as a forward reference.
+.stabs "bad_type1:t(42,6)", N_LSYM,0,0, 0
+
+# Arrays indexed by weird things.
+.stabs "array_index0:t205=r1;0;5;", N_LSYM,0,0, 0
+.stabs "array0:G206=a205;1", N_GSYM,0,0, 0
+.globl array0
+.data
+.align_it
+ array0:
+.long 42
+ .long 43, 44, 45, 46, 47
+
+.stabs "array_index1:t207=", N_LSYM,0,0, 0
+.stabs "array1:G208=aeai1_red:0,ai1_green:1,ai1_blue:2,;;1", N_GSYM,0,0, 0
+.globl array1
+.data
+.align_it
+ array1:
+.long 42
+ .long 43, 44
+
+# See if GDB can deal with it if the compiler gets smarter about saying
+# which variables were defined with which types.
+.stabs "inttype_one:t209=1", N_LSYM,0,0, 0
+.stabs "inttype_two:t210=1", N_LSYM,0,0, 0
+.stabs "one_var:G209", N_GSYM,0,0, 0
+.globl one_var
+.data
+.align_it
+one_var:
+.long 42
+.stabs "two_var:G210", N_GSYM,0,0, 0
+.globl two_var
+.data
+.align_it
+two_var:
+.long 42
+
+# And see if the caddr_t hack can deal with the same thing.
+.stabs "intp:t211=*1", N_LSYM,0,0, 0
+# If it weren't for this variable, we'd need to ignore the intp name.
+.stabs "pointer_to_int_var:G212=*1", N_LSYM,0,0, 0
+.stabs "intp_var:G211", N_GSYM,0,0, 0
+.globl intp_var
+.data
+.align_it
+intp_var:
+.long 42
+
+# Unrecognized constant code.
+.stabs "unrecog_const:c=xjksdflskd33,4;473;", N_LSYM,0,0, 0
+
+.globl attr85
+.data
+.align_it
+attr85:
+.long 42
+.globl attr86
+.data
+.align_it
+attr86:
+.long 42
+.globl attr87
+.data
+.align_it
+attr87:
+.long 42
+.globl attr88
+.data
+.align_it
+attr88:
+.long 42
+.globl attr89
+.data
+.align_it
+attr89:
+.long 42
+.globl attr90
+.data
+.align_it
+attr90:
+.long 42
+.globl attr91
+.data
+.align_it
+attr91:
+.long 42
+.globl attr92
+.data
+.align_it
+attr92:
+.long 42
+.globl attr93
+.data
+.align_it
+attr93:
+.long 42
+.globl attr94
+.data
+.align_it
+attr94:
+.long 42
+.globl attr95
+.data
+.align_it
+attr95:
+.long 42
+.globl attr96
+.data
+.align_it
+attr96:
+.long 42
+.globl attr97
+.data
+.align_it
+attr97:
+.long 42
+.globl attr98
+.data
+.align_it
+attr98:
+.long 42
+.globl attr99
+.data
+.align_it
+attr99:
+.long 42
+.globl attr100
+.data
+.align_it
+attr100:
+.long 42
+.globl attr101
+.data
+.align_it
+attr101:
+.long 42
+.globl attr102
+.data
+.align_it
+attr102:
+.long 42
+.globl attr103
+.data
+.align_it
+attr103:
+.long 42
+.globl attr104
+.data
+.align_it
+attr104:
+.long 42
+.globl attr105
+.data
+.align_it
+attr105:
+.long 42
+.globl attr106
+.data
+.align_it
+attr106:
+.long 42
+.globl attr107
+.data
+.align_it
+attr107:
+.long 42
+.globl attr108
+.data
+.align_it
+attr108:
+.long 42
+.globl attr109
+.data
+.align_it
+attr109:
+.long 42
+.globl attr110
+.data
+.align_it
+attr110:
+.long 42
+.globl attr111
+.data
+.align_it
+attr111:
+.long 42
+.globl attr112
+.data
+.align_it
+attr112:
+.long 42
+.globl attr113
+.data
+.align_it
+attr113:
+.long 42
+.globl attr114
+.data
+.align_it
+attr114:
+.long 42
+.globl attr115
+.data
+.align_it
+attr115:
+.long 42
+.globl attr116
+.data
+.align_it
+attr116:
+.long 42
+.globl attr117
+.data
+.align_it
+attr117:
+.long 42
+.globl attr118
+.data
+.align_it
+attr118:
+.long 42
+.globl attr119
+.data
+.align_it
+attr119:
+.long 42
+.globl attr120
+.data
+.align_it
+attr120:
+.long 42
+.globl attr121
+.data
+.align_it
+attr121:
+.long 42
+.globl attr125
+.data
+.align_it
+attr125:
+.long 42
+.globl attr126
+.data
+.align_it
+attr126:
+.long 42
+
+# Size.
+.stabs "var1:G301=@s32;1",N_GSYM,0,0, 0
+.globl var1
+.data
+.align_it
+var1:
+.long 42
+# Pointer class.
+.stabs "var2:G302=@p42;1",N_GSYM,0,0, 0
+.globl var2
+.data
+.align_it
+var2:
+.long 42
+# Packed type.
+.stabs "var3:G303=@P;1",N_GSYM,0,0, 0
+.globl var3
+.data
+.align_it
+var3:
+.long 42
+
+.stabs "sym92:\ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "type92:t92=\ !#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~",N_LSYM,0,0,0
+.stabs "attr92:G392=@\ !#$%&'()*+,-./0123456789:<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~;1",N_GSYM,0,0, 0
diff --git a/gdb/testsuite/gdb.stabs/weird.exp b/gdb/testsuite/gdb.stabs/weird.exp
new file mode 100644
index 00000000000..e584cba3135
--- /dev/null
+++ b/gdb/testsuite/gdb.stabs/weird.exp
@@ -0,0 +1,328 @@
+# Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# Test that GDB properly ignores invalid stabs.
+# Also test that GDB can debug a .o file, and that it doesn't mind
+# a file that's more minimal than what a compiler normally puts out.
+if $tracelevel then {
+ strace $tracelevel
+}
+
+# If the test directory was not created by configure then skip
+# this test.
+if ![file isdirectory ${objdir}/${subdir}] then {
+ return 0
+}
+
+set prms_id 0
+set bug_id 0
+
+proc do_tests {} {
+ global binfile
+ global gdb_prompt
+
+ # Mips/alpha targets that use gcc with mips-tfile put out the stabs
+ # assembler directives embedded in comments. If the assembler
+ # file is then processed with native cc, all stabs directives
+ # will be lost.
+ # Skip the rest of the stabs tests for this case.
+ send_gdb "ptype inttype\n"
+ gdb_expect {
+ -re "^ptype inttype\r*\ntype = inttype.*$gdb_prompt $" {
+ pass "stabs found"
+ }
+ -re ".*$gdb_prompt $" {
+ setup_xfail "mips-*-*"
+ setup_xfail "alpha-*-*"
+ fail "stabs not found"
+ return
+ }
+ default { fail "checking for stabs" }
+ }
+
+ print_weird_var var0
+ print_weird_var var1
+ print_weird_var var2
+ print_weird_var var3
+
+ print_weird_var attr32
+ print_weird_var attr33
+ print_weird_var attr35
+ print_weird_var attr36
+ print_weird_var attr37
+ print_weird_var attr38
+ print_weird_var attr39
+ print_weird_var attr41
+ print_weird_var attr42
+ print_weird_var attr43
+ print_weird_var attr44
+ print_weird_var attr46
+ print_weird_var attr47
+ print_weird_var attr58
+ print_weird_var attr59
+ print_weird_var attr60
+ print_weird_var attr61
+ print_weird_var attr62
+ print_weird_var attr63
+ print_weird_var attr64
+ print_weird_var attr65
+ print_weird_var attr66
+ print_weird_var attr67
+ print_weird_var attr68
+ print_weird_var attr69
+ print_weird_var attr70
+ print_weird_var attr71
+ print_weird_var attr72
+ print_weird_var attr73
+ print_weird_var attr74
+ print_weird_var attr75
+ print_weird_var attr76
+ print_weird_var attr77
+ print_weird_var attr78
+ print_weird_var attr79
+ print_weird_var attr80
+ print_weird_var attr81
+ print_weird_var attr82
+ print_weird_var attr83
+ print_weird_var attr84
+ print_weird_var attr85
+ print_weird_var attr86
+ print_weird_var attr87
+ print_weird_var attr88
+ print_weird_var attr89
+ print_weird_var attr90
+ print_weird_var attr91
+ print_weird_var attr92
+ print_weird_var attr93
+ print_weird_var attr94
+ print_weird_var attr95
+ print_weird_var attr96
+ print_weird_var attr97
+ print_weird_var attr98
+ print_weird_var attr99
+ print_weird_var attr100
+ print_weird_var attr101
+ print_weird_var attr102
+ print_weird_var attr103
+ print_weird_var attr104
+ print_weird_var attr105
+ print_weird_var attr106
+ print_weird_var attr107
+ print_weird_var attr108
+ print_weird_var attr109
+ print_weird_var attr110
+ print_weird_var attr111
+ print_weird_var attr112
+ print_weird_var attr113
+ print_weird_var attr114
+ print_weird_var attr115
+ print_weird_var attr116
+ print_weird_var attr117
+ print_weird_var attr118
+ print_weird_var attr119
+ print_weird_var attr120
+ print_weird_var attr121
+ print_weird_var attr122
+ print_weird_var attr123
+ print_weird_var attr124
+ print_weird_var attr125
+ print_weird_var attr126
+
+ gdb_test "p const69" " = 69" "'e' constant on non-enum type"
+ gdb_test "whatis const69" "type = (unsigned int|inttype)" "whatis const69"
+
+ gdb_test "p sizeof (const70)" " = 2" "'e' constant with embedded type"
+
+ gdb_test "p bad_neg0" " = \{field0 = 42, field2 =.*field3 = 45\}" "p bad_neg0"
+
+ gdb_test "ptype inttype" "type = (unsigned int|inttype)" "ptype on inttype"
+ gdb_test "p sizeof (float72type)" " = 9" "unrecognized floating point type"
+
+ # This big number needs to be kept as one piece
+ gdb_test "p/x int256var" " = 0x0*2a0000002b0000002c0000002d0000002d0000002c0000002b0000002a" "print very big integer"
+
+ gdb_test "whatis consth" "type = inttype" "whatis consth"
+ gdb_test "whatis consth2" "type = inttype" "whatis consth2"
+
+ # GDB does not yet understand S constants
+ setup_xfail "*-*-*"
+ gdb_test "p/x bad_neg0const" " = \{field0 = 0x11222211, field2 =.*\
+field3 = 0x77888877\}" "print struct constant"
+
+ gdb_test "ptype bad_type0" "type = .*" "print bad_type0"
+ gdb_test "ptype bad_type1" "type = .*" "print bad_type1"
+
+ # GDB does not yet support arrays indexed by anything at all unusual
+ setup_xfail "*-*-*"
+ gdb_test "p array0" " = \\{42, 43, 44, 45, 46, 47\\}" "array0 with strange index"
+ setup_xfail "*-*-*"
+ gdb_test "p array1" " = \\{42, 43, 44\\}" "array1 with strange index"
+
+ # GDB does not yet support this feature
+ gdb_test "whatis one_var" "type = inttype_one" \
+ "whatis one_var (known failure in gdb 4.10)"
+ # But do make sure that it prints as something reasonable
+ gdb_test "whatis one_var" "type = inttype(|_one)" \
+ "whatis one_var test 2"
+
+ gdb_test "whatis two_var" "type = inttype_two" \
+ "whatis two_var (known failure in gdb 4.10)"
+ # But do make sure that it prints as something reasonable
+ gdb_test "whatis two_var" "type = inttype(|_two)" \
+ "whatis two_var test 2"
+
+ setup_xfail "*-*-*"
+ gdb_test "whatis pointer_to_int_var" "type = int \[*\]"
+ setup_xfail "*-*-*"
+ gdb_test "whatis intp_var" "type = intp"
+
+ gdb_test "p common0var0" "= 42"
+ # GDB seems to only understand common blocks local to a function.
+ # These variables never get relocated to be relative to the common
+ # block.
+ # I'm not sure whether it is valid to have a common block which
+ # is not local to a function.
+ setup_xfail "*-*-*"
+ gdb_test "p common0var1" "= 24"
+ setup_xfail "*-*-*"
+ gdb_test "p common0var2" "= 22"
+}
+
+proc print_weird_var { var } {
+ global gdb_prompt
+
+ # Make sure that the variable gets printed out correctly, without
+ # any sort of warning message.
+ send_gdb "print $var\n"
+ gdb_expect {
+ -re "^print $var\r*\n.\[0-9\]* = 42.*$gdb_prompt $" {
+ pass "variable $var printed properly"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "variable $var printed properly"
+ }
+ timeout { fail "variable $var printed properly (timeout)" }
+ eof { fail "variable $var printed properly (eof)" }
+ }
+
+ # Make sure that the stabs did get loaded in a sensible way.
+ # If somehow the stabs got skipped, then the above test can
+ # pass because GDB assumes int for variables without a stab.
+
+ # This doesn't work because 32=45 doesn't preserve the name in
+ # gdb (as of 14 Sep 93 anyway).
+ #gdb_test "whatis $var" "type = (unsigned int|inttype)"
+
+ # But the size should be right.
+ gdb_test "print sizeof ($var)" "= 4"
+}
+
+
+# Don't use gdb_load; it doesn't bitch if the loading produced some
+# error messages during symbol reading.
+set testfile weird
+set srcfile ${objdir}/${subdir}/weird.s
+set binfile ${objdir}/${subdir}/weirdx.o
+
+global target_os
+set sedscript ${srcdir}/${subdir}/aout.sed
+switch -glob ${target_triplet} {
+ "hppa*-*-*" {
+ set sedscript ${srcdir}/${subdir}/hppa.sed
+ }
+ "mips-*-ecoff" {
+ set sedscript ${srcdir}/${subdir}/ecoff.sed
+ }
+ "powerpc-*-aix*" {
+ set sedscript ${srcdir}/${subdir}/xcoff.sed
+ }
+ "rs6000-*-aix*" {
+ set sedscript ${srcdir}/${subdir}/xcoff.sed
+ }
+ "*-*-aout" {
+ set sedscript ${srcdir}/${subdir}/aout.sed
+ }
+ "*-*-xcoff" {
+ set sedscript ${srcdir}/${subdir}/xcoff.sed
+ }
+ "alpha-*-*" {
+ set sedscript ${srcdir}/${subdir}/ecoff.sed
+ }
+}
+
+
+# Hope this is a Unix box.
+set exec_output [remote_exec build "sed" "-f ${sedscript}" "${srcdir}/${subdir}/weird.def" "${srcfile}"]
+if { [lindex $exec_output 0] != 0 } {
+ perror "Couldn't make test case. $exec_output"
+ return -1
+}
+
+# HP's assembler has no idea of what to do with .stab directives; detect the
+# use of HP compilers and escape from here. (No doubt a better heuristic
+# could be devised.)
+
+if { [ info exists CC ] && [ string first "/opt/ansic/bin/cc" "$CC" ] >= 0 } then { continue }
+
+if { [gdb_compile "${srcfile}" "${binfile}" object ""] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+remote_file build delete ${srcfile}
+
+# Start with a fresh gdb
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+set binfile [remote_download host ${binfile} object.o]
+send_gdb "file $binfile\n"
+# If $binfile is very long, a \r (but not a \n) will echo in the
+# middle of the echo of the command. So to match the echo, we
+# would like to match anything not containing \n
+# (we would prefer to be sure not to match any warning message).
+# But \[^\n\]* doesn't seem to work, so instead use the heuristic
+# that a filename won't contain a space and a warning message will.
+# But spaces following by backspaces aren't really spaces.
+gdb_expect 60 {
+ -re "^file (\[^ \]| +\008)*\r*\n" {
+ exp_continue
+ }
+ -re "A program is being debugged already. Kill it\\? \\(y or n\\)" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "^Reading symbols from $binfile\\.\\.\\.done\.\r*\n$gdb_prompt $" {
+ pass "weirdx.o read without error"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "Errors reading weirdx.o"
+ }
+ timeout {
+ perror "couldn't load $binfile into $GDB (timed out)."
+ return -1
+ }
+ eof { fail "(eof) cannot read weirdx.o" }
+}
+
+do_tests
+
+remote_file host delete ${binfile}
+
+return 0
diff --git a/gdb/testsuite/gdb.stabs/xcoff.sed b/gdb/testsuite/gdb.stabs/xcoff.sed
new file mode 100644
index 00000000000..8a6b4ef1986
--- /dev/null
+++ b/gdb/testsuite/gdb.stabs/xcoff.sed
@@ -0,0 +1,17 @@
+# Put everything in this csect, which seems to make things work.
+# The compiler actually puts the stabs in .csect [PR], but that didn't
+# work here (I guess because there is no text section).
+1i\
+ .csect .data[RW]
+# .stabs string,type,0,0,value -> .stabx string,value,type,0
+s/^[ ]*\.stabs[ ]*\("[^"]*"\),[ ]*\([^,]*\),[ ]*0,0,[ ]*\(.*\)$/.stabx \1,\3,\2,0/
+s/N_GSYM/128/
+# This needs to be C_DECL, which is used for types, not C_LSYM, which is
+# ignored on the initial scan.
+s/N_LSYM/140/
+s/\.begin_common/.bc/
+# The AIX assembler doesn't want the name in a .ec directive
+s/\.end_common.*/.ec/
+s/\.align_it/.align 1/
+/\.data/d
+/^#/d
diff --git a/gdb/testsuite/gdb.threads/Makefile.in b/gdb/testsuite/gdb.threads/Makefile.in
new file mode 100644
index 00000000000..34f22b53bb3
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/Makefile.in
@@ -0,0 +1,31 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = pthreads
+
+all:
+ @echo "Nothing to be done for all..."
+
+info:
+install-info:
+dvi:
+install:
+uninstall: force
+installcheck:
+check:
+
+clean mostlyclean:
+ -rm -f *~ *.o a.out xgdb *.x *.ci *.tmp core* $(EXECUTABLES)
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log config.h
+
+Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
+
+config.h: stamp-h ; @true
+stamp-h: config.in config.status
+ CONFIG_HEADERS=config.h:config.in $(SHELL) config.status
+
+config.status: configure
+ $(SHELL) config.status --recheck
diff --git a/gdb/testsuite/gdb.threads/config.in b/gdb/testsuite/gdb.threads/config.in
new file mode 100644
index 00000000000..37bfc2ba592
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/config.in
@@ -0,0 +1,4 @@
+/* config.in. Generated automatically from configure.in by autoheader. */
+
+/* Define if you have the <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
diff --git a/gdb/testsuite/gdb.threads/configure b/gdb/testsuite/gdb.threads/configure
new file mode 100755
index 00000000000..6649098712b
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/configure
@@ -0,0 +1,1098 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=pthreads.exp
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:574: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:595: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:613: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:637: checking how to run the C preprocessor" >&5
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # This must be in double quotes, not single quotes, because CPP may get
+ # substituted into the Makefile and "${CC-cc}" will confuse make.
+ CPP="${CC-cc} -E"
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp.
+ cat > conftest.$ac_ext <<EOF
+#line 652 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP="${CC-cc} -E -traditional-cpp"
+ cat > conftest.$ac_ext <<EOF
+#line 669 "configure"
+#include "confdefs.h"
+#include <assert.h>
+Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ :
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+ ac_cv_prog_CPP="$CPP"
+fi
+ CPP="$ac_cv_prog_CPP"
+else
+ ac_cv_prog_CPP="$CPP"
+fi
+echo "$ac_t""$CPP" 1>&6
+
+for ac_hdr in pthread.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:701: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 706 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:711: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1 | grep ac_space` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@CPP@%$CPP%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='\([ ][ ]*\)[^ ]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='\([ ]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+ CONFIG_HEADERS="config.h:config.in"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ echo creating $ac_file
+
+ rm -f conftest.frag conftest.in conftest.out
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h. And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+ ac_lines=`grep -c . conftest.vals`
+ # grep -c gives empty output for an empty file on some AIX systems.
+ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+ # Write a limited-size here document to conftest.frag.
+ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ echo 'CEOF
+ sed -f conftest.frag conftest.in > conftest.out
+ rm -f conftest.in
+ mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+ rm -f conftest.vals
+ mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+ rm -f conftest.frag conftest.h
+ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
+ cat conftest.in >> conftest.h
+ rm -f conftest.in
+ if cmp -s $ac_file conftest.h 2>/dev/null; then
+ echo "$ac_file is unchanged"
+ rm -f conftest.h
+ else
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ fi
+ rm -f $ac_file
+ mv conftest.h $ac_file
+ fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.threads/configure.in b/gdb/testsuite/gdb.threads/configure.in
new file mode 100644
index 00000000000..1afe91ac4e1
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/configure.in
@@ -0,0 +1,18 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(pthreads.exp)
+AC_CONFIG_HEADER(config.h:config.in)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
+AC_CANONICAL_SYSTEM
+
+AC_CHECK_HEADERS(pthread.h)
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.threads/gcore-thread.exp b/gdb/testsuite/gdb.threads/gcore-thread.exp
new file mode 100644
index 00000000000..b56697be434
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/gcore-thread.exp
@@ -0,0 +1,186 @@
+# Copyright 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@redhat.com)
+# This is a test for the gdb command "generate-core-file".
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# Single-threaded test case
+set testfile "pthreads"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+set built_binfile 0
+if [istarget "*-*-linux"] then {
+ set target_cflags "-D_MIT_POSIX_THREADS"
+} else {
+ set target_cflags ""
+}
+set why_msg "unrecognized error"
+foreach lib {-lpthreads -lpthread -lthread} {
+ set options "debug"
+ lappend options "incdir=${objdir}/${subdir}"
+ lappend options "libs=$lib"
+ set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options]
+ switch -regexp -- $ccout {
+ ".*no posix threads support.*" {
+ set why_msg "missing threads include file"
+ break
+ }
+ ".*cannot open -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ ".*Can't find library for -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ {^$} {
+ pass "successfully compiled posix threads test case"
+ set built_binfile 1
+ break
+ }
+ }
+}
+if {$built_binfile == "0"} {
+ unsupported "Couldn't compile ${srcfile}, ${why_msg}"
+ return -1
+}
+
+# Now we can proceed with the real testing.
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+# regexp for "horizontal" text (i.e. doesn't include newline or
+# carriage return)
+set horiz "\[^\n\r\]*"
+
+# regexp for newline
+set nl "\[\r\n\]+"
+
+set timeout 30
+
+send_gdb "help gcore\n"
+gdb_expect {
+ -re "Undefined command: .gcore.*$gdb_prompt $" {
+ # gcore command not supported -- nothing to test here.
+ unsupported "gdb does not support gcore on this target"
+ return -1;
+ }
+ -re "Save a core file .*$gdb_prompt $" {
+ pass "help gcore"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "help gcore"
+ }
+ timeout {
+ fail "help gcore (timeout)"
+ }
+}
+
+if { ! [ runto main ] } then {
+ gdb_suppress_entire_file "Run to main failed, so all tests in this file will automatically fail."
+}
+
+send_gdb "info threads\n"
+gdb_expect {
+ -re ".* main .*$gdb_prompt $" {
+ # OK, threads are supported.
+ }
+ -re "${nl}$gdb_prompt $" {
+ unsupported "gdb does not support threads on this target"
+ return -1;
+ }
+}
+
+# Make sure thread 1 is running
+delete_breakpoints
+gdb_breakpoint "thread1"
+gdb_test "continue" "Continuing.*Breakpoint.* thread1 .*" "thread 1 is running"
+
+# Make sure thread 2 is running
+delete_breakpoints
+gdb_breakpoint "thread2"
+gdb_test "continue" "Continuing.*Breakpoint.* thread2 .*" "thread 2 is running"
+
+# Drop corefile
+gdb_test "gcore ${objdir}/${subdir}/gcore.test" \
+ "Saved corefile ${objdir}/${subdir}/gcore.test" \
+ "save a corefile"
+
+# Now restart gdb and load the corefile.
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+send_gdb "core ${objdir}/${subdir}/gcore.test\n"
+gdb_expect {
+ -re ".* is not a core dump:.*$gdb_prompt $" {
+ fail "re-load generated corefile (bad file format)"
+ # No use proceeding from here.
+ return;
+ }
+ -re ".*: No such file or directory.*$gdb_prompt $" {
+ fail "re-load generated corefile (file not found)"
+ # No use proceeding from here.
+ return;
+ }
+ -re ".*Couldn't find .* registers in core file.*$gdb_prompt $" {
+ fail "re-load generated corefile (incomplete note section)"
+ }
+ -re "Core was generated by .*$gdb_prompt $" {
+ pass "re-load generated corefile"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "re-load generated corefile"
+ }
+ timeout {
+ fail "re-load generated corefile (timeout)"
+ }
+}
+
+# FIXME: now what can we test about the thread state?
+# We do not know for certain that there should be at least
+# three threads, because who knows what kind of many-to-one
+# mapping various OS's may do? Let's assume that there must
+# be at least two threads:
+
+gdb_test "info threads" ".*${nl} 2 ${horiz}${nl}\\* 1 .*" \
+ "corefile contains at least two threads"
+
+# One thread in the corefile should be in the "thread2" function.
+
+gdb_test "info threads" ".* thread2 .*" \
+ "a corefile thread is executing thread2"
+
+# The thread2 thread should be marked as the current thread.
+
+gdb_test "info threads" ".*${nl}\\* ${horiz} thread2 .*" \
+ "thread2 is current thread in corefile"
+
diff --git a/gdb/testsuite/gdb.threads/linux-dp.c b/gdb/testsuite/gdb.threads/linux-dp.c
new file mode 100644
index 00000000000..c3775bd62ae
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/linux-dp.c
@@ -0,0 +1,207 @@
+/* linux-dp.c --- dining philosophers, on LinuxThreads
+ Jim Blandy <jimb@cygnus.com> --- March 1999 */
+
+/* It's okay to edit this file and shift line numbers around. The
+ tests use gdb_get_line_number to find source locations, so they
+ don't depend on having certain line numbers in certain places. */
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <pthread.h>
+#include <sys/time.h>
+#include <sys/types.h>
+
+/* The number of philosophers at the table. */
+int num_philosophers;
+
+/* Mutex ordering -
+ If you want to lock a mutex M, all the mutexes you have locked
+ already must appear before M on this list.
+
+ fork_mutex[0]
+ fork_mutex[1]
+ ...
+ fork_mutex[num_philosophers - 1]
+ stdout_mutex
+ random_mutex
+*/
+
+/* You must hold this mutex while writing to stdout. */
+pthread_mutex_t stdout_mutex;
+
+/* You must hold this mutex while calling any of the random number
+ generation routines. */
+pthread_mutex_t random_mutex;
+
+/* array of mutexes, one for each fork; fork_mutex[i] is to the left
+ of philosopher i. A philosopher is holding fork i iff his/her
+ thread has locked fork_mutex[i]. */
+pthread_mutex_t *fork_mutex;
+
+/* array of threads, one representing each philosopher. */
+pthread_t *philosophers;
+
+void *
+xmalloc (size_t n)
+{
+ void *p = malloc (n);
+
+ if (! p)
+ {
+ fprintf (stderr, "out of memory\n");
+ exit (2);
+ }
+
+ return p;
+}
+
+void
+shared_printf (char *format, ...)
+{
+ va_list ap;
+
+ va_start (ap, format);
+ pthread_mutex_lock (&stdout_mutex);
+ vprintf (format, ap);
+ pthread_mutex_unlock (&stdout_mutex);
+ va_end (ap);
+}
+
+int
+shared_random ()
+{
+ static unsigned int seed;
+ int result;
+
+ pthread_mutex_lock (&random_mutex);
+ result = rand_r (&seed);
+ pthread_mutex_unlock (&random_mutex);
+ return result;
+}
+
+void
+my_usleep (long usecs)
+{
+ struct timeval timeout;
+
+ timeout.tv_sec = usecs / 1000000;
+ timeout.tv_usec = usecs % 1000000;
+
+ select (0, 0, 0, 0, &timeout);
+}
+
+void
+random_delay ()
+{
+ my_usleep ((shared_random () % 2000) * 100);
+}
+
+void
+print_philosopher (int n, char left, char right)
+{
+ int i;
+
+ shared_printf ("%*s%c %d %c\n", (n * 4) + 2, "", left, n, right);
+}
+
+void *
+philosopher (void *data)
+{
+ int n = * (int *) data;
+
+ print_philosopher (n, '_', '_');
+
+#if 1
+ if (n == num_philosophers - 1)
+ for (;;)
+ {
+ /* The last philosopher is different. He goes for his right
+ fork first, so there is no cycle in the mutex graph. */
+
+ /* Grab the right fork. */
+ pthread_mutex_lock (&fork_mutex[(n + 1) % num_philosophers]);
+ print_philosopher (n, '_', '!');
+ random_delay ();
+
+ /* Then grab the left fork. */
+ pthread_mutex_lock (&fork_mutex[n]);
+ print_philosopher (n, '!', '!');
+ random_delay ();
+
+ print_philosopher (n, '_', '_');
+ pthread_mutex_unlock (&fork_mutex[n]);
+ pthread_mutex_unlock (&fork_mutex[(n + 1) % num_philosophers]);
+ random_delay ();
+ }
+ else
+#endif
+ for (;;)
+ {
+ /* Grab the left fork. */
+ pthread_mutex_lock (&fork_mutex[n]);
+ print_philosopher (n, '!', '_');
+ random_delay ();
+
+ /* Then grab the right fork. */
+ pthread_mutex_lock (&fork_mutex[(n + 1) % num_philosophers]);
+ print_philosopher (n, '!', '!');
+ random_delay ();
+
+ print_philosopher (n, '_', '_');
+ pthread_mutex_unlock (&fork_mutex[n]);
+ pthread_mutex_unlock (&fork_mutex[(n + 1) % num_philosophers]);
+ random_delay ();
+ }
+
+ return (void *) 0;
+}
+
+int
+main (int argc, char **argv)
+{
+ num_philosophers = 5;
+
+ /* Set up the mutexes. */
+ {
+ pthread_mutexattr_t ma;
+ int i;
+
+ pthread_mutexattr_init (&ma);
+ pthread_mutex_init (&stdout_mutex, &ma);
+ pthread_mutex_init (&random_mutex, &ma);
+ fork_mutex = xmalloc (num_philosophers * sizeof (fork_mutex[0]));
+ for (i = 0; i < num_philosophers; i++)
+ pthread_mutex_init (&fork_mutex[i], &ma);
+ pthread_mutexattr_destroy (&ma);
+ }
+
+ /* Set off the threads. */
+ {
+ int i;
+ int *numbers = xmalloc (num_philosophers * sizeof (*numbers));
+ pthread_attr_t ta;
+
+ philosophers = xmalloc (num_philosophers * sizeof (*philosophers));
+
+ pthread_attr_init (&ta);
+
+ for (i = 0; i < num_philosophers; i++)
+ {
+ numbers[i] = i;
+ /* linuxthreads.exp: create philosopher */
+ pthread_create (&philosophers[i], &ta, philosopher, &numbers[i]);
+ }
+
+ pthread_attr_destroy (&ta);
+ }
+
+ /* linuxthreads.exp: info threads 2 */
+ sleep (1000000);
+
+ /* Drink yourself into oblivion. */
+ for (;;)
+ sleep (1000000);
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.threads/linux-dp.exp b/gdb/testsuite/gdb.threads/linux-dp.exp
new file mode 100644
index 00000000000..67ed122d103
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/linux-dp.exp
@@ -0,0 +1,229 @@
+# Copyright 1999, 2001, 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@gnu.org
+
+#### Dining Philosophers, on LinuxThreads - Jim Blandy <jimb@cygnus.com>
+####
+#### At the moment, GDB's support for LinuxThreads is pretty
+#### idiosyncratic --- GDB's output doesn't look much like the output
+#### it produces for other thread implementations, messages appear at
+#### different times, etc. So these tests are specific to LinuxThreads.
+####
+#### However, if all goes well, Linux will soon have a libthread_db
+#### interface, and GDB will manage it the same way it does other
+#### libthread_db-based systems. Then, we can adjust this file to
+#### work with any such system.
+
+### Other things we ought to test:
+### stepping a thread while others are running
+### killing and restarting
+### quitting gracefully
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# This only works with Linux configurations.
+if ![istarget *-*-linux-gnu] then {
+ return
+}
+
+set testfile "linux-dp"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug libs=-lpthread}] != ""} {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+send_gdb "set print sevenbit-strings\n" ; gdb_expect -re "$gdb_prompt $"
+runto_main
+
+# There should be no threads initially.
+gdb_test "info threads" "" "info threads 1"
+
+# Try stepping over the thread creation function.
+gdb_breakpoint [gdb_get_line_number "linuxthreads.exp: create philosopher"]
+for {set i 0} {$i < 5} {incr i} {
+ gdb_continue_to_breakpoint "about to create philosopher: $i"
+ send_gdb "next\n"
+ gdb_expect {
+ -re "\\\[New .*\\\].*$gdb_prompt $" {
+ pass "create philosopher: $i"
+ }
+ -re "Program received signal.*(Unknown signal|SIGUSR|Real-time event).*$gdb_prompt $" {
+ # It would be nice if we could catch the message that GDB prints
+ # when it first notices that the thread library doesn't support
+ # debugging, or if we could explicitly ask GDB somehow.
+ unsupported "This GDB does not support threads on this system."
+ return -1
+ }
+ -re "$gdb_prompt $" {
+ fail "create philosopher: $i"
+ }
+ timeout {
+ fail "(timeout) create philosopher: $i"
+ }
+ }
+}
+
+# Run until there are some threads.
+gdb_breakpoint [gdb_get_line_number "linuxthreads.exp: info threads 2"]
+gdb_continue_to_breakpoint "main thread's sleep"
+gdb_test "info threads" "7 Thread .*6 Thread .*5 Thread .*4 Thread .*3 Thread .*2 Thread .*1 Thread .*" "info threads 2"
+
+# Try setting a thread-specific breakpoint.
+gdb_breakpoint "print_philosopher thread 5"
+gdb_continue_to_breakpoint "thread 5's print"
+gdb_test "where" "print_philosopher.*philosopher.*pthread_start_thread.*" \
+ "first thread-specific breakpoint hit"
+
+# Make sure it's catching the right thread. Try hitting the
+# breakpoint ten times, and make sure we don't get anyone else.
+set only_five 1
+for {set i 0} {$only_five > 0 && $i < 10} {incr i} {
+ gdb_continue_to_breakpoint "thread 5's print, pass: $i"
+ send_gdb "info threads\n"
+ gdb_expect {
+ -re "\\* 5 Thread .* print_philosopher .*\r\n$gdb_prompt $" {
+ # Okay this time.
+ }
+ -re ".*$gdb_prompt $" {
+ set only_five 0
+ }
+ timeout {
+ set only_five -1
+ }
+ }
+}
+
+set name "thread-specific breakpoint is thread-specific"
+if {$only_five == 1} { pass $name }
+if {$only_five == 0} { fail $name }
+if {$only_five == -1} { fail "$name (timeout)" }
+
+
+### Select a particular thread.
+proc select_thread {thread} {
+ global gdb_prompt
+
+ send_gdb "thread $thread\n"
+ gdb_expect {
+ -re "\\\[Switching to thread .*\\\].*\r\n$gdb_prompt $" {
+ pass "selected thread: $thread"
+ }
+ -re "$gdb_prompt $" {
+ fail "selected thread: $thread"
+ }
+ timeout {
+ fail "selected thread: $thread (timeout)"
+ }
+ }
+}
+
+### Select THREAD, check for a plausible backtrace, and make sure
+### we're actually selecting a different philosopher each time.
+### Return true if the thread had a stack which was not only
+### acceptable, but interesting. SEEN should be an array in which
+### SEEN(N) exists iff we have found philosopher number N before.
+
+set main_seen 0
+set manager_seen 0
+
+proc check_philosopher_stack {thread seen_name} {
+ global gdb_prompt
+ upvar $seen_name seen
+ global main_seen
+ global manager_seen
+
+ set name "philosopher is distinct: $thread"
+ set interesting 0
+
+ select_thread $thread
+ send_gdb "where\n"
+ gdb_expect {
+ -re ".* in philosopher \\(data=(0x\[0-9a-f\]+).*\r\n$gdb_prompt $" {
+ set data $expect_out(1,string)
+ if {[info exists seen($data)]} {
+ fail $name
+ } else {
+ pass $name
+ set seen($data) yep
+ }
+ set interesting 1
+ }
+ -re ".* in __pthread_manager \\(.*$gdb_prompt $" {
+ if {$manager_seen == 1} {
+ fail "manager thread is distinct: $thread"
+ } else {
+ set manager_seen 1
+ pass "manager thread is distinct: $thread"
+ }
+ set interesting 1
+ }
+ -re "pthread_start_thread.*\r\n$gdb_prompt $" {
+ ## Maybe the thread hasn't started yet.
+ pass $name
+ }
+ -re ".* in main \\(.*$gdb_prompt $" {
+ if {$main_seen == 1} {
+ fail "main is distinct: $thread"
+ } else {
+ set main_seen 1
+ pass "main is distinct: $thread"
+ }
+ set interesting 1
+ }
+ -re " in \\?\\?.*\r\n$gdb_prompt $" {
+ ## Sometimes we can't get a backtrace. I'm going to call
+ ## this a pass, since we do verify that at least one
+ ## thread was interesting, so we can get more consistent
+ ## test suite totals. But in my heart, I think it should
+ ## be an xfail.
+ pass $name
+ }
+ -re "$gdb_prompt $" {
+ fail $name
+ }
+ timeout {
+ fail "$name (timeout)"
+ }
+ }
+
+ return $interesting
+}
+
+set any_interesting 0
+array set seen {}
+unset seen
+for {set i 1} {$i <= 7} {incr i} {
+ if [check_philosopher_stack $i seen] {
+ set any_interesting 1
+ }
+}
+
+if {$any_interesting} {
+ pass "found an interesting thread"
+} else {
+ fail "found an interesting thread"
+}
diff --git a/gdb/testsuite/gdb.threads/pthreads.c b/gdb/testsuite/gdb.threads/pthreads.c
new file mode 100644
index 00000000000..b8f126debd0
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/pthreads.c
@@ -0,0 +1,171 @@
+#include <stdio.h>
+
+#include "config.h"
+
+#ifndef HAVE_PTHREAD_H
+
+/* Don't even try to compile. In fact, cause a syntax error that we can
+ look for as a compiler error message and know that we have no pthread
+ support. In that case we can just suppress the test completely. */
+
+#error "no posix threads support"
+
+#else
+
+/* OK. We have the right header. If we try to compile this and fail, then
+ there is something wrong and the user should know about it so the testsuite
+ should issue an ERROR result.. */
+
+#ifdef __linux__
+#define _MIT_POSIX_THREADS 1 /* GNU/Linux (or at least RedHat 4.0)
+ needs this */
+#endif
+
+#include <pthread.h>
+
+/* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create
+ is prototyped to be just a "pthread_attr_t", while under Solaris it
+ is a "pthread_attr_t *". Arg! */
+
+#if defined (__osf__) || defined (__hpux__)
+#define PTHREAD_CREATE_ARG2(arg) arg
+#define PTHREAD_CREATE_NULL_ARG2 null_attr
+static pthread_attr_t null_attr;
+#else
+#define PTHREAD_CREATE_ARG2(arg) &arg
+#define PTHREAD_CREATE_NULL_ARG2 NULL
+#endif
+
+static int verbose = 0;
+
+static void
+common_routine (arg)
+ int arg;
+{
+ static int from_thread1;
+ static int from_thread2;
+ static int from_main;
+ static int hits;
+ static int full_coverage;
+
+ if (verbose) printf("common_routine (%d)\n", arg);
+ hits++;
+ switch (arg)
+ {
+ case 0:
+ from_main++;
+ break;
+ case 1:
+ from_thread1++;
+ break;
+ case 2:
+ from_thread2++;
+ break;
+ }
+ if (from_main && from_thread1 && from_thread2)
+ full_coverage = 1;
+}
+
+static void *
+thread1 (void *arg)
+{
+ int i;
+ int z = 0;
+
+ if (verbose) printf ("thread1 (%0x) ; pid = %d\n", arg, getpid ());
+ for (i=1; i <= 10000000; i++)
+ {
+ if (verbose) printf("thread1 %d\n", pthread_self ());
+ z += i;
+ common_routine (1);
+ sleep(1);
+ }
+ return (void *) 0;
+}
+
+static void *
+thread2 (void * arg)
+{
+ int i;
+ int k = 0;
+
+ if (verbose) printf ("thread2 (%0x) ; pid = %d\n", arg, getpid ());
+ for (i=1; i <= 10000000; i++)
+ {
+ if (verbose) printf("thread2 %d\n", pthread_self ());
+ k += i;
+ common_routine (2);
+ sleep(1);
+ }
+ sleep(100);
+ return (void *) 0;
+}
+
+void
+foo (a, b, c)
+ int a, b, c;
+{
+ int d, e, f;
+
+ if (verbose) printf("a=%d\n", a);
+}
+
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ pthread_t tid1, tid2;
+ int j;
+ int t = 0;
+ void (*xxx) ();
+ pthread_attr_t attr;
+
+ if (verbose) printf ("pid = %d\n", getpid());
+
+ foo (1, 2, 3);
+
+#ifndef __osf__
+ if (pthread_attr_init (&attr))
+ {
+ perror ("pthread_attr_init 1");
+ exit (1);
+ }
+#endif
+
+#ifdef PTHREAD_SCOPE_SYSTEM
+ if (pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM))
+ {
+ perror ("pthread_attr_setscope 1");
+ exit (1);
+ }
+#endif
+
+ if (pthread_create (&tid1, PTHREAD_CREATE_ARG2(attr), thread1, (void *) 0xfeedface))
+ {
+ perror ("pthread_create 1");
+ exit (1);
+ }
+ if (verbose) printf ("Made thread %d\n", tid1);
+ sleep (1);
+
+ if (pthread_create (&tid2, PTHREAD_CREATE_NULL_ARG2, thread2, (void *) 0xdeadbeef))
+ {
+ perror ("pthread_create 2");
+ exit (1);
+ }
+ if (verbose) printf("Made thread %d\n", tid2);
+
+ sleep (1);
+
+ for (j = 1; j <= 10000000; j++)
+ {
+ if (verbose) printf("top %d\n", pthread_self ());
+ common_routine (0);
+ sleep(1);
+ t += j;
+ }
+
+ exit(0);
+}
+
+#endif /* ifndef HAVE_PTHREAD_H */
diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp
new file mode 100644
index 00000000000..0703395d78b
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/pthreads.exp
@@ -0,0 +1,358 @@
+# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+# This only works with native configurations
+if ![isnative] then {
+ return
+}
+
+set testfile "pthreads"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+# regexp for "horizontal" text (i.e. doesn't include newline or
+# carriage return)
+set horiz "\[^\n\r\]*"
+
+set built_binfile 0
+if [istarget "*-*-linux"] then {
+ set target_cflags "-D_MIT_POSIX_THREADS"
+} else {
+ set target_cflags ""
+}
+set why_msg "unrecognized error"
+foreach lib {-lpthreads -lpthread -lthread} {
+ set options "debug"
+ lappend options "incdir=${objdir}/${subdir}"
+ lappend options "libs=$lib"
+ set ccout [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $options]
+ switch -regexp -- $ccout {
+ ".*no posix threads support.*" {
+ set why_msg "missing threads include file"
+ break
+ }
+ ".*cannot open -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ ".*Can't find library for -lpthread.*" {
+ set why_msg "missing runtime threads library"
+ }
+ {^$} {
+ pass "successfully compiled posix threads test case"
+ set built_binfile 1
+ break
+ }
+ }
+}
+if {$built_binfile == "0"} {
+ unsupported "Couldn't compile ${srcfile}, ${why_msg}"
+ return -1
+}
+
+# Now we can proceed with the real testing.
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "set print sevenbit-strings" ""
+#gdb_test "set print address off" ""
+gdb_test "set width 0" ""
+
+# We'll need this when we send_gdb a ^C to GDB. Need to do it before we
+# run the program and gdb starts saving and restoring tty states.
+# On Ultrix, we don't need it and it is really slow (because shell_escape
+# doesn't use vfork).
+if ![istarget "*-*-ultrix*"] then {
+ gdb_test "shell stty intr '^C'" ""
+}
+
+proc all_threads_running {} {
+ global gdb_prompt
+ global srcfile
+
+ # Reset all the counters to zero.
+ gdb_test "set var common_routine::hits=0" ""
+ gdb_test "set var common_routine::from_thread1=0" ""
+ gdb_test "set var common_routine::from_thread2=0" ""
+ gdb_test "set var common_routine::from_main=0" ""
+ gdb_test "set var common_routine::full_coverage=0" ""
+
+ # Disable all breakpoints.
+ gdb_test "disable" ""
+
+ # Set up a breakpoint that will cause us to stop when we have
+ # been called 15 times. This should be plenty of time to allow
+ # every thread to run at least once, since each thread sleeps for
+ # one second between calls to common_routine.
+ gdb_test "tbreak common_routine if hits >= 15" ""
+
+ # Start all the threads running again and wait for the inferior
+ # to stop. Since no other breakpoints are set at this time
+ # we should stop only when we have been previously called 15 times.
+
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Continuing.*common_routine.*at.*$srcfile.*$gdb_prompt $" {}
+ default {
+ fail "continue until common routine run 15 times"
+ return 0
+ }
+ timeout {
+ fail "continue until common routine run 15 times (timeout)"
+ return 0
+ }
+ }
+
+ # Check that we stopped when we actually expected to stop, by
+ # verifying that there have been 15 previous hits.
+
+ # NOTE: Because of synchronization behavior, it is possible for
+ # more than one thread to increment "hits" between one breakpoint
+ # trap and the next. So stopping after 16 or 17 hits should be
+ # considered acceptable.
+
+ send_gdb "p common_routine::hits\n"
+ gdb_expect {
+ -re ".*= 15\r\n$gdb_prompt $" {
+ pass "stopped before calling common_routine 15 times"
+ }
+ -re ".*= 16\r\n$gdb_prompt $" {
+ pass "stopped before calling common_routine 15 times (16 times)"
+ }
+ -re ".*= 17\r\n$gdb_prompt $" {
+ pass "stopped before calling common_routine 15 times (17 times)"
+ }
+ default {
+ fail "stopped before calling common_routine 15 times"
+ return 0
+ }
+ -re ".*$gdb_prompt $" {
+ fail "stopped before calling common_routine 15 times"
+ return 0
+ }
+ timeout {
+ fail "stopped before calling common_routine 15 times (timeout)"
+ return 0
+ }
+ }
+
+ # Also check that all of the threads have run, which will only be true
+ # if the full_coverage variable is set.
+
+ send_gdb "p common_routine::full_coverage\n"
+ gdb_expect {
+ -re ".* = 1.*$gdb_prompt $" {}
+ -re ".* = 0.*$gdb_prompt $" {
+ fail "some threads didn't run"
+ return 0
+ }
+ default {
+ fail "some threads didn't run"
+ return 0
+ }
+ timeout {
+ fail "some threads didn't run (timeout)"
+ return 0
+ }
+ }
+
+ # Looks fine, return success.
+ return 1
+}
+
+proc test_startup {} {
+ global srcdir srcfile gdb_prompt expect_out
+ global horiz
+ global main_id thread1_id thread2_id
+
+ # We should be able to do an info threads before starting any others.
+ send_gdb "info threads\n"
+ gdb_expect {
+ -re ".*Thread.*main.*$gdb_prompt $" {
+ pass "info threads"
+ }
+ -re "\r\n$gdb_prompt $" {
+ unsupported "gdb does not support pthreads for this machine"
+ return 0
+ }
+ }
+
+ # Extract the thread id number of main thread from "info threads" output.
+ send_gdb "info threads\n"
+ gdb_expect -re "(\[0-9\]+)(${horiz}Thread${horiz}main.*)($gdb_prompt $)"
+ set main_id $expect_out(1,string)
+
+ # Check that we can continue and create the first thread.
+ gdb_test "break thread1" "Breakpoint .* file .*$srcdir.*"
+ gdb_test "continue" \
+ "Continuing.*Breakpoint .*, thread1 \\(arg=0xfeedface\\).*at.*$srcfile.*" \
+ "Continue to creation of first thread"
+ gdb_test "disable" ""
+
+ # Extract the thread id number of thread 1 from "info threads" output.
+ send_gdb "info threads\n"
+ gdb_expect -re "(\[0-9\]+)(${horiz}Thread${horiz}thread1.*)($gdb_prompt $)"
+ set thread1_id $expect_out(1,string)
+
+ # Check that we can continue and create the second thread,
+ # ignoring the first thread for the moment.
+ gdb_test "break thread2" "Breakpoint .* file .*$srcdir.*"
+ gdb_test "continue" \
+ "Continuing.*Breakpoint .*, thread2 \\(arg=0xdeadbeef\\).*at.*$srcfile.*" \
+ "Continue to creation of second thread"
+
+ # Extract the thread id number of thread 2 from "info threads" output.
+ send_gdb "info threads\n"
+ gdb_expect -re "(\[0-9\]+)(${horiz}Thread${horiz}thread2.*)($gdb_prompt $)"
+ set thread2_id $expect_out(1,string)
+
+ return 1
+}
+
+proc check_control_c {} {
+ global gdb_prompt
+
+ # Verify that all threads are running.
+ if [all_threads_running] then {
+ pass "All threads running after startup"
+ }
+
+ # Send a continue followed by ^C to the process to stop it.
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Continuing." {
+ pass "Continue with all threads running"
+ }
+ timeout {
+ fail "Continue with all threads running (timeout)"
+ }
+ }
+ sleep 1
+ set description "Stopped with a ^C"
+ after 1000 [send_gdb "\003"]
+ gdb_expect {
+ -re "Program received signal SIGINT.*$gdb_prompt $" {
+ pass $description
+ }
+ -re "Quit.*$gdb_prompt $" {
+ pass $description
+ }
+ timeout {
+ fail "$description (timeout)"
+ return 1;
+ }
+ }
+ gdb_test "bt" ""
+
+ # Verify that all threads can be run again after a ^C stop.
+ if [all_threads_running] then {
+ pass "All threads running after continuing from ^C stop"
+ }
+ return 0;
+}
+
+proc check_backtraces {} {
+ global gdb_prompt main_id thread1_id thread2_id
+
+ # Check that the "thread apply N backtrace" command works
+
+ gdb_test "thread apply $main_id backtrace" \
+ ".* in main \\(argc=.*, argv=.*\\).*" \
+ "check backtrace from main thread"
+ gdb_test "thread apply $thread1_id backtrace" \
+ ".* in thread1 \\(arg=0xfeedface\\).*" \
+ "check backtrace from thread 1"
+ gdb_test "thread apply $thread2_id backtrace" \
+ ".* in thread2 \\(arg=0xdeadbeef\\).*" \
+ "check backtrace from thread 2"
+
+ # Check that we can apply the backtrace command to all
+ # three threads with a single gdb command
+
+ gdb_test "thread apply $main_id $thread1_id $thread2_id bt" \
+ ".* in main .* in thread1 .* in thread2.*" \
+ "apply backtrace command to all three threads"
+
+ # Check that we can do thread specific backtraces
+ # This also tests that we can do thread specific breakpoints.
+
+ gdb_test "break common_routine thread $thread2_id" \
+ "Breakpoint .* at 0x.* file .* line .*" \
+ "set break at common_routine in thread 2"
+
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Breakpoint .* common_routine \\(arg=2\\).*" {
+ pass "continue to bkpt at common_routine in thread 2"
+ send_gdb "backtrace\n"
+ gdb_expect {
+ -re "#0.*common_routine \\(arg=2\\).*#1.*thread2.*" {
+ pass "backtrace from thread 2 bkpt in common_routine"
+ }
+ default {
+ fail "backtrace from thread 2 bkpt in common_routine"
+ }
+ timeout {
+ fail "backtrace from thread 2 bkpt in common_routine (timeout)"
+ }
+ }
+ }
+ -re "Breakpoint .* common_routine \\(arg=0\\).*" {
+ fail "continue to bkpt at common_routine in thread 2 (arg=0)"
+ }
+ -re "Breakpoint .* common_routine \\(arg=1\\).*" {
+ fail "continue to bkpt at common_routine in thread 2 (arg=1)"
+ }
+ -re ".*$gdb_prompt" {
+ fail "continue to bkpt at common_routine in thread 2"
+ }
+ default {
+ fail "continue to bkpt at common_routine in thread 2 (default)"
+ }
+ timeout {
+ fail "continue to bkpt at common_routine in thread 2 (timeout)"
+ }
+ }
+}
+
+setup_xfail "alpha-*-osf*"
+if [runto_main] then {
+ clear_xfail "alpha-*-osf*"
+ if [test_startup] then {
+ if [check_control_c] then {
+ warning "Could not stop child with ^C; skipping rest of tests.\n"
+ return;
+ }
+ check_backtraces
+ }
+}
+clear_xfail "alpha-*-osf*"
diff --git a/gdb/testsuite/gdb.threads/step.c b/gdb/testsuite/gdb.threads/step.c
new file mode 100644
index 00000000000..1b18a4b07ad
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/step.c
@@ -0,0 +1,221 @@
+/* step.c for step.exp */
+#include <ipc.h>
+#include <pthread.h>
+#include <st.h>
+#include <signal.h>
+#include <stdio.h>
+
+void alarm_handler ();
+void alarm_handler1 ();
+void alarm_handler2 ();
+void thread1 ();
+void thread2 ();
+
+#define TIME_LIMIT 30
+
+
+int count1 = 0;
+int count2 = 0;
+
+pthread_t tid1, tid2;
+pthread_attr_t attr1, attr2;
+
+pthread_mutex_t mut;
+pthread_mutexattr_t mut_attr;
+
+pthread_condattr_t cv_attr_a, cv_attr_b;
+pthread_cond_t cv_a, cv_b;
+
+struct cv_struct
+ {
+ char a;
+ char b;
+ }
+test_struct;
+
+main ()
+{
+ /*init la struct */
+ test_struct.a = 0;
+ test_struct.b = 1;
+
+ /* create le mutex */
+ if (pthread_mutexattr_create (&mut_attr) == -1)
+ {
+ perror ("mutexattr_create");
+ exit (1);
+ }
+
+
+ if (pthread_mutex_init (&mut, mut_attr) == -1)
+ {
+ perror ("mutex_init");
+ exit (1);
+ }
+
+ /* create 2 cv */
+ if (pthread_condattr_create (&cv_attr_a) == -1)
+ {
+ perror ("condattr_create(1)");
+ exit (1);
+ }
+
+ if (pthread_cond_init (&cv_a, cv_attr_a) == -1)
+ {
+ perror ("cond_init(1)");
+ exit (1);
+ }
+
+ if (pthread_condattr_create (&cv_attr_b) == -1)
+ {
+ perror ("condattr_create(2)");
+ exit (1);
+ }
+
+ if (pthread_cond_init (&cv_b, cv_attr_b) == -1)
+ {
+ perror ("cond_init(2)");
+ exit (1);
+ }
+
+ /* create 2 threads of execution */
+ if (pthread_attr_create (&attr1) == -1)
+ {
+ perror ("attr_create(1)");
+ exit (1);
+ }
+
+ if (pthread_create (&tid1, attr1, thread1, &count1) == -1)
+ {
+ perror ("pthread_create(1)");
+ exit (1);
+ }
+
+ if (pthread_attr_create (&attr2) == -1)
+ {
+ perror ("attr_create(2)");
+ exit (1);
+ }
+
+ if (pthread_create (&tid2, attr2, thread2, &count2) == -1)
+ {
+ perror ("pthread_create(2)");
+ exit (1);
+ }
+
+ /* set alarm to print out data and exit */
+ signal (SIGALRM, alarm_handler);
+ alarm (TIME_LIMIT);
+
+ for (;;)
+ pause ();
+}
+
+void
+thread1 (count)
+ int *count;
+{
+ tid_t tid;
+
+ tid = getstid ();
+ printf ("Thread1 tid 0x%x (%d) \n", tid, tid);
+ printf ("Thread1 @tid=0x%x \n", &tid);
+ signal (SIGALRM, alarm_handler1);
+
+ for (;;)
+ {
+ if (pthread_mutex_lock (&mut) == -1)
+ {
+ perror ("pthread_mutex_lock(1)");
+ pthread_exit ((void *) 0);
+ }
+
+ while (test_struct.a == 0)
+ {
+ if (pthread_cond_wait (&cv_a, &mut) == -1)
+ {
+ perror ("pthread_cond_wait(1)");
+ pthread_exit ((void *) -1);
+ }
+ }
+
+ (*count)++;
+ printf ("*******thread1 count %d\n", *count);
+
+ test_struct.a = 0;
+
+ test_struct.b = 1;
+ pthread_cond_signal (&cv_b);
+
+ if (pthread_mutex_unlock (&mut) == -1)
+ {
+ perror ("pthread_mutex_unlock(1)");
+ pthread_exit ((void *) -1);
+ }
+ }
+}
+
+void
+thread2 (count)
+ int *count;
+{
+ tid_t tid;
+
+ tid = getstid ();
+ printf ("Thread2 tid 0x%x (%d) \n", tid, tid);
+ printf ("Thread1 @tid=0x%x \n", &tid);
+ signal (SIGALRM, alarm_handler2);
+
+ for (;;)
+ {
+ if (pthread_mutex_lock (&mut) == -1)
+ {
+ perror ("pthread_mutex_lock(2)");
+ pthread_exit ((void *) 0);
+ }
+
+ while (test_struct.b == 0)
+ {
+ if (pthread_cond_wait (&cv_b, &mut) == -1)
+ {
+ perror ("pthread_cond_wait(2)");
+ pthread_exit ((void *) -1);
+ }
+ }
+
+ (*count)++;
+ printf ("*******thread2 count %d\n", *count);
+
+ test_struct.b = 0;
+
+ test_struct.a = 1;
+ pthread_cond_signal (&cv_a);
+
+ if (pthread_mutex_unlock (&mut) == -1)
+ {
+ perror ("pthread_mutex_unlock(2)");
+ pthread_exit ((void *) -1);
+ }
+ }
+}
+
+
+void
+alarm_handler ()
+{
+ printf ("\tcount1 (%d) \n\tcount2 (%d)\n", count1, count2);
+ exit (0);
+}
+
+void
+alarm_handler1 ()
+{
+ printf ("ALARM thread 1\n");
+}
+
+void
+alarm_handler2 ()
+{
+ printf ("ALARM thread 2\n");
+ pthread_exit ((void *) 0);
+}
diff --git a/gdb/testsuite/gdb.threads/step.exp b/gdb/testsuite/gdb.threads/step.exp
new file mode 100644
index 00000000000..aa5639347b7
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/step.exp
@@ -0,0 +1,200 @@
+# step.exp -- Expect script to test gdb with step.c
+# Copyright (C) 1992, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Hiro Sugawara. (hiro@lynx.com)
+#
+# This test really needs some major surgery to be acceptable, but
+# I'm just about burnt out on lynx work, so I'm not doing it now.
+#
+# * The test has an indeterminate number of pass/fails
+# for each run (it runs a small group of tests until
+# it's timer kicks off). This is very bad for nightly
+# automated regression testing.
+#
+# * It tries to "step" from withint he prologue of a
+# function. This isn't support in gdb (it's going
+# to act like a continue).
+#
+# * This test rarely check that it stopped in sensible
+# places. (see previous bullet -- this test doesn't
+# catch the fact it continued rather than stepped)
+
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set program_exited 0
+
+proc set_bp { where } {
+ global gdb_prompt
+
+ send_gdb "break $where\n"
+ # The first regexp is what we get with -g, the second without -g.
+ gdb_expect {
+ -re "Break.* at .*: file .*, line \[0-9\]*.*$gdb_prompt $" {}
+ -re "Breakpoint \[0-9\]* at 0x\[0-9a-f\]*.*$gdb_prompt $" {}
+ -re "$gdb_prompt $" { fail "setting breakpoint at $where" ; return 0 }
+ timeout { fail "setting breakpoint at $where (timeout)" ; return 0 }
+ }
+ pass "set_bp"
+}
+
+proc step_it { cmd } {
+ global gdb_prompt
+ global program_exited
+
+ send_gdb "$cmd\n"
+ gdb_expect {
+ -re "0x\[0-9A-Fa-f\]* *in.*\r\n$gdb_prompt $" { pass "step_it"; return 0 }
+ -re "0x\[0-9A-Fa-f\]* *\[0-9\]*.*\r\n$gdb_prompt $" { pass "step_it"; return 1 }
+ -re "Program exited .*\n$gdb_prompt $" {
+ set program_exited 1
+ return -1
+ }
+ -re "$gdb_prompt $" { fail "single-stepping ($cmd).\n" ; return -1 }
+ timeout { fail "single-stepping ($cmd) timout.\n" ; return -1 }
+ }
+}
+
+proc step_inst {} {
+ step_it "stepi"
+}
+
+proc step_source {} {
+ step_it "step"
+}
+
+proc continue_all {} {
+ global gdb_prompt
+
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Breakpoint \[0-9\]*, thread\[0-9\]* .*$gdb_prompt $" {
+ pass "continue_all"
+ return 0
+ }
+ -re "Program exited .*\n$gdb_prompt $" {
+ set program_exited 1
+ return 1;
+ }
+ -re "$gdb_prompt $" { fail "continue" ; return -1 }
+ timeout { fail "continue (timeout)" ; return -1 }
+ }
+}
+
+proc check_threads { num_threads } {
+ global gdb_prompt
+
+ set curr_thread 0
+ send_gdb "info threads\n"
+ while { $num_threads > 0 } {
+ gdb_expect {
+ -re "\\* *\[0-9\]* process \[0-9\]* thread \[0-9\]* .*\n" {
+ incr curr_thread
+ set num_threads [expr $num_threads - 1]
+ }
+ -re " *\[0-9\]* process \[0-9\]* thread \[0-9\]* .*\n" {
+ set num_threads [expr $num_threads - 1]
+ }
+ -re "$gdb_prompt $" {
+ if { $num_threads < 0 } {
+ fail "check_threads (too many)" ; return -1
+ }
+ break
+ }
+ timeout { fail "check_threads (timeout)" ; return -1 }
+ }
+ }
+
+ if { $curr_thread == 0 } {
+ fail "check_threads (no current thread)\n"
+ return -1
+ }
+ if { $curr_thread > 1 } {
+ fail "check_threads (more than one current thread)\n"
+ return -1
+ }
+ return 0
+}
+
+proc test_cond_wait {} {
+ global program_exited
+
+ set_bp 135
+ runto 179
+ while { 1 } {
+ set stepi_counter 0
+ while { [step_inst] } {
+ if { $program_exited } { break }
+ incr stepi_counter
+ if { $stepi_counter > 30 } {
+ fail "too many stepi's per line\n"
+ return -1
+ }
+ }
+ if { $program_exited } { break }
+ step_source
+ if { $program_exited } { break }
+ continue_all
+ if { $program_exited } { break }
+ check_threads 3
+ }
+}
+
+proc do_tests {} {
+ global prms_id
+ global bug_id
+ global subdir
+ global objdir
+ global srcdir
+ global binfile
+ global gdb_prompt
+
+ set prms_id 0
+ set bug_id 0
+
+ # Start with a fresh gdb.
+
+ gdb_exit
+ gdb_start
+ gdb_reinitialize_dir $srcdir/$subdir
+ gdb_load $objdir/$subdir/$binfile
+
+ send_gdb "set width 0\n"
+ gdb_expect -re "$gdb_prompt $"
+
+ test_cond_wait
+}
+
+# Check to see if we have an executable to test. If not, then either we
+# haven't tried to compile one, or the compilation failed for some reason.
+# In either case, just notify the user and skip the tests in this file.
+
+set binfile "step"
+set srcfile "step.c"
+
+if ![file exists $objdir/$subdir/$binfile] then {
+ if $all_flag then {
+ warning "$binfile does not exist; tests suppressed."
+ }
+} else {
+ do_tests
+}
diff --git a/gdb/testsuite/gdb.threads/step2.exp b/gdb/testsuite/gdb.threads/step2.exp
new file mode 100644
index 00000000000..5442e6aef6f
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/step2.exp
@@ -0,0 +1,150 @@
+# step2.exp -- Expect script to test gdb step.c
+# Copyright (C) 1992, 1997 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Jeff Law. (law@cygnus.com)
+#
+
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set program_exited 0
+
+# A simple and crude test to see that we can step two threads independently
+proc test_multi_threaded_stepping {} {
+ global gdb_prompt
+ global hex
+ global srcfile
+ global decimal
+
+ # Set breakpoints in code that we know is executed in only
+ # thread of control.
+ gdb_test "break thread1" \
+ "Break.* at $hex: file .*$srcfile, line $decimal\\."
+ gdb_test "break thread2" \
+ "Break.* at $hex: file .*$srcfile, line $decimal\\."
+
+ # the order in which things happen is indeterminate. So we basically
+ # look for a set of events and note that each one happens and that
+ # all of the required events have happened when we're done.
+ #
+ # Right now we only verify that both threads start and that they
+ # both call pthread_cond_wait twice.
+ set thread1started 0
+ set thread1condwait 0
+ set thread2started 0
+ set thread2condwait 0
+
+ send_gdb "run\n"
+ gdb_expect {
+ -re "The program .* has been started already.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re ".*Breakpoint \[0-9\]+,.*thread1.* at .*$srcfile:.*\[\t \].*$gdb_prompt $" {
+ if { $thread1started != 0 } then {
+ fail "thread1 started"
+ return
+ } else {
+ set thread1started 1
+ pass "thread1 started"
+ }
+ send_gdb "step\n"
+ exp_continue
+ }
+ -re ".*Breakpoint \[0-9\]+,.*thread2.* at .*$srcfile:.*\[\t \].*$gdb_prompt $" {
+ if { $thread2started != 0 } then {
+ fail "thread2 started"
+ return
+ } else {
+ set thread2started 1
+ pass "thread2 started"
+ }
+ send_gdb "step\n"
+ exp_continue
+ }
+ -re ".*pthread_cond_wait.*cv_a.*$gdb_prompt" {
+ if { $thread1started == 0 } then {
+ fail "thread1 condwait"
+ return
+ }
+ if { $thread1condwait < 2 } then {
+ pass "thread1 condwait"
+ incr thread1condwait
+ }
+ if { $thread2condwait == 2 } then {
+ pass "multi threaded stepping"
+ return
+ }
+ send_gdb "step\n"
+ exp_continue
+ }
+
+ -re ".*pthread_cond_wait.*cv_b.*$gdb_prompt" {
+ if { $thread2started == 0 } then {
+ fail "thread2 condwait"
+ return
+ }
+ if { $thread2condwait < 2 } then {
+ pass "thread2 condwait"
+ incr thread2condwait
+ }
+ if { $thread1condwait == 2 } then {
+ pass "multi threaded stepping"
+ return
+ }
+ send_gdb "step\n"
+ exp_continue
+ }
+
+ -re "$gdb_prompt" {
+ send_gdb "step\n"
+ exp_continue
+ }
+ default { fail "multi threaded stepping" }
+ }
+}
+
+# Check to see if we have an executable to test. If not, then either we
+# haven't tried to compile one, or the compilation failed for some reason.
+# In either case, just notify the user and skip the tests in this file.
+
+set binfile "step"
+set srcfile "step.c"
+
+if ![file exists $objdir/$subdir/$binfile] then {
+ if $all_flag then {
+ warning "$binfile does not exist; tests suppressed."
+ }
+ return
+}
+
+set prms_id 0
+set bug_id 0
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $objdir/$subdir/$binfile
+
+test_multi_threaded_stepping
diff --git a/gdb/testsuite/gdb.trace/Makefile.in b/gdb/testsuite/gdb.trace/Makefile.in
new file mode 100644
index 00000000000..601c9e17ff9
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/Makefile.in
@@ -0,0 +1,21 @@
+#### host, target, and site specific Makefile frags come in here.
+
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+.PHONY: all clean mostlyclean distclean realclean
+
+all:
+ @echo "Nothing to be done for all..."
+
+clean mostlyclean:
+ -rm -f actions circ collection limits
+ -rm -f *.o *.diff *~ *.bad core sh3 hppa mn10200 mn10300
+
+distclean maintainer-clean realclean: clean
+ -rm -f Makefile config.status config.log
+
+Makefile: $(srcdir)/Makefile.in $(srcdir)/configure.in
+ $(SHELL) ./config.status --recheck
+
+
diff --git a/gdb/testsuite/gdb.trace/actions.c b/gdb/testsuite/gdb.trace/actions.c
new file mode 100644
index 00000000000..ae3c1c38c1c
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/actions.c
@@ -0,0 +1,134 @@
+/*
+ * Test program for trace action commands
+ */
+
+static char gdb_char_test;
+static short gdb_short_test;
+static long gdb_long_test;
+static char gdb_arr_test[25];
+static struct GDB_STRUCT_TEST
+{
+ char c;
+ short s;
+ long l;
+ int bfield : 11; /* collect bitfield */
+ char arr[25];
+ struct GDB_STRUCT_TEST *next;
+} gdb_struct1_test, gdb_struct2_test, *gdb_structp_test, **gdb_structpp_test;
+
+static union GDB_UNION_TEST
+{
+ char c;
+ short s;
+ long l;
+ int bfield : 11; /* collect bitfield */
+ char arr[4];
+ union GDB_UNION_TEST *next;
+} gdb_union1_test;
+
+void gdb_recursion_test (int, int, int, int, int, int, int);
+
+void gdb_recursion_test (int depth,
+ int q1,
+ int q2,
+ int q3,
+ int q4,
+ int q5,
+ int q6)
+{ /* gdb_recursion_test line 0 */
+ int q = q1; /* gdbtestline 1 */
+
+ q1 = q2; /* gdbtestline 2 */
+ q2 = q3; /* gdbtestline 3 */
+ q3 = q4; /* gdbtestline 4 */
+ q4 = q5; /* gdbtestline 5 */
+ q5 = q6; /* gdbtestline 6 */
+ q6 = q; /* gdbtestline 7 */
+ if (depth--) /* gdbtestline 8 */
+ gdb_recursion_test (depth, q1, q2, q3, q4, q5, q6); /* gdbtestline 9 */
+}
+
+
+unsigned long gdb_c_test( unsigned long *parm )
+
+{
+ char *p = "gdb_c_test";
+ char *ridiculously_long_variable_name_with_equally_long_string_assignment;
+ register long local_reg = 7;
+ static unsigned long local_static, local_static_sizeof;
+ long local_long;
+ unsigned long *stack_ptr;
+ unsigned long end_of_stack;
+
+ ridiculously_long_variable_name_with_equally_long_string_assignment =
+ "ridiculously long variable name with equally long string assignment";
+ local_static = 9;
+ local_static_sizeof = sizeof (struct GDB_STRUCT_TEST);
+ local_long = local_reg + 1;
+ stack_ptr = (unsigned long *) &local_long;
+ end_of_stack =
+ (unsigned long) &stack_ptr + sizeof(stack_ptr) + sizeof(end_of_stack) - 1;
+
+ gdb_char_test = gdb_struct1_test.c = (char) ((long) parm[1] & 0xff);
+ gdb_short_test = gdb_struct1_test.s = (short) ((long) parm[2] & 0xffff);
+ gdb_long_test = gdb_struct1_test.l = (long) ((long) parm[3] & 0xffffffff);
+ gdb_union1_test.l = (long) parm[4];
+ gdb_arr_test[0] = gdb_struct1_test.arr[0] = (char) ((long) parm[1] & 0xff);
+ gdb_arr_test[1] = gdb_struct1_test.arr[1] = (char) ((long) parm[2] & 0xff);
+ gdb_arr_test[2] = gdb_struct1_test.arr[2] = (char) ((long) parm[3] & 0xff);
+ gdb_arr_test[3] = gdb_struct1_test.arr[3] = (char) ((long) parm[4] & 0xff);
+ gdb_arr_test[4] = gdb_struct1_test.arr[4] = (char) ((long) parm[5] & 0xff);
+ gdb_arr_test[5] = gdb_struct1_test.arr[5] = (char) ((long) parm[6] & 0xff);
+ gdb_struct1_test.bfield = 144;
+ gdb_struct1_test.next = &gdb_struct2_test;
+ gdb_structp_test = &gdb_struct1_test;
+ gdb_structpp_test = &gdb_structp_test;
+
+ gdb_recursion_test (3, (long) parm[1], (long) parm[2], (long) parm[3],
+ (long) parm[4], (long) parm[5], (long) parm[6]);
+
+ gdb_char_test = gdb_short_test = gdb_long_test = 0;
+ gdb_structp_test = (void *) 0;
+ gdb_structpp_test = (void *) 0;
+ memset ((char *) &gdb_struct1_test, 0, sizeof (gdb_struct1_test));
+ memset ((char *) &gdb_struct2_test, 0, sizeof (gdb_struct2_test));
+ local_static_sizeof = 0;
+ local_static = 0;
+ return ( (unsigned long) 0 );
+}
+
+static void gdb_asm_test (void)
+{
+}
+
+static void begin () /* called before anything else */
+{
+}
+
+static void end () /* called after everything else */
+{
+}
+
+int
+main (argc, argv, envp)
+ int argc;
+ char *argv[], **envp;
+{
+ int i;
+ unsigned long myparms[10];
+
+#ifdef usestubs
+ set_debug_traps ();
+ breakpoint ();
+#endif
+
+ begin ();
+ for (i = 0; i < sizeof (myparms) / sizeof (myparms[0]); i++)
+ myparms[i] = i;
+
+ gdb_c_test (&myparms[0]);
+
+ end ();
+ return 0;
+}
+
diff --git a/gdb/testsuite/gdb.trace/actions.exp b/gdb/testsuite/gdb.trace/actions.exp
new file mode 100644
index 00000000000..66d3d87d22e
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/actions.exp
@@ -0,0 +1,207 @@
+# Copyright 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp";
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+
+if [istarget "m68k-*-elf"] then {
+ set binfile [board_info target d490_binfile];
+ set srcfile gdb_c_test.c
+} else {
+ set testfile "actions"
+ set srcfile ${testfile}.c
+ set binfile $objdir/$subdir/$testfile
+ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# If testing on a remote host, download the source file.
+# remote_download host $srcdir/$subdir/$srcfile
+
+gdb_file_cmd $binfile
+
+# define relative source line numbers:
+# all subsequent line numbers are relative to this first one (baseline)
+
+set baseline [gdb_find_recursion_test_baseline $srcfile];
+if { $baseline == -1 } then {
+ fail "Could not find gdb_recursion_test function"
+ return;
+}
+
+set testline1 [expr $baseline + 7]
+
+#
+# test actions command
+#
+
+gdb_delete_tracepoints
+set trcpt1 [gdb_gettpnum gdb_c_test];
+set trcpt2 [gdb_gettpnum gdb_asm_test];
+set trcpt3 [gdb_gettpnum $testline1];
+if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
+ fail "setting tracepoints"
+ return;
+}
+
+# 5.1 actions of specified tracepoint
+
+send_gdb "info tracepoints\n"
+gdb_expect {
+ -re "Actions for tracepoint \[0-9\]+:.*$gdb_prompt $" {
+ fail "5.1a: testsuite failure (tracepoint already has action)!"
+ }
+ -re "No tracepoints.*$gdb_prompt $" {
+ fail "5.1a: set three tracepoints, no actions (No tracepoints!)"
+ }
+ -re "$gdb_prompt $" {
+ pass "5.1a: set three tracepoints, no actions"
+ }
+}
+
+gdb_trace_setactions "5.1b: set actions for first tracepoint" \
+ "$trcpt1" \
+ "collect gdb_char_test" "^$"
+
+send_gdb "info tracepoints\n"
+gdb_expect {
+ -re "Actions for.* $trcpt1:.*collect gdb_char_test.*$gdb_prompt $" {
+ pass "5.1c: verify actions set for first tracepoint"
+ }
+ -re "$gdb_prompt $" {
+ fail "5.1c: verify actions set for first tracepoint"
+ }
+}
+
+gdb_trace_setactions "5.1d: set actions for second tracepoint" \
+ "$trcpt2" \
+ "collect gdb_short_test" "^$"
+
+send_gdb "info tracepoints\n"
+gdb_expect {
+ -re "Actions for.* $trcpt2:.*collect gdb_short_test.*$gdb_prompt $" {
+ pass "5.1e: verify actions set for second tracepoint"
+ }
+ -re "$gdb_prompt $" {
+ fail "5.1e: verify actions set for second tracepoint"
+ }
+}
+
+gdb_trace_setactions "5.2a: set actions for last (default) tracepoint" \
+ "" \
+ "collect gdb_long_test" "^$"
+
+send_gdb "info tracepoints\n"
+gdb_expect {
+ -re "Actions for.* $trcpt3:.*collect gdb_long_test.*$gdb_prompt $" {
+ pass "5.2b: verify actions set for last (default) tracepoint"
+ }
+ -re "$gdb_prompt $" {
+ fail "5.2b: verify actions set for last (default) tracepoint"
+ }
+}
+
+# 5.3 replace actions set earlier
+
+gdb_trace_setactions "5.3a: reset actions for first tracepoint" \
+ "$trcpt1" \
+ "collect gdb_struct1_test" "^$"
+
+send_gdb "info tracepoints\n"
+gdb_expect {
+ -re "Actions for.* $trcpt1:.*collect gdb_struct1_test.*$gdb_prompt $" {
+ pass "5.3b: verify actions set for first tracepoint"
+ }
+ -re "$gdb_prompt $" {
+ fail "5.3b: verify actions set for first tracepoint"
+ }
+}
+
+#
+# test end command (all by itself)
+#
+
+# 5.4 end outside of context
+
+gdb_test "end" "This command cannot be used at the top level." \
+ "5.4: 'end' command out of context"
+
+# 5.5 empty actions (just an end with no other actions)
+
+gdb_trace_setactions "5.5a: set empty actions for first tracepoint" \
+ "$trcpt1"
+
+send_gdb "info tracepoints\n"
+gdb_expect {
+ -re "No tracepoints.*$gdb_prompt $" {
+ fail "5.5c: verify NO actions for first tracepoint"
+ }
+ -re "Actions for.* $trcpt1:.*$gdb_prompt $" {
+ fail "5.5c: verify NO actions for first tracepoint"
+ }
+ -re "$gdb_prompt $" {
+ pass "5.5c: verify NO actions for first tracepoint"
+ }
+}
+
+# 5.6 actions for invalid tracepoint number
+
+gdb_test "actions [expr $trcpt2 + $trcpt3]" \
+ "No tracepoint number [expr $trcpt2 + $trcpt3]." \
+ "5.6: actions for invalid tracepoint number"
+
+# 5.7 invalid action (other than 'collect', 'while-stepping' or 'end')
+# "warning: .print gdb_c_test. is not a supported trace.*> $" \
+
+gdb_trace_setactions "5.7: invalid action" \
+ "$trcpt1" \
+ "print gdb_c_test" \
+ "warning: .print gdb_c_test. is not a supported trace"
+
+# 5.8 help actions (collect, while-stepping, end)
+
+gdb_test "help actions" \
+ "Specify the actions to be taken at a tracepoint.*" \
+ "5.8a: help actions"
+
+gdb_test "help collect" \
+ "Specify one or more data items to be collected at a tracepoint.*" \
+ "5.8b: help collect"
+
+gdb_test "help while-stepping" \
+ "Specify single-stepping behavior at a tracepoint.*" \
+ "5.8c: help while-stepping"
+
+gdb_test "help end" "Ends a list of commands or actions.*" \
+ "5.8d: help end"
+
diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp
new file mode 100644
index 00000000000..e217f955cd8
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/backtrace.exp
@@ -0,0 +1,376 @@
+# Copyright 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp";
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+
+if [istarget "m68k-*-elf"] then {
+ load_lib "emc-support.exp";
+ set srcfile gdb_c_test.c
+ set binfile [board_info target d490_binfile];
+ gdb_test "set remotetimeout 6" "" ""
+ set timeout 500
+ gdb_target_monitor "$binfile"
+ # Give a TSTOP and ignore errors, to make sure any previous trace is off
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ send_gdb "compare-sections CS\n"
+ gdb_expect {
+ -re "MIS-MATCHED.*$gdb_prompt $" {
+ gdb_suppress_entire_file "Symbol file does not match target!
+ all tests in this module will fail.";
+ }
+ -re ".*$gdb_prompt $" { }
+ }
+} else {
+ set testfile "actions"
+ set srcfile ${testfile}.c
+ set binfile $objdir/$subdir/$testfile
+ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+ gdb_load $binfile
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ runto_main
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# We generously give ourselves one "pass" if we successfully
+# detect that this test cannot be run on this target!
+if { ![gdb_target_supports_trace] } then {
+ pass "Current target does not supporst trace"
+ return 1;
+
+}
+
+#
+# test backtraces in trace frames
+#
+
+set testline1 0
+set testline2 0
+set testline3 0
+set testline4 0
+set testline5 0
+set testline6 0
+
+set arg1 1
+set arg2 2
+set arg3 3
+set arg4 4
+set arg5 5
+set arg6 6
+
+set baseline [gdb_find_recursion_test_baseline $srcfile];
+if { $baseline == -1 } {
+ fail "Could not find gdb_recursion_test function"
+ return;
+}
+
+send_gdb "list $baseline, +12\n"
+gdb_expect {
+ -re "\[\r\n\](\[0-9\]+).*gdbtestline 1 " {
+ set testline1 $expect_out(1,string)
+ exp_continue
+ }
+ -re "\[\r\n\](\[0-9\]+).*gdbtestline 2 " {
+ set testline2 $expect_out(1,string)
+ exp_continue
+ }
+ -re "\[\r\n\](\[0-9\]+).*gdbtestline 3 " {
+ set testline3 $expect_out(1,string)
+ exp_continue
+ }
+ -re "\[\r\n\](\[0-9\]+).*gdbtestline 4 " {
+ set testline4 $expect_out(1,string)
+ exp_continue
+ }
+ -re "\[\r\n\](\[0-9\]+).*gdbtestline 5 " {
+ set testline5 $expect_out(1,string)
+ exp_continue
+ }
+ -re "\[\r\n\](\[0-9\]+).*gdbtestline 6 " {
+ set testline6 $expect_out(1,string)
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {
+ if { ($testline1 == 0) || ($testline2 == 0) || ($testline3 == 0) || ($testline4 == 0) || ($testline5 == 0) || ($testline6 == 0) } {
+ gdb_suppress_entire_file "failed to locate test source lines:
+all tests in this module will fail."
+ }
+ }
+ default {
+ gdb_suppress_entire_file "failed to locate test source lines (def):
+all tests in this module will fail."
+ }
+}
+
+#
+# Setup backtrace experiment. This will involve:
+# 1) a tracepoint where nothing is collected
+# 2) a tracepoint where only regs are collected
+# 3) a tracepoint where regs, locals and args are collected
+# 4) a tracepoint where regs plus some amount of stack are collected.
+#
+
+gdb_delete_tracepoints
+set tdp2 [gdb_gettpnum $testline2]
+set tdp3 [gdb_gettpnum $testline3]
+set tdp4 [gdb_gettpnum $testline4]
+set tdp5 [gdb_gettpnum $testline5]
+set tdp6 [gdb_gettpnum $testline6]
+if { $tdp2 <= 0 || $tdp3 <= 0 || \
+ $tdp4 <= 0 || $tdp5 <= 0 || $tdp6 <= 0 } then {
+ fail "setting tracepoints failed"
+ return;
+}
+
+#gdb_trace_setactions "setup TP to collect FP" \
+# "$tdp2" \
+# "collect \$fp" ""
+#
+
+gdb_trace_setactions "8.6: setup TP to collect regs" \
+ "$tdp3" \
+ "collect \$regs" "^$"
+
+gdb_trace_setactions "8.6: setup TP to collect regs, args, and locals" \
+ "$tdp4" \
+ "collect \$regs, \$args, \$locs" "^$"
+
+gdb_trace_setactions "8.6: setup TP to collect stack mem cast expr" \
+ "$tdp6" \
+ "collect \$fp, \(\*\(void \*\*\) \(\$sp\)\) @ 64" "^$"
+
+gdb_test "tstart" "" ""
+
+if [istarget "m68k-*-elf"] then {
+ gdb_emclaptop_command "85,$arg1,$arg2,$arg3,$arg4,$arg5,$arg6"
+ sleep 5
+} else {
+ gdb_test "break end" "" ""
+ gdb_test "continue" \
+ "Continuing.*Breakpoint $decimal, end.*" \
+ "run trace experiment"
+}
+
+gdb_test "tstop" "" ""
+
+proc gdb_backtrace_tdp_1 { msg } {
+ global gdb_prompt
+
+ # We are in a trace frame at which we didn't collect anything
+ # except $PC. Therefore we expect to be able to identify stack
+ # frame #0, but that's about all. In particular we do not expect
+ # to be able to display the function's arguments or locals, and we
+ # do not expect to be able to identify the caller of this function.
+
+ send_gdb "backtrace\n"
+ gdb_expect {
+ -re "#0\[\t \]+gdb_recursion_test.*depth=.*$gdb_prompt $" {
+ pass "$msg"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$msg"
+ }
+ timeout { fail "$msg (timeout)" }
+ }
+}
+
+proc gdb_backtrace_tdp_2 { msg } {
+ global gdb_prompt
+
+ # We are in a trace frame at which we collected only the registers
+ # Therefore we expect to be able to identify stack frame #0, but
+ # we don't expect to be able to display its args unles they are
+ # passed in registers (which isn't the case for m68k), and we
+ # don't expect to be able to identify the caller's stack frame.
+
+ send_gdb "backtrace\n"
+ gdb_expect {
+ -re "#0\[\t \]+gdb_recursion_test.*depth=.*$gdb_prompt $" {
+ pass "$msg"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$msg"
+ }
+ timeout { fail "$msg (timeout)" }
+ }
+}
+
+proc gdb_backtrace_tdp_3 { msg } {
+ global gdb_prompt
+
+ # We are in a trace frame at which we collected all registers, all
+ # arguments and all locals. This means that the display of
+ # stack frame #0 should be complete (including argument values).
+
+ send_gdb "backtrace\n"
+ gdb_expect {
+ -re "#0\[\t \]+gdb_recursion_test.*depth=\[0-9\]+.*q1=\[0-9\]+.*q2=\[0-9\]+.*q3=\[0-9\]+.*q4=\[0-9\]+.*q5=\[0-9\]+.*q6=\[0-9\]+.*$gdb_prompt $" {
+ pass "$msg"
+ }
+ -re "#0\[\t \]+gdb_recursion_test.*depth=Cannot access.*$gdb_prompt $" {
+ fail "$msg (failed to collect arguments)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$msg"
+ }
+ timeout { fail "$msg (timeout)" }
+ }
+}
+
+proc gdb_backtrace_tdp_4 { msg depth } {
+ global gdb_prompt
+
+ # We are in a trace frame at which we collected all registers,
+ # plus a sizeable hunk of stack memory. This should enable us to
+ # display at least several stack frames worth of backtrace. We'll
+ # assume that if we can't display at least "depth" levels (with
+ # args), it counts as an error.
+
+ send_gdb "backtrace\n"
+ gdb_expect {
+ -re "#$depth\[\t \].*gdb_recursion_test.*depth=\[0-9\]+.*q1=\[0-9\]+.*q2=\[0-9\]+.*q3=\[0-9\]+.*q4=\[0-9\]+.*q5=\[0-9\]+.*q6=\[0-9\]+.*$gdb_prompt $" {
+ pass "$msg"
+ }
+ -re "#$depth\[\t \].*gdb_recursion_test.*depth=.*$gdb_prompt $" {
+ fail "$msg (args missing from #$depth stack frame)"
+ }
+ -re "#\[0-9\]+\[\t \].*gdb_recursion_test.*depth=.*$gdb_prompt $" {
+ fail "$msg (fewer than $depth stack frames found)"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$msg"
+ }
+ timeout { fail "$msg (timeout)" }
+ }
+}
+
+#
+# begin backtrace test
+#
+
+set timeout 60
+
+gdb_tfind_test "init: make sure not debugging any trace frame" "none" "-1"
+
+gdb_tfind_test "8.6: find start frame" "start" "0"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp2:" ""
+gdb_backtrace_tdp_1 "8.6: Backtrace, depth == 1, collect nothing"
+
+gdb_tfind_test "8.6: find frame 1" "1" "1"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp3:" ""
+gdb_backtrace_tdp_2 "8.6: Backtrace, depth == 1, collect regs"
+
+gdb_tfind_test "8.6: find frame 2" "2" "2"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp4:" ""
+gdb_backtrace_tdp_3 "8.6: Backtrace, depth == 1, collect args and locals"
+
+
+gdb_tfind_test "8.6: find frame 4" "4" "4"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp6:" ""
+gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0"
+
+gdb_tfind_test "8.6: find frame 5" "5" "5"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp2:" ""
+gdb_backtrace_tdp_1 "8.6: Backtrace, depth == 2, collect nothing"
+
+gdb_tfind_test "8.6: find frame 6" "6" "6"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp3:" ""
+gdb_backtrace_tdp_2 "8.6: Backtrace, depth == 2, collect regs"
+
+gdb_tfind_test "8.6: find frame 7" "7" "7"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp4:" ""
+gdb_backtrace_tdp_3 "8.6: Backtrace, depth == 2, collect args and locals"
+
+
+gdb_tfind_test "8.6: find frame 9" "9" "9"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp6:" ""
+gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0"
+
+gdb_tfind_test "8.6: find frame 10" "10" "10"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp2:" ""
+gdb_backtrace_tdp_1 "8.6: Backtrace, depth == 3, collect nothing"
+
+gdb_tfind_test "8.6: find frame 11" "11" "11"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp3:" ""
+gdb_backtrace_tdp_2 "8.6: Backtrace, depth == 3, collect regs"
+
+gdb_tfind_test "8.6: find frame 12" "12" "12"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp4:" ""
+gdb_backtrace_tdp_3 "8.6: Backtrace, depth == 3, collect args and locals"
+
+
+gdb_tfind_test "8.6: find frame 14" "14" "14"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp6:" ""
+gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0"
+
+gdb_tfind_test "8.6: find frame 15" "15" "15"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp2:" ""
+gdb_backtrace_tdp_1 "8.6: Backtrace, depth == 4, collect nothing"
+
+gdb_tfind_test "8.6: find frame 16" "16" "16"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp3:" ""
+gdb_backtrace_tdp_2 "8.6: Backtrace, depth == 4, collect regs"
+
+gdb_tfind_test "8.6: find frame 17" "17" "17"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp4:" ""
+gdb_backtrace_tdp_3 "8.6: Backtrace, depth == 4, collect args and locals"
+
+
+gdb_tfind_test "8.6: find frame 19" "19" "19"
+gdb_test "printf \"TDP \%d:\\n\", \$tracepoint" \
+ "TDP $tdp6:" ""
+gdb_backtrace_tdp_4 "8.6: Backtrace, depth == 1, collect stack mem expr" "0"
+
+gdb_test "printf \"x \%d x\\n\", depth == 3" \
+ "x 0 x" \
+ "1.13: trace in recursion: depth not equal to 3"
+
+# Finished!
+gdb_test "tfind none" "" ""
diff --git a/gdb/testsuite/gdb.trace/circ.c b/gdb/testsuite/gdb.trace/circ.c
new file mode 100644
index 00000000000..98a2ce6be54
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/circ.c
@@ -0,0 +1,90 @@
+/*
+ * Test program for tracing; circular buffer
+ */
+
+int n = 6;
+
+int testload[13];
+
+static void func0(void)
+{
+}
+
+static void func1(void)
+{
+}
+
+static void func2(void)
+{
+}
+
+static void func3(void)
+{
+}
+
+static void func4(void)
+{
+}
+
+static void func5(void)
+{
+}
+
+static void func6(void)
+{
+}
+
+static void func7(void)
+{
+}
+
+static void func8(void)
+{
+}
+
+static void func9(void)
+{
+}
+
+static void begin () /* called before anything else */
+{
+}
+
+static void end () /* called after everything else */
+{
+}
+
+int
+main (argc, argv, envp)
+ int argc;
+ char *argv[], **envp;
+{
+ int i;
+
+#ifdef usestubs
+ set_debug_traps ();
+ breakpoint ();
+#endif
+
+ begin ();
+ for (i = 0; i < sizeof(testload) / sizeof(testload[0]); i++)
+ testload[i] = i + 1;
+
+ func0 ();
+ func1 ();
+ func2 ();
+ func3 ();
+ func4 ();
+ func5();
+ func6 ();
+ func7 ();
+ func8 ();
+ func9 ();
+
+ end ();
+
+#ifdef usestubs
+ breakpoint ();
+#endif
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.trace/circ.exp b/gdb/testsuite/gdb.trace/circ.exp
new file mode 100644
index 00000000000..2bfb7a67b70
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/circ.exp
@@ -0,0 +1,215 @@
+# Copyright 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if [istarget "m68k-*-elf"] then {
+ pass "Test not supported on this target"
+ return;
+}
+
+load_lib "trace-support.exp"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "circ"
+set srcfile ${testfile}.c
+set binfile $objdir/$subdir/$testfile
+
+if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Tests:
+# 1) Set up a trace experiment that will collect approximately 10 frames,
+# requiring more than 512 but less than 1024 bytes of cache buffer.
+# (most targets should have at least 1024 bytes of cache buffer!)
+# Run and confirm that it collects all 10 frames.
+# 2) Artificially limit the trace buffer to 512 bytes, and rerun the
+# experiment. Confirm that the first several frames are collected,
+# but that the last several are not.
+# 3) Set trace buffer to circular mode, still with the artificial limit
+# of 512 bytes, and rerun the experiment. Confirm that the last
+# several frames are collected, but the first several are not.
+#
+
+# return 0 for success, 1 for failure
+proc run_trace_experiment { pass } {
+ gdb_run_cmd
+
+ if [gdb_test "tstart" \
+ "\[\r\n\]*" \
+ "start trace experiment, pass $pass"] then { return 1; }
+ if [gdb_test "continue" \
+ "Continuing.*Breakpoint \[0-9\]+, end.*" \
+ "run to end, pass $pass"] then { return 1; }
+ if [gdb_test "tstop" \
+ "\[\r\n\]*" \
+ "stop trace experiment, pass $pass"] then { return 1; }
+ return 0;
+}
+
+# return 0 for success, 1 for failure
+proc set_a_tracepoint { func } {
+ if [gdb_test "trace $func" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "set tracepoint at $func"] then {
+ return 1;
+ }
+ if [gdb_trace_setactions "set actions for $func" \
+ "" \
+ "collect testload" "^$"] then {
+ return 1;
+ }
+ return 0;
+}
+
+# return 0 for success, 1 for failure
+proc setup_tracepoints { } {
+ gdb_delete_tracepoints
+ if [set_a_tracepoint func0] then { return 1; }
+ if [set_a_tracepoint func1] then { return 1; }
+ if [set_a_tracepoint func2] then { return 1; }
+ if [set_a_tracepoint func3] then { return 1; }
+ if [set_a_tracepoint func4] then { return 1; }
+ if [set_a_tracepoint func5] then { return 1; }
+ if [set_a_tracepoint func6] then { return 1; }
+ if [set_a_tracepoint func7] then { return 1; }
+ if [set_a_tracepoint func8] then { return 1; }
+ if [set_a_tracepoint func9] then { return 1; }
+ return 0;
+}
+
+# return 0 for success, 1 for failure
+proc trace_buffer_normal { } {
+ if [gdb_test "maint packet QTBuffer:size:ffffffff" \
+ "received: .OK." ""] then {
+ pass "This test cannot be run on this target"
+ return 1;
+ }
+ if [gdb_test "maint packet QTBuffer:circular:0" \
+ "received: .OK." ""] then {
+ pass "This test cannot be run on this target"
+ return 1;
+ }
+ return 0;
+}
+
+# return 0 for success, 1 for failure
+proc gdb_trace_circular_tests { } {
+
+ # We generously give ourselves one "pass" if we successfully
+ # detect that this test cannot be run on this target!
+ if { ![gdb_target_supports_trace] } then {
+ pass "Current target does not supporst trace"
+ return 1;
+ }
+
+ if [trace_buffer_normal] then { return 1; }
+
+ gdb_test "break begin" "" ""
+ gdb_test "break end" "" ""
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+
+ if [setup_tracepoints] then { return 1; }
+
+ # First, run the trace experiment with default attributes:
+ # Make sure it behaves as expected.
+ if [run_trace_experiment 1] then { return 1; }
+ if [gdb_test "tfind start" \
+ "#0 func0 .*" \
+ "find frame zero, pass 1"] then { return 1; }
+
+ if [gdb_test "tfind 9" \
+ "#0 func9 .*" \
+ "find frame nine, pass 1"] then { return 1; }
+
+ if [gdb_test "tfind none" \
+ "#0 end .*" \
+ "quit trace debugging, pass 1"] then { return 1; }
+
+ # Then, shrink the trace buffer so that it will not hold
+ # all ten trace frames. Verify that frame zero is still
+ # collected, but frame nine is not.
+ if [gdb_test "maint packet QTBuffer:size:200" \
+ "received: .OK." "shrink the target trace buffer"] then {
+ return 1;
+ }
+ if [run_trace_experiment 2] then { return 1; }
+ if [gdb_test "tfind start" \
+ "#0 func0 .*" \
+ "find frame zero, pass 2"] then { return 1; }
+
+ if [gdb_test "tfind 9" \
+ ".* failed to find .*" \
+ "fail to find frame nine, pass 2"] then { return 1; }
+
+ if [gdb_test "tfind none" \
+ "#0 end .*" \
+ "quit trace debugging, pass 2"] then { return 1; }
+
+ # Finally, make the buffer circular. Now when it runs out of
+ # space, it should wrap around and overwrite the earliest frames.
+ # This means that:
+ # 1) frame zero will be overwritten and therefore unavailable
+ # 2) the earliest frame in the buffer will be other-than-zero
+ # 3) frame nine will be available (unlike on pass 2).
+ if [gdb_test "maint packet QTBuffer:circular:1" \
+ "received: .OK." "make the target trace buffer circular"] then {
+ return 1;
+ }
+ if [run_trace_experiment 3] then { return 1; }
+ if [gdb_test "tfind start" \
+ "#0 func\[1-9\] .*" \
+ "first frame is NOT frame zero, pass 3"] then { return 1; }
+
+ if [gdb_test "tfind 9" \
+ "#0 func9 .*" \
+ "find frame nine, pass 3"] then { return 1; }
+
+ if [gdb_test "tfind none" \
+ "#0 end .*" \
+ "quit trace debugging, pass 3"] then { return 1; }
+
+ return 0;
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+# Body of test encased in a proc so we can return prematurely.
+if { ![gdb_trace_circular_tests] } then {
+ # Set trace buffer attributes back to normal
+ trace_buffer_normal;
+}
+
+# Finished!
+gdb_test "tfind none" "" ""
diff --git a/gdb/testsuite/gdb.trace/collection.c b/gdb/testsuite/gdb.trace/collection.c
new file mode 100644
index 00000000000..39863325b0a
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/collection.c
@@ -0,0 +1,280 @@
+/*
+ * Test program for trace collection
+ */
+
+/*
+ * Typedefs
+ */
+
+typedef struct TEST_STRUCT {
+ char memberc;
+ int memberi;
+ float memberf;
+ double memberd;
+} test_struct;
+
+typedef int test_array [4];
+
+/*
+ * Global variables to be collected
+ */
+
+char globalc;
+int globali;
+float globalf;
+double globald;
+test_struct globalstruct;
+test_struct *globalp;
+int globalarr[16];
+
+/*
+ * Additional globals used in arithmetic tests
+ */
+
+signed char c0, c1, c2, c3, c4, c5, c6, c7,
+ c8, c9, c10, c11, c12, c13, c14, c15, cminus;
+signed short s0, s1, s2, s3, s4, s5, s6, s7,
+ s8, s9, s10, s11, s12, s13, s14, s15, sminus;
+signed long l0, l1, l2, l3, l4, l5, l6, l7,
+ l8, l9, l10, l11, l12, l13, l14, l15, lminus;
+
+
+/*
+ * Test functions
+ */
+
+static void begin () /* called before anything else */
+{
+}
+
+static void end () /* called after everything else */
+{
+}
+
+/* Test collecting args. */
+int args_test_func (argc, argi, argf, argd, argstruct, argarray)
+ char argc;
+ int argi;
+ float argf;
+ double argd;
+ test_struct argstruct;
+ int argarray[4];
+{
+ int i;
+
+ i = (int) argc + argi + argf + argd + argstruct.memberi + argarray[1];
+
+ return i;
+}
+
+/* Test collecting struct args. */
+int argstruct_test_func (argstruct)
+ test_struct argstruct;
+{
+ return (int) argstruct.memberc + argstruct.memberi +
+ argstruct.memberf + argstruct.memberd;
+}
+
+/* Test collecting array args. */
+int argarray_test_func (argarray)
+ int argarray[4];
+{
+ return (int) argarray[0] + argarray[1] + argarray[2] + argarray[3];
+}
+
+
+
+int local_test_func () /* test collecting locals */
+{
+ char locc = 11;
+ int loci = 12;
+ float locf = 13.3;
+ double locd = 14.4;
+ test_struct locst;
+ int locar[4];
+ int i;
+
+ locst.memberc = 15;
+ locst.memberi = 16;
+ locst.memberf = 17.7;
+ locst.memberd = 18.8;
+ locar[0] = 121;
+ locar[1] = 122;
+ locar[2] = 123;
+ locar[3] = 124;
+
+ i = /* Set_Tracepoint_Here */
+ (int) locc + loci + locf + locd + locst.memberi + locar[1];
+
+ return i;
+}
+
+int reglocal_test_func () /* test collecting register locals */
+{
+ register char locc = 11;
+ register int loci = 12;
+ register float locf = 13.3;
+ register double locd = 14.4;
+ register test_struct locst;
+ register int locar[4];
+ int i;
+
+ locst.memberc = 15;
+ locst.memberi = 16;
+ locst.memberf = 17.7;
+ locst.memberd = 18.8;
+ locar[0] = 121;
+ locar[1] = 122;
+ locar[2] = 123;
+ locar[3] = 124;
+
+ i = /* Set_Tracepoint_Here */
+ (int) locc + loci + locf + locd + locst.memberi + locar[1];
+
+ return i;
+}
+
+int statlocal_test_func () /* test collecting static locals */
+{
+ static char locc;
+ static int loci;
+ static float locf;
+ static double locd;
+ static test_struct locst;
+ static int locar[4];
+ int i;
+
+ locc = 11;
+ loci = 12;
+ locf = 13.3;
+ locd = 14.4;
+ locst.memberc = 15;
+ locst.memberi = 16;
+ locst.memberf = 17.7;
+ locst.memberd = 18.8;
+ locar[0] = 121;
+ locar[1] = 122;
+ locar[2] = 123;
+ locar[3] = 124;
+
+ i = /* Set_Tracepoint_Here */
+ (int) locc + loci + locf + locd + locst.memberi + locar[1];
+
+ /* Set static locals back to zero so collected values are clearly special. */
+ locc = 0;
+ loci = 0;
+ locf = 0;
+ locd = 0;
+ locst.memberc = 0;
+ locst.memberi = 0;
+ locst.memberf = 0;
+ locst.memberd = 0;
+ locar[0] = 0;
+ locar[1] = 0;
+ locar[2] = 0;
+ locar[3] = 0;
+
+ return i;
+}
+
+
+int globals_test_func ()
+{
+ int i = 0;
+
+ i += globalc + globali + globalf + globald;
+ i += globalstruct.memberc + globalstruct.memberi;
+ i += globalstruct.memberf + globalstruct.memberd;
+ i += globalarr[1];
+
+ return i; /* Set_Tracepoint_Here */
+}
+
+int
+main (argc, argv, envp)
+ int argc;
+ char *argv[], **envp;
+{
+ int i = 0;
+ test_struct mystruct;
+ int myarray[4];
+
+#ifdef usestubs
+ set_debug_traps ();
+ breakpoint ();
+#endif
+
+ begin ();
+ /* Assign collectable values to global variables. */
+ l0 = s0 = c0 = 0; l1 = s1 = c1 = 1;
+ l2 = s2 = c2 = 2; l3 = s3 = c3 = 3;
+ l4 = s4 = c4 = 4; l5 = s5 = c5 = 5;
+ l6 = s6 = c6 = 6; l7 = s7 = c7 = 7;
+ l8 = s8 = c8 = 8; l9 = s9 = c9 = 9;
+ l10 = s10 = c10 = 10; l11 = s11 = c11 = 11;
+ l12 = s12 = c12 = 12; l13 = s13 = c13 = 13;
+ l14 = s14 = c14 = 14; l15 = s15 = c15 = 15;
+ lminus = sminus = cminus = -2;
+ globalc = 71;
+ globali = 72;
+ globalf = 73.3;
+ globald = 74.4;
+ globalstruct.memberc = 81;
+ globalstruct.memberi = 82;
+ globalstruct.memberf = 83.3;
+ globalstruct.memberd = 84.4;
+ globalp = &globalstruct;
+
+ for (i = 0; i < 15; i++)
+ globalarr[i] = i;
+
+ mystruct.memberc = 101;
+ mystruct.memberi = 102;
+ mystruct.memberf = 103.3;
+ mystruct.memberd = 104.4;
+ myarray[0] = 111;
+ myarray[1] = 112;
+ myarray[2] = 113;
+ myarray[3] = 114;
+
+ /* Call test functions, so they can be traced and data collected. */
+ i = 0;
+ i += args_test_func (1, 2, 3.3, 4.4, mystruct, myarray);
+ i += argstruct_test_func (mystruct);
+ i += argarray_test_func (myarray);
+ i += local_test_func ();
+ i += reglocal_test_func ();
+ i += statlocal_test_func ();
+ i += globals_test_func ();
+
+ /* Values of globals at end of test should be different from
+ values that they had when trace data was captured. */
+
+ l0 = s0 = c0 = 0; l1 = s1 = c1 = 0;
+ l2 = s2 = c2 = 0; l3 = s3 = c3 = 0;
+ l4 = s4 = c4 = 0; l5 = s5 = c5 = 0;
+ l6 = s6 = c6 = 0; l7 = s7 = c7 = 0;
+ l8 = s8 = c8 = 0; l9 = s9 = c9 = 0;
+ l10 = s10 = c10 = 0; l11 = s11 = c11 = 0;
+ l12 = s12 = c12 = 0; l13 = s13 = c13 = 0;
+ l14 = s14 = c14 = 0; l15 = s15 = c15 = 0;
+ lminus = sminus = cminus = 0;
+
+ /* Set 'em back to zero, so that the collected values will be
+ distinctly different from the "realtime" (end of test) values. */
+
+ globalc = 0;
+ globali = 0;
+ globalf = 0;
+ globald = 0;
+ globalstruct.memberc = 0;
+ globalstruct.memberi = 0;
+ globalstruct.memberf = 0;
+ globalstruct.memberd = 0;
+ globalp = 0;
+ for (i = 0; i < 15; i++)
+ globalarr[i] = 0;
+
+ end ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp
new file mode 100644
index 00000000000..a6ac5d80248
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/collection.exp
@@ -0,0 +1,623 @@
+# Copyright 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if [istarget "m68k-*-elf"] then {
+ pass "Test not supported on this target"
+ return;
+}
+
+load_lib "trace-support.exp"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "collection"
+set srcfile ${testfile}.c
+set binfile $objdir/$subdir/$testfile
+
+if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Tests:
+# 1) $args
+# 2) function args by name
+# 3) $locs
+# 4) function locals by name
+# 5) $regs
+# 6) registers by name ($sp, $fp?)
+# 7) globals by name
+# 8) expressions (lots of different kinds: local and global)
+
+set ws "\[\r\n\t \]+"
+set cr "\[\r\n\]+"
+
+#
+# Utility procs
+#
+
+proc test_register { reg test_id } {
+ global cr
+ global gdb_prompt
+
+ send_gdb "print $reg\n"
+ gdb_expect {
+ -re "\\$\[0-9\]+ = \[x0\]+$cr$gdb_prompt " {
+ fail "collect $test_id: collected $reg (zero)"
+ }
+ -re "\\$\[0-9\]+ = \[x0-9a-fA-F\]+$cr$gdb_prompt " {
+ pass "collect $test_id: collected $reg"
+ }
+ -re "\[Ee\]rror.*$gdb_prompt " {
+ fail "collect $test_id: collected $reg (error)"
+ }
+ timeout {
+ fail "collect $test_id: collected $reg (timeout)"
+ }
+ }
+}
+
+proc run_trace_experiment { msg test_func } {
+ gdb_run_cmd
+ gdb_test "tstart" \
+ "\[\r\n\]+" \
+ "collect $msg: start trace experiment"
+ gdb_test "continue" \
+ "Continuing.*Breakpoint \[0-9\]+, end.*" \
+ "collect $msg: run trace experiment"
+ gdb_test "tstop" \
+ "\[\r\n\]+" \
+ "collect $msg: stop trace experiment"
+ gdb_test "tfind start" \
+ "#0 $test_func .*" \
+ "collect $msg: tfind test frame"
+}
+
+
+#
+# Test procs
+#
+
+proc gdb_collect_args_test { myargs msg } {
+ global cr
+ global gdb_prompt
+
+ # Make sure we're in a sane starting state.
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ gdb_delete_tracepoints
+
+ gdb_test "trace args_test_func" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "collect $msg: set tracepoint"
+ gdb_trace_setactions "collect $msg: define actions" \
+ "" \
+ "collect $myargs" "^$"
+
+ # Begin the test.
+ run_trace_experiment $msg args_test_func
+
+ gdb_test "print argc" \
+ "\\$\[0-9\]+ = 1 '.001'$cr" \
+ "collect $msg: collected arg char"
+ gdb_test "print argi" \
+ "\\$\[0-9\]+ = 2$cr" \
+ "collect $msg: collected arg int"
+ gdb_test "print argf" \
+ "\\$\[0-9\]+ = 3.\[23\]\[0-9\]*$cr" \
+ "collect $msg: collected arg float"
+ gdb_test "print argd" \
+ "\\$\[0-9\]+ = 4.\[34\]\[0-9\]*$cr" \
+ "collect $msg: collected arg double"
+
+ # struct arg as one of several args (near end of list)
+ gdb_test "print argstruct.memberc" \
+ "\\$\[0-9\]+ = 101 'e'$cr" \
+ "collect $msg: collected arg struct member char"
+ gdb_test "print argstruct.memberi" \
+ "\\$\[0-9\]+ = 102$cr" \
+ "collect $msg: collected arg struct member int"
+ gdb_test "print argstruct.memberf" \
+ "\\$\[0-9\]+ = 103.\[23\]\[0-9\]*$cr" \
+ "collect $msg: collected arg struct member float"
+ gdb_test "print argstruct.memberd" \
+ "\\$\[0-9\]+ = 104.\[34\]\[0-9\]*$cr" \
+ "collect $msg: collected arg struct member double"
+
+ # array arg as one of several args (near end of list)
+ gdb_test "print argarray\[0\]" \
+ "\\$\[0-9\]+ = 111$cr" \
+ "collect $msg: collected argarray #0"
+ gdb_test "print argarray\[1\]" \
+ "\\$\[0-9\]+ = 112$cr" \
+ "collect $msg: collected argarray #1"
+ gdb_test "print argarray\[2\]" \
+ "\\$\[0-9\]+ = 113$cr" \
+ "collect $msg: collected argarray #2"
+ gdb_test "print argarray\[3\]" \
+ "\\$\[0-9\]+ = 114$cr" \
+ "collect $msg: collected argarray #3"
+
+ gdb_test "tfind none" \
+ "#0 end .*" \
+ "collect $msg: cease trace debugging"
+}
+
+proc gdb_collect_argstruct_test { myargs msg } {
+ global cr
+ global gdb_prompt
+
+ # Make sure we're in a sane starting state.
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ gdb_delete_tracepoints
+
+ gdb_test "trace argstruct_test_func" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "collect $msg: set tracepoint"
+ gdb_trace_setactions "collect $msg: define actions" \
+ "" \
+ "collect $myargs" "^$"
+
+ # Begin the test.
+ run_trace_experiment $msg argstruct_test_func
+
+ # struct argument as only argument
+ gdb_test "print argstruct.memberc" \
+ "\\$\[0-9\]+ = 101 'e'$cr" \
+ "collect $msg: collected arg struct member char"
+ gdb_test "print argstruct.memberi" \
+ "\\$\[0-9\]+ = 102$cr" \
+ "collect $msg: collected arg struct member int"
+ gdb_test "print argstruct.memberf" \
+ "\\$\[0-9\]+ = 103.\[23\]\[0-9\]*$cr" \
+ "collect $msg: collected arg struct member float"
+ gdb_test "print argstruct.memberd" \
+ "\\$\[0-9\]+ = 104.\[34\]\[0-9\]*$cr" \
+ "collect $msg: collected arg struct member double"
+
+ gdb_test "tfind none" \
+ "#0 end .*" \
+ "collect $msg: cease trace debugging"
+}
+
+
+proc gdb_collect_argarray_test { myargs msg } {
+ global cr
+ global gdb_prompt
+
+ # Make sure we're in a sane starting state.
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ gdb_delete_tracepoints
+
+ gdb_test "trace argarray_test_func" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "collect $msg: set tracepoint"
+ gdb_trace_setactions "collect $msg: define actions" \
+ "" \
+ "collect $myargs" "^$"
+
+ # Begin the test.
+ run_trace_experiment $msg argarray_test_func
+
+ # array arg as only argument
+ gdb_test "print argarray\[0\]" \
+ "\\$\[0-9\]+ = 111$cr" \
+ "collect $msg: collected argarray #0"
+ gdb_test "print argarray\[1\]" \
+ "\\$\[0-9\]+ = 112$cr" \
+ "collect $msg: collected argarray #1"
+ gdb_test "print argarray\[2\]" \
+ "\\$\[0-9\]+ = 113$cr" \
+ "collect $msg: collected argarray #2"
+ gdb_test "print argarray\[3\]" \
+ "\\$\[0-9\]+ = 114$cr" \
+ "collect $msg: collected argarray #3"
+
+ gdb_test "tfind none" \
+ "#0 end .*" \
+ "collect $msg: cease trace debugging"
+}
+
+
+proc gdb_collect_locals_test { func mylocs msg } {
+ global cr
+ global gdb_prompt
+
+ # Make sure we're in a sane starting state.
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ gdb_delete_tracepoints
+
+ # Find the comment-identified line for setting this tracepoint.
+ set testline 0
+ send_gdb "list $func, +30\n"
+ gdb_expect {
+ -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
+ set testline $expect_out(1,string)
+ pass "collect $msg: find tracepoint line"
+ }
+ -re ".*$gdb_prompt " {
+ fail "collect $msg: find tracepoint line (skipping locals test)"
+ return
+ }
+ timeout {
+ fail "collect $msg: find tracepoint line (skipping locals test)"
+ return
+ }
+ }
+
+ gdb_test "trace $testline" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "collect $msg: set tracepoint"
+ gdb_trace_setactions "collect $msg: define actions" \
+ "" \
+ "collect $mylocs" "^$"
+
+ # Begin the test.
+ run_trace_experiment $msg $func
+
+ gdb_test "print locc" \
+ "\\$\[0-9\]+ = 11 '.013'$cr" \
+ "collect $msg: collected local char"
+ gdb_test "print loci" \
+ "\\$\[0-9\]+ = 12$cr" \
+ "collect $msg: collected local int"
+ gdb_test "print locf" \
+ "\\$\[0-9\]+ = 13.\[23\]\[0-9\]*$cr" \
+ "collect $msg: collected local float"
+ gdb_test "print locd" \
+ "\\$\[0-9\]+ = 14.\[34\]\[0-9\]*$cr" \
+ "collect $msg: collected local double"
+
+ gdb_test "print locst.memberc" \
+ "\\$\[0-9\]+ = 15 '.017'$cr" \
+ "collect $msg: collected local member char"
+ gdb_test "print locst.memberi" \
+ "\\$\[0-9\]+ = 16$cr" \
+ "collect $msg: collected local member int"
+ gdb_test "print locst.memberf" \
+ "\\$\[0-9\]+ = 17.\[67\]\[0-9\]*$cr" \
+ "collect $msg: collected local member float"
+ gdb_test "print locst.memberd" \
+ "\\$\[0-9\]+ = 18.\[78\]\[0-9\]*$cr" \
+ "collect $msg: collected local member double"
+
+ gdb_test "print locar\[0\]" \
+ "\\$\[0-9\]+ = 121$cr" \
+ "collect $msg: collected locarray #0"
+ gdb_test "print locar\[1\]" \
+ "\\$\[0-9\]+ = 122$cr" \
+ "collect $msg: collected locarray #1"
+ gdb_test "print locar\[2\]" \
+ "\\$\[0-9\]+ = 123$cr" \
+ "collect $msg: collected locarray #2"
+ gdb_test "print locar\[3\]" \
+ "\\$\[0-9\]+ = 124$cr" \
+ "collect $msg: collected locarray #3"
+
+
+ gdb_test "tfind none" \
+ "#0 end .*" \
+ "collect $msg: cease trace debugging"
+}
+
+proc gdb_collect_registers_test { myregs } {
+ global cr
+ global gdb_prompt
+
+ # Make sure we're in a sane starting state.
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ gdb_delete_tracepoints
+
+ # We'll simply re-use the args_test_function for this test
+ gdb_test "trace args_test_func" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "collect $myregs: set tracepoint"
+ gdb_trace_setactions "collect $myregs: define actions" \
+ "" \
+ "collect $myregs" "^$"
+
+ # Begin the test.
+ run_trace_experiment $myregs args_test_func
+
+ test_register "\$fp" $myregs
+ test_register "\$sp" $myregs
+ test_register "\$pc" $myregs
+
+ gdb_test "tfind none" \
+ "#0 end .*" \
+ "collect $myregs: cease trace debugging"
+}
+
+proc gdb_collect_expression_test { func expr val msg } {
+ global cr
+ global gdb_prompt
+
+ # Make sure we're in a sane starting state.
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ gdb_delete_tracepoints
+
+ # Find the comment-identified line for setting this tracepoint.
+ set testline 0
+ send_gdb "list $func, +30\n"
+ gdb_expect {
+ -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
+ set testline $expect_out(1,string)
+ pass "collect $msg: find tracepoint line"
+ }
+ -re ".*$gdb_prompt " {
+ fail "collect $msg: find tracepoint line (skipping locals test)"
+ return
+ }
+ timeout {
+ fail "collect $msg: find tracepoint line (skipping locals test)"
+ return
+ }
+ }
+
+ gdb_test "trace $testline" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "collect $msg: set tracepoint"
+ gdb_trace_setactions "collect $msg: define actions" \
+ "" \
+ "collect $expr" "^$"
+
+ # Begin the test.
+ run_trace_experiment $msg $func
+
+ gdb_test "print $expr" \
+ "\\$\[0-9\]+ = $val$cr" \
+ "collect $msg: got expected value '$val'"
+
+ gdb_test "tfind none" \
+ "#0 end .*" \
+ "collect $msg: cease trace debugging"
+}
+
+proc gdb_collect_globals_test { } {
+ global cr
+ global gdb_prompt
+
+ # Make sure we're in a sane starting state.
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ gdb_delete_tracepoints
+
+ # Find the comment-identified line for setting this tracepoint.
+ set testline 0
+ send_gdb "list globals_test_func, +30\n"
+ gdb_expect {
+ -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+ Set_Tracepoint_Here .*$gdb_prompt" {
+ set testline $expect_out(1,string)
+ pass "collect globals: find tracepoint line"
+ }
+ -re ".*$gdb_prompt " {
+ fail "collect globals: find tracepoint line (skipping global test)"
+ return
+ }
+ timeout {
+ fail "collect globals: find tracepoint line (skipping global test)"
+ return
+ }
+ }
+
+ gdb_test "trace $testline" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "collect globals: set tracepoint"
+ gdb_trace_setactions "collect globals: define actions" \
+ "" \
+ "collect globalc, globali, globalf, globald" "^$" \
+ "collect globalstruct, globalp, globalarr" "^$"
+
+ # Begin the test.
+ run_trace_experiment "globals" globals_test_func
+
+ gdb_test "print globalc" \
+ "\\$\[0-9\]+ = 71 'G'$cr" \
+ "collect globals: collected global char"
+ gdb_test "print globali" \
+ "\\$\[0-9\]+ = 72$cr" \
+ "collect globals: collected global int"
+ gdb_test "print globalf" \
+ "\\$\[0-9\]+ = 73.\[23\]\[0-9\]*$cr" \
+ "collect globals: collected global float"
+ gdb_test "print globald" \
+ "\\$\[0-9\]+ = 74.\[34\]\[0-9\]*$cr" \
+ "collect globals: collected global double"
+
+ gdb_test "print globalstruct.memberc" \
+ "\\$\[0-9\]+ = 81 'Q'$cr" \
+ "collect globals: collected struct char member"
+ gdb_test "print globalstruct.memberi" \
+ "\\$\[0-9\]+ = 82$cr" \
+ "collect globals: collected struct member int"
+ gdb_test "print globalstruct.memberf" \
+ "\\$\[0-9\]+ = 83.\[23\]\[0-9\]*$cr" \
+ "collect globals: collected struct member float"
+ gdb_test "print globalstruct.memberd" \
+ "\\$\[0-9\]+ = 84.\[34\]\[0-9\]*$cr" \
+ "collect globals: collected struct member double"
+
+ gdb_test "print globalp == &globalstruct" \
+ "\\$\[0-9\]+ = 1$cr" \
+ "collect globals: collected global pointer"
+
+ gdb_test "print globalarr\[1\]" \
+ "\\$\[0-9\]+ = 1$cr" \
+ "collect globals: collected global array element #1"
+ gdb_test "print globalarr\[2\]" \
+ "\\$\[0-9\]+ = 2$cr" \
+ "collect globals: collected global array element #2"
+ gdb_test "print globalarr\[3\]" \
+ "\\$\[0-9\]+ = 3$cr" \
+ "collect globals: collected global array element #3"
+
+ gdb_test "tfind none" \
+ "#0 end .*" \
+ "collect globals: cease trace debugging"
+}
+
+proc gdb_trace_collection_test { } {
+ global gdb_prompt;
+
+ gdb_test "set width 0" "" ""
+ delete_breakpoints
+
+ # We generously give ourselves one "pass" if we successfully
+ # detect that this test cannot be run on this target!
+ if { ![gdb_target_supports_trace] } then {
+ pass "Current target does not supporst trace"
+ return 1;
+ }
+
+ gdb_test "break begin" "" ""
+ gdb_test "break end" "" ""
+ gdb_collect_args_test "\$args" \
+ "args collectively"
+ gdb_collect_args_test "argc, argi, argf, argd, argstruct, argarray" \
+ "args individually"
+ gdb_collect_argstruct_test "\$args" \
+ "argstruct collectively"
+ gdb_collect_argstruct_test "argstruct" \
+ "argstruct individually"
+ gdb_collect_argarray_test "\$args" \
+ "argarray collectively"
+ gdb_collect_argarray_test "argarray" \
+ "argarray individually"
+ gdb_collect_locals_test local_test_func "\$locals" \
+ "auto locals collectively"
+ gdb_collect_locals_test local_test_func \
+ "locc, loci, locf, locd, locst, locar" \
+ "auto locals individually"
+ gdb_collect_locals_test reglocal_test_func "\$locals" \
+ "register locals collectively"
+ gdb_collect_locals_test reglocal_test_func \
+ "locc, loci, locf, locd, locst, locar" \
+ "register locals individually"
+ gdb_collect_locals_test statlocal_test_func "\$locals" \
+ "static locals collectively"
+ gdb_collect_locals_test statlocal_test_func \
+ "locc, loci, locf, locd, locst, locar" \
+ "static locals individually"
+
+ gdb_collect_registers_test "\$regs"
+ gdb_collect_registers_test "\$fp, \$sp, \$pc"
+ gdb_collect_globals_test
+
+ #
+ # Expression tests:
+ #
+ # *x (**x, ...)
+ # x.y (x.y.z, ...)
+ # x->y (x->y->z, ...)
+ # x[2] (x[2][3], ...) (const index)
+ # x[y] (x[y][z], ...) (index to be char, short, long, float, double)
+ # NOTE:
+ # We test the following operators by using them in an array index
+ # expression -- because the naked result of an operator is not really
+ # collected. To be sure the operator was evaluated correctly on the
+ # target, we have to actually use the result eg. in an array offset
+ # calculation.
+ # x[y + z] (tests addition: y and z various combos of types, sclasses)
+ # x[y - z] (tests subtraction) (ditto)
+ # x[y * z] (tests multiplication) (ditto)
+ # x[y / z] (tests division) (ditto)
+ # x[y % z] (tests modulo division) (ditto)
+ # x[y == z] (tests equality relation) (ditto) UNSUPPORTED
+ # x[y != z] (tests inequality relation) (ditto) UNSUPPORTED
+ # x[y > z] (tests greater-than relation) (ditto) UNSUPPORTED
+ # x[y < z] (tests less-than relation) (ditto) UNSUPPORTED
+ # x[y >= z] (tests greater-than-or-equal relation) (ditto) UNSUPPORTED
+ # x[y <= z] (tests less-than-or-equal relation) (ditto) UNSUPPORTED
+ # x[y && z] (tests logical and) (ditto) UNSUPPORTED
+ # x[y || z] (tests logical or) (ditto) UNSUPPORTED
+ # x[y & z] (tests binary and) (ditto) UNSUPPORTED
+ # x[y | z] (tests binary or) (ditto) UNSUPPORTED
+ # x[y ^ z] (tests binary xor) (ditto) UNSUPPORTED
+ # x[y ? z1 : z2] (tests ternary operator) (ditto) UNSUPPORTED
+ # x[y << z] (tests shift-left) (ditto) UNSUPPORTED
+ # x[y >> z] (tests shift-right) (ditto) UNSUPPORTED
+ # x[y = z] (tests assignment operator) (ditto) UNSUPPORTED
+ # x[++y] (tests pre-increment operator) (ditto) UNSUPPORTED
+ # x[--y] (tests pre-decrement operator) (ditto) UNSUPPORTED
+ # x[y++] (tests post-increment operator) (ditto) UNSUPPORTED
+ # x[y--] (tests post-decrement operator) (ditto) UNSUPPORTED
+ # x[+y] (tests unary plus) (ditto)
+ # x[-y] (tests unary minus) (ditto)
+ # x[!y] (tests logical not) (ditto) UNSUPPORTED
+ # x[~y] (tests binary not) (ditto) UNSUPPORTED
+ # x[(y, z)] (tests comma expression) (ditto)
+ # cast expr
+ # stack data
+
+ gdb_collect_expression_test globals_test_func \
+ "globalstruct.memberi" "82" "a.b"
+ gdb_collect_expression_test globals_test_func \
+ "globalp->memberc" "81 'Q'" "a->b"
+ gdb_collect_expression_test globals_test_func \
+ "globalarr\[2\]" "2" "a\[2\]"
+ gdb_collect_expression_test globals_test_func \
+ "globalarr\[l3\]" "3" "a\[b\]"
+ gdb_collect_expression_test globals_test_func \
+ "globalarr\[l3 + l2\]" "5" "a\[b + c\]"
+ gdb_collect_expression_test globals_test_func \
+ "globalarr\[l3 - l2\]" "1" "a\[b - c\]"
+ gdb_collect_expression_test globals_test_func \
+ "globalarr\[l3 * l2\]" "6" "a\[b * c\]"
+ gdb_collect_expression_test globals_test_func \
+ "globalarr\[l6 / l3\]" "2" "a\[b / c\]"
+ gdb_collect_expression_test globals_test_func \
+ "globalarr\[l7 % l3\]" "1" "a\[b % c\]"
+ gdb_collect_expression_test globals_test_func \
+ "globalarr\[+l1\]" "1" "a\[+b\]"
+ gdb_collect_expression_test globals_test_func \
+ "globalarr\[-lminus\]" "2" "a\[-b\]"
+ gdb_collect_expression_test globals_test_func \
+ "globalarr\[\(l6, l7\)\]" "7" "a\[\(b, c\)\]"
+
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+
+# Body of test encased in a proc so we can return prematurely.
+gdb_trace_collection_test
+
+# Finished!
+gdb_test "tfind none" "" ""
+
+
+
diff --git a/gdb/testsuite/gdb.trace/configure b/gdb/testsuite/gdb.trace/configure
new file mode 100755
index 00000000000..417620553ee
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/configure
@@ -0,0 +1,899 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.12.1
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+for ac_option
+do
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ case "$ac_option" in
+ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) ac_optarg= ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case "$ac_option" in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir="$ac_optarg" ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build="$ac_optarg" ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file="$ac_optarg" ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir="$ac_optarg" ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ eval "enable_${ac_feature}=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+ fi
+ ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_${ac_feature}='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix="$ac_optarg" ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he)
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+ --cache-file=FILE cache test results in FILE
+ --help print this message
+ --no-create do not create output files
+ --quiet, --silent do not print \`checking...' messages
+ --version print the version of autoconf that created configure
+Directory and file names:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+EOF
+ cat << EOF
+Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
+Features and packages:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+EOF
+ if test -n "$ac_help"; then
+ echo "--enable and --with options recognized:$ac_help"
+ fi
+ exit 0 ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host="$ac_optarg" ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir="$ac_optarg" ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir="$ac_optarg" ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir="$ac_optarg" ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir="$ac_optarg" ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir="$ac_optarg" ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir="$ac_optarg" ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir="$ac_optarg" ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix="$ac_optarg" ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix="$ac_optarg" ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix="$ac_optarg" ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name="$ac_optarg" ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir="$ac_optarg" ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir="$ac_optarg" ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site="$ac_optarg" ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir="$ac_optarg" ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir="$ac_optarg" ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target="$ac_optarg" ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers)
+ echo "configure generated by autoconf version 2.12.1"
+ exit 0 ;;
+
+ -with-* | --with-*)
+ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case "$ac_option" in
+ *=*) ;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_${ac_package}='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ # Reject names that are not valid shell variable names.
+ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+ fi
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ eval "with_${ac_package}=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes="$ac_optarg" ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries="$ac_optarg" ;;
+
+ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ ;;
+
+ *)
+ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+ echo "configure: warning: $ac_option: invalid host type" 1>&2
+ fi
+ if test "x$nonopt" != xNONE; then
+ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+ fi
+ nonopt="$ac_option"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+ exec 6>/dev/null
+else
+ exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+ case "$ac_arg" in
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c) ;;
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+ ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set. These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=collection.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_prog=$0
+ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ else
+ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ echo "loading site script $ac_site_file"
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ echo "loading cache $cache_file"
+ . $cache_file
+else
+ echo "creating cache $cache_file"
+ > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+ ac_n= ac_c='
+' ac_t=' '
+ else
+ ac_n=-n ac_c= ac_t=
+ fi
+else
+ ac_n= ac_c='\c' ac_t=
+fi
+
+
+
+CC=${CC-cc}
+
+ac_aux_dir=
+for ac_dir in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { echo "configure: error: can not find install-sh or install.sh in `cd $srcdir;pwd`/../../.. $srcdir/`cd $srcdir;pwd`/../../.." 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+# configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+# same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+# as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:573: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+ case $nonopt in
+ NONE)
+ if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) host_alias=$nonopt ;;
+ esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:594: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+ case $nonopt in
+ NONE) target_alias=$host_alias ;;
+ *) target_alias=$nonopt ;;
+ esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:612: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+ case $nonopt in
+ NONE) build_alias=$host_alias ;;
+ *) build_alias=$nonopt ;;
+ esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs. It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already. You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+ case `(ac_space=' '; set) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote substitution
+ # turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ -e "s/'/'\\\\''/g" \
+ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+ ;;
+ esac >> confcache
+if cmp -s $cache_file confcache; then
+ :
+else
+ if test -w $cache_file; then
+ echo "updating cache $cache_file"
+ cat confcache > $cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+# Transform confdefs.h into DEFS.
+# Protect against shell expansion while executing Makefile rules.
+# Protect against Makefile macro expansion.
+cat > conftest.defs <<\EOF
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g
+s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g
+s%\[%\\&%g
+s%\]%\\&%g
+s%\$%$$%g
+EOF
+DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
+rm -f conftest.defs
+
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+ echo "$CONFIG_STATUS generated by autoconf version 2.12.1"
+ exit 0 ;;
+ -help | --help | --hel | --he | --h)
+ echo "\$ac_cs_usage"; exit 0 ;;
+ *) echo "\$ac_cs_usage"; exit 1 ;;
+ esac
+done
+
+ac_given_srcdir=$srcdir
+
+trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@CC@%$CC%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+ else
+ sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ fi
+ if test ! -s conftest.s$ac_file; then
+ ac_more_lines=false
+ rm -f conftest.s$ac_file
+ else
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f conftest.s$ac_file"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+ fi
+ ac_file=`expr $ac_file + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_cmds`
+ fi
+done
+if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case "$ac_file" in
+ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+ *) ac_file_in="${ac_file}.in" ;;
+ esac
+
+ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+ # The file is in a subdirectory.
+ test ! -d "$ac_dir" && mkdir "$ac_dir"
+ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+ else
+ ac_dir_suffix= ac_dots=
+ fi
+
+ case "$ac_given_srcdir" in
+ .) srcdir=.
+ if test -z "$ac_dots"; then top_srcdir=.
+ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+ *) # Relative path.
+ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+ top_srcdir="$ac_dots$ac_given_srcdir" ;;
+ esac
+
+
+ echo creating "$ac_file"
+ rm -f "$ac_file"
+ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+ case "$ac_file" in
+ *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+ *) ac_comsub= ;;
+ esac
+
+ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+ sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+
+exit 0
+EOF
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
diff --git a/gdb/testsuite/gdb.trace/configure.in b/gdb/testsuite/gdb.trace/configure.in
new file mode 100644
index 00000000000..6d0eae2674b
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/configure.in
@@ -0,0 +1,15 @@
+dnl Process this file file with autoconf to produce a configure script.
+dnl This file is a shell script fragment that supplies the information
+dnl necessary to tailor a template configure script into the configure
+dnl script appropriate for this directory. For more information, check
+dnl any existing configure script.
+
+AC_PREREQ(2.5)
+AC_INIT(collection.c)
+
+CC=${CC-cc}
+AC_SUBST(CC)
+AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../../..)
+AC_CANONICAL_SYSTEM
+
+AC_OUTPUT(Makefile)
diff --git a/gdb/testsuite/gdb.trace/deltrace.exp b/gdb/testsuite/gdb.trace/deltrace.exp
new file mode 100644
index 00000000000..58a69ba2442
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/deltrace.exp
@@ -0,0 +1,269 @@
+# Copyright 1998, 1999 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp";
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+
+if [istarget "m68k-*-elf"] then {
+ set srcfile gdb_c_test.c
+ set binfile [board_info target d490_binfile];
+} else {
+ set testfile "actions"
+ set srcfile ${testfile}.c
+ set binfile $objdir/$subdir/$testfile
+ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# If testing on a remote host, download the source file.
+# remote_download host $srcdir/$subdir/$srcfile
+
+gdb_file_cmd $binfile
+
+# define relative source line numbers:
+# all subsequent line numbers are relative to this first one (baseline)
+set baseline [gdb_find_recursion_test_baseline $srcfile];
+if { $baseline == -1 } then {
+ fail "Could not find gdb_recursion_test function"
+ return;
+}
+set testline1 [expr $baseline + 4]
+
+#
+# test "delete tracepoints" command
+#
+
+# 3.1 delete tracepoints (all)
+gdb_delete_tracepoints
+gdb_test "trace gdb_c_test" "Tracepoint \[0-9\]+ at .*" "set tracepoint 1"
+gdb_test "trace gdb_asm_test" "Tracepoint \[0-9\]+ at .*" "set tracepoint 2"
+gdb_test "trace $testline1" "Tracepoint \[0-9\]+ at .*" "set tracepoint 3"
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*\[0-9\]+\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_c_test.*\[0-9\]+\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*\[0-9\]+\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_recursion_test.*" \
+ "3.1a: set three tracepoints"
+
+send_gdb "delete tracepoints\n"
+gdb_expect 30 {
+ -re "Delete all tracepoints.*y or n.*$" {
+ send_gdb "y\n"
+ gdb_expect 30 {
+ -re "$gdb_prompt $" {
+ pass "3.1b: delete all tracepoints"
+ }
+ timeout { fail "3.1b: delete all tracepoints (timeout)" }
+ }
+ }
+ -re "$gdb_prompt $" { # This should only happen if there are no tracepoints
+ fail "3.1b: delete all tracepoints (no tracepoints?)"
+ }
+ timeout { fail "3.1b: delete all tracepoints (timeout)" }
+}
+
+# 3.2 delete tracepoint <n>
+gdb_delete_tracepoints
+set trcpt1 [gdb_gettpnum gdb_c_test];
+set trcpt2 [gdb_gettpnum gdb_asm_test];
+set trcpt3 [gdb_gettpnum $testline1];
+if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
+ fail "setting tracepoints"
+ return;
+}
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in.*gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in.*gdb_recursion_test.*" \
+ "3.2a: set three tracepoints"
+
+#gdb_test "delete tracepoint $trcpt1" "" ""
+send_gdb "delete tracepoint $trcpt1\n"
+gdb_expect {
+ -re "No tracepoint number.*$gdb_prompt $" {
+ fail "3.2b: delete first tracepoint"
+ }
+ -re ".*\[Ee\]rror.*$gdb_prompt $" {
+ fail "3.2b: delete first tracepoint"
+ }
+ -re "$gdb_prompt $" {
+ pass "3.2b: delete first tracepoint"
+ }
+ timeout {
+ fail "3.2b: delete first tracepoint (timeout)"
+ }
+}
+
+send_gdb "info tracepoints\n"
+gdb_expect {
+ -re "$trcpt1\[\t \]+y\[\t \]+0x.*in.*gdb_c_test.*$gdb_prompt $" {
+ fail "3.2c: verify delete first tracepoint (argh)"
+ }
+ -re "$trcpt2\[\t \]+y.*gdb_asm_test.*\[\r\n\t ]+$trcpt3\[\t \]+y.* in gdb_recursion_test at .*$gdb_prompt $" {
+ pass "3.2c: verify delete first tracepoint"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "3.2c: verify delete first tracepoint (mumble)"
+ }
+ timeout {
+ fail "3.2c: verify delete first tracepoint (timeout)"
+ }
+}
+
+#gdb_test "delete tracepoint $trcpt2" "" ""
+send_gdb "delete tracepoint $trcpt2\n"
+gdb_expect {
+ -re "No tracepoint number.*$gdb_prompt $" {
+ fail "3.2d: delete second tracepoint"
+ }
+ -re ".*\[Ee\]rror.*$gdb_prompt $" {
+ fail "3.2d: delete second tracepoint"
+ }
+ -re "$gdb_prompt $" {
+ pass "3.2d: delete second tracepoint"
+ }
+ timeout {
+ fail "3.2d: delete second tracepoint (timeout)"
+ }
+}
+
+send_gdb "info tracepoints\n"
+gdb_expect {
+ -re "$trcpt1\[\t \]+y\[\t \]+0x.*in.*gdb_c_test.*$gdb_prompt $" {
+ fail "3.2e: verify delete second tracepoint"
+ }
+ -re "$trcpt2\[\t \]+y\[\t \]+0x.*in gdb_asm_test.*$gdb_prompt $" {
+ fail "3.2e: verify delete second tracepoint"
+ }
+ -re "$trcpt3\[\t \]+y\[\t \]+0x.*in gdb_recursion_test.*$gdb_prompt $" {
+ pass "3.2e: verify delete second tracepoint"
+ }
+ -re "$gdb_prompt $" {
+ fail "3.2e: verify delete second tracepoint"
+ }
+ timeout {
+ fail "3.2e: verify delete second tracepoint (timeout)"
+ }
+}
+
+#gdb_test "delete tracepoint $trcpt3" "" ""
+send_gdb "delete tracepoint $trcpt3\n"
+gdb_expect {
+ -re "No tracepoint number.*$gdb_prompt $" {
+ fail "3.2f: delete third tracepoint"
+ }
+ -re ".*\[Ee\]rror.*$gdb_prompt $" {
+ fail "3.2f: delete third tracepoint"
+ }
+ -re "$gdb_prompt $" {
+ pass "3.2f: delete third tracepoint"
+ }
+ timeout {
+ fail "3.2f: delete third tracepoint (timeout)"
+ }
+}
+
+# send_gdb "ARF! \\n\n"
+send_gdb "info tracepoints\n"
+gdb_expect {
+ -re "$trcpt3\[\t \]+y\[\t \]+0x.*in gdb_recursion_test.*$gdb_prompt $" {
+ fail "3.2g: verify delete third tracepoint"
+ }
+ -re "$gdb_prompt $" {
+ pass "3.2g: verify delete third tracepoint"
+ }
+ timeout {
+ fail "3.2g: verify delete third tracepoint (timeout)"
+ }
+}
+
+# 3.3 delete three tracepoints at once
+gdb_delete_tracepoints
+set trcpt1 [gdb_gettpnum gdb_c_test];
+set trcpt2 [gdb_gettpnum gdb_asm_test];
+set trcpt3 [gdb_gettpnum $testline1];
+if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
+ fail "setting tracepoints"
+ return;
+}
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_recursion_test.*" \
+ "3.3a: set three tracepoints"
+
+#gdb_test "delete tracepoint $trcpt1 $trcpt2 $trcpt3" "" ""
+send_gdb "delete tracepoint $trcpt1 $trcpt2 $trcpt3\n"
+gdb_expect {
+ -re "No tracepoint number.*$gdb_prompt $" {
+ fail "3.3b: delete three tracepoints"
+ }
+ -re ".*\[Ee\]rror.*$gdb_prompt $" {
+ fail "3.3b: delete three tracepoints"
+ }
+ -re "$gdb_prompt $" {
+ pass "3.3b: delete three tracepoints"
+ }
+ timeout {
+ fail "3.3b: delete three tracepoint (timeout)"
+ }
+}
+
+send_gdb "info tracepoints\n"
+gdb_expect {
+ -re "$trcpt1\[\t \]+y\[\t \]+0x.*in gdb_c_test.*$gdb_prompt $" {
+ fail "3.3c: verify delete three tracepoints (first one persists)"
+ }
+ -re "$trcpt2\[\t \]+y\[\t \]+0x.*in gdb_asm_test.*$gdb_prompt $" {
+ fail "3.3c: verify delete three tracepoints (second one persists)"
+ }
+ -re "$trcpt3\[\t \]+y\[\t \]+0x.*in gdb_recursion_test.*$gdb_prompt $" {
+ fail "3.3c: verify delete three tracepoints (third one persists)"
+ }
+ -re "$gdb_prompt $" {
+ pass "3.3c: verify delete three tracepoints"
+ }
+ timeout {
+ fail "3.3c: verify delete three tracepoints (timeout)"
+ }
+}
+
+# 3.4 delete invalid tracepoint number
+gdb_test "delete tracepoint [expr $trcpt2 + $trcpt3]" \
+ "No tracepoint number [expr $trcpt2 + $trcpt3]." \
+ "3.4: delete invalid tracepoint number"
+
+# 3.5 delete tracepoint number zero
+gdb_test "delete tracepoint 0" "bad tracepoint number at or near '0'" \
+ "3.5: delete tracepoint number zero"
+
+# 3.6 help delete tracepoints
+gdb_test "help delete tracepoints" \
+ "Delete specified tracepoints.*" \
+ "3.6: help delete tracepoints"
diff --git a/gdb/testsuite/gdb.trace/gdb_c_test.c b/gdb/testsuite/gdb.trace/gdb_c_test.c
new file mode 100644
index 00000000000..03382c27d77
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/gdb_c_test.c
@@ -0,0 +1,3792 @@
+/*
+ ******************************************************************************
+ ******************************************************************************
+ *
+ * COPYRIGHT (C) by EMC Corporation, 1997 All rights reserved.
+ * $Id$
+ * DESCRIPTION: This module has been provided for the purpose of testing GDB.
+ *
+ * NOTES:
+ *
+ ******************************************************************************
+ *****************************************************************************/
+
+/*=============================================================================
+ * INCLUDE FILES
+ *===========================================================================*/
+
+
+#ifdef DO_IT_BY_THE_BOOK
+
+
+#include "symtypes_defs.h"
+#include "printp.h"
+
+#include "adbg_expression.h"
+#include "common_hw_ds.h"
+#include "common_hw_defs.h"
+#include "evnttrac.h"
+#include "sym_scratch_ds.h"
+#include "symglob_ds.h"
+#include "sym_protglob_ds.h"
+
+#include "ether.h"
+
+#include <ctype.h>
+
+
+#else
+
+#include "adbg_dtc.h"
+
+#define YES 1
+#define NO 0
+
+#define TRUE 1
+#define FALSE 0
+
+#define ENABLED 1
+#define DISABLED 0
+
+#define CONTROL_C 3 /* ASCII 'ETX' */
+
+
+/*
+ * Faked after ctype.h
+ */
+
+#define isxdigit(X) (((X) >= '0' && (X) <= '9') || \
+ ((X) >= 'A' && (X) <= 'F') || \
+ ((X) >= 'a' && (X) <= 'f'))
+/*
+ * Borrowed from string.h
+ */
+
+extern unsigned int strlen ( const char * );
+
+/*
+ * Extracted from symtypes.h:
+ */
+
+typedef char BOOL; /* 8 Bits */
+typedef unsigned char UCHAR; /* 8 Bits */
+typedef unsigned short USHORT; /* 16 Bits */
+typedef unsigned long ULONG; /* 32 Bits */
+
+/*
+ * for struct t_expr_tag and
+ * decl of build_and_add_expression
+ */
+#include "adbg_expression.h"
+#define NULL 0
+
+/*
+ * Extracted from printp.h:
+ */
+
+extern void printp ( const char * fptr, ... );
+extern void sprintp ( const char * fptr, ... );
+
+/*
+ * Extracted from ether.h:
+ */
+
+extern long eth_to_gdb ( UCHAR *buf, long length );
+
+
+/*
+ * Derived from hwequs.s:
+ */
+
+#define CS_CODE_START 0x100000
+#define CS_CODE_SIZE 0x200000
+#define LAST_CS_WORD (CS_CODE_START + CS_CODE_SIZE - 2)
+
+#define sh_genstat1 (*((volatile ULONG *) 0xFFFFFE54))
+
+#define rs232_mode1 0 /* rs-232 mode 1 reg. */
+#define rs232_mode2 rs232_mode1 /* rs-232 mode 2 reg. */
+#define rs232_stat 4 /* rs-232 status reg. */
+#define rs232_clk rs232_stat /* rs-232 clock select reg. */
+#define rs232_cmd 8 /* rs-232 command reg */
+#define rs232_transmit 12 /* rs-232 transmit reg. */
+#define rs232_receive rs232_transmit /* rs-232 transmit reg. */
+#define rs232_aux 16 /* rs-232 aux control reg. */
+#define rs232_isr 20 /* rs-232 interrupt status reg. */
+#define rs232_imr rs232_isr /* rs-232 interrupt mask reg. */
+#define rs232_tc_high 24 /* rs-232 timer/counter high reg. */
+#define rs232_tc_low 28 /* rs-232 timer/counter low reg. */
+
+
+#endif
+
+
+/*============================================================================
+ * MODULE DEFINES
+ *===========================================================================*/
+
+#define P_RST_LAN_UART_REG ((volatile UCHAR *) 0xFFFFFE45)
+#define M_RST_LAN_UART 0x80 /* Bit 7 */
+
+#define P_LAN0TR_REG P_RST_LAN_UART_REG
+#define M_LAN0TR 0x20 /* Bit 5 */
+
+#define M_SH_GENCON_LAN0TR 0x00200000 /* Bit 21 */
+
+#define MAX_RS232_CHARS 512
+
+#define LAN_Q_MOD(X) ((X) % MAX_RS232_CHARS)
+
+/*---------------------------------------*
+ * LAN UART Registers *
+ *---------------------------------------*/
+
+#define LAN_UART_BASE ((ULONG) 0xfffffc22)
+
+/* Write-Read */
+
+#define P_LAN_MR1 ((volatile UCHAR *) (LAN_UART_BASE + ((ULONG) rs232_mode1 )))
+#define P_LAN_MR2 ((volatile UCHAR *) (LAN_UART_BASE + ((ULONG) rs232_mode2 )))
+
+/* Write-Only */
+
+#define P_LAN_ACR ((volatile UCHAR *) (LAN_UART_BASE + ((ULONG) rs232_aux )))
+#define P_LAN_CR ((volatile UCHAR *) (LAN_UART_BASE + ((ULONG) rs232_cmd )))
+#define P_LAN_CSR ((volatile UCHAR *) (LAN_UART_BASE + ((ULONG) rs232_clk )))
+#define P_LAN_CTLR ((volatile UCHAR *) (LAN_UART_BASE + ((ULONG) rs232_tc_low )))
+#define P_LAN_CTUR ((volatile UCHAR *) (LAN_UART_BASE + ((ULONG) rs232_tc_high )))
+#define P_LAN_IMR ((volatile UCHAR *) (LAN_UART_BASE + ((ULONG) rs232_imr )))
+
+/* Read-Only */
+
+#define P_LAN_SR ((volatile UCHAR *) (LAN_UART_BASE + ((ULONG) rs232_stat )))
+#define P_LAN_ISR ((volatile UCHAR *) (LAN_UART_BASE + ((ULONG) rs232_isr )))
+#define P_LAN_XMT ((volatile UCHAR *) (LAN_UART_BASE + ((ULONG) rs232_transmit)))
+#define P_LAN_RCV ((volatile UCHAR *) (LAN_UART_BASE + ((ULONG) rs232_receive )))
+
+/*
+ * Bit Values for Write-Read and Write-Only Registers
+ */
+
+#define DEFAULT_LAN_MR1 ((UCHAR) 0x13)
+#define DEFAULT_LAN_MR2 ((UCHAR) 0x07)
+#define DEFAULT_LAN_CSR ((UCHAR) 0xcc)
+#define DEFAULT_LAN_ACR ((UCHAR) 0x38)
+#define DEFAULT_LAN_CTUR ((UCHAR) 0xff)
+#define DEFAULT_LAN_CTLR ((UCHAR) 0xff)
+
+#define LAN_ACR_SELECT_BRG_0 DEFAULT_LAN_ACR
+#define LAN_ACR_SELECT_BRG_1 (DEFAULT_LAN_ACR | 0x80)
+
+#define UART_CR_RESET_MR_PTR ((UCHAR) 0x10) /* Reset MR pointer (points to MR1). */
+#define UART_CR_RESET_RVCR ((UCHAR) 0x20) /* Reset receiver (disabled). */
+#define UART_CR_RESET_XMTR ((UCHAR) 0x30) /* Reset transmitter (disabled). */
+#define UART_CR_RESET_ERROR_STATUS ((UCHAR) 0x40) /* Reset error status. */
+#define UART_CR_RESET_BRK_CHG_INT ((UCHAR) 0x50) /* Reset break change interrupt. */
+#define UART_CR_START_CNTR_TIMER ((UCHAR) 0x80) /* Start counter/timer. */
+#define UART_CR_STOP_CNTR ((UCHAR) 0x90) /* Stop counter. */
+
+#define UART_CR_DISABLE_XMTR ((UCHAR) 0x08) /* Disable transmitter. */
+#define UART_CR_ENABLE_XMTR ((UCHAR) 0x04) /* Enable transmitter. */
+#define UART_CR_DISABLE_RCVR ((UCHAR) 0x02) /* Disable receiver. */
+#define UART_CR_ENABLE_RCVR ((UCHAR) 0x01) /* Enable receiver. */
+
+#define UART_CSR_BR_4800 ((UCHAR) 0x99) /* With either BRG Set selected (via ACR). */
+#define UART_CSR_BR_9600 ((UCHAR) 0xbb) /* With either BRG Set selected (via ACR). */
+#define UART_CSR_BR_19200 ((UCHAR) 0xcc) /* With BRG Set '1' selected (via ACR). */
+#define UART_CSR_BR_38400 ((UCHAR) 0xcc) /* With BRG Set '0' selected (via ACR). */
+
+#define UART_IMR_RxRDY ((UCHAR) 0x04) /* Enable 'RxRDY' interrupt. */
+#define UART_IMR_TxEMT ((UCHAR) 0x02) /* Enable 'TxEMT' interrupt. */
+#define UART_IMR_TxRDY ((UCHAR) 0x01) /* Enable 'TxRDY' interrupt. */
+
+/*
+ * Bit Masks for Read-Only Registers
+ */
+
+#define M_UART_SR_RCVD_BRK 0x80 /* Bit 7 */
+#define M_UART_SR_FE 0x40 /* Bit 6 */
+#define M_UART_SR_PE 0x20 /* Bit 5 */
+#define M_UART_SR_OE 0x10 /* Bit 4 */
+#define M_UART_SR_TxEMT 0x08 /* Bit 3 */
+#define M_UART_SR_TxRDY 0x04 /* Bit 2 */
+#define M_UART_SR_FFULL 0x02 /* Bit 1 */
+#define M_UART_SR_RxRDY 0x01 /* Bit 0 */
+
+#define M_UART_ISR_RxRDY 0x04 /* Bit 2 */
+#define M_UART_ISR_TxEMT 0x02 /* Bit 1 */
+#define M_UART_ISR_TxRDY 0x01 /* Bit 0 */
+
+/*---------------------------------------*
+ * Support for 'Utility 83'. *
+ *---------------------------------------*/
+
+#define LAN_UTIL_CODE 0x83
+
+#define LAN_INIT ((ULONG) (('I' << 24) | ('N' << 16) | ('I' << 8) | 'T'))
+#define LAN_BAUD ((ULONG) (('B' << 24) | ('A' << 16) | ('U' << 8) | 'D'))
+#define LAN_INTR ((ULONG) (('I' << 24) | ('N' << 16) | ('T' << 8) | 'R'))
+#define LAN_XMT ((ULONG) (('X' << 16) | ('M' << 8) | 'T'))
+#define LAN_ECHO ((ULONG) (('E' << 24) | ('C' << 16) | ('H' << 8) | 'O'))
+#define LAN_STAT ((ULONG) (('S' << 24) | ('T' << 16) | ('A' << 8) | 'T'))
+#define LAN_IN ((ULONG) (('I' << 8) | 'N'))
+#define LAN_OUT ((ULONG) (('O' << 16) | ('U' << 8) | 'T'))
+
+#define LAN_PUTC ((ULONG) (('P' << 24) | ('U' << 16) | ('T' << 8) | 'C'))
+#define LAN_WPM ((ULONG) (('W' << 16) | ('P' << 8) | 'M'))
+
+#define STATUS(X) ( ( ( X ) == 0 ) ? "disabled" : "enabled" )
+
+#define XMT_VIA_BP_ENABLED() ( *P_LAN0TR_REG & M_LAN0TR ? 1 : 0 )
+
+#define TRAP_1_INST 0x4E41
+
+/*
+ * Bit #13 of shared genstat 1 indicates
+ * which processor we are as follows.
+ *
+ * 0 => X (side A)
+ * 1 => Y (side B)
+ */
+
+#define M_PROC_ID 0x00002000
+
+#define IS_SIDE_A() ( ( (sh_genstat1) & M_PROC_ID ) == 0 )
+#define IS_SIDE_B() ( (sh_genstat1) & M_PROC_ID )
+
+
+#ifdef STANDALONE /* Compile this module stand-alone for debugging */
+#define LAN_PUT_CHAR(X) printf("%c", X)
+#else
+#define LAN_PUT_CHAR(X) while ( lan_put_char( X ) )
+#endif
+
+
+
+
+#define VIA_RS232 0
+#define VIA_ETHERNET 1
+
+#define MAX_IO_BUF_SIZE 400
+
+#define MAX_BYTE_CODES 200 /* maximum length for bytecode string */
+
+
+static ULONG gdb_host_comm;
+
+static ULONG gdb_cat_ack;
+
+static char eth_outbuffer[ MAX_IO_BUF_SIZE + 1 ];
+
+
+#ifdef STANDALONE
+
+#define ACK_PKT() LAN_PUT_CHAR( '+' )
+#define NACK_PKT() LAN_PUT_CHAR( '-' )
+
+#else
+
+#define ACK_PKT() { \
+ if ( VIA_ETHERNET == gdb_host_comm ) \
+ { \
+ gdb_cat_ack = YES; \
+ } \
+ else \
+ { \
+ LAN_PUT_CHAR( '+' ); \
+ } \
+ }
+
+
+
+#define NACK_PKT() { \
+ if ( VIA_ETHERNET == gdb_host_comm ) \
+ { \
+ eth_outbuffer[ 0 ] = '-'; \
+ eth_to_gdb( (UCHAR *) eth_outbuffer, 1 ); \
+ } \
+ else \
+ { \
+ LAN_PUT_CHAR( '-' ); \
+ } \
+ }
+
+#endif
+
+
+
+
+/*============================================================================
+ * MODULE TYPEDEFS
+ *===========================================================================*/
+
+typedef struct rs232_queue {
+
+ long head_index;
+
+ long tail_index;
+
+ ULONG overflows;
+
+ long gdb_packet_start;
+ long gdb_packet_end;
+ long gdb_packet_csum1;
+ long gdb_packet_csum2;
+
+ UCHAR buf[ MAX_RS232_CHARS ];
+
+} T_RS232_QUEUE;
+
+
+
+
+/*=============================================================================
+ * EXTERNAL GLOBAL VARIABLES
+ *===========================================================================*/
+
+extern volatile UCHAR sss_trace_flag;
+
+
+/*=============================================================================
+ * STATIC MODULE DECLARATIONS
+ *===========================================================================*/
+
+static T_RS232_QUEUE lan_input_queue,
+ lan_output_queue;
+
+static BOOL test_echo;
+
+#if 0
+/* The stub no longer seems to use this. */
+static BOOL write_access_enabled;
+#endif
+
+static int baud_rate_idx;
+
+static ULONG tx_by_intr,
+ tx_by_poll;
+
+static UCHAR lan_shadow_imr;
+
+
+/*=============================================================================
+ * EXTERNAL FUNCTION PROTOTYPES
+ *===========================================================================*/
+
+extern long write_to_protected_mem( void *address, unsigned short value );
+
+
+/*=============================================================================
+ * MODULE GLOBAL FUNCTIONS PROTOTYPES
+ *===========================================================================*/
+
+ULONG gdb_c_test( ULONG *parm );
+
+
+void lan_init( void );
+
+void lan_isr( void );
+
+long lan_get_char( void );
+
+long lan_put_char( UCHAR c );
+
+ULONG lan_util( ULONG *parm );
+
+
+/*=============================================================================
+ * MODULE LOCAL FUNCTION PROTOTYPES
+ *===========================================================================*/
+
+static void lan_reset( void );
+
+static void lan_configure( void );
+
+static void lan_init_queue( T_RS232_QUEUE *p_queue );
+
+static void lan_add_to_queue( long c, T_RS232_QUEUE *p_queue );
+
+static UCHAR lan_next_queue_char( T_RS232_QUEUE *p_queue );
+
+static void lan_util_menu( void );
+
+static long get_gdb_input( long c, T_RS232_QUEUE *p_input_q );
+
+
+/*=============================================================================
+ * GDB STUB FUNCTION PROTOTYPES
+ *===========================================================================*/
+
+void gdb_trap_1_handler( void );
+void gdb_trace_handler ( void );
+
+void gdb_get_eth_input( unsigned char *buf, long length );
+
+static void getpacket ( void );
+static void putpacket ( char * );
+static void discard_packet ( void );
+
+#ifdef STANDALONE /* Compile this module stand-alone for debugging */
+#include <stdio.h>
+#define printp printf /* easier than declaring a local varargs stub func. */
+#endif /* STANDALONE */
+
+
+/*=============================================================================
+ * MODULE BODY
+ *===========================================================================*/
+
+/* ------------------- Things that belong in a header file --------------- */
+extern char *memset (char *, int, int);
+
+ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*
+ * *
+ * Global Module Functions *
+ * *
+ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+
+static char gdb_char_test;
+static short gdb_short_test;
+static long gdb_long_test;
+static char gdb_arr_test[25];
+static struct GDB_STRUCT_TEST
+{
+ char c;
+ short s;
+ long l;
+ int bfield : 11; /* collect bitfield */
+ char arr[25];
+ struct GDB_STRUCT_TEST *next;
+} gdb_struct1_test, gdb_struct2_test, *gdb_structp_test, **gdb_structpp_test;
+
+static union GDB_UNION_TEST
+{
+ char c;
+ short s;
+ long l;
+ int bfield : 11; /* collect bitfield */
+ char arr[4];
+ union GDB_UNION_TEST *next;
+} gdb_union1_test;
+
+void gdb_recursion_test (int, int, int, int, int, int, int);
+
+void gdb_recursion_test (int depth,
+ int q1,
+ int q2,
+ int q3,
+ int q4,
+ int q5,
+ int q6)
+{ /* gdb_recursion_test line 0 */
+ int q = q1; /* gdbtestline 1 */
+
+ q1 = q2; /* gdbtestline 2 */
+ q2 = q3; /* gdbtestline 3 */
+ q3 = q4; /* gdbtestline 4 */
+ q4 = q5; /* gdbtestline 5 */
+ q5 = q6; /* gdbtestline 6 */
+ q6 = q; /* gdbtestline 7 */
+ if (depth--) /* gdbtestline 8 */
+ gdb_recursion_test (depth, q1, q2, q3, q4, q5, q6); /* gdbtestline 9 */
+}
+
+
+ULONG gdb_c_test( ULONG *parm )
+
+{
+ char *p = "gdb_c_test";
+ char *ridiculously_long_variable_name_with_equally_long_string_assignment;
+ register long local_reg = 7;
+ static unsigned long local_static, local_static_sizeof;
+ long local_long;
+ unsigned long *stack_ptr;
+ unsigned long end_of_stack;
+
+ ridiculously_long_variable_name_with_equally_long_string_assignment =
+ "ridiculously long variable name with equally long string assignment";
+ local_static = 9;
+ local_static_sizeof = sizeof (struct GDB_STRUCT_TEST);
+ local_long = local_reg + 1;
+ stack_ptr = (unsigned long *) &local_long;
+ end_of_stack =
+ (unsigned long) &stack_ptr + sizeof(stack_ptr) + sizeof(end_of_stack) - 1;
+
+ printp ("\n$Id$\n");
+
+ printp( "%s: arguments = %X, %X, %X, %X, %X, %X\n",
+ p, parm[ 1 ], parm[ 2 ], parm[ 3 ], parm[ 4 ], parm[ 5 ], parm[ 6 ] );
+
+ gdb_char_test = gdb_struct1_test.c = (char) ((long) parm[1] & 0xff);
+ gdb_short_test = gdb_struct1_test.s = (short) ((long) parm[2] & 0xffff);
+ gdb_long_test = gdb_struct1_test.l = (long) ((long) parm[3] & 0xffffffff);
+ gdb_union1_test.l = (long) parm[4];
+ gdb_arr_test[0] = gdb_struct1_test.arr[0] = (char) ((long) parm[1] & 0xff);
+ gdb_arr_test[1] = gdb_struct1_test.arr[1] = (char) ((long) parm[2] & 0xff);
+ gdb_arr_test[2] = gdb_struct1_test.arr[2] = (char) ((long) parm[3] & 0xff);
+ gdb_arr_test[3] = gdb_struct1_test.arr[3] = (char) ((long) parm[4] & 0xff);
+ gdb_arr_test[4] = gdb_struct1_test.arr[4] = (char) ((long) parm[5] & 0xff);
+ gdb_arr_test[5] = gdb_struct1_test.arr[5] = (char) ((long) parm[6] & 0xff);
+ gdb_struct1_test.bfield = 144;
+ gdb_struct1_test.next = &gdb_struct2_test;
+ gdb_structp_test = &gdb_struct1_test;
+ gdb_structpp_test = &gdb_structp_test;
+
+ gdb_recursion_test (3, (long) parm[1], (long) parm[2], (long) parm[3],
+ (long) parm[4], (long) parm[5], (long) parm[6]);
+
+ gdb_char_test = gdb_short_test = gdb_long_test = 0;
+ gdb_structp_test = (void *) 0;
+ gdb_structpp_test = (void *) 0;
+ memset ((char *) &gdb_struct1_test, 0, sizeof (gdb_struct1_test));
+ memset ((char *) &gdb_struct2_test, 0, sizeof (gdb_struct2_test));
+ local_static_sizeof = 0;
+ local_static = 0;
+ return ( (ULONG) 0 );
+}
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * FUNCTION NAME: lan_init
+ *
+ *
+ * DESCRIPTION:
+ *
+ *
+ * RETURN VALUE:
+ *
+ *
+ * USED GLOBAL VARIABLES:
+ *
+ *
+ * AFFECTED GLOBAL VARIABLES/SIDE EFFECTS:
+ *
+ *
+ * NOTES:
+ *
+ *
+ *
+ *---------------------------------------------------------------------------*/
+
+void lan_init( void )
+
+{
+
+ if ( IS_SIDE_A( ) )
+ {
+
+ lan_reset( );
+
+ lan_init_queue( &lan_input_queue );
+
+ lan_init_queue( &lan_output_queue );
+
+ lan_configure( );
+ }
+
+ return;
+}
+/* end of 'lan_init'
+ *===========================================================================*/
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * FUNCTION NAME: lan_isr
+ *
+ *
+ * DESCRIPTION:
+ *
+ *
+ * RETURN VALUE: None.
+ *
+ *
+ * USED GLOBAL VARIABLES:
+ *
+ *
+ * AFFECTED GLOBAL VARIABLES/SIDE EFFECTS:
+ *
+ *
+ * NOTES:
+ *
+ *
+ *---------------------------------------------------------------------------*/
+
+void lan_isr( void )
+
+{
+ UCHAR c;
+
+
+ lan_shadow_imr = 0; /* Disable all UART interrupts. */
+ *P_LAN_IMR = lan_shadow_imr;
+
+
+ if ( *P_LAN_ISR & M_UART_ISR_RxRDY )
+ {
+
+ gdb_host_comm = VIA_RS232;
+
+ c = *P_LAN_RCV;
+
+ if ( test_echo )
+ {
+ /* ????? */
+ }
+
+ if ( c == CONTROL_C )
+ {
+ /* can't stop the target, but we can tell gdb to stop waiting... */
+ discard_packet( );
+ putpacket( "S03" ); /* send back SIGINT to the debugger */
+ }
+
+ else
+ {
+ lan_add_to_queue( (long) c, &lan_input_queue );
+ get_gdb_input( (long) c, &lan_input_queue );
+ }
+
+ }
+
+ if ( XMT_VIA_BP_ENABLED( ) )
+ {
+
+ c = 0;
+
+ while ( (*P_LAN_ISR & M_UART_ISR_TxRDY) && (c = lan_next_queue_char( &lan_output_queue )) )
+ {
+ *P_LAN_XMT = c;
+ ++tx_by_intr;
+ }
+
+ if ( c )
+ {
+ lan_shadow_imr |= UART_IMR_TxRDY; /* (Re-)Enable 'TxRDY' interrupt from UART. */
+ }
+
+ }
+
+
+ lan_shadow_imr |= UART_IMR_RxRDY; /* Re-Enable 'RxRDY' interrupt from UART. */
+ *P_LAN_IMR = lan_shadow_imr;
+
+
+
+ return;
+}
+/* end of 'lan_isr'
+ *===========================================================================*/
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * FUNCTION NAME: lan_get_char
+ *
+ *
+ * DESCRIPTION: Fetches a character from the UART.
+ *
+ *
+ * RETURN VALUE: 0 on success, -1 on failure.
+ *
+ *
+ * USED GLOBAL VARIABLES:
+ *
+ *
+ * AFFECTED GLOBAL VARIABLES/SIDE EFFECTS:
+ *
+ *
+ * NOTES:
+ *
+ *
+ *---------------------------------------------------------------------------*/
+
+long lan_get_char( void )
+
+{
+ long status = -2; /* AGD: nothing found in rcv buffer */
+
+ if ( *P_LAN_SR & M_UART_SR_RxRDY )
+ {
+ char c = (char) *P_LAN_RCV;
+
+ if ( test_echo )
+ {
+ LAN_PUT_CHAR ( c );
+ }
+
+ if ( c == CONTROL_C )
+ {
+ /* can't stop the target, but we can tell gdb to stop waiting... */
+ discard_packet( );
+ putpacket( "S03" ); /* send back SIGINT to the debugger */
+ status = 0; /* success */
+ }
+
+ else
+ {
+ lan_add_to_queue( (long) c, &lan_input_queue );
+ status = get_gdb_input( (long) c, &lan_input_queue );
+ }
+
+ }
+
+ return( status );
+}
+/* end of 'lan_get_char'
+ *===========================================================================*/
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * FUNCTION NAME: lan_put_char
+ *
+ * DESCRIPTION: Puts a character out via the UART.
+ *
+ * RETURN VALUE: 0 on success, -1 on failure.
+ *
+ * USED GLOBAL VARIABLES: none.
+ *
+ * AFFECTED GLOBAL VARIABLES/SIDE EFFECTS:
+ *
+ * NOTES: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ * !! !!
+ * !! If 'XMT_VIA_BP_ENABLED()' is FALSE then output is THROWN AWAY. !!
+ * !! This prevents anyone infinite-looping on this function. !!
+ * !! !!
+ * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ *
+ *---------------------------------------------------------------------------*/
+
+long lan_put_char( UCHAR c )
+
+{
+ long status = -1;
+
+ if ( XMT_VIA_BP_ENABLED( ) )
+ {
+
+ if ( *P_LAN_SR & M_UART_SR_TxRDY )
+ {
+ lan_add_to_queue( (long) c, &lan_output_queue );
+
+ c = lan_next_queue_char( &lan_output_queue );
+
+ *P_LAN_XMT = c;
+ ++tx_by_poll;
+ status = 0;
+ }
+#if 0
+ else
+ {
+ status = 0;
+ lan_shadow_imr |= UART_IMR_TxRDY; /* Enable 'TxRDY' interrupt from UART. */
+ *P_LAN_IMR = lan_shadow_imr;
+ }
+#endif
+ }
+
+ else
+ {
+ status = 0; /* You lose: input character goes to the bit bucket. */
+ }
+
+ return( status );
+}
+/* end of 'lan_put_char'
+ *===========================================================================*/
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * FUNCTION NAME: lan_util
+ *
+ * DESCRIPTION:
+ *
+ * RETURN VALUE:
+ *
+ * USED GLOBAL VARIABLES:
+ *
+ * AFFECTED GLOBAL VARIABLES/SIDE EFFECTS:
+ *
+ * NOTES:
+ *
+ *---------------------------------------------------------------------------*/
+
+ULONG lan_util( ULONG *parm )
+
+{
+
+
+ static const struct {
+
+ ULONG rate_code;
+ UCHAR acr_setting;
+ UCHAR csr_setting;
+
+ } baud_rate_setting [] = {
+
+ { 0x38400, LAN_ACR_SELECT_BRG_0, UART_CSR_BR_38400 },
+ { 0x19200, LAN_ACR_SELECT_BRG_1, UART_CSR_BR_19200 },
+ { 0x9600, LAN_ACR_SELECT_BRG_0, UART_CSR_BR_9600 },
+ { 0x4800, LAN_ACR_SELECT_BRG_0, UART_CSR_BR_4800 }
+ };
+
+
+#define BOGUS_P1 0xE1
+#define BOGUS_P2 0xE2
+
+ ULONG not_done_code;
+
+
+ ULONG opcode;
+ ULONG parm_1;
+ ULONG parm_2;
+
+ int i;
+ UCHAR c;
+
+
+ not_done_code = 0;
+
+ opcode = parm[ 1 ];
+ parm_1 = parm[ 2 ];
+ parm_2 = parm[ 3 ];
+
+
+ switch ( opcode )
+ {
+
+ case LAN_INIT:
+ {
+
+ lan_init( );
+ printp( "\n\n Interface (Re)Initialized ...\n\n" );
+
+ break;
+ }
+
+
+ case LAN_BAUD:
+ {
+
+ for ( i = 0; i < (int)(sizeof(baud_rate_setting) / sizeof(baud_rate_setting[0])); i ++ )
+ {
+ if ( baud_rate_setting[i].rate_code == parm_1 )
+ {
+ baud_rate_idx = i;
+ *P_LAN_ACR = baud_rate_setting[i].acr_setting;
+ *P_LAN_CSR = baud_rate_setting[i].csr_setting;
+ printp ( "Baud rate set to %X!\n", baud_rate_setting[i].rate_code );
+ return( not_done_code );
+ }
+ }
+
+ printp( "\n\n *** SYNTAX Error - Invalid baudrate (P2)\n\n" );
+ not_done_code = BOGUS_P2;
+
+ break;
+ }
+
+
+ case LAN_INTR:
+ {
+
+ switch ( parm_1 )
+ {
+
+ case 0x0D: /* Disable 'RxRDY' Interrupts */
+ {
+ lan_shadow_imr &= ~UART_IMR_RxRDY;
+ *P_LAN_IMR = lan_shadow_imr;
+ printp( "\n\n Receive Ready Interrupts DISABLED ...\n\n" );
+ break;
+ }
+
+ case 0x0E: /* Enable 'RxRDY' Interrupts */
+ {
+ lan_shadow_imr |= UART_IMR_RxRDY;
+ *P_LAN_IMR = lan_shadow_imr;
+ printp( "\n\n Receive Ready Interrupts ENABLED ...\n\n" );
+ break;
+ }
+
+ default:
+ {
+ printp( "\n\n *** SYNTAX Error - Invalid P2 (use D or E)\n\n" );
+ not_done_code = BOGUS_P2;
+ }
+ }
+
+ break;
+ }
+
+
+ case LAN_XMT:
+ {
+
+ switch ( parm_1 )
+ {
+
+ case 0x0E: /* Enable Transmission-via-Backplane */
+ {
+ if ( !(*P_LAN0TR_REG & M_LAN0TR) )
+ {
+ *P_LAN0TR_REG |= M_LAN0TR; /* 0 -> 1 */
+ }
+
+ printp( "\n\n Transmit-via-Backplane ENABLED ...\n\n" );
+ break;
+ }
+
+ case 0x0D: /* Disable Transmission-via-Backplane */
+ {
+ if ( *P_LAN0TR_REG & M_LAN0TR )
+ {
+ *P_LAN0TR_REG &= ~M_LAN0TR; /* 1 -> 0 */
+ }
+
+ printp( "\n\n Transmit-via-Backplane DISABLED ...\n\n" );
+ break;
+ }
+
+ default:
+ {
+ printp( "\n\n *** SYNTAX Error - Invalid P2 (use D or E)\n\n" );
+ not_done_code = BOGUS_P2;
+ lan_util_menu( );
+ }
+ }
+
+ break;
+ }
+
+
+ case LAN_STAT:
+ {
+
+ printp( "\n -- Status --\n\n" );
+
+ printp( " Baud Rate: %X *\n", baud_rate_setting[ baud_rate_idx ].rate_code );
+ printp( " Xmt-via-BP: %s *\n", STATUS( XMT_VIA_BP_ENABLED( ) ) );
+ printp( " RxRdy Intr: %s *\n", STATUS( (lan_shadow_imr & M_UART_ISR_RxRDY) ) );
+ /*** printp( " TxRdy Intr: %s\n", STATUS( (lan_shadow_imr & M_UART_ISR_TxRDY) ) ); ***/
+ printp( " Echo: %s *\n\n", STATUS( test_echo ) );
+
+ printp( " IMR: %02X\n", (ULONG) lan_shadow_imr );
+ printp( " ISR: %02X\n", (ULONG) *P_LAN_ISR );
+ printp( " SR: %02X\n\n", (ULONG) *P_LAN_SR );
+
+ printp( " Input Overflows: %d\n\n", lan_input_queue.overflows );
+
+ printp( " Tx by Intr: %d\n", tx_by_intr );
+ printp( " Tx by Poll: %d\n\n", tx_by_poll );
+
+ printp( " * Can be set or toggled via Utility %2X.\n\n", (ULONG) LAN_UTIL_CODE );
+
+ break;
+ }
+
+
+ case LAN_IN:
+ {
+
+ switch ( parm_1 )
+ {
+
+ case 0x0C: /* Clear and Reset Queue */
+ {
+ lan_init_queue( &lan_input_queue );
+ printp( "\n\n Queue CLEARED/RESET ...\n\n" );
+ break;
+ }
+
+ case 0x0D: /* Display Queue */
+ {
+ printp( "\n -- Input Queue --\n" );
+ printp( "\n Head Index: %8X Tail Index: %8X\n\n ",
+ (ULONG) lan_input_queue.head_index, (ULONG) lan_input_queue.tail_index );
+
+ for ( i = 0; i < MAX_RS232_CHARS; ++i )
+ {
+ printp( " %02X", (ULONG) lan_input_queue.buf[ i ] );
+
+ if ( 15 == (i % 16) )
+ {
+ int j;
+
+ printp ( " " );
+ for ( j = i - 15; j <= i; j++ )
+ {
+ if ( lan_input_queue.buf[ j ] >= ' ' &&
+ lan_input_queue.buf[ j ] < 127 )
+ printp ( "%c", lan_input_queue.buf[ j ] );
+ else
+ printp ( "." );
+ }
+ printp( "\n " );
+ }
+
+ else if ( 7 == (i % 8) )
+ {
+ printp( " " );
+ }
+
+ }
+
+ printp( "\n" );
+
+ break;
+ }
+
+ case 0x0F: /* Fetch next character in Queue */
+ {
+ c = lan_next_queue_char( &lan_input_queue );
+
+ if ( c )
+ {
+ printp( "\n\n Next Character: " );
+ if ( 0x21 <= c && c <= 0x7F )
+ {
+ printp( "%c\n\n", (ULONG) c );
+ }
+
+ else if ( 0x20 == ((UCHAR) c) )
+ {
+ printp( "<space>\n\n" );
+ }
+
+ else
+ {
+ printp( "%02X\n\n", (ULONG) c );
+ }
+ }
+
+ else
+ {
+ printp( "\n\n Input Queue EMPTY ...\n\n" );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ printp( "\n\n *** SYNTAX Error - Invalid P2 ...\n\n" );
+ not_done_code = BOGUS_P2;
+ break;
+ }
+ }
+
+ break;
+ }
+
+
+ case LAN_OUT:
+ {
+
+ switch ( parm_1 )
+ {
+
+ case 0x0C: /* Clear and Reset Queue */
+ {
+ lan_init_queue( &lan_output_queue );
+ printp( "\n\n Queue CLEARED/RESET ...\n\n" );
+ break;
+ }
+
+ case 0x0D: /* Display Queue */
+ {
+ printp( "\n -- Output Queue --\n" );
+ printp( "\n Head Index: %8X Tail Index: %8X\n\n ",
+ (ULONG) lan_output_queue.head_index, (ULONG) lan_output_queue.tail_index );
+
+ for ( i = 0; i < MAX_RS232_CHARS; ++i )
+ {
+ printp( " %02X", (ULONG) lan_output_queue.buf[ i ] );
+
+ if ( 15 == (i % 16) )
+ {
+ int j;
+
+ printp ( " " );
+ for ( j = i - 15; j <= i; j++ )
+ {
+ if ( lan_output_queue.buf[ j ] >= ' ' &&
+ lan_output_queue.buf[ j ] < 127 )
+ printp ( "%c", lan_output_queue.buf[ j ] );
+ else
+ printp ( "." );
+ }
+ printp( "\n " );
+ }
+
+ else if ( 7 == (i % 8) )
+ {
+ printp( " " );
+ }
+
+ }
+
+ printp( "\n" );
+
+ break;
+ }
+
+ case 0x0F: /* Fetch next character in Queue */
+ {
+ c = lan_next_queue_char( &lan_output_queue );
+
+ if ( c )
+ {
+ printp( "\n\n Next Character: " );
+ if ( 0x21 <= c && c <= 0x7F )
+ {
+ printp( "%c\n\n", (ULONG) c );
+ }
+
+ else if ( 0x20 == c )
+ {
+ printp( "<space>\n\n" );
+ }
+
+ else
+ {
+ printp( "%02X\n\n", (ULONG) c );
+ }
+ }
+
+ else
+ {
+ printp( "\n\n Input Queue EMPTY ...\n\n" );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ printp( "\n\n *** SYNTAX Error - Invalid P2 ...\n\n" );
+ not_done_code = BOGUS_P2;
+ break;
+ }
+ }
+
+ break;
+ }
+
+
+ case LAN_ECHO:
+ {
+
+ switch ( parm_1 )
+ {
+
+ case 0x0E:
+ {
+ test_echo = ENABLED;
+ printp( "\n\n Test echo ENABLED ...\n\n" );
+ break;
+ }
+
+ case 0x0D:
+ {
+ test_echo = DISABLED;
+ printp( "\n\n Test echo DISABLED ...\n\n" );
+ break;
+ }
+
+ default:
+ {
+ printp( "\n\n *** SYNTAX Error - Invalid P2 ...\n\n" );
+ not_done_code = BOGUS_P2;
+ break;
+ }
+ }
+
+ break;
+ }
+
+
+ case LAN_PUTC:
+ {
+
+ if ( 0x20 < parm_1 && parm_1 < 0x7F )
+ {
+ if ( lan_put_char( (UCHAR) parm_1 ) )
+ {
+ printp( "\n\n *** 'lan_put_char' Error ...\n" );
+ }
+
+ else
+ {
+ printp( "\n\n O.K. ...\n" );
+ }
+
+ }
+
+ else
+ {
+ printp( "\n\n *** Error - character must be in the 0x21-0x7E range ...\n" );
+ not_done_code = BOGUS_P2;
+ }
+
+ break;
+ }
+
+/***
+ case LAN_WPM:
+ {
+
+ if ( write_to_protected_mem( (void *) parm_1, (unsigned short) parm_2 ) )
+ {
+ printp( "\n Write to protected memory FAILED ...\n" );
+ }
+
+ break;
+ }
+***/
+
+ case 0: /* no argument -- print menu */
+ {
+ lan_util_menu( );
+ break;
+ }
+
+
+ default:
+ {
+ parm_2 = 0; /* to supress compiler warning with 'LAN_WPM' case disabled */
+
+ printp( "\n\n *** SYNTAX Error - Invalid P1 ...\n\n" );
+ not_done_code = BOGUS_P1;
+ break;
+ }
+
+
+ } /* End of 'switch ( opcode )'. */
+
+
+return( not_done_code );
+}
+/* end of 'lan_util'
+ *===========================================================================*/
+
+
+ /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*
+ * *
+ * Local Module Functions *
+ * *
+ *%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/*-----------------------------------------------------------------------------
+ *
+ * FUNCTION NAME: lan_reset
+ *
+ * DESCRIPTION: Resets the LAN UART by strobing the 'RST_LAN_UART' bit in the
+ * Shared Control 1 area.
+ *
+ * 1 _| ______
+ * | | |
+ * Bit | | |
+ * | | |
+ * 0 _|______| |______
+ * |---------------------> t
+ *
+ * RETURN VALUE: None.
+ *
+ * USED GLOBAL VARIABLES:
+ *
+ * AFFECTED GLOBAL VARIABLES/SIDE EFFECTS:
+ *
+ * NOTES: H/W configuration requires that a byte in the shared
+ * control 1 area must be read before being written.
+ *
+ *---------------------------------------------------------------------------*/
+
+static void lan_reset( void )
+
+{
+
+ while ( *P_RST_LAN_UART_REG & M_RST_LAN_UART )
+ {
+ *P_RST_LAN_UART_REG &= ~M_RST_LAN_UART; /* 0 */
+ }
+
+ while ( !(*P_RST_LAN_UART_REG & M_RST_LAN_UART) )
+ {
+ *P_RST_LAN_UART_REG |= M_RST_LAN_UART; /* 1 */
+ }
+
+ while ( *P_RST_LAN_UART_REG & M_RST_LAN_UART )
+ {
+ *P_RST_LAN_UART_REG &= ~M_RST_LAN_UART; /* 0 */
+ }
+
+}
+/* end of 'lan_reset'
+ *===========================================================================*/
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * FUNCTION NAME: lan_configure
+ *
+ *
+ * DESCRIPTION:
+ *
+ *
+ * RETURN VALUE:
+ *
+ *
+ * USED GLOBAL VARIABLES:
+ *
+ *
+ * AFFECTED GLOBAL VARIABLES/SIDE EFFECTS:
+ *
+ *
+ * NOTES:
+ *
+ *
+ *
+ *---------------------------------------------------------------------------*/
+
+static void lan_configure( void )
+
+{
+
+ *P_LAN_CR = UART_CR_RESET_MR_PTR; /* Points to MR1. */
+ *P_LAN_CR = UART_CR_RESET_RVCR; /* Receiver disabled. */
+ *P_LAN_CR = UART_CR_RESET_XMTR; /* Transmitter disabled. */
+ *P_LAN_CR = UART_CR_RESET_ERROR_STATUS;
+ *P_LAN_CR = UART_CR_RESET_BRK_CHG_INT;
+
+ *P_LAN_MR1 = DEFAULT_LAN_MR1;
+ *P_LAN_MR2 = DEFAULT_LAN_MR2;
+
+ *P_LAN_ACR = DEFAULT_LAN_ACR;
+
+ *P_LAN_CSR = UART_CSR_BR_9600;
+ baud_rate_idx = 2;
+
+ *P_LAN_CTUR = DEFAULT_LAN_CTUR;
+ *P_LAN_CTLR = DEFAULT_LAN_CTLR;
+
+ *P_LAN_CR = (UART_CR_START_CNTR_TIMER | UART_CR_ENABLE_XMTR | UART_CR_ENABLE_RCVR);
+
+ lan_shadow_imr = UART_IMR_RxRDY; /* Enable only 'RxRDY' interrupt from UART. */
+ *P_LAN_IMR = lan_shadow_imr;
+
+ tx_by_intr = 0;
+ tx_by_poll = 0;
+
+ return;
+}
+/* end of 'lan_configure'
+ *===========================================================================*/
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * FUNCTION NAME: lan_init_queue
+ *
+ * DESCRIPTION:
+ *
+ * RETURN VALUE: None.
+ *
+ * USED GLOBAL VARIABLES:
+ *
+ * AFFECTED GLOBAL VARIABLES/SIDE EFFECTS:
+ *
+ * NOTES:
+ *
+ *---------------------------------------------------------------------------*/
+
+static void lan_init_queue( T_RS232_QUEUE *p_queue )
+
+{
+ long i;
+
+ /*
+ * We set "head" equal to "tail" implying the queue is empty,
+ * BUT the "head" and "tail" should each point to valid queue
+ * positions.
+ */
+
+ p_queue->head_index = 0;
+ p_queue->tail_index = 0;
+
+ p_queue->overflows = 0;
+
+ p_queue->gdb_packet_start = -1;
+ p_queue->gdb_packet_end = -1;
+
+ p_queue->gdb_packet_csum1 = -1;
+ p_queue->gdb_packet_csum2 = -1;
+
+ for ( i = 0; i < MAX_RS232_CHARS; ++i )
+ {
+ p_queue->buf[ i ] = 0;
+ }
+
+ return;
+}
+/* end of 'lan_init_queue'
+ *===========================================================================*/
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * FUNCTION NAME: lan_add_to_queue
+ *
+ *
+ * DESCRIPTION: Adds the specified character to the tail of the
+ * specified queue. Observes "oldest thrown on floor"
+ * rule (i.e. the queue is allowed to "wrap" and the
+ * input character is unconditionally placed at the
+ * tail of the queue.
+ *
+ *
+ * RETURN VALUE: None.
+ *
+ *
+ * USED GLOBAL VARIABLES:
+ *
+ *
+ * AFFECTED GLOBAL VARIABLES/SIDE EFFECTS:
+ *
+ *
+ * NOTES:
+ *
+ *
+ *---------------------------------------------------------------------------*/
+
+static void lan_add_to_queue( long c, T_RS232_QUEUE *p_queue )
+
+{
+
+ if ( p_queue ) /* Sanity check. */
+ {
+
+ if ( c & 0x000000FF ) /* We don't allow NULL characters to be added to a queue. */
+ {
+ /* Insert the new character at the tail of the queue. */
+
+ p_queue->buf[ p_queue->tail_index ] = (UCHAR) (c & 0x000000FF);
+
+ /* Increment the tail index. */
+
+ if ( MAX_RS232_CHARS <= ++(p_queue->tail_index) )
+ {
+ p_queue->tail_index = 0;
+ }
+
+ /* Check for wrapping (i.e. overflow). */
+
+ if ( p_queue->head_index == p_queue->tail_index )
+ {
+ /* If the tail has caught up to the head record the overflow . . . */
+
+ ++(p_queue->overflows);
+
+ /* . . . then increment the head index. */
+
+ if ( MAX_RS232_CHARS <= ++(p_queue->head_index) )
+ {
+ p_queue->head_index = 0;
+ }
+
+ }
+
+ } /* End of 'if ( c & 0x000000FF )'. */
+
+ } /* End of 'if ( p_queue )'. */
+
+
+ return;
+}
+/* end of 'lan_add_to_queue'
+ *===========================================================================*/
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * FUNCTION NAME: lan_next_queue_char
+ *
+ * DESCRIPTION:
+ *
+ * RETURN VALUE:
+ *
+ * USED GLOBAL VARIABLES:
+ *
+ * AFFECTED GLOBAL VARIABLES/SIDE EFFECTS:
+ *
+ * NOTES:
+ *
+ *---------------------------------------------------------------------------*/
+
+static UCHAR lan_next_queue_char( T_RS232_QUEUE *p_queue )
+
+{
+ UCHAR c;
+
+
+ c = 0;
+
+ if ( p_queue )
+ {
+
+ if ( p_queue->head_index != p_queue->tail_index )
+ {
+ /* Return the 'oldest' character in the queue. */
+
+ c = p_queue->buf[ p_queue->head_index ];
+
+ /* Increment the head index. */
+
+ if ( MAX_RS232_CHARS <= ++(p_queue->head_index) )
+ {
+ p_queue->head_index = 0;
+ }
+
+ }
+
+ } /* End of 'if ( p_queue )'. */
+
+
+ return( c );
+}
+
+/* end of 'lan_next_queue_char'
+ *===========================================================================*/
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * FUNCTION NAME: lan_util_menu
+ *
+ * DESCRIPTION: Prints out a brief help on the LAN UART control utility.
+ *
+ * RETURN VALUE: None.
+ *
+ * USED GLOBAL VARIABLES: None.
+ *
+ * AFFECTED GLOBAL VARIABLES/SIDE EFFECTS: None.
+ *
+ * NOTES: None.
+ *
+ *---------------------------------------------------------------------------*/
+
+static void lan_util_menu( void )
+
+{
+
+ /*
+ * Multiply calling printp() below is made due to the limitations
+ * of printp(), incapable of handling long formatting constants:
+ */
+
+ printp( "\n -- Options --\n\n" );
+
+ printp( " %2X,'INIT' ............... Reset & (Re)INITIALIZE Interface.\n", (ULONG) LAN_UTIL_CODE );
+ printp( " %2X,'BAUD',<rate> ........ Set BAUD Rate.\n", (ULONG) LAN_UTIL_CODE );
+ printp( " %2X,'INTR',<mode> ........ Toggle 'RxRDY' Interrupts.\n", (ULONG) LAN_UTIL_CODE );
+ printp( " %2X,'XMT',<mode> ......... Toggle TRANSMIT-via-backplane.\n", (ULONG) LAN_UTIL_CODE );
+ printp( " %2X,'STAT' ............... Display STATUS.\n", (ULONG) LAN_UTIL_CODE );
+ printp( " %2X,'ECHO',<mode> ........ Enable/Disable Test ECHO.\n", (ULONG) LAN_UTIL_CODE );
+ printp( " %2X,'IN',<action> ........ Access INPUT Queue.\n", (ULONG) LAN_UTIL_CODE );
+ printp( " %2X,'OUT',<action> ....... Access OUTPUT Queue.\n\n", (ULONG) LAN_UTIL_CODE );
+
+ printp( " %2X,'PUTC',<char> ........ Output a Character (i.e. <char>).\n\n", (ULONG) LAN_UTIL_CODE );
+
+/***
+ printp( " %2X,'WPM',address,word ... Write Protected Memory Test.\n\n", (ULONG) LAN_UTIL_CODE );
+***/
+
+ printp( " <rate>: 4800 <mode>: E - enable <action>: C - clear/reset\n" );
+ printp( " 9600 D - disable D - display\n" );
+ printp( " 19200 F - fetch next char\n" );
+ printp( " 38400\n" );
+}
+/* end of 'lan_util_menu'
+ *===========================================================================*/
+
+
+/* Thu Feb 5 17:14:41 EST 1998 CYGNUS...CYGNUS...CYGNUS...CYGNUS...CYGNUS...CYGNUS...CYGNUS...CYGNUS */
+
+
+static long get_gdb_input( long c, T_RS232_QUEUE * p_input_q )
+
+{
+
+ /* Now to detect when we've got a gdb packet... */
+
+ if ( '$' == c ) { /* char marks beginning of a packet */
+
+ if ( -1 != p_input_q->gdb_packet_start ||
+ -1 != p_input_q->gdb_packet_end ||
+ -1 != p_input_q->gdb_packet_csum1 ||
+ -1 != p_input_q->gdb_packet_csum2 ) { /* PROTOCOL ERROR */
+
+ /* NEW: Actually, this probably means that we muffed a packet,
+ and GDB has already resent it. The thing to do now is to
+ throw away the one we WERE working on, but immediately start
+ accepting the new one. Don't NAK, or GDB will have to try
+ and send it yet a third time! */
+
+ /*NACK_PKT( );*/ /*<ETHERNET>*/
+ discard_packet( ); /* throw away old packet */
+ lan_add_to_queue ('$', p_input_q); /* put the new "$" back in */
+ return 0;
+ } else { /* match new "$" */
+ p_input_q->gdb_packet_start = p_input_q->tail_index;
+ p_input_q->gdb_packet_end =
+ p_input_q->gdb_packet_csum1 =
+ p_input_q->gdb_packet_csum2 = -1;
+ }
+ } else if ( '#' == c ) { /* # marks end of packet (except for checksum) */
+
+ if ( -1 == p_input_q->gdb_packet_start ||
+ -1 != p_input_q->gdb_packet_end ||
+ -1 != p_input_q->gdb_packet_csum1 ||
+ -1 != p_input_q->gdb_packet_csum2 ) { /* PROTOCOL ERROR */
+
+ /* Garbled packet. Discard, but do not NAK. */
+
+ /*NACK_PKT( );*/ /*<ETHERNET>*/
+ discard_packet( );
+ return -1;
+ }
+ p_input_q->gdb_packet_end = p_input_q->tail_index;
+ p_input_q->gdb_packet_csum1 = p_input_q->gdb_packet_csum2 = -1;
+
+ } else if ( -1 != p_input_q->gdb_packet_start &&
+ -1 != p_input_q->gdb_packet_end) {
+
+ if ( isxdigit( c ) ) { /* char is one of two checksum digits for packet */
+
+ if ( -1 == p_input_q->gdb_packet_csum1 &&
+ LAN_Q_MOD( p_input_q->gdb_packet_end + 1 ) ==
+ p_input_q->tail_index ) {
+
+ /* first checksum digit */
+
+ p_input_q->gdb_packet_csum1 = p_input_q->tail_index;
+ p_input_q->gdb_packet_csum2 = -1;
+
+ } else if ( -1 == p_input_q->gdb_packet_csum2 &&
+ LAN_Q_MOD( p_input_q->gdb_packet_end + 2 ) ==
+ p_input_q->tail_index ) {
+
+ /* second checksum digit: packet is complete! */
+
+ p_input_q->gdb_packet_csum2 = p_input_q->tail_index;
+ getpacket(); /* got a packet -- extract it */
+
+ } else { /* probably can't happen (um... three hex digits?) */
+
+ /* PROTOCOL ERROR */
+ /* Not sure how this can happen, but ...
+ discard it, but do not NAK it. */
+ /*NACK_PKT( );*/ /*<ETHERNET>*/
+ discard_packet( );
+ return -1;
+ }
+
+ } else { /* '#' followed by non-hex char */
+
+ /* PROTOCOL ERROR */
+ /* Bad packet -- discard but do not NAK */
+ /*NACK_PKT( );*/ /*<ETHERNET>*/
+ discard_packet( );
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+
+
+
+#ifdef STANDALONE
+
+/* stand-alone stand-alone stand-alone stand-alone stand-alone stand-alone
+ stand-alone stand-alone
+ stand-alone Enable stand-alone build, for ease of debugging stand-alone
+ stand-alone stand-alone
+ stand-alone stand-alone stand-alone stand-alone stand-alone stand-alone */
+
+long write_to_protected_mem (addr, word)
+ void *addr;
+ unsigned short word;
+{
+ return 0;
+}
+
+
+char dummy_memory[0x4000];
+
+int main ( void )
+{
+ long c;
+
+ lan_init_queue( &lan_input_queue );
+ printf( "Stand-alone EMC 'stub', pid = %d\n", getpid( ) );
+ printf( "Start of simulated 'memory': 0x%08x\n", &dummy_memory);
+ while ( (c = getc( stdin ) ) != EOF )
+ {
+ if ( c == '\\' ) /* escape char */
+ break;
+
+ lan_add_to_queue( c, &lan_input_queue );
+ get_gdb_input (c, &lan_input_queue);
+ fflush( stdout );
+ }
+
+ printf( "Goodbye!\n" );
+ exit( 0 );
+}
+
+#define SRAM_START ((void *) (&dummy_memory[0] + 0x00000000))
+#define SRAM_END ((void *) (&dummy_memory[0] + 0x00000400))
+
+#define RO_AREA_START ((void *) (&dummy_memory[0] + 0x00000100))
+#define RO_AREA_END ((void *) (&dummy_memory[0] + 0x00000300))
+
+#define NVD_START ((void *) (&dummy_memory[0] + 0x00003000))
+#define NVD_END ((void *) (&dummy_memory[0] + 0x00003100))
+
+#else /* normal stub (not stand-alone) */
+
+#define SRAM_START ((void *) 0x00000000)
+#define SRAM_END ((void *) 0x00400000)
+
+#define RO_AREA_START ((void *) 0x00100000)
+#define RO_AREA_END ((void *) 0x00300000)
+
+#define NVD_START ((void *) 0x03000000)
+#define NVD_END ((void *) 0x03100000)
+
+#endif /* STANDALONE */
+
+
+
+
+/* gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb
+ gdb gdb
+ gdb Here begins the gdb stub section. gdb
+ gdb The following functions were added by Cygnus, gdb
+ gdb to make this thing act like a gdb stub. gdb
+ gdb gdb
+ gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb gdb */
+
+
+/* ------------------- global defines and data decl's -------------------- */
+
+#define hexchars "0123456789abcdef"
+
+/* there are 180 bytes of registers on a 68020 w/68881 */
+/* many of the fpa registers are 12 byte (96 bit) registers */
+#define NUMREGBYTES 180
+#define NUMREGS 29
+#define REGISTER_BYTE(regno) regno
+
+enum regnames { D0, D1, D2, D3, D4, D5, D6, D7,
+ A0, A1, A2, A3, A4, A5, A6, A7,
+ PS, PC,
+ FP0, FP1,
+ FP2, FP3,
+ FP4, FP5,
+ FP6, FP7,
+ FPCONTROL, FPSTATUS, FPIADDR
+ };
+
+unsigned long registers[NUMREGBYTES/4];
+
+static long remote_debug;
+
+#define BUFMAX MAX_IO_BUF_SIZE
+static char inbuffer[BUFMAX], outbuffer[BUFMAX];
+static char spare_buffer[BUFMAX];
+
+
+struct stub_trace_frame
+{
+ int valid;
+ unsigned long frame_id;
+ unsigned long tdp_id;
+ FRAME_DEF *frame_data;
+ COLLECTION_FORMAT_DEF *format;
+ unsigned long traceregs[NUMREGBYTES/4];
+ unsigned char *stack_data;
+ unsigned char *memrange_data;
+} curframe;
+
+/* ------------------- function prototypes -------------------- */
+
+void handle_request ( char * );
+
+/* ------------------- Implementation -------------------- */
+
+static void
+discard_packet( void )
+{
+ lan_input_queue.head_index = lan_input_queue.tail_index;
+
+ lan_input_queue.gdb_packet_start =
+ lan_input_queue.gdb_packet_end =
+ lan_input_queue.gdb_packet_csum1 =
+ lan_input_queue.gdb_packet_csum2 = -1;
+}
+
+/* Utility function: convert an ASCII isxdigit to a hex nybble */
+
+static long
+hex( char ch )
+{
+ if ( (ch >= 'A') && (ch <= 'F') )
+ return ch - 'A' + 10;
+ if ( (ch >= 'a') && (ch <= 'f') )
+ return ch - 'a' + 10;
+ if ( (ch >= '0') && (ch <= '9') )
+ return ch - '0';
+ return -1;
+}
+
+static void
+getpacket( void )
+{
+ unsigned char our_checksum, their_checksum;
+ char *copy = inbuffer;
+ unsigned char c;
+
+ our_checksum = 0;
+
+ /* first find the '$' */
+ while ((c = lan_next_queue_char ( &lan_input_queue )) != '$')
+ if (c == 0) /* ??? Protocol error? (paranoia) */
+ {
+ /* PROTOCOL ERROR (missing '$') */
+ /*NACK_PKT( );*/ /*<ETHERNET>*/
+ return;
+ }
+
+ /* Now copy the message (up to the '#') */
+ for (c = lan_next_queue_char ( &lan_input_queue ); /* skip the '$' */
+ c != 0 && c != '#'; /* stop at the '#' */
+ c = lan_next_queue_char ( &lan_input_queue ))
+ {
+ *copy++ = c;
+ our_checksum += c;
+ }
+ *copy++ = '\0'; /* terminate the copy */
+
+ if (c == 0) /* ??? Protocol error? (paranoia) */
+ {
+ /* PROTOCOL ERROR (missing '#') */
+ /*NACK_PKT( );*/ /*<ETHERNET>*/
+ return;
+ }
+ their_checksum = hex( lan_next_queue_char ( &lan_input_queue ) ) << 4;
+ their_checksum += hex( lan_next_queue_char ( &lan_input_queue ) );
+
+ /* Now reset the queue packet-recognition bits */
+ discard_packet( );
+
+ if ( remote_debug ||
+ our_checksum == their_checksum )
+ {
+ ACK_PKT( ); /* good packet */
+ /* Parse and process the packet */
+ handle_request( inbuffer );
+ }
+ else
+ /* PROTOCOL ERROR (bad check sum) */
+ NACK_PKT( );
+}
+
+/* EMC will provide a better implementation
+ (perhaps just of LAN_PUT_CHAR) that does not block.
+ For now, this works. */
+
+
+static void
+putpacket( char *str )
+{
+ unsigned char checksum;
+
+ /* '$'<packet>'#'<checksum> */
+
+ if ( VIA_ETHERNET == gdb_host_comm )
+ {
+ char *p_out;
+ long length;
+
+ p_out = eth_outbuffer;
+ length = 0;
+
+
+ if ( YES == gdb_cat_ack )
+ {
+ *p_out++ = '+';
+ ++length;
+ }
+
+ gdb_cat_ack = NO;
+
+
+ *p_out++ = '$';
+ ++length;
+
+ checksum = 0;
+
+ while ( *str )
+ {
+ *p_out++ = *str;
+ ++length;
+ checksum += *str++;
+ }
+
+ *p_out++ = '#';
+ *p_out++ = hexchars[checksum >> 4];
+ *p_out = hexchars[checksum % 16];
+ length += 3;
+
+ eth_to_gdb( (UCHAR *) eth_outbuffer, length );
+ }
+
+ else
+ {
+
+ /* via RS-232 */
+ do {
+ LAN_PUT_CHAR( '$' );
+ checksum = 0;
+
+ while ( *str )
+ {
+ LAN_PUT_CHAR( *str );
+ checksum += *str++;
+ }
+
+ LAN_PUT_CHAR( '#' );
+ LAN_PUT_CHAR( hexchars[checksum >> 4] );
+ LAN_PUT_CHAR( hexchars[checksum % 16] );
+ } while ( 0 /* get_debug_char( ) != '+' */ );
+ /* XXX FIXME: not waiting for the ack. */
+
+ }
+
+}
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * FUNCTION NAME: gdb_get_eth_input
+ *
+ *
+ * DESCRIPTION:
+ *
+ *
+ * RETURN VALUE: None.
+ *
+ *
+ * USED GLOBAL VARIABLES:
+ *
+ *
+ * AFFECTED GLOBAL VARIABLES/SIDE EFFECTS:
+ *
+ *
+ * NOTES:
+ *
+ *
+ *---------------------------------------------------------------------------*/
+
+void gdb_get_eth_input( unsigned char *buf, long length )
+
+{
+
+ gdb_host_comm = VIA_ETHERNET;
+
+ for ( ; 0 < length; ++buf, --length)
+ {
+
+ if ( *buf == CONTROL_C )
+ {
+ /* can't stop the target, but we can tell gdb to stop waiting... */
+ discard_packet( );
+ putpacket( "S03" ); /* send back SIGINT to the debugger */
+ }
+
+ else
+ {
+ lan_add_to_queue( (long) *buf, &lan_input_queue );
+ get_gdb_input( (long) *buf, &lan_input_queue );
+ }
+
+ }
+
+
+ return;
+}
+/* end of 'gdb_get_eth_input'
+ *===========================================================================*/
+
+
+
+
+/* STDOUT STDOUT STDOUT STDOUT STDOUT STDOUT STDOUT STDOUT STDOUT STDOUT
+ Stuff pertaining to simulating stdout by sending chars to gdb to be echoed.
+
+ Dear reader:
+ This code is based on the premise that if GDB receives a packet
+ from the stub that begins with the character CAPITAL-OH, GDB will
+ echo the rest of the packet to GDB's console / stdout. This gives
+ the stub a way to send a message directly to the user. In practice,
+ (as currently implemented), GDB will only accept such a packet when
+ it believes the target to be running (ie. when you say STEP or
+ CONTINUE); at other times it does not expect it. This will probably
+ change as a side effect of the "asynchronous" behavior.
+
+ Functions: gdb_putchar(char ch)
+ gdb_write(char *str, int len)
+ gdb_puts(char *str)
+ gdb_error(char *format, char *parm)
+ */
+
+#if 0 /* avoid compiler warning while this is not used */
+
+/* Function: gdb_putchar(int)
+ Make gdb write a char to stdout.
+ Returns: the char */
+
+static int
+gdb_putchar( long ch )
+{
+ char buf[4];
+
+ buf[0] = 'O';
+ buf[1] = hexchars[ch >> 4];
+ buf[2] = hexchars[ch & 0x0F];
+ buf[3] = 0;
+ putpacket( buf );
+ return ch;
+}
+#endif
+
+/* Function: gdb_write(char *, int)
+ Make gdb write n bytes to stdout (not assumed to be null-terminated).
+ Returns: number of bytes written */
+
+static int
+gdb_write( char *data, long len )
+{
+ char *buf, *cpy;
+ long i;
+
+ buf = outbuffer;
+ buf[0] = 'O';
+ i = 0;
+ while ( i < len )
+ {
+ for ( cpy = buf+1;
+ i < len && cpy < buf + BUFMAX - 3;
+ i++ )
+ {
+ *cpy++ = hexchars[data[i] >> 4];
+ *cpy++ = hexchars[data[i] & 0x0F];
+ }
+ *cpy = 0;
+ putpacket( buf );
+ }
+ return len;
+}
+
+/* Function: gdb_puts(char *)
+ Make gdb write a null-terminated string to stdout.
+ Returns: the length of the string */
+
+static int
+gdb_puts( char *str )
+{
+ return gdb_write( str, strlen( str ) );
+}
+
+/* Function: gdb_error(char *, char *)
+ Send an error message to gdb's stdout.
+ First string may have 1 (one) optional "%s" in it, which
+ will cause the optional second string to be inserted. */
+
+#if 0
+static void
+gdb_error( char *format, char *parm )
+{
+ static char buf[400];
+ char *cpy;
+ long len;
+
+ if ( remote_debug )
+ {
+ if ( format && *format )
+ len = strlen( format );
+ else
+ return; /* empty input */
+
+ if ( parm && *parm )
+ len += strlen( parm );
+
+ for ( cpy = buf; *format; )
+ {
+ if ( format[0] == '%' && format[1] == 's' ) /* include 2nd string */
+ {
+ format += 2; /* advance two chars instead of just one */
+ while ( parm && *parm )
+ *cpy++ = *parm++;
+ }
+ else
+ *cpy++ = *format++;
+ }
+ *cpy = '\0';
+ gdb_puts( buf );
+ }
+}
+#endif
+
+static void gdb_note (char *, int);
+static int error_ret (int, char *, int);
+
+static unsigned long
+elinum_to_index (unsigned long elinum)
+{
+ if ((elinum & 0xf0) == 0xd0)
+ return (elinum & 0x0f);
+ else if ((elinum & 0xf0) == 0xa0)
+ return (elinum & 0x0f) + 8;
+ else
+ return -1;
+}
+
+static long
+index_to_elinum (unsigned long index)
+{
+ if (index <= 7)
+ return index + 0xd0;
+ else if (index <= 15)
+ return (index - 8) + 0xa0;
+ else
+ return -1;
+}
+
+
+/*
+ READMEM READMEM READMEM READMEM READMEM READMEM READMEM READMEM READMEM
+
+ The following code pertains to reading memory from the target.
+ Some sort of exception handling should be added to make it safe.
+
+ READMEM READMEM READMEM READMEM READMEM READMEM READMEM READMEM READMEM
+
+ Safe Memory Access:
+
+ All reads and writes into the application's memory will pass thru
+ get_uchar() or set_uchar(), which check whether accessing their
+ argument is legal before actual access (thus avoiding a bus error).
+
+ */
+
+enum { SUCCESS = 0, FAIL = -1 };
+
+#if 0
+static long get_uchar ( const unsigned char * );
+#endif
+static long set_uchar ( unsigned char *, unsigned char );
+static long read_access_violation ( const void * );
+static long write_access_violation ( const void * );
+static long read_access_range(const void *, long);
+static DTC_RESPONSE find_memory(unsigned char *,long,unsigned char **,long *);
+
+static int
+dtc_error_ret (int ret, char *src, DTC_RESPONSE code)
+{
+ if (src)
+ sprintp (spare_buffer,
+ "'%s' returned DTC error '%s'.\n", src, get_err_text (code));
+ else
+ sprintp (spare_buffer, "DTC error '%s'.\n", get_err_text (code));
+
+ gdb_puts (spare_buffer);
+ return ret;
+}
+
+
+#if 0
+/* I think this function is unnecessary since the introduction of
+ adbg_find_memory_addr_in_frame. */
+
+/* Return the number of expressions in the format associated with a
+ given trace frame. */
+static int
+count_frame_exprs (FRAME_DEF *frame)
+{
+ CFD *format;
+ T_EXPR *expr;
+ int num_exprs;
+
+ /* Get the format from the frame. */
+ get_frame_format_pointer (frame, &format);
+
+ /* Walk the linked list of expressions, and count the number of
+ expressions we find there. */
+ num_exprs = 0;
+ for (expr = format->p_cfd_expr; expr; expr = expr->next)
+ num_exprs++;
+
+ return num_exprs;
+}
+#endif
+
+#if 0
+/* Function: get_frame_addr
+ *
+ * Description: If the input memory address was collected in the
+ * current trace frame, then lookup and return the address
+ * from within the trace buffer from which the collected byte
+ * may be retrieved. Else return -1. */
+
+unsigned char *
+get_frame_addr ( const unsigned char *addr )
+{
+ unsigned char *base, *regs, *stack, *mem;
+ CFD *dummy;
+ DTC_RESPONSE ret;
+
+ /* first, see if addr is on the saved piece of stack for curframe */
+ if (curframe.format->stack_size > 0 &&
+ (base = (unsigned char *) curframe.traceregs[A7]) <= addr &&
+ addr < base + curframe.format->stack_size)
+ {
+ gdb_puts("STUB: get_frame_addr: call get_addr_to_frame_regs_stack_mem\n");
+ if ((ret = get_addr_to_frame_regs_stack_mem (curframe.frame_data,
+ &dummy,
+ (void *) &regs,
+ (void *) &stack,
+ (void *) &mem))
+ != OK_TARGET_RESPONSE)
+ return (void *) dtc_error_ret (-1,
+ "get_addr_to_frame_regs_stack_mem",
+ ret);
+ else
+ return stack + (addr - base);
+ }
+
+ /* Next, try to find addr in the current frame's expression-
+ collected memory blocks. I'm sure this is at least quadradic in
+ time. */
+ {
+ int num_exprs = count_frame_exprs (curframe.frame_data);
+ int expr, block;
+
+ /* Try each expression in turn. */
+ for (expr = 0; expr < num_exprs; expr++)
+ {
+ for (block = 0; ; block++)
+ {
+ T_EXPR_DATA *data;
+ if (adbg_get_expr_data (curframe.frame_data,
+ 'x', expr, block,
+ &data)
+ != OK_TARGET_RESPONSE)
+ break;
+ else if ((unsigned char *) data->address <= addr
+ && addr < ((unsigned char *) data->address + data->size))
+ {
+ /* We have found the right block; is it valid data?
+ Upper-case stamps mean bad data. */
+ if ('A' <= data->stamp && data->stamp <= 'Z')
+ {
+ gdb_puts("STUB: get_frame_addr: adbg_get_expr_data INVALID\n");
+ return (unsigned char *) -1;
+ }
+ else
+ {
+ if (remote_debug > 1)
+ {
+ sprintp(spare_buffer,
+ "STUB: get_frame_addr: got it [%x,%x)\n",
+ data->address, data->address + data->size);
+ gdb_puts(spare_buffer);
+ }
+
+ return (((unsigned char *) &data->data)
+ + (addr - (unsigned char *) data->address));
+ }
+ }
+ }
+ }
+ }
+
+ /* not found, return error */
+ return (unsigned char *) -1;
+}
+
+/*============================================================*/
+
+static long get_uchar ( const unsigned char * addr )
+{
+ unsigned char *frame_addr;
+
+ if ( read_access_violation ( addr ) )
+ return ( -1 ); /* Access error */
+
+ if (curframe.valid) /* if debugging a trace frame? */
+ {
+ /* If the requested address was collected in the current frame,
+ * then fetch and return the data from the trace buffer.
+ */
+ if ((frame_addr = get_frame_addr (addr)) != (unsigned char *) -1)
+ return ( *frame_addr );
+ /* If the requested address is in the Code Section,
+ * let's be magnanimous and read it anyway (else we shall
+ * not be able to disassemble, find function prologues, etc.)
+ */
+ else if (CS_CODE_START <= (unsigned long) addr &&
+ (unsigned long) addr < CS_CODE_START + CS_CODE_SIZE)
+ return (*addr);
+ else
+ return ( -1 ); /* "Access error" (the data was not collected) */
+ }
+ else
+ /* Not debugging a trace frame, read the data from live memory. */
+ return ( *addr ); /* Meaningful result >= 0 */
+}
+#endif
+
+/*============================================================*/
+
+static long set_uchar ( unsigned char * addr, unsigned char val )
+{
+ long check_result = write_access_violation ( addr );
+
+ if ( check_result != 0L )
+ return ( check_result ); /* Access error */
+
+ return ( *addr = val ); /* Successful writing */
+}
+
+/*============================================================*/
+
+/*
+ * Function read_access_violation() below returns TRUE if dereferencing
+ * its argument for reading would cause a bus error - and FALSE otherwise:
+ */
+
+static long read_access_violation ( const void * addr )
+{
+ return ( ( ( addr < SRAM_START ) || ( addr >= SRAM_END ) ) &&
+ ( ( addr < NVD_START ) || ( addr >= NVD_END ) ) );
+}
+
+/*============================================================*/
+
+/*
+ * Function write_access_violation() below returns zero if dereferencing
+ * its argument for writing is safe, -1 on a soft error (the argument
+ * falls into the write-protected area), -2 on a hard error (the argument
+ * points to a non-existent memory location). In other words, it returns
+ * FALSE when no bus error is expected - and an error code otherwise:
+ */
+
+static long write_access_violation ( const void * addr )
+{
+ /*
+ * The boundaries of the write-protected area have to be received via
+ * an API provided in the Symmetrix core code. For now, these limits
+ * are hard-coded:
+ */
+
+ if ( ( addr >= RO_AREA_START ) && ( addr < RO_AREA_END ) )
+ return ( -1 ); /* soft error */
+
+ if ( ( ( addr < SRAM_START ) || ( addr >= SRAM_END ) ) &&
+ ( ( addr < NVD_START ) || ( addr >= NVD_END ) ) )
+ return ( -2 ); /* hard error */
+
+ return ( 0 );
+}
+
+
+/* read_access_range is like read_access_violation,
+ but returns the number of bytes we can read w/o faulting.
+ that is, it checks an address range and tells us what portion
+ (if any) of the prefix is safe to read without a bus error */
+static long
+read_access_range(const void *addr, long count)
+{
+ if ((addr >= SRAM_START) && (addr < SRAM_END))
+ {
+ if ((char *)addr + count < (char *)SRAM_END)
+ return (count);
+ else
+ return ((char *)SRAM_END - (char *)addr);
+ }
+ else if (((char *)addr >= (char *)NVD_START) &&
+ ((char *)addr < (char *)NVD_END))
+ {
+ if ((char *)addr + count < (char *)NVD_END)
+ return (count);
+ else
+ return ((char *)NVD_END - (char *)addr);
+ }
+ else
+ return (0);
+}
+
+/* Convert the memory pointed to by mem into hex, placing result in buf.
+ Return SUCCESS or FAIL.
+ If MAY_FAULT is non-zero, then we should return FAIL in response to
+ a fault; if zero treat a fault like any other fault in the stub. */
+
+static long
+mem2hex(unsigned char *mem, char *buf, long count, long may_fault)
+{
+ long ndx;
+ long ndx2;
+ long ch;
+ long incr;
+ unsigned char *location;
+ DTC_RESPONSE status;
+
+ if (may_fault)
+ {
+ for (ndx = 0, incr = 1; (ndx < count) && (incr > 0); ndx += incr)
+ {
+ status = find_memory(mem, count - ndx, &location, &incr);
+
+ if (status == OK_TARGET_RESPONSE)
+ {
+ if (incr > 0)
+ {
+ for (ndx2 = 0; ndx2 < incr; ndx2++)
+ {
+ ch = *location++;
+ *buf++ = hexchars[ch >> 4];
+ *buf++ = hexchars[ch & 0xf];
+ }
+ mem += incr;
+ }
+ else if (incr <= 0) /* should never happen */
+ {
+ *buf = 0;
+ return (0);
+ }
+ }
+ else if (status == NOT_FOUND_TARGET_RESPONSE)
+ {
+ *buf = 0;
+ return (ndx); /* return amount copied */
+ }
+ else
+ {
+ *buf = 0;
+ return (0); /* XXX: how do we tell the user the status? */
+ }
+ }
+ *buf = 0;
+ return (count);
+ }
+ else
+ {
+ for (ndx = 0; ndx < count; ndx++)
+ {
+ ch = *mem++;
+ *buf++ = hexchars[ch >> 4];
+ *buf++ = hexchars[ch & 0xf];
+ }
+ *buf = 0;
+ return (count); /* we copied everything */
+ }
+}
+
+static DTC_RESPONSE
+find_memory(unsigned char *mem, long count,
+ unsigned char **location, long *incr)
+{
+ DTC_RESPONSE retval;
+ long length;
+
+ /* figure out how much of the memory range we can read w/o faulting */
+ count = read_access_range(mem, count);
+ if (count == 0)
+ return (NOT_FOUND_TARGET_RESPONSE);
+
+ if (curframe.valid)
+ {
+ unsigned char *mem_block;
+ unsigned char *mem_addr;
+ unsigned long mem_size;
+ unsigned long mem_stamp;
+
+ retval = adbg_find_memory_addr_in_frame(curframe.frame_data, mem,
+ (unsigned long **)&mem_block,
+ (unsigned long **)&mem_addr,
+ &mem_size, &mem_stamp);
+
+ switch (retval)
+ {
+ case OK_TARGET_RESPONSE:
+#if 0
+ printp("FOUND: mem %x block %x addr %x size %d stamp %x\n",
+ mem, mem_block, mem_addr, mem_size, mem_stamp);
+#endif
+ *location = mem_block + (mem - mem_addr);
+ length = mem_size - (mem - mem_addr);
+
+ if (length < count)
+ *incr = length;
+ else
+ *incr = count;
+
+ break;
+
+ case NOT_FOUND_TARGET_RESPONSE:
+ case NEAR_FOUND_TARGET_RESPONSE:
+#if 0
+ printp("NOT FOUND: mem %x, checking code region\n", mem);
+#endif
+ /* check to see if it's in the code region */
+ if ((CS_CODE_START <= (long)mem) &&
+ ((long)mem < CS_CODE_START + CS_CODE_SIZE))
+ {
+ /* some or all of the address range is in the code */
+ *location = mem;
+ if ((long)mem + count <= CS_CODE_START + CS_CODE_SIZE)
+ *incr = count; /* it's totally in the code */
+ else
+ /* how much is in the code? */
+ *incr = CS_CODE_START + CS_CODE_SIZE - (long)mem;
+#if 0
+ printp("FOUND in code region: %x\n", mem);
+#endif
+ retval = OK_TARGET_RESPONSE;
+ }
+ else
+ retval = NOT_FOUND_TARGET_RESPONSE;
+
+ break;
+
+ default:
+#if 0
+ printp("BAD RETURN: %d\n", retval);
+#endif
+ retval = NOT_FOUND_TARGET_RESPONSE;
+ break;
+ }
+ }
+ else
+ {
+ *location = mem;
+ *incr = count;
+ retval = OK_TARGET_RESPONSE;
+ }
+
+ return (retval);
+}
+
+/* Convert the hex array pointed to by buf into binary to be placed in mem.
+ Return SUCCESS or FAIL. */
+
+static long
+hex2mem( char *buf, unsigned char *mem, long count, long may_fault )
+{
+ long i, ch;
+
+ for ( i=0; i<count; i++ )
+ {
+ ch = hex( *buf++ ) << 4;
+ ch = ch + hex( *buf++ );
+ if ( may_fault )
+ {
+ ch = set_uchar( mem++, ch );
+ if ( ch < 0 ) /* negative return indicates error */
+ return FAIL;
+ }
+ else
+ *mem++ = ch;
+ }
+ return SUCCESS;
+}
+
+/**********************************************/
+/* WHILE WE FIND NICE HEX CHARS, BUILD AN INT */
+/* RETURN NUMBER OF CHARS PROCESSED */
+/**********************************************/
+
+static int
+hexToInt( char **ptr, unsigned long *intValue )
+{
+ long numChars = 0;
+ long hexValue;
+
+ *intValue = 0;
+ while ( **ptr )
+ {
+ hexValue = hex( **ptr );
+ if ( hexValue >=0 )
+ {
+ *intValue = (*intValue << 4) | hexValue;
+ numChars ++;
+ }
+ else
+ break;
+ (*ptr)++;
+ }
+ return numChars;
+}
+
+static volatile long gdb_handling_trap1;
+static volatile long gdb_handling_sstrace;
+static volatile long gdb_signo;
+
+/*
+ Here is the "callable" stub entry point.
+ Call this function with a GDB request as an argument,
+ and it will service the request and return.
+
+ May be further broken up as we go along, with individual requests
+ broken out as separate functions.
+ */
+
+static char * handle_trace_query (char *);
+static char * handle_trace_set (char *);
+static int handle_format (char **request, CFD *format);
+static unsigned long crc32 (unsigned char *buf, int len, unsigned long crc);
+static char * crc_query (char *);
+static char * handle_test (char *);
+
+void
+handle_request( char *request )
+{
+#if 0
+ remote_debug = 2;
+#endif
+ switch( *request++ )
+ {
+ case 'k': /* "kill" */
+ curframe.valid = FALSE;
+ putpacket ("");
+ break;
+ case 'D': /* "detach" */
+ curframe.valid = FALSE;
+ putpacket ("");
+ break;
+ default: /* Unknown code. Return an empty reply message. */
+ putpacket( "" ); /* return empty packet */
+ break;
+
+ case 'H': /* Set thread for subsequent operations.
+ Hct... c = 'c' for thread used in step and continue;
+ t... can be -1 for all threads.
+ c = 'g' for thread used in other operations.
+ If zero, pick a thread, any thread. */
+
+ putpacket( "OK" );
+ break;
+
+ case 'g': /* Read registers.
+ Each byte of register data is described by
+ two hex digits. registers are in the
+ internal order for GDB, and the bytes in a
+ register are in the same order the machine
+ uses. */
+ {
+ /* Return the values in (one of) the registers cache(s).
+ Several situations may pertain:
+ 1) We're synchronous, in which case the "registers" array
+ should actually be current.
+ 2) We're asynchronous, in which case the "registers" array
+ holds whatever was cached most recently.
+ 3) We're looking at a trace frame that was collected earlier:
+ we will return those earlier registers.
+ */
+
+ /* all registers default to zero */
+ memset (outbuffer, '0', NUMREGBYTES);
+ outbuffer[NUMREGBYTES] = '\0';
+
+ if (curframe.valid) /* debugging a trace frame */
+ mem2hex( (unsigned char*) curframe.traceregs,
+ outbuffer, NUMREGBYTES, 0 );
+ else
+ mem2hex( (unsigned char*) registers, outbuffer, NUMREGBYTES, 0 );
+
+ putpacket( outbuffer );
+ }
+ break;
+ case 'G': /* Write registers.
+ Gxxxxxxxx Each byte of register data is described by
+ two hex digits. */
+ if (curframe.valid) /* debugging a trace frame */
+ putpacket ("E03"); /* can't write regs into a trace frame! */
+ else
+ {
+ /* Write the values into the local registers cache...
+ Note that no actual registers are being changed. */
+
+ hex2mem( request,
+ (unsigned char *) registers, NUMREGBYTES, 0 );
+ putpacket( "OK" );
+ }
+ break;
+ case 'P': /* Write (single) register.
+ Pnn=xxxxxxxx register nn gets value xxxxxxxx;
+ two hex digits for each byte in the register
+ (target byte order). */
+
+ if (curframe.valid)
+ putpacket ("E03"); /* can't write regs into a trace frame! */
+ else
+ {
+ unsigned long regno;
+
+ if ( hexToInt( &request, &regno ) && *(request++) == '=' )
+ {
+ if ( regno < NUMREGS )
+ {
+ hexToInt( &request,
+ (unsigned long *) &registers[REGISTER_BYTE(regno)]);
+
+ putpacket( "OK" );
+ }
+ else
+ putpacket( "E01" ); /* bad packet or regno */
+ }
+ }
+ break;
+ case 'm': /* Read memory.
+ mAAAAAAAA,LLLL AAAAAAAA is address, LLLL is length.
+ Reply can be fewer bytes than requested
+ if able to read only part of the data. */
+ {
+ unsigned long addr, len;
+
+ if ( hexToInt( &request, &addr ) &&
+ *(request++) == ',' &&
+ hexToInt( &request, &len ) )
+ {
+ /* better not overwrite outbuffer! */
+ if ( len > (BUFMAX / 2) - 5 )
+ len = (BUFMAX / 2) - 5;
+ if (mem2hex((unsigned char *) addr, outbuffer, len, 1) == 0) /* XXX: eventually use returned value */
+ putpacket( "E03" ); /* read fault (access denied) */
+ else
+ putpacket( outbuffer ); /* read succeeded */
+ }
+ else
+ putpacket( "E01" ); /* badly formed read request */
+
+ }
+ break;
+ case 'M': /* Write memory.
+ Maaaaaaaa,llll:xxxx aaaaaaaa is address, llll is length;
+ xxxx is data to write. */
+
+ {
+ unsigned long addr, len;
+
+ if (curframe.valid) /* can't write memory into a trace frame! */
+ putpacket ("E03"); /* "access denied" */
+ else /*** if ( write_access_enabled ) ***/
+ {
+ if ( hexToInt( &request, &addr ) &&
+ *(request++) == ',' &&
+ hexToInt( &request, &len ) &&
+ *(request++) == ':' )
+ {
+ if (len == 2 &&
+ addr >= CS_CODE_START &&
+ addr <= LAST_CS_WORD)
+ {
+ unsigned long val;
+
+ if ( !hexToInt( &request, &val ) ||
+ write_to_protected_mem( (void *)addr, val ) )
+ putpacket( "E03" ); /* write fault (access denied) */
+ else
+ putpacket( "OK" ); /* write succeeded */
+ }
+ else
+ {
+ if ( hex2mem( request, (unsigned char*) addr, len, 1 ) )
+ putpacket( "E03" ); /* write fault (access denied) */
+ else
+ putpacket( "OK" ); /* write succeeded */
+ }
+ }
+ else
+ putpacket( "E02" ); /* badly formed write request */
+ }
+ }
+ break;
+ case 'c': /* Continue.
+ cAAAAAAAA AAAAAAAA is address from which to resume.
+ If omitted, resume at current PC. */
+
+ {
+ unsigned long addr;
+
+ if (curframe.valid)
+ {
+ /* Don't continue if debugging a trace frame! */
+ gdb_puts ("Error: can't continue!\n");
+ putpacket ("S03");
+ }
+ else
+ {
+ gdb_signo = 3;
+ if (isxdigit(request[0]))
+ {
+ hexToInt(&request, &addr);
+ registers[REGISTER_BYTE(PC)] = addr;
+ }
+
+ gdb_handling_trap1 = FALSE;
+ gdb_handling_sstrace = FALSE;
+ sss_trace_flag = '\0';
+ }
+ }
+ break;
+ case 's': /* Step.
+ sAAAAAAAA AAAAAAAA is address from which to begin stepping.
+ If omitted, begin stepping at current PC. */
+ {
+ unsigned long addr;
+
+ if (curframe.valid)
+ {
+ /* Don't step if debugging a trace frame! */
+ gdb_puts ("Error: can't step!\n");
+ putpacket ("S03");
+ }
+ else
+ {
+ gdb_signo = 3;
+ if (isxdigit(request[0]))
+ {
+ hexToInt(&request, &addr);
+ registers[REGISTER_BYTE(PC)] = addr;
+ }
+
+ gdb_handling_trap1 = FALSE;
+ gdb_handling_sstrace = FALSE;
+ sss_trace_flag = 't';
+ }
+ }
+ break;
+ case 'C': /* Continue with signal.
+ Cxx;AAAAAAAA xx is signal number in hex;
+ AAAAAAAA is adddress from which to resume.
+ If ;AAAAAAAA omitted, continue from PC. */
+
+ {
+ unsigned long addr = 0;
+
+ if (!gdb_handling_trap1 || curframe.valid)
+ {
+ /* Don't continue if not currently in synchronous mode,
+ or if currently debugging a trace frame! */
+ gdb_puts( "Error: can't continue!\n" );
+ putpacket( "S03" ); /* "sigquit" (better idea?) */
+ }
+ else
+ {
+ gdb_signo = 3;
+ if ( isxdigit( *request ) )
+ {
+ hex2mem( request, (unsigned char *) &gdb_signo, 2, 0 );
+ request += 2;
+ if ( *request == ';' && isxdigit( *++request ) )
+ {
+ hexToInt( &request, &addr );
+ registers[REGISTER_BYTE(PC)] = addr;
+ }
+ }
+ gdb_handling_trap1 = FALSE;
+ gdb_handling_sstrace = FALSE;
+ sss_trace_flag = '\0';
+ }
+ }
+ break;
+ case 'S': /* Step with signal.
+ Sxx;AAAAAAAA xx is signal number in hex;
+ AAAAAAAA is adddress from which to begin stepping.
+ If ;AAAAAAAA omitted, begin stepping from PC. */
+ {
+ unsigned long addr = 0;
+
+ if (!gdb_handling_trap1 || curframe.valid)
+ {
+ /* Don't step if not currently in synchronous mode,
+ or if currently debugging a trace frame! */
+ gdb_puts( "Error: can't step!\n" );
+ putpacket( "S03" ); /* "sigquit" (better idea?) */
+ }
+ else
+ {
+ gdb_signo = 3;
+ if ( isxdigit( *request ) )
+ {
+ hex2mem( request, (unsigned char *) &gdb_signo, 2, 0 );
+ request += 2;
+ if ( *request == ';' && isxdigit( *++request ) )
+ {
+ hexToInt( &request, &addr );
+ registers[REGISTER_BYTE(PC)] = addr;
+ }
+ }
+ gdb_handling_trap1 = FALSE;
+ gdb_handling_sstrace = FALSE;
+ sss_trace_flag = 't';
+ }
+ }
+ break;
+ case '?': /* Query the latest reason for stopping.
+ Should be same reply as was last generated
+ for step or continue. */
+
+ if ( gdb_signo == 0 )
+ gdb_signo = 3; /* default to SIGQUIT */
+ outbuffer[ 0 ] = 'S';
+ outbuffer[ 1 ] = hexchars[ gdb_signo >> 4 ];
+ outbuffer[ 2 ] = hexchars[ gdb_signo & 0xf ];
+ outbuffer[ 3 ] = 0;
+ putpacket( outbuffer );
+ break;
+
+ case 'd': /* Toggle debug mode
+ I'm sure we can think of something interesting. */
+
+ remote_debug = !remote_debug;
+ putpacket( "" ); /* return empty packet */
+ break;
+
+ case 'q': /* general query */
+ switch (*request++)
+ {
+ default:
+ putpacket (""); /* nak a request which we don't handle */
+ break;
+ case 'T': /* trace query */
+ putpacket (handle_trace_query (request));
+ break;
+ case 'C': /* crc query (?) */
+ if (*request++ == 'R' &&
+ *request++ == 'C' &&
+ *request++ == ':')
+ putpacket (crc_query (request));
+ else
+ putpacket (""); /* unknown query */
+ break;
+ }
+ break;
+
+ case 'Q': /* general set */
+ switch (*request++)
+ {
+ default:
+ putpacket (""); /* nak a request which we don't handle */
+ break;
+ case 'T': /* trace */
+ putpacket (handle_trace_set (request));
+ break;
+ }
+ break;
+
+ case 'T':
+ /* call test function: TAAA,BBB,CCC
+ A, B, and C are arguments to pass to gdb_c_test. Reply is
+ "E01" (bad arguments) or "OK" (test function called). */
+ putpacket (handle_test (request));
+ break;
+ }
+}
+
+static TDP_SETUP_INFO tdp_temp;
+static int trace_running;
+
+/*
+ * Function msgcmp:
+ *
+ * If second argument (str) is matched in first argument,
+ * then advance first argument past end of str and return "SAME"
+ * else return "DIFFERENT" without changing first argument.
+ *
+ * Return: zero for DIFFERENT, non-zero for SUCCESS
+ */
+
+static int
+msgcmp (char **msgp, char *str)
+{
+ char *next;
+
+ if (msgp != 0 && str != 0) /* input validation */
+ if ((next = *msgp) != 0)
+ {
+ for (;
+ *next && *str && *next == *str;
+ next++, str++)
+ ;
+
+ if (*str == 0) /* matched all of str in msg */
+ return (int) (*msgp = next); /* advance msg ptr past str */
+ }
+ return 0; /* failure */
+}
+
+static char *
+handle_trace_query (char *request)
+{
+ if (msgcmp (&request, "Status"))
+ {
+ if (adbg_check_if_active ())
+ {
+ gdb_puts ("Target trace is running.\n");
+ return "T1";
+ }
+ else
+ {
+ gdb_puts ("Target trace not running.\n");
+ trace_running = 0;
+ return "T0";
+ }
+ }
+ else /* unknown trace query */
+ {
+ return "";
+ }
+}
+
+static void
+gdb_note (char *fmt, int arg1)
+{
+ if (remote_debug > 1)
+ {
+ sprintp (spare_buffer, fmt, arg1);
+ gdb_puts (spare_buffer);
+ }
+}
+
+static int
+error_ret (int ret, char *fmt, int arg1)
+{
+ if (remote_debug > 0)
+ {
+ sprintp (spare_buffer, fmt, arg1);
+ gdb_puts (spare_buffer);
+ }
+ return ret;
+}
+
+static int
+handle_format (char **request, COLLECTION_FORMAT_DEF *format)
+{
+ MEMRANGE_DEF m;
+ DTC_RESPONSE ret;
+ int elinum;
+ unsigned long regnum;
+ long bytecodes[(MAX_BYTE_CODES + sizeof (struct t_expr_tag))/ 4];
+ struct t_expr_tag *t_expr = (struct t_expr_tag *)bytecodes;
+
+ if (format->id == 0)
+ {
+ if ((ret = get_unused_format_id (&format->id)) != OK_TARGET_RESPONSE)
+ return dtc_error_ret (-1, "get_unused_format_id", ret);
+
+ if (**request == 'R')
+ {
+ (*request)++;
+ hexToInt (request, &format->regs_mask);
+ }
+ gdb_note ("STUB: call define_format (id = %d, ", format->id);
+ gdb_note ("regs_mask = 0x%X);\n", format->regs_mask);
+
+ if ((ret = define_format (format)) != OK_TARGET_RESPONSE)
+ {
+ sprintp (spare_buffer,
+ "'define_format': DTC error '%s' for format id %d.\n",
+ get_err_text (ret),
+ format->id);
+ gdb_puts (spare_buffer);
+ return -1;
+ }
+ }
+
+ while ((**request == 'M') || (**request == 'X'))
+ {
+ switch (**request)
+ {
+ case 'M': /* M<regnum>,<offset>,<size> */
+ (*request)++;
+ hexToInt(request, &regnum);
+
+ if (regnum == 0 || regnum == (unsigned long) -1)
+ m.typecode = -1;
+ else if ((elinum = index_to_elinum (regnum)) > 0)
+ m.typecode = elinum;
+ else
+ return error_ret (-1,
+ "Memrange register %d is not between 0 and 15\n",
+ regnum);
+
+ if (*(*request)++ != ',')
+ return error_ret (-1,"Malformed memrange (comma #%d missing)\n",1);
+ hexToInt(request, &m.offset);
+ if (*(*request)++ != ',')
+ return error_ret (-1,"Malformed memrange (comma #%d missing)\n",2);
+ hexToInt(request, &m.size);
+
+ gdb_note ("STUB: call add_format_mem_range (typecode = 0x%x, ",
+ m.typecode);
+ gdb_note ("offset = 0x%X, ", m.offset);
+ gdb_note ("size = %d);\n", m.size);
+ if ((ret = add_format_mem_ranges (format->id, &m)) !=
+ OK_TARGET_RESPONSE)
+ {
+ dtc_error_ret (-1, "add_format_mem_ranges", ret);
+ sprintp (spare_buffer,
+ "format id %d: memrange (0x%x, 0x%x, 0x%x).\n",
+ format->id, m.typecode, m.offset, m.size);
+ gdb_puts (spare_buffer);
+ return -1;
+ }
+ break;
+
+ case 'X': /* X<length>,<bytecodes> */
+ {
+ unsigned long length;
+
+ (*request)++;
+ hexToInt(request, &length);
+
+ if ((length <= 0) || (length > MAX_BYTE_CODES))
+ return error_ret (-1,
+ "Bytecode expression length (%d) too large\n",
+ length);
+
+ if (*(*request)++ != ',')
+ return error_ret (-1,
+ "Malformed bytecode expr (comma#%d missing)\n",
+ 1);
+ t_expr->next = NULL;
+ /* subtract one to account for expr[0] in header */
+ t_expr->size = sizeof(struct t_expr_tag) + length - 1;
+ t_expr->expr_size = length;
+
+ hex2mem(*request, &t_expr->expr[0], length, 0);
+ *request += 2 * length;
+ build_and_add_expression(format->id, t_expr);
+ }
+ break;
+ }
+ }
+ return 0;
+}
+
+static char *
+handle_trace_set (char *request)
+{
+ long n_frame;
+ unsigned long frameno, tdp, pc, start, stop;
+ DTC_RESPONSE ret = -1;
+ static COLLECTION_FORMAT_DEF tempfmt1;
+ static char enable;
+ static char retbuf[20];
+
+ if (msgcmp (&request, "init"))
+ {
+ gdb_note ("STUB: call clear_trace_state();\n", 0);
+ curframe.valid = 0; /* all old frames become invalid now */
+ if ((ret = clear_trace_state ()) == OK_TARGET_RESPONSE)
+ return "OK";
+ else
+ {
+ sprintp (retbuf, "E2%x", ret);
+ return (char *) dtc_error_ret ((int) &retbuf,
+ "clear_trace_state",
+ ret);
+ }
+ }
+ else if (msgcmp (&request, "Start"))
+ {
+ trace_running = 1;
+ curframe.valid = 0; /* all old frames become invalid now */
+ gdb_note ("STUB: call start_trace_experiment();\n", 0);
+ adbg_save_trace_in_nvd ();
+ if ((ret = start_trace_experiment ()) == OK_TARGET_RESPONSE)
+ return "OK";
+ else
+ {
+ sprintp (retbuf, "E2%x", ret);
+ return (char *) dtc_error_ret ((int) &retbuf,
+ "start_trace_experiment",
+ ret);
+ }
+ }
+ else if (msgcmp (&request, "Stop"))
+ {
+ trace_running = 0;
+ if (adbg_check_if_active ())
+ {
+ gdb_note ("STUB: call end_trace_experiment();\n", 0);
+ if ((ret = end_trace_experiment ()) == OK_TARGET_RESPONSE)
+ return "OK";
+ else
+ {
+ sprintp (retbuf, "E2%x", ret);
+ return (char *) dtc_error_ret ((int) &retbuf,
+ "end_trace_experiment",
+ ret);
+ }
+ }
+ else return "OK";
+ }
+ /* "TDP:" (The 'T' was consumed in handle_request.) */
+ else if (msgcmp (&request, "DP:"))
+ {
+ /* TDP:<id>:<addr>:{D,E}:<stepcount>:<pass_limit>{R[M,X]+}<tdp-format>
+ {S{R[M,X]+}}<tp-format>
+
+ D -- disable tracepoint (illegal from EMC's point of view)
+ E -- enable tracepoint?
+
+ R -- regs format: R<regs-mask>
+ M -- memory format: M<regnum>,<offset>,<size>
+ X -- expr format: X<size>,<bytecodes>
+ S -- fencepost between trap formats and stepping formats.
+ */
+
+ /* state variable, required for splitting TDP packets. */
+ static int doing_step_formats;
+
+ /*
+ * TDP: packets may now be split into multiple packets.
+ * If a TDP packet is to be continued in another packet, it
+ * must end in a "-" character. The subsequent continuation
+ * packet will then begin with a "-" character, between the
+ * token "TDP:" and the tdp_id field. The ID and address
+ * will be repeated in each sub-packet. The step_count,
+ * pass_count, and 'enabled' field must appear in the first
+ * packet. The boundary between sub-packets may not appear
+ * between the "S" that denotes the start of stepping "formats",
+ * and the regs_mask that follows it. The split may also not
+ * occur in the middle of either a memrange description or a
+ * bytecode string. -- MVS
+ */
+
+ if (*request == '-') /* this is a continuation of a
+ trace definition in progress */
+ {
+ unsigned long temp_id, temp_addr;
+
+ request++;
+ if (!(hexToInt (&request, &temp_id) &&
+ *request++ == ':'))
+ return "E11"; /* badly formed packet, field 1 */
+
+ if (!(hexToInt (&request, (unsigned long *) &temp_addr) &&
+ *request++ == ':'))
+ return "E12"; /* badly formed packet, field 2 */
+
+ if (temp_id != tdp_temp.id)
+ return "E11"; /* something wrong: field 1 doesn't match */
+ if (temp_addr != (unsigned long) tdp_temp.addr)
+ return "E12"; /* something wrong: field 2 doesn't match */
+ }
+ else /* This is a new TDP definition */
+ {
+ memset ((char *) &tdp_temp, 0, sizeof (tdp_temp));
+ memset ((char *) &tempfmt1, 0, sizeof (tempfmt1));
+ doing_step_formats = FALSE;
+
+ if (!(hexToInt (&request, &tdp_temp.id) &&
+ *request++ == ':'))
+ return "E11"; /* badly formed packet, field 1 */
+
+ if (!(hexToInt (&request, (unsigned long *) &tdp_temp.addr) &&
+ *request++ == ':'))
+ return "E12"; /* badly formed packet, field 2 */
+
+ if (!(((enable = *request++) == 'D' || enable == 'E') &&
+ *request++ == ':'))
+ return "E13"; /* badly formed packet, field 3 */
+#if 0
+ if (enable == 'D')
+ {
+ gdb_puts ("Disabling of tracepoints not supported by EMC target\n");
+ return "E20";
+ }
+#endif
+ if (!(hexToInt (&request, &tdp_temp.stepcount) &&
+ *request++ == ':'))
+ return "E14"; /* badly formed packet, field 4 */
+
+ if (!hexToInt (&request, &tdp_temp.pass_limit))
+ return "E15"; /* badly formed packet, field 5 */
+
+ }
+
+ /* Typically, the first group of collection descriptors
+ refers to the trap collection. There is an "S" token
+ to act as a fencepost between collection descriptors for
+ the trap, and those for the single-stepping.
+
+ However, when the packet is split up into several packets,
+ this "S" token may already have been seen in a previous
+ sub-packet; so we have to remember it in a state variable. */
+
+ if (*request == 'R' || *request == 'M' || *request == 'X')
+ {
+ if (handle_format (&request, &tempfmt1))
+ return "E16";
+ if (doing_step_formats)
+ tdp_temp.tp_format_p = tempfmt1.id;
+ else
+ tdp_temp.tdp_format_p = tempfmt1.id;
+ }
+
+ /* When we see the "S" token, we remember it in a state variable
+ (in case the packet is split up and continued in another message),
+ and discard all current state from the collection "format". */
+ if (*request == 'S')
+ {
+ doing_step_formats = TRUE;
+ /* discard prev format and start a new one */
+ memset ((char *) &tempfmt1, 0, sizeof (tempfmt1));
+ request++;
+
+ /* Having seen the "S" fencepost, it is now possible that
+ we will see some more collection descriptors pertaining
+ to the stepping collection. */
+ if (*request == 'R' || *request == 'M' || *request == 'X')
+ {
+ if (handle_format (&request, &tempfmt1))
+ return "E17";
+ /* new format ID is tp_format */
+ tdp_temp.tp_format_p = tempfmt1.id;
+ }
+ }
+
+ if (*request == '-') /* this TDP definition will be continued. */
+ sprintp (retbuf, "OK");
+ else if (enable == 'E') /* end of TDP definition: pass to ADBG (if enabled!) */
+ {
+ gdb_note ("STUB: call define_tdp (id %d, ", tdp_temp.id);
+ gdb_note ("addr 0x%X, ", (int) tdp_temp.addr);
+ gdb_note ("passc %d, ", tdp_temp.pass_limit);
+ gdb_note ("stepc %d, ", tdp_temp.stepcount);
+ gdb_note ("TDP fmt #%d, ", tdp_temp.tdp_format_p);
+ gdb_note ("TP fmt #%d);\n", tdp_temp.tp_format_p);
+
+ ret = define_tdp (tdp_temp.id, &tdp_temp, 0);
+
+ if (ret == OK_TARGET_RESPONSE)
+ {
+ sprintp (retbuf, "OK");
+ }
+ else
+ {
+ sprintp (spare_buffer,
+ "'define_tdp' returned DTC error '%s' for tracepoint %d.\n",
+ get_err_text (ret),
+ tdp_temp.id);
+ gdb_puts (spare_buffer);
+ sprintp (retbuf, "E2%x", ret);
+ }
+ /* Redundant, but let's try to make sure this state gets discarded. */
+ {
+ memset ((char *) &tdp_temp, 0, sizeof (tdp_temp));
+ memset ((char *) &tempfmt1, 0, sizeof (tempfmt1));
+ }
+ }
+ else /* ADBG_DTC does not support disabled tracepoints -- ignore it. */
+ gdb_note ("STUB: ignoring disabled tracepoint %d.\n", tdp_temp.id);
+
+ return retbuf;
+ }
+ else if (msgcmp (&request, "Frame:"))
+ {
+ ret = OK_TARGET_RESPONSE;
+
+ if (msgcmp (&request, "pc:"))
+ {
+ if (!hexToInt (&request, &pc))
+ return "E10"; /* badly formed packet */
+ n_frame = curframe.valid ? curframe.frame_id + 1 : 0;
+ gdb_note ("STUB: call fetch_trace_frame_pc (id %d, ", n_frame);
+ gdb_note ("pc 0x%X);\n", pc);
+ ret = fetch_trace_frame_with_pc (&n_frame,
+ (void *) pc,
+ &curframe.format,
+ &curframe.frame_data);
+ }
+ else if (msgcmp (&request, "tdp:"))
+ {
+ if (!hexToInt (&request, &tdp))
+ return "E10"; /* badly formed packet */
+ n_frame = curframe.valid ? curframe.frame_id + 1: 0;
+ gdb_note ("STUB: call fetch_trace_frame_tdp (id %d, ", n_frame);
+ gdb_note ("tdp 0x%X);\n", tdp);
+ ret = fetch_trace_frame_with_tdp (&n_frame,
+ tdp,
+ &curframe.format,
+ &curframe.frame_data);
+ }
+ else if (msgcmp (&request, "range:"))
+ {
+ if (!(hexToInt (&request, &start) &&
+ *request++ == ':'))
+ return "E11"; /* badly formed packet, field 1 */
+ else if (!hexToInt (&request, &stop))
+ return "E12"; /* badly formed packet, field 2 */
+ n_frame = curframe.valid ? curframe.frame_id + 1: 0;
+ gdb_note ("STUB: call fetch_trace_frame_range (id %d, ", n_frame);
+ gdb_note ("start 0x%X, ", start);
+ gdb_note ("stop 0x%X);\n", stop);
+ ret = fetch_trace_frame_with_pc_in_range (&n_frame,
+ (void *) start,
+ (void *) stop,
+ &curframe.format,
+ &curframe.frame_data);
+ }
+ else if (msgcmp (&request, "outside:"))
+ {
+ if (!(hexToInt (&request, &start) &&
+ *request++ == ':'))
+ return "E11"; /* badly formed packet, field 1 */
+ else if (!hexToInt (&request, &stop))
+ return "E12"; /* badly formed packet, field 2 */
+ n_frame = curframe.valid ? curframe.frame_id + 1: 0;
+ gdb_note ("STUB: call fetch_trace_frame_outside (id %d, ", n_frame);
+ gdb_note ("start 0x%X, ", start);
+ gdb_note ("stop 0x%X);\n", stop);
+ ret = fetch_trace_frame_with_pc_outside (&n_frame,
+ (void *) start,
+ (void *) stop,
+ &curframe.format,
+ &curframe.frame_data);
+ }
+ else /* simple TFind by frame number: */
+ {
+ if (!hexToInt (&request, &frameno))
+ return "E10"; /* badly formed packet */
+ if (frameno != (unsigned long) -1)
+ {
+ gdb_note ("STUB: call fetch_trace_frame (id %d);\n", frameno);
+ ret = fetch_trace_frame (n_frame = frameno,
+ &curframe.format,
+ &curframe.frame_data);
+#if 0
+ printp("STUB: fetch_trace_frame: return %d\n", ret);
+#endif
+ }
+ else /* discard any trace frame, debug "the real world" */
+ {
+ if (curframe.valid)
+ gdb_note ("STUB: discard current trace frame #%d.\n",
+ curframe.frame_id);
+ curframe.valid = 0;
+ return "OK";
+ }
+ }
+ if (ret == OK_TARGET_RESPONSE) /* fetch_trace_frame succeeded */
+ { /* setup for debugging the trace frame */
+ curframe.valid = 1;
+ curframe.frame_id = n_frame;
+ curframe.tdp_id = curframe.frame_data->id;
+
+ memset ((char *) &curframe.traceregs, 0,
+ sizeof (curframe.traceregs));
+ curframe.traceregs[PC] = (unsigned long)
+ curframe.frame_data->program_counter;
+
+ if (curframe.format)
+ {
+ unsigned long regs_mask = curframe.format->regs_mask;
+ unsigned long *regs, *stack, *mem;
+ unsigned long regno, index = 0;
+ CFD *dummy;
+
+ if ((ret = get_addr_to_frame_regs_stack_mem
+ (curframe.frame_data, &dummy, &regs, &stack, &mem))
+ != OK_TARGET_RESPONSE)
+ {
+ curframe.valid = 0;
+ sprintp (retbuf, "E2%x", ret);
+ return (char *)
+ dtc_error_ret ((int) &retbuf,
+ "get_addr_to_frame_regs_stack_mem",
+ ret);
+ }
+
+ if (remote_debug > 1)
+ { /* echo what we've found to gdb console */
+ sprintp (spare_buffer,
+ "STUB: Found frame %d, TDP %d, format %d (%s):\n",
+ curframe.frame_id,
+ curframe.tdp_id & 0x7fffffff,
+ curframe.format->id,
+ curframe.tdp_id & 0x80000000 ?
+ "trap frame" : "stepping frame");
+ gdb_puts (spare_buffer);
+ }
+ /* copy trace frame regs into stub's data format */
+ for (regno = 0, index = 0;
+ regno < 16;
+ regno++, regs_mask >>= 1)
+ if (regs_mask & 1) /* got a collected register */
+ {
+ curframe.traceregs[regno] = regs[index++];
+ if (remote_debug > 1)
+ {
+ sprintp (spare_buffer,
+ " Collected 0x%08x for register %d.\n",
+ curframe.traceregs[regno], regno);
+ gdb_puts (spare_buffer);
+ }
+ }
+ if (remote_debug > 1)
+ {
+ long midx, ridx, len;
+ MEMRANGE_DEF *mrange;
+ unsigned char *data, *base;
+
+ if (curframe.format->stack_size > 0)
+ {
+ len = curframe.format->stack_size;
+ sprintp (spare_buffer,
+ " Collected %d bytes of stack at 0x%x:\n",
+ len, curframe.traceregs[A7]);
+ gdb_puts (spare_buffer);
+
+ /* print stack data, but stay under msg len */
+ if (len >= (NUMREGBYTES/2 - 2))
+ len = (NUMREGBYTES/2 - 3);
+ mem2hex ((unsigned char *) stack,
+ spare_buffer, len, 0);
+ spare_buffer [len * 2] = '\n';
+ spare_buffer [len * 2 + 1] = '\0'; /* EOS */
+ gdb_puts (spare_buffer);
+ }
+ else
+ gdb_puts ("Stack not collected\n");
+
+ for (midx = 0;
+ get_addr_to_a_mem_range (curframe.frame_data,
+ midx,
+ &mrange,
+ (void **) &data)
+ == OK_TARGET_RESPONSE;
+ midx++)
+ {
+ if ((mrange->typecode == 0) ||
+ (mrange->typecode == (unsigned long) -1))
+ {
+ sprintp (spare_buffer,
+ " Collected %d bytes at MEM: 0x%x:\n",
+ mrange->size, mrange->offset);
+ base = (unsigned char *) mrange->offset;
+ }
+ else
+ {
+ if ((ridx = elinum_to_index (mrange->typecode)) > 0)
+ base = (unsigned char *) curframe.traceregs[ridx]
+ + (long) mrange->offset;
+ else
+ {
+ sprintp (spare_buffer,
+ "STUB: bad typecode in memrange #%d: (0x%x,0x%x,0x%x).\n",
+ midx,
+ mrange->typecode,
+ mrange->offset,
+ mrange->size);
+ gdb_puts (spare_buffer);
+ continue;
+ }
+ sprintp (spare_buffer,
+ " Collected %d bytes at 0x%x (REG %X + %d):\n",
+ mrange->size,
+ base,
+ mrange->typecode,
+ mrange->offset);
+ }
+ gdb_puts (spare_buffer);
+ len = mrange->size;
+ if (len >= (NUMREGBYTES/2 - 2))
+ len = (NUMREGBYTES/2 - 3);
+ mem2hex (data, spare_buffer, len, 0);
+ spare_buffer [len * 2] = '\n';
+ spare_buffer [len * 2 + 1] = '\0'; /* EOS */
+ gdb_puts (spare_buffer);
+ }
+ }
+ }
+ sprintp (retbuf, "F%xT%x", n_frame, curframe.tdp_id & 0x7fffffff);
+ return retbuf;
+ }
+ else if (ret == NOT_FOUND_TARGET_RESPONSE)
+ {
+ /* Here's a question: if the fetch_trace_frame call failed
+ (which probably means a bad "TFIND" command from GDB),
+ should we remain focused on the previous frame (if any),
+ or should we revert to "no current frame"?
+ */
+ return "F-1";
+ }
+ else
+ {
+ sprintp (retbuf, "E2%x", ret);
+ return (char *) dtc_error_ret ((int) &retbuf,
+ "fetch_trace_frame[...]",
+ ret);
+ }
+ }
+ else /* unknown trace command */
+ {
+ return "";
+ }
+}
+
+/* Table used by the crc32 function to calcuate the checksum. */
+static unsigned long crc32_table[256];
+
+static int crc_mem_err;
+
+static unsigned long
+crc32 (buf, len, crc)
+ unsigned char *buf;
+ int len;
+ unsigned long crc;
+{
+ crc_mem_err = FALSE;
+
+ if (! crc32_table[1])
+ {
+ /* Initialize the CRC table and the decoding table. */
+ int i, j;
+ unsigned int c;
+
+ for (i = 0; i < 256; i++)
+ {
+ for (c = i << 24, j = 8; j > 0; --j)
+ c = c & 0x80000000 ? (c << 1) ^ 0x04c11db7 : (c << 1);
+ crc32_table[i] = c;
+ }
+ }
+
+ while (len--)
+ {
+ if (read_access_violation (buf))
+ {
+ crc_mem_err = TRUE;
+ return -1;
+ }
+ crc = (crc << 8) ^ crc32_table[((crc >> 24) ^ *buf++) & 255];
+ }
+ return crc;
+}
+
+static char *
+crc_query (cmd)
+ char *cmd;
+{
+ unsigned long startmem, len, crc;
+ static char buf[32];
+
+ if (hexToInt (&cmd, &startmem) &&
+ *cmd++ == ',' &&
+ hexToInt (&cmd, &len))
+ {
+ crc = crc32 ((unsigned char *) startmem, len, 0xffffffff);
+ if (!crc_mem_err)
+ {
+ sprintp (buf, "C%08x", crc);
+ return buf;
+ }
+ /* else error, fall thru */
+ }
+ sprintp (buf, "E01");
+ return buf;
+}
+
+
+static char *
+handle_test (request)
+ char *request;
+{
+ ULONG args[7];
+ int i;
+
+ /* Parse the arguments, a comma-separated list of hex numbers, into
+ ARGS. Parse at most six arguments. */
+ i = 1;
+ if (*request != '\0')
+ while (i < 7)
+ {
+ if (! hexToInt (&request, &args[i++]))
+ return "E01";
+ if (*request == '\0')
+ break;
+ if (*request++ != ',')
+ return "E01";
+ }
+
+ /* Fill the rest of the args array with zeros. This is what the
+ INLINES command processor does with omitted arguments. */
+ for (; i < 7; i++)
+ args[i] = 0;
+
+ gdb_c_test (args);
+
+ return "OK";
+}
+
+
+/* GDB_TRAP_1_HANDLER
+
+ By the time this is called, the registers have been saved in "registers",
+ and the interrupt priority has been set to permit serial UART interrupts.
+
+ However, since no gdb request has yet been received, and there is no
+ equivalent of getpacket for us to wait on, we can't sit here waiting
+ for packets and processing them.
+
+ In fact, the ONLY thing for us to do here is sit and wait.
+ As gdb sends packet requests, they will handle themselves at the
+ interrupt level. When gdb decides we can continue, it will reset
+ the global variable "gdb_handling_trap1", and we will return
+ (whereupon registers will be restored etc.) */
+
+void gdb_trap_1_handler( void )
+{
+ gdb_handling_trap1 = TRUE;
+ sss_trace_flag = '\0'; /* shut off "trace bit" (indirectly) */
+ gdb_signo = 5;
+ putpacket( "S05" );
+ while ( gdb_handling_trap1 )
+ ;
+ return;
+}
+
+void gdb_trace_handler( void )
+{
+ sss_trace_flag = '\0'; /* shut off "trace bit" (indirectly) */
+ gdb_handling_trap1 = TRUE;
+ gdb_handling_sstrace = TRUE;
+ gdb_signo = 5;
+ putpacket( "S05" );
+ while ( gdb_handling_trap1 )
+ ;
+ return;
+}
diff --git a/gdb/testsuite/gdb.trace/infotrace.exp b/gdb/testsuite/gdb.trace/infotrace.exp
new file mode 100644
index 00000000000..6a117d319ef
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/infotrace.exp
@@ -0,0 +1,99 @@
+# Copyright 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp";
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+
+if [istarget "m68k-*-elf"] then {
+ set srcfile gdb_c_test.c
+ set binfile [board_info target d490_binfile];
+} else {
+ set testfile "actions"
+ set srcfile ${testfile}.c
+ set binfile $objdir/$subdir/$testfile
+ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# If testing on a remote host, download the source file.
+# remote_download host $srcdir/$subdir/$srcfile
+
+gdb_file_cmd $binfile
+
+#
+# test "info tracepoints" command
+#
+
+gdb_delete_tracepoints
+set c_test_num [gdb_gettpnum gdb_c_test];
+set asm_test_num [gdb_gettpnum gdb_asm_test];
+if { $c_test_num <= 0 || $asm_test_num <= 0 } then {
+ fail "setting tracepoints"
+ return;
+}
+
+# 2.1 info tracepoints (all)
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$c_test_num\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_c_test.*$asm_test_num\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*" \
+ "2.1: info tracepoints (all)"
+
+# 2.2 info tracepoint (specific)
+gdb_test "info tracepoint $c_test_num" \
+ "$c_test_num\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*in gdb_c_test.*" \
+ "2.2a: info tracepoint $c_test_num (gdb_c_test)"
+
+gdb_test "info tracepoint $asm_test_num" \
+ "$asm_test_num\[\t \]+y\[\t \]+0x\[0-9a-fA-F\]+.*gdb_asm_test.*" \
+ "2.2b: info tracepoint $asm_test_num (gdb_asm_test)"
+
+# 2.3 info tracepoint (invalid tracepoint number)
+gdb_test "info tracepoint [expr $c_test_num + $asm_test_num]" \
+ "No tracepoint number [expr $c_test_num + $asm_test_num]." \
+ "2.3: info tracepoint (invalid tracepoint number)"
+
+# 2.4 info tracepoints (list of numbers)
+send_gdb "info tracepoints $c_test_num $asm_test_num \n"
+gdb_expect {
+ -re "Num Enb .*$gdb_prompt $" {
+ fail "2.4: info trace rejects multiple tracepoint numbers"
+ }
+ -re ".*$gdb_prompt $" {
+ pass "2.4: info trace rejects multiple tracepoint numbers"
+ }
+}
+
+# 2.5 help info trace
+gdb_test "help info tracepoints" \
+ "Status of tracepoints, or tracepoint number NUMBER.*" \
+ "2.5: help info tracepoints"
+
diff --git a/gdb/testsuite/gdb.trace/limits.c b/gdb/testsuite/gdb.trace/limits.c
new file mode 100644
index 00000000000..d9c02e74bac
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/limits.c
@@ -0,0 +1,51 @@
+/*
+ * Test program for tracing internal limits (number of tracepoints etc.)
+ */
+
+int n = 6;
+
+int arr[64];
+
+static void foo(int x)
+{
+}
+
+static void bar(int y)
+{
+}
+
+static void baz(int z)
+{
+}
+
+static void begin () /* called before anything else */
+{
+}
+
+static void end () /* called after everything else */
+{
+}
+
+int
+main (argc, argv, envp)
+ int argc;
+ char *argv[], **envp;
+{
+ int i;
+
+#ifdef usestubs
+ set_debug_traps ();
+ breakpoint ();
+#endif
+
+ begin ();
+ for (i = 0; i < sizeof(arr) / sizeof(arr[0]); i++)
+ arr[i] = i + 1;
+
+ foo (1);
+ bar (2);
+ baz (3);
+ end ();
+ return 0;
+}
+
diff --git a/gdb/testsuite/gdb.trace/limits.exp b/gdb/testsuite/gdb.trace/limits.exp
new file mode 100644
index 00000000000..eed178084bb
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/limits.exp
@@ -0,0 +1,316 @@
+# Copyright 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+if [istarget "m68k-*-elf"] then {
+ pass "Test not supported on this target"
+ return;
+}
+
+load_lib "trace-support.exp"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+set testfile "limits"
+set srcfile ${testfile}.c
+set binfile $objdir/$subdir/$testfile
+
+if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+# Tests:
+# 1) Meet and exceed artificial limit on number of tracepoints
+# 2) Meet and exceed artificial limit on number of memranges
+# 3) Meet and exceed artificial limit on bytes of bytecode data
+# [NOTE: number four is moved out into its own separate test module.]
+# 4) Meet and exceed artificial limit on bytes of trace buffer storage
+# (circular and non-circular modes). However note that a more
+# thorough test of the circular mode can be made separately.
+
+set cr "\[\r\n\]+"
+
+proc gdb_tracepoint_limit_test { } {
+ global gdb_prompt
+ global cr
+
+ # Make sure we're in a sane starting state.
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ gdb_delete_tracepoints
+
+ # Set three tracepoints
+ gdb_test "trace foo" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "tracepoint limit test: set first tracepoint"
+
+ gdb_test "trace bar" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "tracepoint limit test: set second tracepoint"
+
+ gdb_test "trace baz" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "tracepoint limit test: set third tracepoint"
+
+ # Set secret artificial tracepoint limit to four
+ gdb_test "maint packet QTLimit:tp:4" \
+ "received: .OK." \
+ "tracepoint limit test: set limit to four"
+
+ # Now sending three tracepoints should succeed.
+ send_gdb "tstart\n"
+ gdb_expect {
+ -re "$cr$gdb_prompt" {
+ pass "tracepoint limit test: send fewer than limit"
+ }
+ default {
+ fail "tracepoint limit test: send fewer than limit"
+ }
+ }
+
+ # Set secret artificial tracepoint limit to three
+ gdb_test "maint packet QTLimit:tp:3" \
+ "received: .OK." \
+ "tracepoint limit test: set limit to three"
+
+ # Now sending three tracepoints should still succeed.
+ send_gdb "tstart\n"
+ gdb_expect {
+ -re "$cr$gdb_prompt" {
+ pass "tracepoint limit test: send equal to limit"
+ }
+ default {
+ fail "tracepoint limit test: send equal to limit"
+ }
+ }
+
+ # Set secret artificial tracepoint limit to two
+ gdb_test "maint packet QTLimit:tp:2" \
+ "received: .OK." \
+ "tracepoint limit test: set limit to two"
+
+ # Now sending three tracepoints should fail.
+ gdb_test "tstart" \
+ ".*\[Ee\]rror.*" \
+ "tracepoint limit test: send more than limit"
+
+ # Clean up:
+ gdb_test "tstop" "" ""
+ gdb_test "maint packet QTLimit:tp:FFFFFFFF" "" ""
+}
+
+proc gdb_memrange_limit_test { } {
+ global gdb_prompt
+ global cr
+
+ # Make sure we're in a sane starting state.
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ gdb_delete_tracepoints
+
+ # Set three tracepoints, and make 'em collect memranges
+ gdb_test "trace foo" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "memrange limit test: set first tracepoint"
+
+ gdb_trace_setactions "memrange limit test: set first actions" \
+ "" \
+ "collect \$arg" "^$"
+
+ gdb_test "trace bar" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "memrange limit test: set second tracepoint"
+
+ gdb_trace_setactions "memrange limit test: set second actions" \
+ "" \
+ "collect \$arg" "^$"
+
+ gdb_test "trace baz" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "memrange limit test: set third tracepoint"
+
+ gdb_trace_setactions "memrange limit test: set third actions" \
+ "" \
+ "collect \$arg" "^$"
+
+ # Set secret artificial memrange limit to four
+ gdb_test "maint packet QTLimit:memrange:4" \
+ "received: .OK." \
+ "memrange limit test: set limit to four"
+
+ # Now sending three memranges should still succeed.
+ send_gdb "tstart\n"
+ gdb_expect {
+ -re "$cr$gdb_prompt" {
+ pass "memrange limit test: send fewer than limit"
+ }
+ default {
+ fail "memrange limit test: send fewer than limit"
+ }
+ }
+
+ # Set secret artificial memrange limit to three
+ gdb_test "maint packet QTLimit:memrange:3" \
+ "received: .OK." \
+ "memrange limit test: set limit to three"
+
+ # Now sending three memranges should still succeed.
+ send_gdb "tstart\n"
+ gdb_expect {
+ -re "$cr$gdb_prompt" {
+ pass "memrange limit test: send equal to limit"
+ }
+ default {
+ fail "memrange limit test: send equal to limit"
+ }
+ }
+
+ # Set secret artificial memrange limit to two
+ gdb_test "maint packet QTLimit:memrange:2" \
+ "received: .OK." \
+ "memrange limit test: set limit to two"
+
+ # Now sending three memranges should fail.
+ gdb_test "tstart" \
+ ".*\[Ee\]rror.*" \
+ "memrange limit test: send more than limit"
+
+ # Clean up:
+ gdb_test "tstop" "" ""
+ gdb_test "maint packet QTLimit:memrange:FFFFFFFF" "" ""
+}
+
+
+proc gdb_bytecode_limit_test { } {
+ global gdb_prompt
+ global cr
+
+ # Make sure we're in a sane starting state.
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ gdb_delete_tracepoints
+
+ # Set three tracepoints
+ gdb_test "trace foo" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "bytecode limit test: set first tracepoint"
+
+ gdb_trace_setactions "bytecode limit test: set first actions" \
+ "" \
+ "collect x + n" "^$"
+
+ gdb_test "trace bar" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "bytecode limit test: set second tracepoint"
+
+ gdb_trace_setactions "bytecode limit test: set second actions" \
+ "" \
+ "collect y + n" "^$"
+
+ gdb_test "trace baz" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "bytecode limit test: set third tracepoint"
+
+ gdb_trace_setactions "bytecode limit test: set third actions" \
+ "" \
+ "collect z + n" "^$"
+
+ # Set secret artificial bytecode limit to a large number
+ gdb_test "maint packet QTLimit:bytecode:400" \
+ "received: .OK." \
+ "bytecode limit test: set limit to large"
+
+ # Now sending three bytecodes should still succeed.
+ send_gdb "tstart\n"
+ gdb_expect {
+ -re "$cr$gdb_prompt" {
+ pass "bytecode limit test: send fewer than limit"
+ }
+ default {
+ fail "bytecode limit test: send fewer than limit"
+ }
+ }
+
+ # Set secret artificial bytecode limit to a small number
+ gdb_test "maint packet QTLimit:bytecode:40" \
+ "received: .OK." \
+ "bytecode limit test: set limit to small"
+
+ # Now sending three bytecodes should fail.
+ gdb_test "tstart" \
+ ".*\[Ee\]rror.*" \
+ "bytecode limit test: send more than limit"
+
+
+ # Clean up:
+ gdb_test "tstop" "" ""
+ gdb_test "maint packet QTLimit:bytecode:FFFFFFFF" "" ""
+}
+
+proc gdb_trace_limits_tests { } {
+ global gdb_prompt
+
+ # We generously give ourselves one "pass" if we successfully
+ # detect that this test cannot be run on this target!
+
+ if { ![gdb_target_supports_trace] } then {
+ pass "Current target does not supporst trace"
+ return 1;
+ }
+
+ if [gdb_test "maint packet QTLimit:tp:ffffffff" \
+ "received: .OK." ""] then {
+ pass "This test cannot be run on this target"
+ return 1;
+ }
+
+ if [gdb_test "maint packet QTLimit:memrange:ffffffff" \
+ "received: .OK." ""] then {
+ pass "This test cannot be run on this target"
+ return 1;
+ }
+
+ if [gdb_test "maint packet QTLimit:bytecode:ffffffff" \
+ "received: .OK." ""] then {
+ pass "This test cannot be run on this target"
+ return;
+ }
+
+ gdb_tracepoint_limit_test
+ gdb_memrange_limit_test
+ gdb_bytecode_limit_test
+}
+
+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+if [target_info exists gdb_stub] {
+ gdb_step_for_stub;
+}
+# Body of test encased in a proc so we can return prematurely.
+gdb_trace_limits_tests
diff --git a/gdb/testsuite/gdb.trace/packetlen.exp b/gdb/testsuite/gdb.trace/packetlen.exp
new file mode 100644
index 00000000000..458f732477e
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/packetlen.exp
@@ -0,0 +1,100 @@
+# Copyright 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+
+if [istarget "m68k-*-elf"] then {
+ load_lib "emc-support.exp"
+ set srcfile gdb_c_test.c
+ set binfile [board_info target d490_binfile];
+ gdb_test "set remotetimeout 6" "" ""
+ set timeout 500
+ gdb_target_monitor "$binfile"
+ # Give a TSTOP and ignore errors, to make sure any previous trace is off
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ send_gdb "compare-sections CS\n"
+ gdb_expect {
+ -re "MIS-MATCHED.*$gdb_prompt $" {
+ gdb_suppress_entire_file "Symbol file does not match target!
+ all tests in this module will fail.";
+ }
+ -re ".*$gdb_prompt $" { }
+ }
+} else {
+ set testfile "actions"
+ set srcfile ${testfile}.c
+ set binfile $objdir/$subdir/$testfile
+ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+ gdb_load $binfile
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ runto_main
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# If testing on a remote host, download the source file.
+# remote_download host $srcdir/$subdir/$srcfile
+
+#
+# Test collecting a whole bunch of stuff at a single tracepoint.
+# The test is whether this crashes GDB.
+#
+
+gdb_delete_tracepoints
+gdb_test "trace gdb_c_test" "" ""
+gdb_trace_setactions "setup collect actions" \
+ "" \
+ "collect parm\[0\], parm\[1\], parm\[2\], parm\[3\]" "^$" \
+ "collect parm\[4\], parm\[5\], parm\[6\], parm\[7\]" "^$" \
+ "collect p, local_reg, local_static, local_static_sizeof" "^$" \
+ "collect local_long, stack_ptr, end_of_stack" "^$" \
+ "collect gdb_char_test, gdb_short_test, gdb_long_test" "^$" \
+ "collect gdb_arr_test, gdb_struct1_test, gdb_struct2_test" "^$" \
+ "collect gdb_structp_test, gdb_structpp_test, gdb_union1_test" "^$" \
+ "end" ""
+
+gdb_test "tstart" "" "survive the long packet send"
+if [istarget "m68k-*-elf"] then {
+ gdb_emclaptop_command "85,1,2,3,4,5,6"
+ sleep 5
+} else {
+ gdb_test "break end" "" ""
+ gdb_test "continue" \
+ "Continuing.*Breakpoint $decimal, end.*" \
+ "run trace experiment"
+}
+
+gdb_test "tstop" "" "confirm: survived the long packet send"
+
diff --git a/gdb/testsuite/gdb.trace/passc-dyn.exp b/gdb/testsuite/gdb.trace/passc-dyn.exp
new file mode 100644
index 00000000000..d0c27ea4386
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/passc-dyn.exp
@@ -0,0 +1,181 @@
+# Copyright 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp";
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+if [istarget "m68k-*-elf"] then {
+ load_lib "emc-support.exp";
+ set srcfile gdb_c_test.c
+ set binfile [board_info target d490_binfile];
+ gdb_test "set remotetimeout 6" "" ""
+ set timeout 500
+ gdb_target_monitor $binfile
+ # Give a TSTOP and ignore errors, to make sure any previous trace is off
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ send_gdb "compare-sections CS\n"
+ gdb_expect {
+ -re "MIS-MATCHED.*$gdb_prompt $" {
+ gdb_suppress_entire_file "Symbol file does not match target!
+ all tests in this module will fail.";
+ }
+ -re ".*$gdb_prompt $" { }
+ }
+} else {
+ set testfile "actions"
+ set srcfile ${testfile}.c
+ set binfile $objdir/$subdir/$testfile
+ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+ gdb_load $binfile
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ runto_main
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# We generously give ourselves one "pass" if we successfully
+# detect that this test cannot be run on this target!
+if { ![gdb_target_supports_trace] } then {
+ pass "Current target does not supporst trace"
+ return 1;
+
+}
+
+# If testing on a remote host, download the source file.
+# remote_download host $srcdir/$subdir/$srcfile
+
+
+#
+# test passcount dynamically (live target)
+#
+
+set baseline [gdb_find_recursion_test_baseline $srcfile];
+
+if { $baseline == -1 } then {
+ fail "Could not find gdb_recursion_test function"
+ return;
+}
+
+# define relative source line numbers:
+# all subsequent line numbers are relative to this first one (baseline)
+
+set testline2 [expr $baseline + 4]
+set testline3 [expr $baseline + 5]
+set testline4 [expr $baseline + 6]
+
+#
+# test passcount command semantics (live test)
+#
+
+## Set three tracepoints with three different passcounts.
+## Verify that the experiment stops after the one with the
+## lowest passcount is hit.
+
+gdb_delete_tracepoints
+set tdp2 [gdb_gettpnum "$testline2"]
+set tdp3 [gdb_gettpnum "$testline3"]
+set tdp4 [gdb_gettpnum "$testline4"]
+if { $tdp2 <= 0 || $tdp3 <= 0 || $tdp4 <= 0 } then {
+ fail "setting tracepoints"
+ return;
+}
+
+gdb_test "passcount 4 $tdp2" "Setting tracepoint $tdp2's passcount to 4" \
+ "4.5: set passcount for tracepoint $tdp2"
+gdb_test "passcount 2 $tdp3" "Setting tracepoint $tdp3's passcount to 2" \
+ "4.5: set passcount for tracepoint $tdp3"
+gdb_test "passcount 3 $tdp4" "Setting tracepoint $tdp4's passcount to 3" \
+ "4.5: set passcount for tracepoint $tdp4"
+
+gdb_test "tstart" "" ""
+
+if [istarget "m68k-*-elf"] then {
+ gdb_emclaptop_command "85,1,2,3,4,5,6"
+ sleep 5
+ gdb_emclaptop_command "85,7,8,9,A,B,C"
+ sleep 5
+ gdb_emclaptop_command "85,D,E,F,10,11,12"
+ sleep 5
+ # gdb_test "tstop"
+ ##
+ ## Note! Must NOT give the tstop command, because the passcount
+ ## has already stopped the experiment. You would not
+ ## think this would be an error, but in EMC's mind it is...
+ ##
+} else {
+ gdb_test "break end" "" ""
+ gdb_test "continue" \
+ "Continuing.*Breakpoint $decimal, end.*" \
+ "run trace experiment"
+ gdb_test "tstop" "" ""
+}
+
+gdb_test "tfind none" "" ""
+if [gdb_test "printf \"x \%d x\\n\", \$trace_frame" "x -1 x" ""] {
+ gdb_suppress_entire_file "0: tfind none failed"
+}
+
+gdb_test "tfind tracepoint $tdp2" "" ""
+if [gdb_test "printf \"x \%d x\\n\", \$trace_frame" "x 0 x" ""] {
+ gdb_suppress_entire_file "1: first tfind failed"
+}
+
+gdb_test "tfind tracepoint $tdp3" "" ""
+if [gdb_test "printf \"x \%d x\\n\", \$trace_frame" "x 1 x" ""] {
+ gdb_suppress_entire_file "2: second tfind failed"
+}
+
+gdb_test "tfind tracepoint $tdp4" "" ""
+if [gdb_test "printf \"x \%d x\\n\", \$trace_frame" "x 2 x" ""] {
+ gdb_suppress_entire_file "3: third tfind failed"
+}
+
+gdb_test "tfind tracepoint $tdp2" "" ""
+if [gdb_test "printf \"x \%d x\\n\", \$trace_frame" "x 3 x" ""] {
+ gdb_suppress_entire_file "4: fourth tfind failed"
+}
+
+gdb_test "tfind tracepoint $tdp3" "" ""
+if [gdb_test "printf \"x \%d x\\n\", \$trace_frame" "x 4 x" ""] {
+ gdb_suppress_entire_file "5: fifth tfind failed"
+}
+
+## We should now be at the last frame, because this frame's passcount
+## should have caused collection to stop. If we do a tfind now,
+## it should fail.
+
+gdb_test "tfind" "failed to find.*" "4.5: dynamic passcount test"
+
+# Finished!
+gdb_test "tfind none" "" ""
+
diff --git a/gdb/testsuite/gdb.trace/passcount.exp b/gdb/testsuite/gdb.trace/passcount.exp
new file mode 100644
index 00000000000..1777693ff55
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/passcount.exp
@@ -0,0 +1,178 @@
+# Copyright 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp";
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+if [istarget "m68k-*-elf"] then {
+ set srcfile gdb_c_test.c
+ set binfile [board_info target d490_binfile];
+} else {
+ set testfile "actions"
+ set srcfile ${testfile}.c
+ set binfile $objdir/$subdir/$testfile
+ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# If testing on a remote host, download the source file.
+# remote_download host $srcdir/$subdir/$srcfile
+
+gdb_file_cmd $binfile
+
+# define relative source line numbers:
+# all subsequent line numbers are relative to this first one (baseline)
+set baseline [gdb_find_recursion_test_baseline $srcfile];
+if { $baseline == -1 } then {
+ fail "Could not find gdb_recursion_test function"
+ return;
+}
+
+set testline1 [expr $baseline + 3]
+
+#
+# test "passcount" command
+#
+
+gdb_delete_tracepoints
+set trcpt1 [gdb_gettpnum gdb_c_test];
+set trcpt2 [gdb_gettpnum gdb_asm_test];
+set trcpt3 [gdb_gettpnum $testline1];
+if { $trcpt1 <= 0 || $trcpt2 <= 0 || $trcpt3 <= 0 } then {
+ fail "setting tracepoints"
+ return;
+}
+
+# 4.1 passcount of specified tracepoint
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*in gdb_recursion_test.*" \
+ "4.1a: set three tracepoints, passcounts all zero"
+
+gdb_test "passcount 2 $trcpt1" \
+ "Setting tracepoint $trcpt1.s passcount to 2" \
+ "4.1b: set 1st tracepoint's passcount to two"
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+2\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*in gdb_recursion_test.*" \
+ "4.1c: verify 1st tracepoint's passcount set to two"
+
+gdb_test "passcount 4 $trcpt2" \
+ "Setting tracepoint $trcpt2.s passcount to 4" \
+ "4.1d: set 2nd tracepoint's passcount to four"
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+2\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*in gdb_recursion_test.*" \
+ "4.1c: verify 2nd tracepoint's passcount set to four"
+
+# 4.2 passcount of last (default) tracepoint
+
+gdb_test "passcount 6" \
+ "Setting tracepoint $trcpt3.s passcount to 6" \
+ "4.2b: set last (default) tp's passcount to six"
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+2\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+6\[\t \]+.*in gdb_recursion_test.*" \
+ "4.2b: verify last (default) tp's passcount set to six"
+
+# 4.3 run until stopped explicitly by user
+# [deferred to dynamic test section]
+
+# 4.4 reset the previously set passcounts to new values
+
+gdb_test "passcount 7" \
+ "Setting tracepoint $trcpt3.s passcount to 7" \
+ "4.4a: reset last (default) tp's passcount to seven"
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+2\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+7\[\t \]+.*in gdb_recursion_test.*" \
+ "4.4a: verify reset last (default) tp's passcount to seven"
+
+gdb_test "passcount 5 $trcpt2" \
+ "Setting tracepoint $trcpt2.s passcount to 5" \
+ "4.4b: reset second tracepoint's passcount to five"
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+2\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+5\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+7\[\t \]+.*in gdb_recursion_test.*" \
+ "4.4c: verify reset second tracepoint's passcount to five"
+
+# 4.20 <FIXME test number> passcount for "all"
+
+gdb_test "passcount 3 all" \
+ ".*$trcpt1.s pass.* 3.*$trcpt2.s pass.* 3.*$trcpt3.s pass.* 3" \
+ "4.20a: set all three passcounts to three"
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+3\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+3\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+3\[\t \]+.*in gdb_recursion_test.*" \
+ "4.20a: set all three passcounts to three"
+
+gdb_test "passcount 4 all" \
+ ".*$trcpt1.s pass.* 4.*$trcpt2.s pass.* 4.*$trcpt3.s pass.* 4" \
+ "4.20a: reset all three passcounts to four"
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*in gdb_recursion_test.*" \
+ "4.20b: reset all three passcounts to four"
+
+# 4.5 Verify trace stops on first "satisfied" passcount
+# [deferred to dynamic test section]
+
+# 4.6 minimum passcount boundary condition
+
+gdb_test "passcount 0 $trcpt1" \
+ "Setting tracepoint $trcpt1.s passcount to 0" \
+ "4.6: set passcount to zero"
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+0\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*in gdb_recursion_test.*" \
+ "4.6: set passcount to zero"
+
+# 4.7 (test a very large passcount)
+
+gdb_test "passcount 32767 $trcpt1" \
+ "Setting tracepoint $trcpt1.s passcount to 32767" \
+ "4.7: set passcount to large number (32767)"
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1\[\t \]+y\[\t \]+$hex\[\t \]+32767\[\t \]+.*in gdb_c_test.*$trcpt2\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*gdb_asm_test.*$trcpt3\[\t \]+y\[\t \]+$hex\[\t \]+4\[\t \]+.*in gdb_recursion_test.*" \
+ "4.7: set passcount to large number (32767)"
+
+# 4.8 set passcount for invalid tracepoint
+
+gdb_test "passcount 1 [expr $trcpt2 + $trcpt3]" \
+ "No tracepoint number [expr $trcpt2 + $trcpt3]." \
+ "4.8: invalid tracepoint number in passcount"
+
+# 4.9 help passcount
+gdb_test "help passcount" "Set the passcount for a tracepoint.*" \
+ "4.9: help passcount"
+
diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp
new file mode 100644
index 00000000000..28449fa0ab6
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/report.exp
@@ -0,0 +1,421 @@
+# Copyright 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp";
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+
+if [istarget "m68k-*-elf"] then {
+ load_lib "emc-support.exp";
+ set srcfile gdb_c_test.c
+ set binfile [board_info target d490_binfile];
+ gdb_test "set remotetimeout 6" "" ""
+ set timeout 500
+ gdb_target_monitor $binfile
+ # Give a TSTOP and ignore errors, to make sure any previous trace is off
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ send_gdb "compare-sections CS\n"
+ gdb_expect {
+ -re "MIS-MATCHED.*$gdb_prompt $" {
+ gdb_suppress_entire_file "Symbol file does not match target!
+ all tests in this module will fail.";
+ }
+ -re ".*$gdb_prompt $" { }
+ }
+} else {
+ set testfile "actions"
+ set srcfile ${testfile}.c
+ set binfile $objdir/$subdir/$testfile
+ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+ gdb_load $binfile
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ runto_main
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# We generously give ourselves one "pass" if we successfully
+# detect that this test cannot be run on this target!
+if { ![gdb_target_supports_trace] } then {
+ pass "Current target does not supporst trace"
+ return 1;
+
+}
+
+set cr "\[\r\n\]+"
+
+# If testing on a remote host, download the source file.
+# remote_download host $srcdir/$subdir/$srcfile
+
+#
+# test general reporting of trace experiment results
+#
+
+set testline1 0
+set testline2 0
+set testline3 0
+set testline4 0
+set testline5 0
+set testline6 0
+
+set arg1 1
+set arg2 2
+set arg3 3
+set arg4 4
+set arg5 5
+set arg6 6
+
+set gdb_recursion_test_baseline [gdb_find_recursion_test_baseline $srcfile];
+if { $gdb_recursion_test_baseline == -1 } {
+ fail "Could not find gdb_recursion_test function"
+ return;
+}
+
+send_gdb "list $gdb_recursion_test_baseline, +12\n"
+gdb_expect {
+ -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+gdbtestline 1 " {
+ set testline1 $expect_out(1,string)
+ exp_continue
+ }
+ -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+gdbtestline 2 " {
+ set testline2 $expect_out(1,string)
+ exp_continue
+ }
+ -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+gdbtestline 3 " {
+ set testline3 $expect_out(1,string)
+ exp_continue
+ }
+ -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+gdbtestline 4 " {
+ set testline4 $expect_out(1,string)
+ exp_continue
+ }
+ -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+gdbtestline 5 " {
+ set testline5 $expect_out(1,string)
+ exp_continue
+ }
+ -re "\[\r\n\](\[0-9\]+)\[^\r\n\]+gdbtestline 6 " {
+ set testline6 $expect_out(1,string)
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {
+ if { ($testline1 == 0) || ($testline2 == 0) || ($testline3 == 0) || ($testline4 == 0) || ($testline5 == 0) || ($testline6 == 0) } {
+ gdb_suppress_entire_file "failed to locate test source lines:
+all tests in this module will fail."
+ }
+ }
+ default {
+ gdb_suppress_entire_file "failed to locate test source lines (def):
+all tests in this module will fail."
+ }
+}
+
+#
+# Setup trace experiment. This will involve:
+# 1) a tracepoint where nothing is collected
+# 2) a tracepoint where only regs are collected
+# 3) a tracepoint where only args are collected
+# 4) a tracepoint where only locals are collected
+# 5) a tracepoint where some amount of stack memory is collected.
+# 6) a tracepoint where some expressions are collected.
+#
+
+gdb_delete_tracepoints
+set tdp1 [gdb_gettpnum $testline1]
+set tdp2 [gdb_gettpnum $testline2]
+set tdp3 [gdb_gettpnum $testline3]
+set tdp4 [gdb_gettpnum $testline4]
+set tdp5 [gdb_gettpnum $testline5]
+set tdp6 [gdb_gettpnum $testline6]
+
+if { $tdp1 <= 0 || $tdp2 <= 0 || $tdp3 <= 0 || \
+ $tdp4 <= 0 || $tdp5 <= 0 || $tdp6 <= 0 } then {
+ fail "setting tracepoints failed"
+ return;
+}
+
+gdb_trace_setactions "9.x: setup TP to collect regs" \
+ "$tdp2" \
+ "collect \$regs" "^$"
+
+
+gdb_trace_setactions "9.x: setup TP to collect args" \
+ "$tdp3" \
+ "collect \$args" "^$"
+
+gdb_trace_setactions "9.x: setup TP to collect locals" \
+ "$tdp4" \
+ "collect \$locs" "^$"
+
+gdb_trace_setactions "9.x: setup TP to collect stack memory" \
+ "$tdp5" \
+ "collect \$fp, \*\(void \*\*\) \$sp @ 64" "^$"
+
+gdb_trace_setactions "9.x: setup TP to collect expressions" \
+ "$tdp6" \
+ "collect gdb_char_test, gdb_short_test, gdb_long_test" "^$"
+
+gdb_test "tstart" "" ""
+
+if [istarget "m68k-*-elf"] then {
+ gdb_emclaptop_command "85,$arg1,$arg2,$arg3,$arg4,$arg5,$arg6"
+ sleep 5
+
+} else {
+ gdb_test "break end" "" ""
+ gdb_test "continue" \
+ "Continuing.*Breakpoint $decimal, end.*" \
+ "run trace experiment"
+}
+
+gdb_test "tstop" "" ""
+
+#
+# 9.1 test the tdump command
+#
+
+set timeout 60
+
+gdb_tfind_test "9.1: init: make sure not debugging any trace frame" "none" "-1"
+
+gdb_tfind_test "9.1: find frame for TP $tdp1" "tracepoint $tdp1" \
+ "\$tracepoint" "$tdp1"
+
+# Nothing was collected at tdp1, so this tdump should be empty.
+gdb_test "tdump" \
+ "Data collected at tracepoint $tdp1, trace frame $decimal:" \
+ "9.1: tdump, nothing collected"
+
+gdb_tfind_test "9.1: find frame for TP $tdp2" "tracepoint $tdp2" \
+ "\$tracepoint" "$tdp2"
+
+# regs were collected at tdp2.
+# How to match for the output of "info registers" on an unknown architecture?
+# For now, assume that every architecture has a register called "pc".
+gdb_test "tdump" \
+ "\[\r\n\]pc .*" \
+ "9.1: tdump, regs collected"
+
+gdb_tfind_test "9.1: find frame for TP $tdp3" "tracepoint $tdp3" \
+ "\$tracepoint" "$tdp3"
+
+# args were collected at tdp3
+gdb_test "tdump" \
+ "depth = 3.*q1 = 2.*q2 = 2.*q3 = 3.*q4 = 4.*q5 = 5.*q6 = 6" \
+ "9.1: tdump, args collected"
+
+gdb_tfind_test "9.1: find frame for TP $tdp4" "tracepoint $tdp4" \
+ "\$tracepoint" "$tdp4"
+
+# locals were collected at tdp4
+gdb_test "tdump" \
+ "q = 1" \
+ "9.1: tdump, locals collected"
+
+gdb_tfind_test "9.1: find frame for TP $tdp5" "tracepoint $tdp5" \
+ "\$tracepoint" "$tdp5"
+
+# stack was collected at tdp5, plus the frame pointer
+gdb_test "tdump" \
+ ".fp = .*sp @ 64 = .*" \
+ "9.1: tdump, memrange collected"
+
+gdb_tfind_test "9.1: find frame for TP $tdp6" "tracepoint $tdp6" \
+ "\$tracepoint" "$tdp6"
+
+# globals were collected at tdp6
+gdb_test "tdump" \
+ "gdb_char_test = 1.*gdb_short_test = 2.*gdb_long_test = 3" \
+ "9.1: tdump, global variables collected"
+
+# 9.2 test tdump with arguments
+# [no go, tdump doesn't have any arguments]
+
+# 9.3 help tdump
+
+gdb_test "help tdump" "Print everything collected at the current.*" \
+ "9.3: help tdump"
+
+set linecount1 0
+set linecount2 0
+set linecount3 0
+set linecount4 0
+set linecount5 0
+set linecount6 0
+
+gdb_tfind_test "11.x, 12.1: find start frame" "start" "0"
+
+#
+# 11.x test built-in trace variables $trace_frame, $trace_line etc.
+#
+
+gdb_test "printf \"x %d x\\n\", \$trace_frame" "x 0 x" \
+ "11.1: test \$trace_frame"
+
+gdb_test "printf \"x %d x\\n\", \$tracepoint" "x $tdp1 x" \
+ "11.2: test \$tracepoint"
+
+gdb_test "printf \"x %d x\\n\", \$trace_line" "x $testline1 x" \
+ "11.3: test \$trace_line"
+
+send_gdb "print \$trace_file\n"
+gdb_expect {
+ -re "\\$\[0-9\]+ = \"$srcfile\"\[\r\n\]+$gdb_prompt $" {
+ pass "11.4: test \$trace_file"
+ }
+ -re "\\$\[0-9\]+ = \"$srcdir/$subdir/$srcfile\"\[\r\n\]+$gdb_prompt $" {
+ pass "11.4: test \$trace_file"
+ }
+ -re "$gdb_prompt $" {
+ fail "11.4: test \$trace_file"
+ }
+ timeout {
+ fail "11.4: test \$trace_file (timeout)"
+ }
+}
+
+#gdb_test "print \$trace_file" "\"$srcdir/$subdir/$srcfile\"" \
+# "11.4: test \$trace_file"
+
+#
+# 12.x test report generation using arbitrary GDB commands, loops etc.
+#
+
+send_gdb "while \$trace_frame != -1\n output \$trace_file\n printf \", line \%d \(tracepoint #\%d\)\\n\", \$trace_line, \$tracepoint\n tfind\n end\n"
+gdb_expect {
+ -re " line $testline1 .tracepoint .$tdp1" {
+ set linecount1 [expr $linecount1 + 1]
+ exp_continue
+ }
+ -re " line $testline2 .tracepoint .$tdp2" {
+ set linecount2 [expr $linecount2 + 1]
+ exp_continue
+ }
+ -re " line $testline3 .tracepoint .$tdp3" {
+ set linecount3 [expr $linecount3 + 1]
+ exp_continue
+ }
+ -re " line $testline4 .tracepoint .$tdp4" {
+ set linecount4 [expr $linecount4 + 1]
+ exp_continue
+ }
+ -re " line $testline5 .tracepoint .$tdp5" {
+ set linecount5 [expr $linecount5 + 1]
+ exp_continue
+ }
+ -re " line $testline6 .tracepoint .$tdp6" {
+ set linecount6 [expr $linecount6 + 1]
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {
+ if { ($linecount1 < 4) || ($linecount2 < 4) || ($linecount3 < 4) || ($linecount4 < 4) || ($linecount5 < 4) || ($linecount6 < 4) } {
+ fail "12.1: trace report #1"
+ } else {
+ pass "12.1: trace report #1"
+ }
+ }
+ timeout {
+ fail "12.1: trace report #1 (timeout)"
+ }
+}
+
+gdb_tfind_test "12.2: find first TDP #2 frame" "tracepoint $tdp2" \
+ "\$tracepoint" "$tdp2"
+
+set linecount2 0
+
+send_gdb "while \$trace_frame != -1\n printf \"tracepoint #\%d, FP 0x\%08x, SP 0x\%08x, PC 0x%08x\\n\", \$tracepoint, \$fp, \$sp, \$pc\n tfind tracepoint\n end\n"
+gdb_expect {
+ -re "tracepoint #$tdp2, FP $hex, SP $hex, PC $hex" {
+ set linecount2 [expr $linecount2 + 1]
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {
+ if { ($linecount2 < 4) } {
+ fail "12.2: trace report #2"
+ } else {
+ pass "12.2: trace report #2"
+ }
+ }
+ timeout {
+ fail "12.2: trace report #2 (timeout)"
+ }
+}
+
+gdb_tfind_test "12.3: find first TDP #3 frame" "tracepoint $tdp3" \
+ "\$tracepoint" "$tdp3"
+
+set linecount3 0
+
+send_gdb "while \$trace_frame != -1\n printf \"TDP #\%d, frame \%d: depth = \%d, q1 = \%d\\n\", \$tracepoint, \$trace_frame, depth, q1\n tfind tracepoint\n end\n"
+gdb_expect {
+ -re "TDP #$tdp3, frame $decimal: depth = $decimal, q1 = $decimal" {
+ set linecount3 [expr $linecount3 + 1]
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {
+ if { ($linecount3 < 4) } {
+ fail "12.3: trace report #3"
+ } else {
+ pass "12.3: trace report #3"
+ }
+ }
+ timeout {
+ fail "12.3: trace report #3 (timeout)"
+ }
+}
+
+gdb_tfind_test "12.4: find first TDP #6 frame" "tracepoint $tdp6" \
+ "\$tracepoint" "$tdp6"
+
+set linecount6 0
+
+send_gdb "while \$trace_frame != -1\n printf \"TDP #\%d, frame %d: char_test = \%d, long_test = \%d\\n\", \$tracepoint, \$trace_frame, gdb_char_test, gdb_long_test\n tfind tracepoint\n end\n"
+gdb_expect {
+ -re "TDP #$tdp6, frame $decimal: char_test = $arg1, long_test = $arg3" {
+ set linecount6 [expr $linecount6 + 1]
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {
+ if { ($linecount6 < 4) } {
+ fail "12.4: trace report #4"
+ } else {
+ pass "12.4: trace report #4"
+ }
+ }
+ timeout {
+ fail "12.4: trace report #4 (timeout)"
+ }
+}
+
+# Finished!
+gdb_tfind_test "finished: make sure not debugging any trace frame" "none" "-1"
diff --git a/gdb/testsuite/gdb.trace/save-trace.exp b/gdb/testsuite/gdb.trace/save-trace.exp
new file mode 100644
index 00000000000..b461ad85940
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/save-trace.exp
@@ -0,0 +1,171 @@
+# Copyright 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp";
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+
+if [istarget "m68k-*-elf"] then {
+ set srcfile gdb_c_test.c
+ set binfile [board_info target d490_binfile];
+} else {
+ set testfile "actions"
+ set srcfile ${testfile}.c
+ set binfile $objdir/$subdir/$testfile
+ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# If testing on a remote host, download the source file.
+# remote_download host $srcdir/$subdir/$srcfile
+
+gdb_file_cmd $binfile
+
+# define relative source line numbers:
+# all subsequent line numbers are relative to this first one (baseline)
+set baseline [gdb_find_recursion_test_baseline $srcfile];
+if { $baseline == -1 } then {
+ fail "Could not find gdb_recursion_test function"
+ return;
+}
+
+set testline1 [expr $baseline + 4]
+set testline2 [expr $baseline + 5]
+set testline3 [expr $baseline + 6]
+set testline4 [expr $baseline + 7]
+set testline5 [expr $baseline + 8]
+set testline6 [expr $baseline + 9]
+
+#
+# test save-trace command
+#
+
+# setup a set of tracepoints to save
+
+gdb_delete_tracepoints
+
+foreach x { 1 2 3 4 5 6 } {
+ set testline [expr \$testline$x];
+ set trcpt [gdb_gettpnum $testline];
+ set trcpt$x $trcpt;
+ gdb_test "passcount $x" \
+ "Setting tracepoint $trcpt.* to $x" \
+ "10.x: set passcount for tracepoint $trcpt"
+
+ gdb_trace_setactions "10.x: set actions for tracepoint $x" \
+ "" \
+ "collect q$x" "^$" \
+ "while-stepping $x" "^$" \
+ "collect q$x" "^$" \
+ "end" "^$"
+}
+
+
+proc gdb_verify_tracepoints { testname } {
+ global gdb_prompt;
+
+ set ws "\[\t \]+"
+ set nl "\[\r\n\]+"
+ set ourstate 1;
+ set result "pass";
+ send_gdb "info tracepoints\n";
+ gdb_expect 10 {
+ -re "y\[\t \]+0x\[0-9a-fA-F\]+\[\t \]+(\[0-9\]+)\[\t \]+(\[0-9\]+)\[\t \]+in gdb_recursion_test\[^\r\n\]+" {
+ if { $expect_out(1,string) != $expect_out(2,string) } {
+ #set result "fail";
+ }
+ if { $expect_out(1,string) != $ourstate } {
+ set result "fail";
+ }
+ incr ourstate;
+ exp_continue;
+ }
+ -re "$gdb_prompt $" {
+ if { $ourstate >= 6 } {
+ set result "pass";
+ } else {
+ set result "fail";
+ }
+ }
+ default {
+ set result "fail";
+ }
+ }
+ $result $testname;
+ return $result;
+}
+
+gdb_verify_tracepoints "10.x: verify trace setup";
+
+# 10.1 Save current tracepoint definitions to a file
+
+remote_file host delete savetrace.tr
+gdb_test "save-tracepoints savetrace.tr" \
+ "Tracepoints saved to file 'savetrace.tr'." \
+ "10.1: save tracepoint definitions"
+
+# 10.2 Read back tracepoint definitions
+
+gdb_delete_tracepoints
+gdb_test "info tracepoints" "No tracepoints." "10.2: delete tracepoints"
+gdb_test "source savetrace.tr" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "10.2: read back saved tracepoints"
+gdb_verify_tracepoints "10.2: verify recovered tracepoints";
+remote_file host delete savetrace.tr
+
+# 10.3 repeat with a path to the file
+
+remote_file host delete $objdir/savetrace.tr
+gdb_test "save-tracepoints $objdir/savetrace.tr" \
+ "Tracepoints saved to file '$objdir/savetrace.tr'." \
+ "10.3: save tracepoint definitions, full path"
+
+gdb_delete_tracepoints
+gdb_test "info tracepoints" "No tracepoints." "10.3: delete tracepoints"
+gdb_test "source $objdir/savetrace.tr" \
+ "Tracepoint \[0-9\]+ at .*" \
+ "10.4: read saved tracepoints, full path"
+gdb_verify_tracepoints "10.3: verify recovered tracepoints, full path";
+remote_file host delete $objdir/savetrace.tr
+
+# 10.5 invalid filename
+# [deferred -- not sure what a good invalid filename would be]
+
+# 10.6 save-trace (file already exists)
+# [expect it to clobber the old one]
+
+# 10.7 help save-tracepoints
+
+gdb_test "help save-tracepoints" \
+ "Save current tracepoint definitions as a script.*" \
+ "10.7: help save-tracepoints"
diff --git a/gdb/testsuite/gdb.trace/tfind.exp b/gdb/testsuite/gdb.trace/tfind.exp
new file mode 100644
index 00000000000..f678975f27e
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/tfind.exp
@@ -0,0 +1,405 @@
+# Copyright 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp";
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+
+if [istarget "m68k-*-elf"] then {
+ load_lib "emc-support.exp";
+ set srcfile gdb_c_test.c
+ set binfile [board_info target d490_binfile];
+ gdb_test "set remotetimeout 6" "" ""
+ set timeout 500
+ gdb_target_monitor $binfile
+ # Give a TSTOP and ignore errors, to make sure any previous trace is off
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ send_gdb "compare-sections CS\n"
+ gdb_expect {
+ -re "MIS-MATCHED.*$gdb_prompt $" {
+ gdb_suppress_entire_file "Symbol file does not match target!
+ all tests in this module will fail.";
+ }
+ -re ".*$gdb_prompt $" { }
+ }
+} else {
+ set testfile "actions"
+ set srcfile ${testfile}.c
+ set binfile $objdir/$subdir/$testfile
+ if { [gdb_compile "$srcdir/$subdir/$srcfile" "$binfile -O1" \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+ gdb_load $binfile
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ runto_main
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# We generously give ourselves one "pass" if we successfully
+# detect that this test cannot be run on this target!
+if { ![gdb_target_supports_trace] } then {
+ pass "Current target does not supporst trace"
+ return 1;
+
+}
+
+# If testing on a remote host, download the source file.
+# remote_download host $srcdir/$subdir/$srcfile
+
+# define relative source line numbers:
+# all subsequent line numbers are relative to this first one (baseline)
+set baseline [gdb_find_recursion_test_baseline $srcfile];
+if { $baseline == -1 } then {
+ fail "Could not find gdb_recursion_test function"
+ return;
+}
+
+set testline1 [expr $baseline + 1]
+set testline2 [expr $baseline + 5]
+set testline3 [expr $baseline + 6]
+set testline4 [expr $baseline + 7]
+set testline5 [expr $baseline + 8]
+
+#
+# test tfind command
+#
+
+gdb_delete_tracepoints
+set tdp1 [gdb_gettpnum "\*gdb_recursion_test"]
+set tdp2 [gdb_gettpnum $testline2]
+set tdp3 [gdb_gettpnum $testline3]
+set tdp4 [gdb_gettpnum $testline4]
+set tdp5 [gdb_gettpnum $testline5]
+if { $tdp1 <= 0 || $tdp2 <= 0 || $tdp3 <= 0 || \
+ $tdp4 <= 0 || $tdp5 <= 0 } then {
+ fail "setting tracepoints"
+ return;
+}
+
+# 6.1 test tstart command
+send_gdb "tstart\n"
+gdb_expect {
+ -re "Trace can only be run on remote targets.*$gdb_prompt $" {
+ fail "6.1: tstart (not connected to remote?)"
+ return;
+ }
+ -re "Target does not support this command.*$gdb_prompt $" {
+ fail "6.1: tstart (connected to wrong target?)"
+ return;
+ }
+ -re "Target returns error code.*$gdb_prompt $" {
+ fail "6.1: tstart (connected to wrong target?)"
+ return;
+ }
+ -re "$gdb_prompt $" {
+ pass "6.1: tstart"
+ }
+ default {
+ fail "6.1: tstart (default)"
+ return;
+ }
+}
+
+# test tstatus (when trace on)
+gdb_test "tstatus" "\[Tt\]race is running.*" "test tstatus on"
+
+# 6.2 test help tstart
+gdb_test "help tstart" "Start trace data collection." "6.2: help tstart"
+
+if [istarget "m68k-*-elf"] then {
+ gdb_emclaptop_command "85,1,2,3,4,5,6"
+ sleep 5
+
+ gdb_emclaptop_command "85,7,8,9,A,B,C"
+ sleep 5
+} else {
+ gdb_test "break end" "" ""
+ gdb_test "continue" \
+ "Continuing.*Breakpoint $decimal, end.*" \
+ "run trace experiment"
+}
+
+# 7.1 test tstop command
+send_gdb "tstop\n"
+gdb_expect {
+ -re "Trace can only be run on remote targets.*$gdb_prompt $" {
+ fail "7.1: tstop (not connected to remote?)"
+ return;
+ }
+ -re "Target does not support this command.*$gdb_prompt $" {
+ fail "7.1: tstop (connected to wrong target?)"
+ return;
+ }
+ -re "Target returns error code.*$gdb_prompt $" {
+ fail "7.1: tstop (connected to wrong target?)"
+ return;
+ }
+ -re "$gdb_prompt $" {
+ pass "7.1: tstop"
+ }
+ default {
+ fail "7.1: tstop (default)"
+ return;
+ }
+}
+
+# 7.2 test help tstop
+gdb_test "help tstop" "Stop trace data collection." "7.2: help tstop"
+
+# test tstatus (when trace off)
+gdb_test "tstatus" "\[Tt\]race.* not running.*" "test tstatus off"
+
+## record starting PC
+set save_pc [gdb_readexpr "(unsigned long) \$pc"];
+if { $save_pc == -1 } then {
+ fail "could not read PC"
+ return;
+}
+
+# 8.7 tfind start
+## check $trace_frame == 0
+gdb_tfind_test "8.7: tfind start command" "start" "0";
+## check $pc != startPC
+gdb_test "printf \"x \%d x\\n\", \$pc != $save_pc" \
+ "x 1 x" \
+ "8.7b: tfind start"
+
+# 8.8 tfind none
+## check $trace_frame == -1
+gdb_tfind_test "8.8: tfind none" "none" "-1";
+## check $pc == startPC
+gdb_test "printf \"x \%d x\\n\", \$pc == $save_pc" \
+ "x 1 x" \
+ "8.8b: tfind none (restores non-trace PC)"
+
+# 8.9 tfind end
+## check $trace_frame == -1
+gdb_tfind_test "8.9: tfind end, selects no frame" "end" "-1";
+## check $pc == startPC
+gdb_test "printf \"x \%d x\\n\", \$pc == $save_pc" \
+ "x 1 x" \
+ "8.9b: tfind end (restores non-tracing PC)"
+
+# 8.1 tfind n
+## check $trace_frame == n
+gdb_tfind_test "8.1: tfind 1" "1" "1"
+## check $trace_line corresponds to tracepoint for frame n
+gdb_test "print \$trace_line" "$testline2" "8.1b: tfind 1 (correct line)"
+
+# 8.28 tfind invalid n (big number)
+## check "not found" error
+## check $trace_frame != n
+gdb_test "tfind 32767" \
+ "failed to find.*" \
+ "8.28: tfind <n> command rejects invalid frame number"
+
+gdb_test "printf \"x \%d x\\n\", \$trace_frame == 32767" \
+ "x 0 x" \
+ "8.28: tfind <n> rejected bad input (32767)"
+
+# 8.31 tfind negative n
+## check error
+gdb_test "tfind -3" "invalid input.*" "8.31: tfind <n> rejects negative input"
+## check $trace_frame != -n
+gdb_test "printf \"x \%d x\\n\", \$trace_frame == -3" "x 0 x" \
+ "8.31: tfind <n> rejected negative input (-3)"
+
+# 8.10 tfind <no arg>
+## check $trace_frame += 1
+
+gdb_tfind_test "8.10: tfind start" "start" "0";
+gdb_test "print \$trace_line" "$baseline" \
+ "8.10: tfind 0 (correct line $baseline)"
+gdb_tfind_test "8.10: tfind noargument 1" "" "1";
+gdb_test "print \$trace_line" "$testline2" \
+ "8.10: tfind 1 (correct line $testline2)"
+gdb_tfind_test "8.10: tfind noargument 2" "" "2";
+gdb_test "print \$trace_line" "$testline3" \
+ "8.10: tfind 2 (correct line $testline3)"
+gdb_tfind_test "8.10: tfind noargument 3" "" "3";
+gdb_test "print \$trace_line" "$testline4" \
+ "8.10: tfind 3 (correct line $testline4)"
+
+gdb_tfind_test "8.11: tfind 3" "3" "3";
+gdb_test "print \$trace_line" "$testline4" \
+ "8.11: tfind 3 (correct line $testline4)"
+gdb_tfind_test "8.11: tfind backward 2" "-" "2";
+gdb_test "print \$trace_line" "$testline3" \
+ "8.11: tfind 2 (correct line $testline3)"
+gdb_tfind_test "8.11: tfind backward 1" "-" "1";
+gdb_test "print \$trace_line" "$testline2" \
+ "8.11: tfind 1 (correct line $testline2)"
+gdb_tfind_test "8.11: tfind backward 0" "-" "0";
+gdb_test "print \$trace_line" "$baseline" \
+ "8.11: tfind 0 (correct line $baseline)"
+
+gdb_tfind_test "8.12: tfind none" "none" "-1";
+gdb_tfind_test "8.12: tfind tracepoint <n>" "tracepoint $tdp2" \
+ "\$tracepoint" "$tdp2";
+gdb_test "print \$trace_line" "$testline2" \
+ "8.12: tfind tracepoint <n> (line $testline2)"
+
+gdb_tfind_test "8.25: tfind none" "none" "-1";
+gdb_test "tfind tracepoint 0" "failed to find.*" \
+ "8.25: tfind tracepoint rejects zero"
+gdb_test "tfind tracepoint 32767" "failed to find.*" \
+ "8.25: tfind tracepoint rejects nonexistant tracepoint (32767)"
+gdb_test "tfind tracepoint -1" "failed to find.*" \
+ "8.25: tfind tracepoint rejects nonexistant tracepoint (-1)"
+
+# 8.37 tfind tracepoint n where n no longer exists (but used to)
+gdb_test "delete trace $tdp2" "" ""
+gdb_tfind_test "8.37: tfind none" "none" "-1";
+gdb_tfind_test "8.37: tfind deleted tracepoint" \
+ "tracepoint $tdp2" \
+ "\$tracepoint" "$tdp2";
+gdb_test "print \$trace_line" "$testline2" \
+ "8.37: tfind deleted tracepoint (line $testline2)"
+
+# 8.13 tfind tracepoint <no arg>
+## check $tracepoint same before and after, $trace_frame changed
+
+gdb_tfind_test "8.13: tfind none" "none" "-1";
+gdb_tfind_test "8.13: tracepoint $tdp1" "tracepoint $tdp1" \
+ "\$tracepoint" "$tdp1";
+gdb_test "print \$trace_line" "$baseline" \
+ "8.13: tfind tracepoint $tdp1 (line $baseline)"
+gdb_test "set \$save_frame = \$trace_frame" "" ""
+gdb_tfind_test "8.13: tracepoint <no arg>" "tracepoint" \
+ "\$tracepoint" "$tdp1";
+gdb_test "printf \"x \%d x\\n\", \$trace_frame == \$save_frame" \
+ "x 0 x" \
+ "8.13: tracepoint <no arg>, tracepoint number unchanged"]
+
+# 1.12 set tracepoint in prologue
+#
+# tdp1 was set at *gdb_recursion_test (ie. the hard address of the
+# function, before the prologue). Test to see that it succeeded.
+# Current pc should be equal to the address of the function.
+
+gdb_test "printf \"x \%d x\\n\", \$pc == gdb_recursion_test" \
+ "x 1 x" \
+ "1.12: set tracepoint in prologue"
+
+# 8.14 tfind pc x
+## check pc == x, $trace_frame != -1
+gdb_tfind_test "8.14: tfind 3" "3" "3"
+gdb_test "print \$trace_line" "$testline4" \
+ "8.14: tfind 3 (line $testline4)"
+
+gdb_test "set \$test_pc = \$pc" "" ""
+gdb_tfind_test "8.14: tfind none" "none" "-1"
+gdb_tfind_test "8.14: tfind pc" "pc \$test_pc" "\$trace_frame != -1" "1";
+gdb_test "print \$trace_line" "$testline4" \
+ "8.14: tfind pc x (line $testline4)"
+gdb_test "printf \"x \%d x\\n\", \$pc == \$test_pc" \
+ "x 1 x" \
+ "8.14: tfind pc x"
+
+# 8.15 tfind pc <no arg>
+## check pc same before and after, $trace_frame changed
+gdb_tfind_test "8.15: tfind 3" "3" "3"
+gdb_test "print \$trace_line" "$testline4" \
+ "8.15: tfind 3 (line $testline4)"
+gdb_test "set \$test_pc = \$pc" "" ""
+gdb_tfind_test "8.15: tfind pc" "pc" "\$pc == \$test_pc" "1"
+gdb_test "print \$trace_line" "$testline4" \
+ "8.15: tfind pc (line $testline4)"
+gdb_test "printf \"x \%d x\\n\", \$trace_frame != 3" "x 1 x" \
+ "8.15: trace frame didn't change"
+
+# 8.26 tfind pc invalid x
+## check error, pc != x (trace_frame unchanged?)
+gdb_tfind_test "8.26: tfind start" "start" "0"
+gdb_test "tfind pc 0" "failed to find.*" "8.26: tfind pc zero"
+gdb_test "tfind pc -1" "failed to find.*" "8.26: tfind pc -1"
+
+# 8.16 tfind line n
+## check #trace_frame != -1, $trace_line == n
+gdb_tfind_test "8.16: tfind none" "none" "-1"
+gdb_tfind_test "8.16: tfind line $testline3" \
+ "line $testline3" \
+ "\$trace_line == $testline3" "1"
+
+# 8.17 tfind line <no arg> (# 8.19, 8.20)
+## check $trace_line changed, no error, pc changed, frame changed, tdp changed
+gdb_tfind_test "8.17: tfind none" "none" "-1"
+gdb_tfind_test "8.17: tfind line $testline3" "line $testline3" "\$trace_line == $testline3" "1"
+gdb_tfind_test "8.17: tfind line <no arg>" "line" "\$trace_line != $testline3" "1"
+
+# 8.36 tfind and disassembly
+gdb_tfind_test "8.36: tfind start" "start" "0"
+set timeout 60
+send_gdb "disassemble gdb_c_test\n"
+# look for disassembly of function label
+gdb_expect {
+ -re "<gdb_c_test>:.*$gdb_prompt $" { pass "8.36: trace disassembly" }
+ -re ".*$gdb_prompt $" { fail "8.36: trace disassembly" }
+ timeout { fail "8.36: trace disassembly (timeout)" }
+}
+
+gdb_test "tfind line 0" \
+ "out of range.*|failed to find.*" \
+ "8.18: tfind line 0";
+gdb_test "tfind line 32767" \
+ "out of range.*|failed to find.*" \
+ "8.27: tfind line 32767";
+gdb_test "tfind line NoSuChFiLe.c:$baseline" \
+ "No source file named.*" \
+ "8.27: tfind line in bad source file";
+
+# 8.32 tfind invalid subcommand (tfind foo)
+## check error
+gdb_test "tfind NoSuChOpTiOn 21" \
+ "No symbol.*|\[Ww\]arning.*|\[Ee\]rror.*" \
+ "8.32: tfind with bad subcommand"
+
+# 8.38 test help tfind
+gdb_test "help tfind" "Select a trace frame.*" \
+ "8.38: help tfind"
+gdb_test "help tfind pc" "Select a trace frame by PC.*" \
+ "8.38: help tfind PC"
+gdb_test "help tfind end" "Synonym for 'none'.*" \
+ "8.38: help tfind end"
+gdb_test "help tfind none" "De-select any trace frame.*" \
+ "8.38: help tfind none"
+gdb_test "help tfind line" "Select a trace frame by source line.*" \
+ "8.38: help tfind line"
+gdb_test "help tfind start" "Select the first trace frame.*" \
+ "8.38: help tfind start"
+gdb_test "help tfind range" "Select a trace frame whose PC is in.*" \
+ "8.38: help tfind range"
+gdb_test "help tfind trace" "Select a trace frame by tracepoint number.*" \
+ "8.38: help tfind tracepoint"
+
+# Finished!
+gdb_tfind_test "8.17: tfind none" "none" "-1"
diff --git a/gdb/testsuite/gdb.trace/tracecmd.exp b/gdb/testsuite/gdb.trace/tracecmd.exp
new file mode 100644
index 00000000000..d79c98edbf5
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/tracecmd.exp
@@ -0,0 +1,269 @@
+# Copyright 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp";
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+if [istarget "m68k-*-elf"] then {
+ set srcfile gdb_c_test.c
+ set binfile [board_info target d490_binfile];
+} else {
+ set testfile "actions"
+ set srcfile ${testfile}.c
+ set binfile $objdir/$subdir/$testfile
+ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# If testing on a remote host, download the source file.
+# remote_download host $srcdir/$subdir/$srcfile
+
+gdb_file_cmd $binfile
+
+# define relative source line numbers:
+# all subsequent line numbers are relative to this first one (baseline)
+set baseline [gdb_find_recursion_test_baseline $srcfile];
+if { $baseline == -1 } then {
+ fail "Could not find gdb_recursion_test function"
+ return;
+}
+
+set testline1 [expr $baseline + 1]
+set testline2 [expr $baseline + 3]
+
+#
+# test "help tracepoints"
+#
+
+set helpcnt 0;
+send_gdb "help tracepoints\n"
+gdb_expect {
+ -re "Tracing of program execution without stopping the program." {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "actions -- Specify the actions to be taken at a tracepoint" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "collect -- Specify one or more data items to be collected" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "delete tracepoints -- Delete specified tracepoints" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "end -- Ends a list of.*actions" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "info tracepoints -- Status of tracepoints" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "passcount -- Set the passcount for a tracepoint" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "save-tracepoints -- Save current tracepoint definitions" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tdump -- Print everything collected at the current tracepoint" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tfind -- Select a trace frame" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tfind end -- Synonym for 'none'" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tfind line -- Select a trace frame by line number" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tfind none -- De-select any trace frame and resume 'live' debugging" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tfind outside -- Select a trace frame whose PC is outside" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tfind pc -- Select a trace frame by PC" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tfind range -- Select a trace frame whose PC is in the given" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tfind start -- Select the first trace frame in the trace buffer" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tfind tracepoint -- Select a trace frame by tracepoint number" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "trace -- Set a tracepoint at a specified line or function or addr" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tstart -- Start trace data collection" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tstatus -- Display the status of the current trace data collection" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "tstop -- Stop trace data collection" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re "while-stepping -- Specify single-stepping behavior at a tracepoint" {
+ incr helpcnt;
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" {
+ if { $helpcnt == 21 } {
+ pass "1.0: help tracepoints"
+ } else {
+ warning "$helpcnt";
+ fail "1.0: help tracepoints"
+ }
+ }
+}
+
+#
+# test trace command:
+#
+
+# 1.1 trace source line
+gdb_delete_tracepoints
+gdb_test "trace $srcfile:$testline2" \
+ "Tracepoint $decimal at $hex: file.*$srcfile, line $testline2." \
+ "1.1a: set tracepoint at sourceline"
+gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline2" \
+ "1.1b: trace sourcefile:line"
+
+# 1.2 trace invalid source line
+gdb_delete_tracepoints
+gdb_test "trace $srcfile:99999" "No line 99999 in file \".*$srcfile\"." \
+ "1.2a: trace invalid line in sourcefile"
+gdb_test "info trace" "No tracepoints.*" \
+ "1.2b: reject invalid line in srcfile"
+
+# 1.3 trace line in invalid source file
+gdb_delete_tracepoints
+gdb_test "trace NoSuChFiLe.c:1" "No source file named NoSuChFiLe.c." \
+ "1.3a: trace invalid source file"
+gdb_test "info trace" "No tracepoints.*" \
+ "1.3b: reject invalid srcfile"
+
+# 1.4 trace function by name
+gdb_delete_tracepoints
+gdb_test "trace gdb_recursion_test" \
+ "Tracepoint $decimal at $hex: file.*$srcfile, line $testline1." \
+ "1.4a: trace function by name"
+gdb_test "info trace" "in gdb_recursion_test.*$srcfile:$testline1" \
+ "1.4b: trace function by name"
+
+# 1.5 trace non-existant function
+gdb_delete_tracepoints
+gdb_test "trace NoSuChFuNc" "Function \"NoSuChFuNc\" not defined." \
+ "1.5a: trace invalid function"
+gdb_test "info trace" "No tracepoints.*" \
+ "1.5b: reject invalid srcfile"
+
+# 1.6 trace at a specific address
+# Collect the address of "gdb_asm_test", and use that.
+send_gdb "print gdb_asm_test\n"
+gdb_expect {
+ -re "\[$\]\[0-9\].*0x(\[0-9a-fA-F\]+).*$gdb_prompt $" {
+ set asm_test_addr $expect_out(1,string)
+ }
+ timeout { }
+}
+
+gdb_delete_tracepoints
+gdb_test "trace \*0x$asm_test_addr" \
+ "Tracepoint $decimal at .*$asm_test_addr.*" \
+ "1.6a: trace at specific address"
+gdb_test "info trace" "$asm_test_addr.*gdb_asm_test.*" \
+ "1.6b: verify trace at specific address"
+
+# 1.7 trace at function's exact address
+# Collect the address of the function for comparison
+send_gdb "print gdb_recursion_test\n"
+gdb_expect {
+ -re "\[$\]\[0-9\].*0x(\[0-9a-fA-F\]+).*$gdb_prompt $" {
+ set c_test_addr $expect_out(1,string)
+ }
+ timeout { }
+}
+
+gdb_delete_tracepoints
+gdb_test "trace \*gdb_recursion_test" \
+ "Tracepoint $decimal at .*$c_test_addr.*" \
+ "1.7a: trace at function label (before prologue)"
+gdb_test "info trace" "$c_test_addr.*in gdb_recursion_test.*:$baseline" \
+ "1.7b: verify trace at specific address"
+
+# 1.8 trace at invalid address
+# no address is invalid
+
+# 1.9 trace no arguments
+gdb_test "trace" "trace command requires an argument" \
+ "1.9: trace <no arguments>"
+
+# 1.10 set large number of tracepoints
+# deferred to limits test module
+
+# 1.11 tracepoint conditions
+# conditions on tracepoints not implemented
+
+# 1.12 set tracepoint in prologue
+# [see tfind.exp]
+
+# 1.13 trace on recursion
+# interesting only in "live" session: see backtrace.exp for live test.
+
+# 1.14 help trace
+gdb_test "help trace" "Set a tracepoint at .*" "1.14: help trace"
+
+
diff --git a/gdb/testsuite/gdb.trace/while-dyn.exp b/gdb/testsuite/gdb.trace/while-dyn.exp
new file mode 100644
index 00000000000..84ab14b9409
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/while-dyn.exp
@@ -0,0 +1,124 @@
+# Copyright 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp"
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+
+if [istarget "m68k-*-elf"] then {
+ load_lib "emc-support.exp"
+ set testfile "gdb_c_test"
+ set srcfile $testfile.c
+ set binfile [board_info target d490_binfile];
+ gdb_test "set remotetimeout 6" "" ""
+ set timeout 500
+ gdb_target_monitor "$binfile"
+ # Give a TSTOP and ignore errors, to make sure any previous trace is off
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ send_gdb "compare-section CS\n"
+ gdb_expect {
+ -re "MIS-MATCHED.*$gdb_prompt $" {
+ gdb_suppress_entire_file "Symbol file does not match target!
+ all tests in this module will fail.";
+ }
+ -re ".*$gdb_prompt $" { }
+ }
+} else {
+ set testfile "actions"
+ set srcfile $testfile.c
+ set binfile $objdir/$subdir/$testfile
+ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+ gdb_load $binfile
+ gdb_test "tstop" "" ""
+ gdb_test "tfind none" "" ""
+ runto_main
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# We generously give ourselves one "pass" if we successfully
+# detect that this test cannot be run on this target!
+if { ![gdb_target_supports_trace] } then {
+ pass "Current target does not supporst trace"
+ return 1;
+
+}
+
+# If testing on a remote host, download the source file.
+# remote_download host $srcdir/$subdir/$srcfile
+
+#
+# test while-stepping dynamically (live target)
+#
+
+## verify number of trace frames collected matches stepcount
+
+gdb_delete_tracepoints
+gdb_test "trace gdb_c_test" \
+ "Tracepoint $decimal at .*" \
+ "Set tracepoint at gdb_c_test"
+
+gdb_trace_setactions "5.12: define while-stepping <stepcount>" \
+ "" \
+ "collect \$fp" "^$" \
+ "while-stepping 5" "^$" \
+ "collect p" "^$" \
+ "end" "^$" \
+ "end" ""
+
+gdb_test "tstart" "" ""
+
+if [istarget "m68k-*-elf"] then {
+ gdb_emclaptop_command "85,1,2,3,4,5,6"
+ sleep 5
+} else {
+ gdb_test "break end" "" ""
+ gdb_test "continue" \
+ "Continuing.*Breakpoint $decimal, end.*" \
+ "run trace experiment"
+}
+
+gdb_test "tstop" "" ""
+
+gdb_tfind_test "5.12: frame 5 should be the last one collected" "5" "5"
+
+send_gdb "tfind 6\n"
+gdb_expect {
+ -re "failed to find.*$gdb_prompt $" {
+ pass "5.12: trace stopped after 5 stepping frames"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "5.12: trace stopped after 5 stepping frames"
+ }
+}
+
+gdb_test "tfind none" "" ""
diff --git a/gdb/testsuite/gdb.trace/while-stepping.exp b/gdb/testsuite/gdb.trace/while-stepping.exp
new file mode 100644
index 00000000000..4c87d5cf214
--- /dev/null
+++ b/gdb/testsuite/gdb.trace/while-stepping.exp
@@ -0,0 +1,116 @@
+# Copyright 1998 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Michael Snyder (msnyder@cygnus.com)
+
+load_lib "trace-support.exp";
+
+if $tracelevel then {
+ strace $tracelevel
+}
+
+set prms_id 0
+set bug_id 0
+
+gdb_exit
+gdb_start
+
+if [istarget "m68k-*-elf"] then {
+ set srcfile gdb_c_test.c
+ set binfile [board_info target d490_binfile];
+} else {
+ set testfile "actions"
+ set srcfile ${testfile}.c
+ set binfile ${objdir}/${subdir}/${testfile}
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \
+ executable {debug additional_flags=-w}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+ }
+}
+gdb_reinitialize_dir $srcdir/$subdir
+
+# If testing on a remote host, download the source file.
+# remote_download host $srcdir/$subdir/$srcfile
+
+gdb_file_cmd $binfile
+
+#
+# test while-stepping command
+#
+
+gdb_delete_tracepoints
+set trcpt1 [gdb_gettpnum gdb_c_test]
+if { $trcpt1 <= 0 } then {
+ fail "Could not find gdb_c_test function"
+ return;
+}
+
+# 5.12 basic while-stepping command (collect regs)
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1.*0x.*\[\t \]+\[0-9\]+\[\t \]+0\[\t \]+.*in gdb_c_test.*" \
+ "5.12: set a tracepoint, stepcount is zero"
+
+set stepcount 12
+
+gdb_trace_setactions "5.12: set stepcount to $stepcount" \
+ "" \
+ "while-stepping $stepcount" "" \
+ "collect \$regs" "^$" \
+ "end" ""
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*$trcpt1.*0x.*\[\t \]+\[0-9\]+\[\t \]+$stepcount\[\t \]+.*in gdb_c_test.*" \
+ "5.12: confirm stepcount set to $stepcount"
+
+gdb_test "info tracepoints" \
+ "Num Enb Address\[ \]+PassC StepC What.*
+.*while-stepping $stepcount.*" \
+ "5.12: info trace shows \"while-stepping\""
+
+
+# 5.13 step out of context while collecting local variable
+# [deferred to dynamic test section]
+
+proc while_stepping_bogus_arg { bogus msgstring } {
+ global gdb_prompt;
+
+ gdb_trace_setactions "$msgstring" \
+ "" \
+ "while-stepping $bogus" "\[Ee\]rror|\[Ww\]arning"
+}
+
+# 5.14 while-stepping (no argument)
+
+while_stepping_bogus_arg "" "5.14: while-stepping null stepcount"
+
+# 5.15 while-stepping (zero stepcount)
+
+while_stepping_bogus_arg "0" "5.15: while-stepping rejects zero stepcount"
+
+# 5.16 while-stepping without collecting anything
+gdb_trace_setactions "5.16: step without collecting anything" \
+ "" \
+ "while-stepping $stepcount" "^$" \
+ "end" ""
+
+gdb_test "info tracepoints" \
+ ".*$trcpt1.*0x.*\[\t \]+\[0-9\]+\[\t \]+$stepcount\[\t \]+.*in gdb_c_test.*\[ \t\]+Actions for tracepoint $trcpt1:.*\[ \t\]+while-stepping $stepcount.*\[ \t\]+end.*\[ \t\]+end.*" \
+ "5.16: confirm actions, step without collecting anything"
+
diff --git a/gdb/testsuite/lib/compiler.c b/gdb/testsuite/lib/compiler.c
new file mode 100644
index 00000000000..8eb0d47dd19
--- /dev/null
+++ b/gdb/testsuite/lib/compiler.c
@@ -0,0 +1,31 @@
+/* Often the behavior of any particular test depends upon what compiler was
+ used to compile the test. As each test is compiled, this file is
+ preprocessed by the same compiler used to compile that specific test
+ (different tests might be compiled by different compilers, particularly
+ if compiled at different times), and used to generate a *.ci (compiler
+ info) file for that test.
+
+ I.E., when callfuncs is compiled, a callfuncs.ci file will be generated,
+ which can then be sourced by callfuncs.exp to give callfuncs.exp access
+ to information about the compilation environment.
+
+ TODO: It might be a good idea to add expect code that tests each
+ definition made with 'set" to see if one already exists, and if so
+ warn about conflicts if it is being set to something else. */
+
+/* This needs to be kept in sync with whatis.c and gdb.exp(get_compiler_info).
+ If this ends up being hairy, we could use a common header file. */
+
+#if defined (__STDC__) || defined (_AIX)
+set signed_keyword_not_used 0
+#else
+set signed_keyword_not_used 1
+#endif
+
+#if defined (__GNUC__)
+set gcc_compiled __GNUC__
+#else
+set gcc_compiled 0
+#endif
+
+return 0
diff --git a/gdb/testsuite/lib/compiler.cc b/gdb/testsuite/lib/compiler.cc
new file mode 100644
index 00000000000..5cb00f6685a
--- /dev/null
+++ b/gdb/testsuite/lib/compiler.cc
@@ -0,0 +1,34 @@
+/* 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. */
+
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6))
+set supports_template_debugging 1
+#else
+set supports_template_debugging 0
+#endif
+
+#if defined(__cplusplus)
+set supports_template_debugging 1
+#else
+set supports_template_debugging 0
+#endif
+
+#if defined (__GNUC__)
+set gcc_compiled __GNUC__
+#else
+set gcc_compiled 0
+#endif
+
+return 0
diff --git a/gdb/testsuite/lib/emc-support.exp b/gdb/testsuite/lib/emc-support.exp
new file mode 100644
index 00000000000..70bf2df0690
--- /dev/null
+++ b/gdb/testsuite/lib/emc-support.exp
@@ -0,0 +1,223 @@
+proc gdb_emc_readvar { varname } {
+ global gdb_prompt;
+
+ set result -1;
+ send_gdb "print $varname\n"
+ gdb_expect 5 {
+ -re "\[$\].*= (\[0-9\]+).*$gdb_prompt $" {
+ set result $expect_out(1,string);
+ }
+ -re "$gdb_prompt $" { }
+ default { }
+ }
+ return $result;
+}
+
+proc gdb_emc_gettpnum { testname } {
+ global gdb_prompt;
+
+ if { $testname != "" } {
+ gdb_test "trace $testname" "" ""
+ }
+ return [gdb_emc_readvar "\$tpnum"];
+}
+
+proc gdb_emc_setactions { testname actionname args } {
+ global gdb_prompt;
+
+ set state 0;
+ set status "pass";
+ send_gdb "actions $actionname\n";
+ set expected_result "";
+ gdb_expect 5 {
+ -re "No tracepoint number .*$gdb_prompt $" {
+ fail $testname
+ return 1;
+ }
+ -re "Enter actions for tracepoint $actionname.*>" {
+ if { [llength $args] > 0 } {
+ set lastcommand "[lindex $args $state]";
+ send_gdb "[lindex $args $state]\n";
+ incr state;
+ set expected_result [lindex $args $state];
+ incr state;
+ } else {
+ send_gdb "end\n";
+ }
+ exp_continue;
+ }
+ -re "\(.*\[\r\n\]+)\[ \t]*> $" {
+ if { $expected_result != "" } {
+ # Remove echoed command and its associated newline.
+ regsub "^\[^\r\n\]+\[\r\n\]+" "$expect_out(1,string)" "" out;
+ # Strip off any newlines at the end of the string.
+ regsub "\[\r\n\]+$" "$out" "" out;
+ verbose "expected '$expected_result', got '$out', expect_out is '$expect_out(1,string)'";
+ if ![regexp $expected_result $out] {
+ set status "fail";
+ }
+ set expected_result "";
+ }
+ if { $state < [llength $args] } {
+ send_gdb "[lindex $args $state]\n";
+ incr state;
+ set expected_result [lindex $args $state];
+ incr state;
+ } else {
+ send_gdb "end\n";
+ set expected_result "";
+ }
+ exp_continue;
+ }
+ -re "\(.*\)$gdb_prompt $" {
+ if { $expected_result != "" } {
+ if ![regexp $expected_result $expect_out(1,string)] {
+ set status "fail";
+ }
+ set expected_result "";
+ }
+ if { [llength $args] < $state } {
+ set status "fail";
+ }
+ }
+ default {
+ set status "fail";
+ }
+ }
+ if { $testname != "" } {
+ $status $testname;
+ }
+ if { $status == "pass" } then {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+#
+# test collect command
+#
+
+proc gdb_emc_tracetest_collect { arg1 msgstring } {
+ global decimal
+ global gdb_prompt;
+
+ set teststate 0
+ gdb_expect 30 {
+ -re "Enter actions for tracepoint $decimal.*> $" {
+ send_gdb "collect $arg1\n"
+ incr teststate;
+ exp_continue
+ }
+ -re "> $" {
+ if { $teststate == 1 } {
+ send_gdb "end\n"
+ incr teststate;
+ exp_continue
+ } else {
+ fail "$msgstring"
+ }
+ }
+ -re ".*$gdb_prompt $" {
+ if { $teststate == 2 } {
+ pass "$msgstring";
+ } else {
+ fail "$msgstring";
+ }
+ }
+ default {
+ fail "$msgstring (default)";
+ }
+ }
+ regsub -all "(\[($@*+)\])" "collect $arg1" "\[\\1\]" arg1_regexp;
+ gdb_test "info tracepoints" ".*$arg1_regexp.*" "$msgstring info tracepoint"
+}
+
+proc gdb_delete_tracepoints { } {
+ global gdb_prompt;
+
+ send_gdb "delete tracepoints\n"
+ gdb_expect 30 {
+ -re "Delete all tracepoints.*y or n.*$" {
+ send_gdb "y\n"
+ exp_continue;
+ }
+ -re "$gdb_prompt $" { }
+ timeout { fail "delete all tracepoints (timeout)" }
+ }
+}
+
+
+# Send each command in the list CMDLIST to gdb. If we see the string
+# "error" or "warning" from gdb, we assume an error has occured and
+# return a non-zero result. All of the commands in CMDLIST are always
+# sent, even if an error occurs.
+# If TESTNAME is non-null, we call pass or fail with the string in TESTNAME
+# depending on whether or not an error/warning has occurred.
+#
+proc gdb_do_cmdlist { cmdlist testname } {
+ global gdb_prompt;
+
+ set status 0;
+
+ foreach x $cmdlist {
+ send_gdb "$x\n";
+ gdb_expect 60 {
+ -re "\[Ee\]rror|\[Ww\]arning" {
+ set status 1;
+ exp_continue;
+ }
+ -re "$gdb_prompt $" { }
+ -re "\[\r\n\]\[ \t\]*> *$" { }
+ }
+ }
+ if { $testname != "" } {
+ if { $status == 0 } {
+ pass "$testname";
+ } else {
+ fail "$testname";
+ }
+ }
+ return $status;
+}
+
+#
+# Given the file FILENAME, we read it as a list of commands and generate
+# a list suitable for use by gdb_do_cmdlist. Lines beginning with # are
+# ignored; blank lines are interpreted as empty lines to be sent to gdb.
+#
+proc gdb_process_cmdfile { filename } {
+ set id [open $filename "r"];
+ if { $id < 0 } {
+ return "";
+ }
+ set result {};
+ while { [gets $id line] >= 0 } {
+ if [regexp "^#" $line] {
+ continue;
+ }
+ set result [concat $result [list "$line"]];
+ }
+ close $id;
+ return $result;
+}
+
+# gdb_find_c_test_baseline
+# returns -1 on failure (CALLER MUST CHECK RETURN!)
+proc gdb_find_c_test_baseline { } {
+ global gdb_prompt;
+
+ set gdb_c_test_baseline -1;
+
+ send_gdb "list gdb_c_test\n"
+ gdb_expect {
+ -re "void.*p5,.*void.*p6.*\[\r\n\](\[0-9\]+)\[\t \]+\{.*$gdb_prompt $" {
+ set gdb_c_test_baseline $expect_out(1,string)
+ }
+ -re "$gdb_prompt $" { }
+ default { }
+ }
+ return $gdb_c_test_baseline;
+}
+
+
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
new file mode 100644
index 00000000000..d9285e86945
--- /dev/null
+++ b/gdb/testsuite/lib/gdb.exp
@@ -0,0 +1,1684 @@
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
+# Generic gdb subroutines that should work for any target. If these
+# need to be modified for any target, it can be done with a variable
+# or by passing arguments.
+
+load_lib libgloss.exp
+
+global GDB
+global CHILL_LIB
+global CHILL_RT0
+
+if ![info exists CHILL_LIB] {
+ set CHILL_LIB [findfile $base_dir/../../gcc/ch/runtime/libchill.a "$base_dir/../../gcc/ch/runtime/libchill.a" [transform -lchill]]
+}
+verbose "using CHILL_LIB = $CHILL_LIB" 2
+if ![info exists CHILL_RT0] {
+ set CHILL_RT0 [findfile $base_dir/../../gcc/ch/runtime/chillrt0.o "$base_dir/../../gcc/ch/runtime/chillrt0.o" ""]
+}
+verbose "using CHILL_RT0 = $CHILL_RT0" 2
+
+if [info exists TOOL_EXECUTABLE] {
+ set GDB $TOOL_EXECUTABLE;
+}
+if ![info exists GDB] {
+ if ![is_remote host] {
+ set GDB [findfile $base_dir/../../gdb/gdb "$base_dir/../../gdb/gdb" [transform gdb]]
+ } else {
+ set GDB [transform gdb];
+ }
+}
+verbose "using GDB = $GDB" 2
+
+global GDBFLAGS
+if ![info exists GDBFLAGS] {
+ set GDBFLAGS "-nx"
+}
+verbose "using GDBFLAGS = $GDBFLAGS" 2
+
+# The variable gdb_prompt is a regexp which matches the gdb prompt.
+# Set it if it is not already set.
+global gdb_prompt
+if ![info exists gdb_prompt] then {
+ set gdb_prompt "\[(\]gdb\[)\]"
+}
+
+# Needed for some tests under Cygwin.
+global EXEEXT
+global env
+
+if ![info exists env(EXEEXT)] {
+ set EXEEXT ""
+} else {
+ set EXEEXT $env(EXEEXT)
+}
+
+### Only procedures should come after this point.
+
+#
+# gdb_version -- extract and print the version number of GDB
+#
+proc default_gdb_version {} {
+ global GDB
+ global GDBFLAGS
+ global gdb_prompt
+ set fileid [open "gdb_cmd" w];
+ puts $fileid "q";
+ close $fileid;
+ set cmdfile [remote_download host "gdb_cmd"];
+ set output [remote_exec host "$GDB -nw --command $cmdfile"]
+ remote_file build delete "gdb_cmd";
+ remote_file host delete "$cmdfile";
+ set tmp [lindex $output 1];
+ set version ""
+ regexp " \[0-9\]\[^ \t\n\r\]+" "$tmp" version
+ if ![is_remote host] {
+ clone_output "[which $GDB] version $version $GDBFLAGS\n"
+ } else {
+ clone_output "$GDB on remote host version $version $GDBFLAGS\n"
+ }
+}
+
+proc gdb_version { } {
+ return [default_gdb_version];
+}
+
+#
+# gdb_unload -- unload a file if one is loaded
+#
+
+proc gdb_unload {} {
+ global verbose
+ global GDB
+ global gdb_prompt
+ send_gdb "file\n"
+ gdb_expect 60 {
+ -re "No executable file now\[^\r\n\]*\[\r\n\]" { exp_continue }
+ -re "No symbol file now\[^\r\n\]*\[\r\n\]" { exp_continue }
+ -re "A program is being debugged already..*Kill it.*y or n. $"\
+ { send_gdb "y\n"
+ verbose "\t\tKilling previous program being debugged"
+ exp_continue
+ }
+ -re "Discard symbol table from .*y or n.*$" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "$gdb_prompt $" {}
+ timeout {
+ perror "couldn't unload file in $GDB (timed out)."
+ return -1
+ }
+ }
+}
+
+# Many of the tests depend on setting breakpoints at various places and
+# running until that breakpoint is reached. At times, we want to start
+# with a clean-slate with respect to breakpoints, so this utility proc
+# lets us do this without duplicating this code everywhere.
+#
+
+proc delete_breakpoints {} {
+ global gdb_prompt
+
+ # we need a larger timeout value here or this thing just confuses
+ # itself. May need a better implementation if possible. - guo
+ #
+ send_gdb "delete breakpoints\n"
+ gdb_expect 100 {
+ -re "Delete all breakpoints.*y or n.*$" {
+ send_gdb "y\n";
+ exp_continue
+ }
+ -re "$gdb_prompt $" { # This happens if there were no breakpoints
+ }
+ timeout { perror "Delete all breakpoints in delete_breakpoints (timeout)" ; return }
+ }
+ send_gdb "info breakpoints\n"
+ gdb_expect 100 {
+ -re "No breakpoints or watchpoints..*$gdb_prompt $" {}
+ -re "$gdb_prompt $" { perror "breakpoints not deleted" ; return }
+ -re "Delete all breakpoints.*or n.*$" {
+ send_gdb "y\n";
+ exp_continue
+ }
+ timeout { perror "info breakpoints (timeout)" ; return }
+ }
+}
+
+
+#
+# Generic run command.
+#
+# The second pattern below matches up to the first newline *only*.
+# Using ``.*$'' could swallow up output that we attempt to match
+# elsewhere.
+#
+proc gdb_run_cmd {args} {
+ global gdb_prompt
+
+ if [target_info exists gdb_init_command] {
+ send_gdb "[target_info gdb_init_command]\n";
+ gdb_expect 30 {
+ -re "$gdb_prompt $" { }
+ default {
+ perror "gdb_init_command for target failed";
+ return;
+ }
+ }
+ }
+
+ if [target_info exists use_gdb_stub] {
+ if [target_info exists gdb,do_reload_on_run] {
+ # Specifying no file, defaults to the executable
+ # currently being debugged.
+ if { [gdb_load ""] < 0 } {
+ return;
+ }
+ send_gdb "continue\n";
+ gdb_expect 60 {
+ -re "Continu\[^\r\n\]*\[\r\n\]" {}
+ default {}
+ }
+ return;
+ }
+
+ if [target_info exists gdb,start_symbol] {
+ set start [target_info gdb,start_symbol];
+ } else {
+ set start "start";
+ }
+ send_gdb "jump *$start\n"
+ set start_attempt 1;
+ while { $start_attempt } {
+ # Cap (re)start attempts at three to ensure that this loop
+ # always eventually fails. Don't worry about trying to be
+ # clever and not send a command when it has failed.
+ if [expr $start_attempt > 3] {
+ perror "Jump to start() failed (retry count exceeded)";
+ return;
+ }
+ set start_attempt [expr $start_attempt + 1];
+ gdb_expect 30 {
+ -re "Continuing at \[^\r\n\]*\[\r\n\]" {
+ set start_attempt 0;
+ }
+ -re "No symbol \"_start\" in current.*$gdb_prompt $" {
+ perror "Can't find start symbol to run in gdb_run";
+ return;
+ }
+ -re "No symbol \"start\" in current.*$gdb_prompt $" {
+ send_gdb "jump *_start\n";
+ }
+ -re "No symbol.*context.*$gdb_prompt $" {
+ set start_attempt 0;
+ }
+ -re "Line.* Jump anyway.*y or n. $" {
+ send_gdb "y\n"
+ }
+ -re "The program is not being run.*$gdb_prompt $" {
+ if { [gdb_load ""] < 0 } {
+ return;
+ }
+ send_gdb "jump *$start\n";
+ }
+ timeout {
+ perror "Jump to start() failed (timeout)";
+ return
+ }
+ }
+ }
+ if [target_info exists gdb_stub] {
+ gdb_expect 60 {
+ -re "$gdb_prompt $" {
+ send_gdb "continue\n"
+ }
+ }
+ }
+ return
+ }
+ send_gdb "run $args\n"
+# This doesn't work quite right yet.
+ gdb_expect 60 {
+ -re "The program .* has been started already.*y or n. $" {
+ send_gdb "y\n"
+ exp_continue
+ }
+ -re "Starting program: \[^\r\n\]*" {}
+ }
+}
+
+proc gdb_breakpoint { function } {
+ global gdb_prompt
+ global decimal
+
+ send_gdb "break $function\n"
+ # The first two regexps are what we get with -g, the third is without -g.
+ gdb_expect 30 {
+ -re "Breakpoint \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {}
+ -re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {}
+ -re "Breakpoint \[0-9\]* at .*$gdb_prompt $" {}
+ -re "$gdb_prompt $" { fail "setting breakpoint at $function" ; return 0 }
+ timeout { fail "setting breakpoint at $function (timeout)" ; return 0 }
+ }
+ return 1;
+}
+
+# Set breakpoint at function and run gdb until it breaks there.
+# Since this is the only breakpoint that will be set, if it stops
+# at a breakpoint, we will assume it is the one we want. We can't
+# just compare to "function" because it might be a fully qualified,
+# single quoted C++ function specifier.
+
+proc runto { function } {
+ global gdb_prompt
+ global decimal
+
+ delete_breakpoints
+
+ if ![gdb_breakpoint $function] {
+ return 0;
+ }
+
+ gdb_run_cmd
+
+ # the "at foo.c:36" output we get with -g.
+ # the "in func" output we get without -g.
+ gdb_expect 30 {
+ -re "Break.* at .*:$decimal.*$gdb_prompt $" {
+ return 1
+ }
+ -re "Breakpoint \[0-9\]*, \[0-9xa-f\]* in .*$gdb_prompt $" {
+ return 1
+ }
+ -re "$gdb_prompt $" {
+ fail "running to $function in runto"
+ return 0
+ }
+ timeout {
+ fail "running to $function in runto (timeout)"
+ return 0
+ }
+ }
+ return 1
+}
+
+#
+# runto_main -- ask gdb to run until we hit a breakpoint at main.
+# The case where the target uses stubs has to be handled
+# specially--if it uses stubs, assuming we hit
+# breakpoint() and just step out of the function.
+#
+proc runto_main { } {
+ global gdb_prompt
+ global decimal
+
+ if ![target_info exists gdb_stub] {
+ return [runto main]
+ }
+
+ delete_breakpoints
+
+ gdb_step_for_stub;
+
+ return 1
+}
+
+
+### Continue, and expect to hit a breakpoint.
+### Report a pass or fail, depending on whether it seems to have
+### worked. Use NAME as part of the test name; each call to
+### continue_to_breakpoint should use a NAME which is unique within
+### that test file.
+proc gdb_continue_to_breakpoint {name} {
+ global gdb_prompt
+ set full_name "continue to breakpoint: $name"
+
+ send_gdb "continue\n"
+ gdb_expect {
+ -re "Breakpoint .* at .*\r\n$gdb_prompt $" {
+ pass $full_name
+ }
+ -re ".*$gdb_prompt $" {
+ fail $full_name
+ }
+ timeout {
+ fail "$full_name (timeout)"
+ }
+ }
+}
+
+
+
+# gdb_test COMMAND PATTERN MESSAGE QUESTION RESPONSE
+# Send a command to gdb; test the result.
+#
+# COMMAND is the command to execute, send to GDB with send_gdb. If
+# this is the null string no command is sent.
+# PATTERN is the pattern to match for a PASS, and must NOT include
+# the \r\n sequence immediately before the gdb prompt.
+# MESSAGE is an optional message to be printed. If this is
+# omitted, then the pass/fail messages use the command string as the
+# message. (If this is the empty string, then sometimes we don't
+# call pass or fail at all; I don't understand this at all.)
+# QUESTION is a question GDB may ask in response to COMMAND, like
+# "are you sure?"
+# RESPONSE is the response to send if QUESTION appears.
+#
+# Returns:
+# 1 if the test failed,
+# 0 if the test passes,
+# -1 if there was an internal error.
+#
+proc gdb_test { args } {
+ global verbose
+ global gdb_prompt
+ global GDB
+ upvar timeout timeout
+
+ if [llength $args]>2 then {
+ set message [lindex $args 2]
+ } else {
+ set message [lindex $args 0]
+ }
+ set command [lindex $args 0]
+ set pattern [lindex $args 1]
+
+ if [llength $args]==5 {
+ set question_string [lindex $args 3];
+ set response_string [lindex $args 4];
+ } else {
+ set question_string "^FOOBAR$"
+ }
+
+ if $verbose>2 then {
+ send_user "Sending \"$command\" to gdb\n"
+ send_user "Looking to match \"$pattern\"\n"
+ send_user "Message is \"$message\"\n"
+ }
+
+ set result -1
+ set string "${command}\n";
+ if { $command != "" } {
+ while { "$string" != "" } {
+ set foo [string first "\n" "$string"];
+ set len [string length "$string"];
+ if { $foo < [expr $len - 1] } {
+ set str [string range "$string" 0 $foo];
+ if { [send_gdb "$str"] != "" } {
+ global suppress_flag;
+
+ if { ! $suppress_flag } {
+ perror "Couldn't send $command to GDB.";
+ }
+ fail "$message";
+ return $result;
+ }
+ # since we're checking if each line of the multi-line
+ # command are 'accepted' by GDB here,
+ # we need to set -notransfer expect option so that
+ # command output is not lost for pattern matching
+ # - guo
+ gdb_expect 2 {
+ -notransfer -re "\[\r\n\]" { verbose "partial: match" 3 }
+ timeout { verbose "partial: timeout" 3 }
+ }
+ set string [string range "$string" [expr $foo + 1] end];
+ } else {
+ break;
+ }
+ }
+ if { "$string" != "" } {
+ if { [send_gdb "$string"] != "" } {
+ global suppress_flag;
+
+ if { ! $suppress_flag } {
+ perror "Couldn't send $command to GDB.";
+ }
+ fail "$message";
+ return $result;
+ }
+ }
+ }
+
+ if [target_info exists gdb,timeout] {
+ set tmt [target_info gdb,timeout];
+ } else {
+ if [info exists timeout] {
+ set tmt $timeout;
+ } else {
+ global timeout;
+ if [info exists timeout] {
+ set tmt $timeout;
+ } else {
+ set tmt 60;
+ }
+ }
+ }
+ gdb_expect $tmt {
+ -re "\\*\\*\\* DOSEXIT code.*" {
+ if { $message != "" } {
+ fail "$message";
+ }
+ gdb_suppress_entire_file "GDB died";
+ return -1;
+ }
+ -re "Ending remote debugging.*$gdb_prompt $" {
+ if ![isnative] then {
+ warning "Can`t communicate to remote target."
+ }
+ gdb_exit
+ gdb_start
+ set result -1
+ }
+ -re "\[\r\n\]*($pattern)\[\r\n\]+$gdb_prompt $" {
+ if ![string match "" $message] then {
+ pass "$message"
+ }
+ set result 0
+ }
+ -re "(${question_string})$" {
+ send_gdb "$response_string\n";
+ exp_continue;
+ }
+ -re "Undefined\[a-z\]* command:.*$gdb_prompt $" {
+ perror "Undefined command \"$command\"."
+ fail "$message"
+ set result 1
+ }
+ -re "Ambiguous command.*$gdb_prompt $" {
+ perror "\"$command\" is not a unique command name."
+ fail "$message"
+ set result 1
+ }
+ -re "Program exited with code \[0-9\]+.*$gdb_prompt $" {
+ if ![string match "" $message] then {
+ set errmsg "$message: the program exited"
+ } else {
+ set errmsg "$command: the program exited"
+ }
+ fail "$errmsg"
+ return -1
+ }
+ -re "EXIT code \[0-9\r\n\]+Program exited normally.*$gdb_prompt $" {
+ if ![string match "" $message] then {
+ set errmsg "$message: the program exited"
+ } else {
+ set errmsg "$command: the program exited"
+ }
+ fail "$errmsg"
+ return -1
+ }
+ -re "The program is not being run.*$gdb_prompt $" {
+ if ![string match "" $message] then {
+ set errmsg "$message: the program is no longer running"
+ } else {
+ set errmsg "$command: the program is no longer running"
+ }
+ fail "$errmsg"
+ return -1
+ }
+ -re ".*$gdb_prompt $" {
+ if ![string match "" $message] then {
+ fail "$message"
+ }
+ set result 1
+ }
+ "<return>" {
+ send_gdb "\n"
+ perror "Window too small."
+ fail "$message"
+ }
+ -re "\\(y or n\\) " {
+ send_gdb "n\n"
+ perror "Got interactive prompt."
+ fail "$message"
+ }
+ eof {
+ perror "Process no longer exists"
+ if { $message != "" } {
+ fail "$message"
+ }
+ return -1
+ }
+ full_buffer {
+ perror "internal buffer is full."
+ fail "$message"
+ }
+ timeout {
+ if ![string match "" $message] then {
+ fail "$message (timeout)"
+ }
+ set result 1
+ }
+ }
+ return $result
+}
+
+# Test that a command gives an error. For pass or fail, return
+# a 1 to indicate that more tests can proceed. However a timeout
+# is a serious error, generates a special fail message, and causes
+# a 0 to be returned to indicate that more tests are likely to fail
+# as well.
+
+proc test_print_reject { args } {
+ global gdb_prompt
+ global verbose
+
+ if [llength $args]==2 then {
+ set expectthis [lindex $args 1]
+ } else {
+ set expectthis "should never match this bogus string"
+ }
+ set sendthis [lindex $args 0]
+ if $verbose>2 then {
+ send_user "Sending \"$sendthis\" to gdb\n"
+ send_user "Looking to match \"$expectthis\"\n"
+ }
+ send_gdb "$sendthis\n"
+ #FIXME: Should add timeout as parameter.
+ gdb_expect {
+ -re "A .* in expression.*\\.*$gdb_prompt $" {
+ pass "reject $sendthis"
+ return 1
+ }
+ -re "Invalid syntax in expression.*$gdb_prompt $" {
+ pass "reject $sendthis"
+ return 1
+ }
+ -re "Junk after end of expression.*$gdb_prompt $" {
+ pass "reject $sendthis"
+ return 1
+ }
+ -re "Invalid number.*$gdb_prompt $" {
+ pass "reject $sendthis"
+ return 1
+ }
+ -re "Invalid character constant.*$gdb_prompt $" {
+ pass "reject $sendthis"
+ return 1
+ }
+ -re "No symbol table is loaded.*$gdb_prompt $" {
+ pass "reject $sendthis"
+ return 1
+ }
+ -re "No symbol .* in current context.*$gdb_prompt $" {
+ pass "reject $sendthis"
+ return 1
+ }
+ -re "Unmatched single quote.*$gdb_prompt $" {
+ pass "reject $sendthis"
+ return 1
+ }
+ -re "A character constant must contain at least one character.*$gdb_prompt $" {
+ pass "reject $sendthis"
+ return 1
+ }
+ -re "$expectthis.*$gdb_prompt $" {
+ pass "reject $sendthis"
+ return 1
+ }
+ -re ".*$gdb_prompt $" {
+ fail "reject $sendthis"
+ return 1
+ }
+ default {
+ fail "reject $sendthis (eof or timeout)"
+ return 0
+ }
+ }
+}
+
+# Given an input string, adds backslashes as needed to create a
+# regexp that will match the string.
+
+proc string_to_regexp {str} {
+ set result $str
+ regsub -all {[]*+.|()^$\[]} $str {\\&} result
+ return $result
+}
+
+# Same as gdb_test, but the second parameter is not a regexp,
+# but a string that must match exactly.
+
+proc gdb_test_exact { args } {
+ upvar timeout timeout
+
+ set command [lindex $args 0]
+
+ # This applies a special meaning to a null string pattern. Without
+ # this, "$pattern\r\n$gdb_prompt $" will match anything, including error
+ # messages from commands that should have no output except a new
+ # prompt. With this, only results of a null string will match a null
+ # string pattern.
+
+ set pattern [lindex $args 1]
+ if [string match $pattern ""] {
+ set pattern [string_to_regexp [lindex $args 0]]
+ } else {
+ set pattern [string_to_regexp [lindex $args 1]]
+ }
+
+ # It is most natural to write the pattern argument with only
+ # embedded \n's, especially if you are trying to avoid Tcl quoting
+ # problems. But gdb_expect really wants to see \r\n in patterns. So
+ # transform the pattern here. First transform \r\n back to \n, in
+ # case some users of gdb_test_exact already do the right thing.
+ regsub -all "\r\n" $pattern "\n" pattern
+ regsub -all "\n" $pattern "\r\n" pattern
+ if [llength $args]==3 then {
+ set message [lindex $args 2]
+ } else {
+ set message $command
+ }
+
+ return [gdb_test $command $pattern $message]
+}
+
+proc gdb_reinitialize_dir { subdir } {
+ global gdb_prompt
+
+ if [is_remote host] {
+ return "";
+ }
+ send_gdb "dir\n"
+ gdb_expect 60 {
+ -re "Reinitialize source path to empty.*y or n. " {
+ send_gdb "y\n"
+ gdb_expect 60 {
+ -re "Source directories searched.*$gdb_prompt $" {
+ send_gdb "dir $subdir\n"
+ gdb_expect 60 {
+ -re "Source directories searched.*$gdb_prompt $" {
+ verbose "Dir set to $subdir"
+ }
+ -re "$gdb_prompt $" {
+ perror "Dir \"$subdir\" failed."
+ }
+ }
+ }
+ -re "$gdb_prompt $" {
+ perror "Dir \"$subdir\" failed."
+ }
+ }
+ }
+ -re "$gdb_prompt $" {
+ perror "Dir \"$subdir\" failed."
+ }
+ }
+}
+
+#
+# gdb_exit -- exit the GDB, killing the target program if necessary
+#
+proc default_gdb_exit {} {
+ global GDB
+ global GDBFLAGS
+ global verbose
+ global gdb_spawn_id;
+
+ gdb_stop_suppressing_tests;
+
+ if ![info exists gdb_spawn_id] {
+ return;
+ }
+
+ verbose "Quitting $GDB $GDBFLAGS"
+
+ if { [is_remote host] && [board_info host exists fileid] } {
+ send_gdb "quit\n";
+ gdb_expect 10 {
+ -re "y or n" {
+ send_gdb "y\n";
+ exp_continue;
+ }
+ -re "DOSEXIT code" { }
+ default { }
+ }
+ }
+
+ if ![is_remote host] {
+ remote_close host;
+ }
+ unset gdb_spawn_id
+}
+
+#
+# load a file into the debugger.
+# return a -1 if anything goes wrong.
+#
+proc gdb_file_cmd { arg } {
+ global verbose
+ global loadpath
+ global loadfile
+ global GDB
+ global gdb_prompt
+ upvar timeout timeout
+
+ if [is_remote host] {
+ set arg [remote_download host $arg];
+ if { $arg == "" } {
+ error "download failed"
+ return -1;
+ }
+ }
+
+ send_gdb "file $arg\n"
+ gdb_expect 120 {
+ -re "Reading symbols from.*done.*$gdb_prompt $" {
+ verbose "\t\tLoaded $arg into the $GDB"
+ return 0
+ }
+ -re "has no symbol-table.*$gdb_prompt $" {
+ perror "$arg wasn't compiled with \"-g\""
+ return -1
+ }
+ -re "A program is being debugged already.*Kill it.*y or n. $" {
+ send_gdb "y\n"
+ verbose "\t\tKilling previous program being debugged"
+ exp_continue
+ }
+ -re "Load new symbol table from \".*\".*y or n. $" {
+ send_gdb "y\n"
+ gdb_expect 120 {
+ -re "Reading symbols from.*done.*$gdb_prompt $" {
+ verbose "\t\tLoaded $arg with new symbol table into $GDB"
+ return 0
+ }
+ timeout {
+ perror "(timeout) Couldn't load $arg, other program already loaded."
+ return -1
+ }
+ }
+ }
+ -re "No such file or directory.*$gdb_prompt $" {
+ perror "($arg) No such file or directory\n"
+ return -1
+ }
+ -re "$gdb_prompt $" {
+ perror "couldn't load $arg into $GDB."
+ return -1
+ }
+ timeout {
+ perror "couldn't load $arg into $GDB (timed out)."
+ return -1
+ }
+ eof {
+ # This is an attempt to detect a core dump, but seems not to
+ # work. Perhaps we need to match .* followed by eof, in which
+ # gdb_expect does not seem to have a way to do that.
+ perror "couldn't load $arg into $GDB (end of file)."
+ return -1
+ }
+ }
+}
+
+#
+# start gdb -- start gdb running, default procedure
+#
+# When running over NFS, particularly if running many simultaneous
+# tests on different hosts all using the same server, things can
+# get really slow. Give gdb at least 3 minutes to start up.
+#
+proc default_gdb_start { } {
+ global verbose
+ global GDB
+ global GDBFLAGS
+ global gdb_prompt
+ global timeout
+ global gdb_spawn_id;
+
+ gdb_stop_suppressing_tests;
+
+ verbose "Spawning $GDB -nw $GDBFLAGS"
+
+ if [info exists gdb_spawn_id] {
+ return 0;
+ }
+
+ if ![is_remote host] {
+ if { [which $GDB] == 0 } then {
+ perror "$GDB does not exist."
+ exit 1
+ }
+ }
+ set res [remote_spawn host "$GDB -nw $GDBFLAGS [host_info gdb_opts]"];
+ if { $res < 0 || $res == "" } {
+ perror "Spawning $GDB failed."
+ return 1;
+ }
+ gdb_expect 360 {
+ -re "\[\r\n\]$gdb_prompt $" {
+ verbose "GDB initialized."
+ }
+ -re "$gdb_prompt $" {
+ perror "GDB never initialized."
+ return -1
+ }
+ timeout {
+ perror "(timeout) GDB never initialized after 10 seconds."
+ remote_close host;
+ return -1
+ }
+ }
+ set gdb_spawn_id -1;
+ # force the height to "unlimited", so no pagers get used
+
+ send_gdb "set height 0\n"
+ gdb_expect 10 {
+ -re "$gdb_prompt $" {
+ verbose "Setting height to 0." 2
+ }
+ timeout {
+ warning "Couldn't set the height to 0"
+ }
+ }
+ # force the width to "unlimited", so no wraparound occurs
+ send_gdb "set width 0\n"
+ gdb_expect 10 {
+ -re "$gdb_prompt $" {
+ verbose "Setting width to 0." 2
+ }
+ timeout {
+ warning "Couldn't set the width to 0."
+ }
+ }
+ return 0;
+}
+
+# Return a 1 for configurations for which we don't even want to try to
+# test C++.
+
+proc skip_cplus_tests {} {
+ if { [istarget "d10v-*-*"] } {
+ return 1
+ }
+ if { [istarget "h8300-*-*"] } {
+ return 1
+ }
+ return 0
+}
+
+# * For crosses, the CHILL runtime doesn't build because it can't find
+# setjmp.h, stdio.h, etc.
+# * For AIX (as of 16 Mar 95), (a) there is no language code for
+# CHILL in output_epilog in gcc/config/rs6000/rs6000.c, (b) collect2
+# does not get along with AIX's too-clever linker.
+# * On Irix5, there is a bug whereby set of bool, etc., don't get
+# TYPE_LOW_BOUND for the bool right because force_to_range_type doesn't
+# work with stub types.
+# Lots of things seem to fail on the PA, and since it's not a supported
+# chill target at the moment, don't run the chill tests.
+
+proc skip_chill_tests {} {
+ if ![info exists do_chill_tests] {
+ return 1;
+ }
+ eval set skip_chill [expr ![isnative] || [istarget "*-*-aix*"] || [istarget "*-*-irix5*"] || [istarget "*-*-irix6*"] || [istarget "alpha-*-osf*"] || [istarget "hppa*-*-*"]]
+ verbose "Skip chill tests is $skip_chill"
+ return $skip_chill
+}
+
+# Skip all the tests in the file if you are not on an hppa running
+# hpux target.
+
+proc skip_hp_tests {} {
+ eval set skip_hp [ expr ![isnative] || ![istarget "hppa*-*-hpux*"] ]
+ verbose "Skip hp tests is $skip_hp"
+ return $skip_hp
+}
+
+proc get_compiler_info {binfile args} {
+ # Create and source the file that provides information about the compiler
+ # used to compile the test case.
+ # Compiler_type can be null or c++. If null we assume c.
+ global srcdir
+ global subdir
+ # These two come from compiler.c.
+ global signed_keyword_not_used
+ global gcc_compiled
+
+ if {![istarget "hppa*-*-hpux*"]} {
+ if { [llength $args] > 0 } {
+ if {$args == "c++"} {
+ if { [gdb_compile "${srcdir}/lib/compiler.cc" "${binfile}.ci" preprocess {}] != "" } {
+ perror "Couldn't make ${binfile}.ci file"
+ return 1;
+ }
+ }
+ } else {
+ if { [gdb_compile "${srcdir}/lib/compiler.c" "${binfile}.ci" preprocess {}] != "" } {
+ perror "Couldn't make ${binfile}.ci file"
+ return 1;
+ }
+ }
+ } else {
+ if { [llength $args] > 0 } {
+ if {$args == "c++"} {
+ if { [eval gdb_preprocess \
+ [list "${srcdir}/lib/compiler.cc" "${binfile}.ci"] \
+ $args] != "" } {
+ perror "Couldn't make ${binfile}.ci file"
+ return 1;
+ }
+ }
+ } elseif { $args != "f77" } {
+ if { [eval gdb_preprocess \
+ [list "${srcdir}/lib/compiler.c" "${binfile}.ci"] \
+ $args] != "" } {
+ perror "Couldn't make ${binfile}.ci file"
+ return 1;
+ }
+ }
+ }
+
+ uplevel \#0 { set gcc_compiled 0 }
+
+ if { [llength $args] == 0 || $args != "f77" } {
+ source ${binfile}.ci
+ }
+
+ # Most compilers will evaluate comparisons and other boolean
+ # operations to 0 or 1.
+ uplevel \#0 { set true 1 }
+ uplevel \#0 { set false 0 }
+
+ uplevel \#0 { set hp_cc_compiler 0 }
+ uplevel \#0 { set hp_aCC_compiler 0 }
+ uplevel \#0 { set hp_f77_compiler 0 }
+ uplevel \#0 { set hp_f90_compiler 0 }
+ if { !$gcc_compiled && [istarget "hppa*-*-hpux*"] } {
+ # Check for the HP compilers
+ set compiler [lindex [split [get_compiler $args] " "] 0]
+ catch "exec what $compiler" output
+ if [regexp ".*HP aC\\+\\+.*" $output] {
+ uplevel \#0 { set hp_aCC_compiler 1 }
+ # Use of aCC results in boolean results being displayed as
+ # "true" or "false"
+ uplevel \#0 { set true true }
+ uplevel \#0 { set false false }
+ } elseif [regexp ".*HP C Compiler.*" $output] {
+ uplevel \#0 { set hp_cc_compiler 1 }
+ } elseif [regexp ".*HP-UX f77.*" $output] {
+ uplevel \#0 { set hp_f77_compiler 1 }
+ } elseif [regexp ".*HP-UX f90.*" $output] {
+ uplevel \#0 { set hp_f90_compiler 1 }
+ }
+ }
+
+ return 0;
+}
+
+proc get_compiler {args} {
+ global CC CC_FOR_TARGET CXX CXX_FOR_TARGET F77_FOR_TARGET
+
+ if { [llength $args] == 0
+ || ([llength $args] == 1 && [lindex $args 0] == "") } {
+ set which_compiler "c"
+ } else {
+ if { $args =="c++" } {
+ set which_compiler "c++"
+ } elseif { $args =="f77" } {
+ set which_compiler "f77"
+ } else {
+ perror "Unknown compiler type supplied to gdb_preprocess"
+ return ""
+ }
+ }
+
+ if [info exists CC_FOR_TARGET] {
+ if {$which_compiler == "c"} {
+ set compiler $CC_FOR_TARGET
+ }
+ }
+
+ if [info exists CXX_FOR_TARGET] {
+ if {$which_compiler == "c++"} {
+ set compiler $CXX_FOR_TARGET
+ }
+ }
+
+ if [info exists F77_FOR_TARGET] {
+ if {$which_compiler == "f77"} {
+ set compiler $F77_FOR_TARGET
+ }
+ }
+
+ if { ![info exists compiler] } {
+ if { $which_compiler == "c" } {
+ if {[info exists CC]} {
+ set compiler $CC
+ }
+ }
+ if { $which_compiler == "c++" } {
+ if {[info exists CXX]} {
+ set compiler $CXX
+ }
+ }
+ if {![info exists compiler]} {
+ set compiler [board_info [target_info name] compiler];
+ if { $compiler == "" } {
+ perror "get_compiler: No compiler found"
+ return ""
+ }
+ }
+ }
+
+ return $compiler
+}
+
+proc gdb_preprocess {source dest args} {
+ set compiler [get_compiler "$args"]
+ if { $compiler == "" } {
+ return 1
+ }
+
+ set cmdline "$compiler -E $source > $dest"
+
+ verbose "Invoking $compiler -E $source > $dest"
+ verbose -log "Executing on local host: $cmdline" 2
+ set status [catch "exec ${cmdline}" exec_output]
+
+ set result [prune_warnings $exec_output]
+ regsub "\[\r\n\]*$" "$result" "" result;
+ regsub "^\[\r\n\]*" "$result" "" result;
+ if { $result != "" } {
+ clone_output "gdb compile failed, $result"
+ }
+ return $result;
+}
+
+set gdb_wrapper_initialized 0
+
+proc gdb_wrapper_init { args } {
+ global gdb_wrapper_initialized;
+ global gdb_wrapper_file;
+ global gdb_wrapper_flags;
+
+ if { $gdb_wrapper_initialized == 1 } { return; }
+
+ if {[target_info exists needs_status_wrapper] && \
+ [target_info needs_status_wrapper] != "0"} {
+ set result [build_wrapper "testglue.o"];
+ if { $result != "" } {
+ set gdb_wrapper_file [lindex $result 0];
+ set gdb_wrapper_flags [lindex $result 1];
+ } else {
+ warning "Status wrapper failed to build."
+ }
+ }
+ set gdb_wrapper_initialized 1
+}
+
+proc gdb_compile {source dest type options} {
+ global GDB_TESTCASE_OPTIONS;
+ global gdb_wrapper_file;
+ global gdb_wrapper_flags;
+ global gdb_wrapper_initialized;
+
+ if [target_info exists gdb_stub] {
+ set options2 { "additional_flags=-Dusestubs" }
+ lappend options "libs=[target_info gdb_stub]";
+ set options [concat $options2 $options]
+ }
+ if [target_info exists is_vxworks] {
+ set options2 { "additional_flags=-Dvxworks" }
+ lappend options "libs=[target_info gdb_stub]";
+ set options [concat $options2 $options]
+ }
+ if [info exists GDB_TESTCASE_OPTIONS] {
+ lappend options "additional_flags=$GDB_TESTCASE_OPTIONS";
+ }
+ verbose "options are $options"
+ verbose "source is $source $dest $type $options"
+
+ if { $gdb_wrapper_initialized == 0 } { gdb_wrapper_init }
+
+ if {[target_info exists needs_status_wrapper] && \
+ [target_info needs_status_wrapper] != "0" && \
+ [info exists gdb_wrapper_file]} {
+ lappend options "libs=${gdb_wrapper_file}"
+ lappend options "ldflags=${gdb_wrapper_flags}"
+ }
+
+ set result [target_compile $source $dest $type $options];
+ regsub "\[\r\n\]*$" "$result" "" result;
+ regsub "^\[\r\n\]*" "$result" "" result;
+ if { $result != "" } {
+ clone_output "gdb compile failed, $result"
+ }
+ return $result;
+}
+
+proc send_gdb { string } {
+ global suppress_flag;
+ if { $suppress_flag } {
+ return "suppressed";
+ }
+ return [remote_send host "$string"];
+}
+
+#
+#
+
+proc gdb_expect { args } {
+ if { [llength $args] == 2 && [lindex $args 0] != "-re" } {
+ set gtimeout [lindex $args 0];
+ set expcode [list [lindex $args 1]];
+ } else {
+ upvar timeout timeout;
+
+ set expcode $args;
+ if [target_info exists gdb,timeout] {
+ if [info exists timeout] {
+ if { $timeout < [target_info gdb,timeout] } {
+ set gtimeout [target_info gdb,timeout];
+ } else {
+ set gtimeout $timeout;
+ }
+ } else {
+ set gtimeout [target_info gdb,timeout];
+ }
+ }
+
+ if ![info exists gtimeout] {
+ global timeout;
+ if [info exists timeout] {
+ set gtimeout $timeout;
+ } else {
+ # Eeeeew.
+ set gtimeout 60;
+ }
+ }
+ }
+ global suppress_flag;
+ global remote_suppress_flag;
+ if [info exists remote_suppress_flag] {
+ set old_val $remote_suppress_flag;
+ }
+ if [info exists suppress_flag] {
+ if { $suppress_flag } {
+ set remote_suppress_flag 1;
+ }
+ }
+ set code [catch \
+ {uplevel remote_expect host $gtimeout $expcode} string];
+ if [info exists old_val] {
+ set remote_suppress_flag $old_val;
+ } else {
+ if [info exists remote_suppress_flag] {
+ unset remote_suppress_flag;
+ }
+ }
+
+ if {$code == 1} {
+ global errorInfo errorCode;
+
+ return -code error -errorinfo $errorInfo -errorcode $errorCode $string
+ } elseif {$code == 2} {
+ return -code return $string
+ } elseif {$code == 3} {
+ return
+ } elseif {$code > 4} {
+ return -code $code $string
+ }
+}
+
+# gdb_expect_list MESSAGE SENTINEL LIST -- expect a sequence of outputs
+#
+# Check for long sequence of output by parts.
+# MESSAGE: is the test message to be printed with the test success/fail.
+# SENTINEL: Is the terminal pattern indicating that output has finished.
+# LIST: is the sequence of outputs to match.
+# If the sentinel is recognized early, it is considered an error.
+#
+# Returns:
+# 1 if the test failed,
+# 0 if the test passes,
+# -1 if there was an internal error.
+#
+proc gdb_expect_list {test sentinel list} {
+ global gdb_prompt
+ global suppress_flag
+ set index 0
+ set ok 1
+ if { $suppress_flag } {
+ set ok 0
+ }
+ while { ${index} < [llength ${list}] } {
+ set pattern [lindex ${list} ${index}]
+ set index [expr ${index} + 1]
+ if { ${index} == [llength ${list}] } {
+ if { ${ok} } {
+ gdb_expect {
+ -re "${pattern}${sentinel}" {
+ pass "${test}, pattern ${index} + sentinel"
+ }
+ -re "${sentinel}" {
+ fail "${test}, pattern ${index} + sentinel"
+ set ok 0
+ }
+ timeout {
+ fail "${test}, pattern ${index} + sentinel (timeout)"
+ set ok 0
+ }
+ }
+ } else {
+ unresolved "${test}, pattern ${index} + sentinel"
+ }
+ } else {
+ if { ${ok} } {
+ gdb_expect {
+ -re "${pattern}" {
+ pass "${test}, pattern ${index}"
+ }
+ -re "${sentinel}" {
+ fail "${test}, pattern ${index}"
+ set ok 0
+ }
+ timeout {
+ fail "${test}, pattern ${index} (timeout)"
+ set ok 0
+ }
+ }
+ } else {
+ unresolved "${test}, pattern ${index}"
+ }
+ }
+ }
+ if { ${ok} } {
+ return 0
+ } else {
+ return 1
+ }
+}
+
+#
+#
+proc gdb_suppress_entire_file { reason } {
+ global suppress_flag;
+
+ warning "$reason\n";
+ set suppress_flag -1;
+}
+
+#
+# Set suppress_flag, which will cause all subsequent calls to send_gdb and
+# gdb_expect to fail immediately (until the next call to
+# gdb_stop_suppressing_tests).
+#
+proc gdb_suppress_tests { args } {
+ global suppress_flag;
+
+ return; # fnf - disable pending review of results where
+ # testsuite ran better without this
+ incr suppress_flag;
+
+ if { $suppress_flag == 1 } {
+ if { [llength $args] > 0 } {
+ warning "[lindex $args 0]\n";
+ } else {
+ warning "Because of previous failure, all subsequent tests in this group will automatically fail.\n";
+ }
+ }
+}
+
+#
+# Clear suppress_flag.
+#
+proc gdb_stop_suppressing_tests { } {
+ global suppress_flag;
+
+ if [info exists suppress_flag] {
+ if { $suppress_flag > 0 } {
+ set suppress_flag 0;
+ clone_output "Tests restarted.\n";
+ }
+ } else {
+ set suppress_flag 0;
+ }
+}
+
+proc gdb_clear_suppressed { } {
+ global suppress_flag;
+
+ set suppress_flag 0;
+}
+
+proc gdb_start { } {
+ default_gdb_start
+}
+
+proc gdb_exit { } {
+ catch default_gdb_exit
+}
+
+#
+# gdb_load -- load a file into the debugger.
+# return a -1 if anything goes wrong.
+#
+proc gdb_load { arg } {
+ return [gdb_file_cmd $arg]
+}
+
+proc gdb_continue { function } {
+ global decimal
+
+ return [gdb_test "continue" ".*Breakpoint $decimal, $function .*" "continue to $function"];
+}
+
+proc default_gdb_init { args } {
+ global gdb_wrapper_initialized
+
+ gdb_clear_suppressed;
+
+ # Make sure that the wrapper is rebuilt
+ # with the appropriate multilib option.
+ set gdb_wrapper_initialized 0
+
+ # Uh, this is lame. Really, really, really lame. But there's this *one*
+ # testcase that will fail in random places if we don't increase this.
+ match_max -d 20000
+
+ # We want to add the name of the TCL testcase to the PASS/FAIL messages.
+ if { [llength $args] > 0 } {
+ global pf_prefix
+
+ set file [lindex $args 0];
+
+ set pf_prefix "[file tail [file dirname $file]]/[file tail $file]:";
+ }
+ global gdb_prompt;
+ if [target_info exists gdb_prompt] {
+ set gdb_prompt [target_info gdb_prompt];
+ } else {
+ set gdb_prompt "\\(gdb\\)"
+ }
+}
+
+proc gdb_init { args } {
+ return [eval default_gdb_init $args];
+}
+
+proc gdb_finish { } {
+ gdb_exit;
+}
+
+global debug_format
+set debug_format "unknown"
+
+# Run the gdb command "info source" and extract the debugging format
+# information from the output and save it in debug_format.
+
+proc get_debug_format { } {
+ global gdb_prompt
+ global verbose
+ global expect_out
+ global debug_format
+
+ set debug_format "unknown"
+ send_gdb "info source\n"
+ gdb_expect 10 {
+ -re "Compiled with (.*) debugging format.\r\n$gdb_prompt $" {
+ set debug_format $expect_out(1,string)
+ verbose "debug format is $debug_format"
+ return 1;
+ }
+ -re "No current source file.\r\n$gdb_prompt $" {
+ perror "get_debug_format used when no current source file"
+ return 0;
+ }
+ -re "$gdb_prompt $" {
+ warning "couldn't check debug format (no valid response)."
+ return 1;
+ }
+ timeout {
+ warning "couldn't check debug format (timed out)."
+ return 1;
+ }
+ }
+}
+
+# Return true if FORMAT matches the debug format the current test was
+# compiled with. FORMAT is a shell-style globbing pattern; it can use
+# `*', `[...]', and so on.
+#
+# This function depends on variables set by `get_debug_format', above.
+
+proc test_debug_format {format} {
+ global debug_format
+
+ return [expr [string match $format $debug_format] != 0]
+}
+
+# Like setup_xfail, but takes the name of a debug format (DWARF 1,
+# COFF, stabs, etc). If that format matches the format that the
+# current test was compiled with, then the next test is expected to
+# fail for any target. Returns 1 if the next test or set of tests is
+# expected to fail, 0 otherwise (or if it is unknown). Must have
+# previously called get_debug_format.
+proc setup_xfail_format { format } {
+ set ret [test_debug_format $format];
+
+ if {$ret} then {
+ setup_xfail "*-*-*"
+ }
+ return $ret;
+}
+
+proc gdb_step_for_stub { } {
+ global gdb_prompt;
+
+ if ![target_info exists gdb,use_breakpoint_for_stub] {
+ if [target_info exists gdb_stub_step_command] {
+ set command [target_info gdb_stub_step_command];
+ } else {
+ set command "step";
+ }
+ send_gdb "${command}\n";
+ set tries 0;
+ gdb_expect 60 {
+ -re "(main.* at |.*in .*start).*$gdb_prompt" {
+ return;
+ }
+ -re ".*$gdb_prompt" {
+ incr tries;
+ if { $tries == 5 } {
+ fail "stepping out of breakpoint function";
+ return;
+ }
+ send_gdb "${command}\n";
+ exp_continue;
+ }
+ default {
+ fail "stepping out of breakpoint function";
+ return;
+ }
+ }
+ }
+ send_gdb "where\n";
+ gdb_expect {
+ -re "main\[^\r\n\]*at \(\[^:]+\):\(\[0-9\]+\)" {
+ set file $expect_out(1,string);
+ set linenum [expr $expect_out(2,string) + 1];
+ set breakplace "${file}:${linenum}";
+ }
+ default {}
+ }
+ send_gdb "break ${breakplace}\n";
+ gdb_expect 60 {
+ -re "Breakpoint (\[0-9\]+) at.*$gdb_prompt" {
+ set breakpoint $expect_out(1,string);
+ }
+ -re "Breakpoint (\[0-9\]+): file.*$gdb_prompt" {
+ set breakpoint $expect_out(1,string);
+ }
+ default {}
+ }
+ send_gdb "continue\n";
+ gdb_expect 60 {
+ -re "Breakpoint ${breakpoint},.*$gdb_prompt" {
+ gdb_test "delete $breakpoint" ".*" "";
+ return;
+ }
+ default {}
+ }
+}
+
+### gdb_get_line_number TEXT [FILE]
+###
+### Search the source file FILE, and return the line number of a line
+### containing TEXT. Use this function instead of hard-coding line
+### numbers into your test script.
+###
+### Specifically, this function uses GDB's "search" command to search
+### FILE for the first line containing TEXT, and returns its line
+### number. Thus, FILE must be a source file, compiled into the
+### executable you are running. If omitted, FILE defaults to the
+### value of the global variable `srcfile'; most test scripts set
+### `srcfile' appropriately at the top anyway.
+###
+### Use this function to keep your test scripts independent of the
+### exact line numbering of the source file. Don't write:
+###
+### send_gdb "break 20"
+###
+### This means that if anyone ever edits your test's source file,
+### your test could break. Instead, put a comment like this on the
+### source file line you want to break at:
+###
+### /* breakpoint spot: frotz.exp: test name */
+###
+### and then write, in your test script (which we assume is named
+### frotz.exp):
+###
+### send_gdb "break [gdb_get_line_number "frotz.exp: test name"]\n"
+###
+### (Yes, Tcl knows how to handle the nested quotes and brackets.
+### Try this:
+### $ tclsh
+### % puts "foo [lindex "bar baz" 1]"
+### foo baz
+### %
+### Tcl is quite clever, for a little stringy language.)
+
+proc gdb_get_line_number {text {file /omitted/}} {
+ global gdb_prompt;
+ global srcfile;
+
+ if {! [string compare $file /omitted/]} {
+ set file $srcfile
+ }
+
+ set result -1;
+ gdb_test "list ${file}:1,1" ".*" ""
+ send_gdb "search ${text}\n"
+ gdb_expect {
+ -re "\[\r\n\]+(\[0-9\]+)\[ \t\].*${text}.*$gdb_prompt $" {
+ set result $expect_out(1,string)
+ }
+ -re ".*$gdb_prompt $" {
+ fail "find line number containing \"${text}\""
+ }
+ timeout {
+ fail "find line number containing \"${text}\" (timeout)"
+ }
+ }
+ return $result;
+}
+
+# gdb_continue_to_end:
+# The case where the target uses stubs has to be handled specially. If a
+# stub is used, we set a breakpoint at exit because we cannot rely on
+# exit() behavior of a remote target.
+#
+# mssg is the error message that gets printed.
+
+proc gdb_continue_to_end {mssg} {
+ if [target_info exists use_gdb_stub] {
+ if {![gdb_breakpoint "exit"]} {
+ return 0
+ }
+ gdb_test "continue" "Continuing..*Breakpoint .*exit.*" \
+ "continue until exit at $mssg"
+ } else {
+ # Continue until we exit. Should not stop again.
+ # Don't bother to check the output of the program, that may be
+ # extremely tough for some remote systems.
+ gdb_test "continue"\
+ "Continuing.\[\r\n0-9\]+(... EXIT code 0\[\r\n\]+|)Program exited normally\\..*"\
+ "continue until exit at $mssg"
+ }
+}
+
+proc rerun_to_main {} {
+ global gdb_prompt
+
+ if [target_info exists use_gdb_stub] {
+ gdb_run_cmd
+ gdb_expect {
+ -re ".*Breakpoint .*main .*$gdb_prompt $"\
+ {pass "rerun to main" ; return 0}
+ -re "$gdb_prompt $"\
+ {fail "rerun to main" ; return 0}
+ timeout {fail "(timeout) rerun to main" ; return 0}
+ }
+ } else {
+ send_gdb "run\n"
+ gdb_expect {
+ -re "Starting program.*$gdb_prompt $"\
+ {pass "rerun to main" ; return 0}
+ -re "$gdb_prompt $"\
+ {fail "rerun to main" ; return 0}
+ timeout {fail "(timeout) rerun to main" ; return 0}
+ }
+ }
+}
+
+# Print a message and return true if a test should be skipped
+# due to lack of floating point suport.
+
+proc gdb_skip_float_test { msg } {
+ if [target_info exists gdb,skip_float_tests] {
+ verbose "Skipping test '$msg': no float tests.";
+ return 1;
+ }
+ return 0;
+}
+
+# Print a message and return true if a test should be skipped
+# due to lack of stdio support.
+
+proc gdb_skip_stdio_test { msg } {
+ if [target_info exists gdb,noinferiorio] {
+ verbose "Skipping test '$msg': no inferior i/o.";
+ return 1;
+ }
+ return 0;
+}
+
+proc gdb_skip_bogus_test { msg } {
+ return 0;
+}
+
diff --git a/gdb/testsuite/lib/insight-support.exp b/gdb/testsuite/lib/insight-support.exp
new file mode 100644
index 00000000000..42d14a9a27a
--- /dev/null
+++ b/gdb/testsuite/lib/insight-support.exp
@@ -0,0 +1,310 @@
+# GDB Testsuite Support for Insight.
+#
+# Copyright 2001 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License (GPL) as published by
+# the Free Software Foundation; either version 2 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# Initializes the display for gdbtk testing.
+# Returns 1 if tests should run, 0 otherwise.
+proc gdbtk_initialize_display {} {
+ global _using_windows
+
+ # This is hacky, but, we don't have much choice. When running
+ # expect under Windows, tcl_platform(platform) is "unix".
+ if {![info exists _using_windows]} {
+ set _using_windows [expr {![catch {exec cygpath --help}]}]
+ }
+
+ if {![_gdbtk_xvfb_init]} {
+ if {$_using_windows} {
+ untested "No GDB_DISPLAY -- skipping tests"
+ } else {
+ untested "No GDB_DISPLAY or Xvfb -- skipping tests"
+ }
+
+ return 0
+ }
+
+ return 1
+}
+
+# From dejagnu:
+# srcdir = testsuite src dir (e.g., devo/gdb/testsuite)
+# objdir = testsuite obj dir (e.g., gdb/testsuite)
+# subdir = subdir of testsuite (e.g., gdb.gdbtk)
+#
+# To gdbtk:
+# env(DEFS)=the "defs" files (e.g., devo/gdb/testsuite/gdb.gdbtk/defs)
+# env(SRCDIR)=directory containing the test code (e.g., *.test)
+# env(OBJDIR)=directory which contains any executables
+# (e.g., gdb/testsuite/gdb.gdbtk)
+proc gdbtk_start {test} {
+ global verbose
+ global GDB
+ global GDBFLAGS
+ global env srcdir subdir objdir
+
+ gdb_stop_suppressing_tests;
+
+ verbose "Starting $GDB -nx -q --tclcommand=$test"
+
+ set real_test [which $test]
+ if {$real_test == 0} {
+ perror "$test is not found"
+ exit 1
+ }
+
+ if {![is_remote host]} {
+ if { [which $GDB] == 0 } {
+ perror "$GDB does not exist."
+ exit 1
+ }
+ }
+
+ set wd [pwd]
+
+ # Find absolute path to test
+ set test [to_tcl_path -abs $test]
+
+ # Set some environment variables
+ cd $srcdir
+ set abs_srcdir [pwd]
+ set env(DEFS) [to_tcl_path -abs [file join $abs_srcdir $subdir defs]]
+
+ cd $wd
+ cd [file join $objdir $subdir]
+ set env(OBJDIR) [pwd]
+ cd $wd
+
+ # Set info about target into env
+ _gdbtk_export_target_info
+
+ set env(SRCDIR) $abs_srcdir
+ set env(GDBTK_VERBOSE) 1
+ set env(GDBTK_LOGFILE) [to_tcl_path [file join $objdir gdb.log]]
+
+ set err [catch {exec $GDB -nx -q --tclcommand=$test} res]
+ if { $err } {
+ perror "Execing $GDB failed: $res"
+ append res "\nERROR gdb-crash"
+ }
+ return $res
+}
+
+# Start xvfb when using it.
+# The precedence is:
+# 1. If GDB_DISPLAY is set (and not ""), use it
+# 2. If Xvfb exists, use it (not on cygwin)
+# 3. Skip tests
+proc _gdbtk_xvfb_init {} {
+ global env spawn_id _xvfb_spawn_id _using_windows
+
+ if {[info exists env(GDB_DISPLAY)]} {
+ if {$env(GDB_DISPLAY) != ""} {
+ set env(DISPLAY) $env(GDB_DISPLAY)
+ } else {
+ # Suppress tests
+ return 0
+ }
+ } elseif {!$_using_windows && [which Xvfb] != 0} {
+ set screen ":[getpid]"
+ set pid [spawn Xvfb $screen -ac]
+ set _xvfb_spawn_id $spawn_id
+ set env(DISPLAY) localhost$screen
+ } else {
+ # No Xvfb found -- skip test
+ return 0
+ }
+
+ return 1
+}
+
+# Kill xvfb
+proc _gdbtk_xvfb_exit {} {
+ global objdir subdir env _xvfb_spawn_id
+
+ if {[info exists _xvfb_spawn_id]} {
+ exec kill [exp_pid -i $_xvfb_spawn_id]
+ wait -i $_xvfb_spawn_id
+ }
+}
+
+# help proc for setting tcl-style paths from unix-style paths
+# pass "-abs" to make it an absolute path
+proc to_tcl_path {unix_path {arg {}}} {
+ global _using_windows
+
+ if {[string compare $unix_path "-abs"] == 0} {
+ set unix_path $arg
+ set wd [pwd]
+ cd [file dirname $unix_path]
+ set dirname [pwd]
+ set unix_name [file join $dirname [file tail $unix_path]]
+ cd $wd
+ }
+
+ if {$_using_windows} {
+ set unix_path [exec cygpath -aw $unix_path]
+ set unix_path [join [split $unix_path \\] /]
+ }
+
+ return $unix_path
+}
+
+# Set information about the target into the environment
+# variable TARGET_INFO. This array will contain a list
+# of commands that are necessary to run a target.
+#
+# This is mostly devined from how dejagnu works, what
+# procs are defined, and analyzing unix.exp, monitor.exp,
+# and sim.exp.
+#
+# Array elements exported:
+# Index Meaning
+# ----- -------
+# init list of target/board initialization commands
+# target target command for target/board
+# load load command for target/board
+# run run command for target_board
+proc _gdbtk_export_target_info {} {
+ global env
+
+ # Figure out what "target class" the testsuite is using,
+ # i.e., sim, monitor, native
+ if {[string compare [info proc gdb_target_monitor] gdb_target_monitor] == 0} {
+ # Using a monitor/remote target
+ set target monitor
+ } elseif {[string compare [info proc gdb_target_sim] gdb_target_sim] == 0} {
+ # Using a simulator target
+ set target simulator
+ } elseif {[string compare [info proc gdb_target_sid] gdb_target_sid] == 0} {
+ # Using sid
+ set target sid
+ } else {
+ # Assume native
+ set target native
+ }
+
+ # Now setup the array to be exported.
+ set info(init) {}
+ set info(target) {}
+ set info(load) {}
+ set info(run) {}
+
+ switch $target {
+ simulator {
+ set opts "[target_info gdb,target_sim_options]"
+ set info(target) "target sim $opts"
+ set info(load) "load"
+ set info(run) "run"
+ }
+
+ monitor {
+ # Setup options for the connection
+ if {[target_info exists baud]} {
+ lappend info(init) "set remotebaud [target_info baud]"
+ }
+ if {[target_info exists binarydownload]} {
+ lappend info(init) "set remotebinarydownload [target_info binarydownload]"
+ }
+ if {[target_info exists disable_x_packet]} {
+ lappend info(init) "set remote X-packet disable"
+ }
+ if {[target_info exists disable_z_packet]} {
+ lappend info(init) "set remote Z-packet disable"
+ }
+
+ # Get target name and connection info
+ if {[target_info exists gdb_protocol]} {
+ set targetname "[target_info gdb_protocol]"
+ } else {
+ set targetname "not_specified"
+ }
+ if {[target_info exists gdb_serial]} {
+ set serialport "[target_info gdb_serial]"
+ } elseif {[target_info exists netport]} {
+ set serialport "[target_info netport]"
+ } else {
+ set serialport "[target_info serial]"
+ }
+
+ set info(target) "target $targetname $serialport"
+ set info(load) "load"
+ set info(run) "continue"
+ }
+
+ sid {
+ # We must start sid first, since Insight won't have a clue
+ # about how to do this.
+ sid_start
+ set info(target) "target [target_info gdb_protocol] [target_info netport]"
+ set info(load) "load"
+ set info(run) "continue"
+ }
+
+ native {
+ set info(run) "run"
+ }
+ }
+
+ # Export the array to the environment
+ set env(TARGET_INFO) [array get info]
+}
+
+# gdbtk tests call this function to print out the results of the
+# tests. The argument is a proper list of lists of the form:
+# {status name description msg}. All of these things typically
+# come from the testsuite harness.
+proc gdbtk_analyze_results {results} {
+ foreach test $results {
+ set status [lindex $test 0]
+ set name [lindex $test 1]
+ set description [lindex $test 2]
+ set msg [lindex $test 3]
+
+ switch $status {
+ PASS {
+ pass "$description ($name)"
+ }
+
+ FAIL {
+ fail "$description ($name)"
+ }
+
+ ERROR {
+ perror "$name"
+ }
+
+ XFAIL {
+ xfail "$description ($name)"
+ }
+
+ XPASS {
+ xpass "$description ($name)"
+ }
+ }
+ }
+}
+
+proc gdbtk_done {{results {}}} {
+ global _xvfb_spawn_id
+ gdbtk_analyze_results $results
+
+ # Kill off xvfb if using it
+ if {[info exists _xvfb_spawn_id]} {
+ _gdbtk_xvfb_exit
+ }
+
+ # Yich. If we're using sid, we must kill it
+ if {[string compare [info proc gdb_target_sid] gdb_target_sid] == 0} {
+ sid_exit
+ }
+}
diff --git a/gdb/testsuite/lib/java.exp b/gdb/testsuite/lib/java.exp
new file mode 100644
index 00000000000..bcfd27c9ce0
--- /dev/null
+++ b/gdb/testsuite/lib/java.exp
@@ -0,0 +1,105 @@
+# Copyright (C) 1998, 1999 Red Hat, Inc.
+
+load_lib "libgloss.exp"
+
+# GCJ_UNDER_TEST is the compiler under test.
+
+global tmpdir
+
+if ![info exists tmpdir] {
+ set tmpdir "/tmp"
+}
+
+set java_initialized 0
+
+#
+# Build the status wrapper library as needed.
+#
+proc java_init { args } {
+ global wrapper_file;
+ global wrap_compile_flags;
+ global java_initialized
+ global GCJ_UNDER_TEST
+ global TOOL_EXECUTABLE
+ global env
+
+ if { $java_initialized == 1 } { return; }
+
+ if ![info exists GCJ_UNDER_TEST] {
+ if [info exists TOOL_EXECUTABLE] {
+ set GCJ_UNDER_TEST $TOOL_EXECUTABLE;
+ } else {
+ if [info exists env(GCJ)] {
+ set GCJ_UNDER_TEST $env(GCJ)
+ } else {
+ global tool_root_dir
+
+ if ![is_remote host] {
+ set file [lookfor_file $tool_root_dir gcj];
+ if { $file == "" } {
+ set file [lookfor_file $tool_root_dir gcc/gcj];
+ }
+ if { $file != "" } {
+ set CC "$file -B[file dirname $file]/ --specs=$tool_root_dir/$target_alias/libjava/libgcj-test.spec";
+ } else {
+ set CC [transform gcj];
+ }
+ } else {
+ set CC [transform gcj]
+ }
+ set GCJ_UNDER_TEST $CC
+ }
+ }
+ }
+
+ set wrapper_file "";
+ set wrap_compile_flags "";
+ if [target_info exists needs_status_wrapper] {
+ set result [build_wrapper "testglue.o"];
+ if { $result != "" } {
+ set wrapper_file [lindex $result 0];
+ set wrap_compile_flags [lindex $result 1];
+ } else {
+ warning "Status wrapper failed to build."
+ }
+ }
+
+ set java_initialized 1
+}
+
+#
+# Run the test specified by srcfile and resultfile. compile_args and
+# exec_args are options telling this proc how to work.
+#
+proc compile_java_from_source { srcfile binfile compile_args } {
+ global GCJ_UNDER_TEST
+ global runtests
+ global java_initialized
+
+ if { $java_initialized != 1 } { java_init }
+
+ set errname [file rootname [file tail $srcfile]]
+ if {! [runtest_file_p $runtests $errname]} {
+ return
+ }
+
+ set args "compiler=$GCJ_UNDER_TEST"
+ lappend args "additional_flags=--main=[file rootname [file tail $srcfile]]"
+ if { $compile_args != "" } {
+ lappend args "additional_flags=$compile_args"
+ }
+
+ if { $compile_args != "" } {
+ set errname "$errname $compile_args"
+ }
+
+ set x [target_compile $srcfile ${binfile} ${binfile} $args]
+ if { $x != "" } {
+ verbose "target_compile failed: $x" 2
+ return "$errname compilation from source";
+ }
+}
+
+# Local Variables:
+# tcl-indent-level:4
+# End:
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
new file mode 100644
index 00000000000..44679f0a004
--- /dev/null
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -0,0 +1,788 @@
+# Copyright 1999, 2000 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+# This file was based on a file written by Fred Fish. (fnf@cygnus.com)
+
+# Test setup routines that work with the MI interpreter.
+
+# The variable mi_gdb_prompt is a regexp which matches the gdb mi prompt.
+# Set it if it is not already set.
+global mi_gdb_prompt
+if ![info exists mi_gdb_prompt] then {
+ set mi_gdb_prompt "\[(\]gdb\[)\] \r\n"
+}
+
+set MIFLAGS "-i=mi"
+
+#
+# mi_gdb_exit -- exit the GDB, killing the target program if necessary
+#
+proc mi_gdb_exit {} {
+ catch mi_uncatched_gdb_exit
+}
+
+proc mi_uncatched_gdb_exit {} {
+ global GDB
+ global GDBFLAGS
+ global verbose
+ global gdb_spawn_id;
+ global gdb_prompt
+ global mi_gdb_prompt
+ global MIFLAGS
+
+ gdb_stop_suppressing_tests;
+
+ if { [info procs sid_exit] != "" } {
+ sid_exit
+ }
+
+ if ![info exists gdb_spawn_id] {
+ return;
+ }
+
+ verbose "Quitting $GDB $GDBFLAGS $MIFLAGS"
+
+ if { [is_remote host] && [board_info host exists fileid] } {
+ send_gdb "999-gdb-exit\n";
+ gdb_expect 10 {
+ -re "y or n" {
+ send_gdb "y\n";
+ exp_continue;
+ }
+ -re "Undefined command.*$gdb_prompt $" {
+ send_gdb "quit\n"
+ exp_continue;
+ }
+ -re "DOSEXIT code" { }
+ default { }
+ }
+ }
+
+ if ![is_remote host] {
+ remote_close host;
+ }
+ unset gdb_spawn_id
+}
+
+#
+# start gdb -- start gdb running, default procedure
+#
+# When running over NFS, particularly if running many simultaneous
+# tests on different hosts all using the same server, things can
+# get really slow. Give gdb at least 3 minutes to start up.
+#
+proc mi_gdb_start { } {
+ global verbose
+ global GDB
+ global GDBFLAGS
+ global gdb_prompt
+ global mi_gdb_prompt
+ global timeout
+ global gdb_spawn_id;
+ global MIFLAGS
+
+ gdb_stop_suppressing_tests;
+
+ # Start SID.
+ if { [info procs sid_start] != "" } {
+ verbose "Spawning SID"
+ sid_start
+ }
+
+ verbose "Spawning $GDB -nw $GDBFLAGS $MIFLAGS"
+
+ if [info exists gdb_spawn_id] {
+ return 0;
+ }
+
+ if ![is_remote host] {
+ if { [which $GDB] == 0 } then {
+ perror "$GDB does not exist."
+ exit 1
+ }
+ }
+ set res [remote_spawn host "$GDB -nw $GDBFLAGS $MIFLAGS [host_info gdb_opts]"];
+ if { $res < 0 || $res == "" } {
+ perror "Spawning $GDB failed."
+ return 1;
+ }
+ gdb_expect {
+ -re ".*$mi_gdb_prompt$" {
+ verbose "GDB initialized."
+ }
+ -re ".*$gdb_prompt $" {
+ untested "Skip mi tests (got non-mi prompt)."
+ remote_close host;
+ return -1;
+ }
+ -re ".*unrecognized option.*for a complete list of options." {
+ untested "Skip mi tests (not compiled with mi support)."
+ remote_close host;
+ return -1;
+ }
+ -re ".*Interpreter `mi' unrecognized." {
+ untested "Skip mi tests (not compiled with mi support)."
+ remote_close host;
+ return -1;
+ }
+ timeout {
+ perror "(timeout) GDB never initialized after 10 seconds."
+ remote_close host;
+ return -1
+ }
+ }
+ set gdb_spawn_id -1;
+
+ # FIXME: mi output does not go through pagers, so these can be removed.
+ # force the height to "unlimited", so no pagers get used
+ send_gdb "100-gdb-set height 0\n"
+ gdb_expect 10 {
+ -re ".*100-gdb-set height 0\r\n100\\\^done\r\n$mi_gdb_prompt$" {
+ verbose "Setting height to 0." 2
+ }
+ timeout {
+ warning "Couldn't set the height to 0"
+ }
+ }
+ # force the width to "unlimited", so no wraparound occurs
+ send_gdb "101-gdb-set width 0\n"
+ gdb_expect 10 {
+ -re ".*101-gdb-set width 0\r\n101\\\^done\r\n$mi_gdb_prompt$" {
+ verbose "Setting width to 0." 2
+ }
+ timeout {
+ warning "Couldn't set the width to 0."
+ }
+ }
+
+ return 0;
+}
+
+# Many of the tests depend on setting breakpoints at various places and
+# running until that breakpoint is reached. At times, we want to start
+# with a clean-slate with respect to breakpoints, so this utility proc
+# lets us do this without duplicating this code everywhere.
+#
+
+proc mi_delete_breakpoints {} {
+ global mi_gdb_prompt
+
+# FIXME: The mi operation won't accept a prompt back and will use the 'all' arg
+ send_gdb "102-break-delete\n"
+ gdb_expect 30 {
+ -re "Delete all breakpoints.*y or n.*$" {
+ send_gdb "y\n";
+ exp_continue
+ }
+ -re ".*102-break-delete\r\n102\\\^done\r\n$mi_gdb_prompt$" {
+ # This happens if there were no breakpoints
+ }
+ timeout { perror "Delete all breakpoints in delete_breakpoints (timeout)" ; return }
+ }
+
+# The correct output is not "No breakpoints or watchpoints." but an
+# empty BreakpointTable. Also, a query is not acceptable with mi.
+ send_gdb "103-break-list\n"
+ gdb_expect 30 {
+ -re "103-break-list\r\n103\\\^done,BreakpointTable=\{\}\r\n$mi_gdb_prompt$" {}
+ -re "103-break-list\r\n103\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[\\\]\}" {}
+ -re "103-break-list\r\n103\\\^doneNo breakpoints or watchpoints.\r\n\r\n$mi_gdb_prompt$" {warning "Unexpected console text received"}
+ -re "$mi_gdb_prompt$" { perror "Breakpoints not deleted" ; return }
+ -re "Delete all breakpoints.*or n.*$" {
+ warning "Unexpected prompt for breakpoints deletion";
+ send_gdb "y\n";
+ exp_continue
+ }
+ timeout { perror "-break-list (timeout)" ; return }
+ }
+}
+
+proc mi_gdb_reinitialize_dir { subdir } {
+ global mi_gdb_prompt
+
+ global suppress_flag
+ if { $suppress_flag } {
+ return
+ }
+
+ if [is_remote host] {
+ return "";
+ }
+
+ send_gdb "104-environment-directory\n"
+ gdb_expect 60 {
+ -re ".*Reinitialize source path to empty.*y or n. " {
+ warning "Got confirmation prompt for dir reinitialization."
+ send_gdb "y\n"
+ gdb_expect 60 {
+ -re "$mi_gdb_prompt$" {}
+ timeout {error "Dir reinitialization failed (timeout)"}
+ }
+ }
+ -re "$mi_gdb_prompt$" {}
+ timeout {error "Dir reinitialization failed (timeout)"}
+ }
+
+ send_gdb "105-environment-directory $subdir\n"
+ gdb_expect 60 {
+ -re "Source directories searched.*$mi_gdb_prompt$" {
+ verbose "Dir set to $subdir"
+ }
+ -re "105\\\^done\r\n$mi_gdb_prompt$" {
+ # FIXME: We return just the prompt for now.
+ verbose "Dir set to $subdir"
+ # perror "Dir \"$subdir\" failed."
+ }
+ }
+}
+
+#
+# load a file into the debugger.
+# return a -1 if anything goes wrong.
+#
+proc mi_gdb_load { arg } {
+ global verbose
+ global loadpath
+ global loadfile
+ global GDB
+ global mi_gdb_prompt
+ upvar timeout timeout
+
+ # ``gdb_unload''
+
+ # ``gdb_file_cmd''
+# FIXME: Several of these patterns are only acceptable for console
+# output. Queries are an error for mi.
+ send_gdb "105-file-exec-and-symbols $arg\n"
+ gdb_expect 120 {
+ -re "Reading symbols from.*done.*$mi_gdb_prompt$" {
+ verbose "\t\tLoaded $arg into the $GDB"
+ # All OK
+ }
+ -re "has no symbol-table.*$mi_gdb_prompt$" {
+ perror "$arg wasn't compiled with \"-g\""
+ return -1
+ }
+ -re "A program is being debugged already.*Kill it.*y or n. $" {
+ send_gdb "y\n"
+ verbose "\t\tKilling previous program being debugged"
+ exp_continue
+ }
+ -re "Load new symbol table from \".*\".*y or n. $" {
+ send_gdb "y\n"
+ gdb_expect 120 {
+ -re "Reading symbols from.*done.*$mi_gdb_prompt$" {
+ verbose "\t\tLoaded $arg with new symbol table into $GDB"
+ # All OK
+ }
+ timeout {
+ perror "(timeout) Couldn't load $arg, other program already loaded."
+ return -1
+ }
+ }
+ }
+ -re "No such file or directory.*$mi_gdb_prompt$" {
+ perror "($arg) No such file or directory\n"
+ return -1
+ }
+ -re "105-file-exec-and-symbols .*\r\n105\\\^done\r\n$mi_gdb_prompt$" {
+ # We are just giving the prompt back for now
+ # All OK
+ }
+ timeout {
+ perror "couldn't load $arg into $GDB (timed out)."
+ return -1
+ }
+ eof {
+ # This is an attempt to detect a core dump, but seems not to
+ # work. Perhaps we need to match .* followed by eof, in which
+ # gdb_expect does not seem to have a way to do that.
+ perror "couldn't load $arg into $GDB (end of file)."
+ return -1
+ }
+ }
+
+ # ``load''
+ if { [info procs send_target_sid] != "" } {
+ # For SID, things get complex
+ send_target_sid
+ gdb_expect 60 {
+ -re "\\^done,.*$mi_gdb_prompt$" {
+ }
+ timeout {
+ perror "Unable to connect to SID target"
+ return -1
+ }
+ }
+ send_gdb "48-target-download\n"
+ gdb_expect 10 {
+ -re "48\\^done.*$mi_gdb_prompt$" {
+ }
+ timeout {
+ perror "Unable to download to SID target"
+ return -1
+ }
+ }
+ } elseif { [target_info protocol] == "sim" } {
+ # For the simulator, just connect to it directly.
+ send_gdb "47-target-select sim\n"
+ gdb_expect 10 {
+ -re "47\\^connected.*$mi_gdb_prompt$" {
+ }
+ timeout {
+ perror "Unable to select sim target"
+ return -1
+ }
+ }
+ send_gdb "48-target-download\n"
+ gdb_expect 10 {
+ -re "48\\^done.*$mi_gdb_prompt$" {
+ }
+ timeout {
+ perror "Unable to download to sim target"
+ return -1
+ }
+ }
+ }
+ return 0
+}
+
+# mi_gdb_test COMMAND PATTERN MESSAGE -- send a command to gdb; test the result.
+#
+# COMMAND is the command to execute, send to GDB with send_gdb. If
+# this is the null string no command is sent.
+# PATTERN is the pattern to match for a PASS, and must NOT include
+# the \r\n sequence immediately before the gdb prompt.
+# MESSAGE is an optional message to be printed. If this is
+# omitted, then the pass/fail messages use the command string as the
+# message. (If this is the empty string, then sometimes we don't
+# call pass or fail at all; I don't understand this at all.)
+#
+# Returns:
+# 1 if the test failed,
+# 0 if the test passes,
+# -1 if there was an internal error.
+#
+proc mi_gdb_test { args } {
+ global verbose
+ global mi_gdb_prompt
+ global GDB
+ upvar timeout timeout
+
+ if [llength $args]>2 then {
+ set message [lindex $args 2]
+ } else {
+ set message [lindex $args 0]
+ }
+ set command [lindex $args 0]
+ set pattern [lindex $args 1]
+
+ if [llength $args]==5 {
+ set question_string [lindex $args 3];
+ set response_string [lindex $args 4];
+ } else {
+ set question_string "^FOOBAR$"
+ }
+
+ if $verbose>2 then {
+ send_user "Sending \"$command\" to gdb\n"
+ send_user "Looking to match \"$pattern\"\n"
+ send_user "Message is \"$message\"\n"
+ }
+
+ set result -1
+ set string "${command}\n";
+ if { $command != "" } {
+ while { "$string" != "" } {
+ set foo [string first "\n" "$string"];
+ set len [string length "$string"];
+ if { $foo < [expr $len - 1] } {
+ set str [string range "$string" 0 $foo];
+ if { [send_gdb "$str"] != "" } {
+ global suppress_flag;
+
+ if { ! $suppress_flag } {
+ perror "Couldn't send $command to GDB.";
+ }
+ fail "$message";
+ return $result;
+ }
+ gdb_expect 2 {
+ -re "\[\r\n\]" { }
+ timeout { }
+ }
+ set string [string range "$string" [expr $foo + 1] end];
+ } else {
+ break;
+ }
+ }
+ if { "$string" != "" } {
+ if { [send_gdb "$string"] != "" } {
+ global suppress_flag;
+
+ if { ! $suppress_flag } {
+ perror "Couldn't send $command to GDB.";
+ }
+ fail "$message";
+ return $result;
+ }
+ }
+ }
+
+ if [info exists timeout] {
+ set tmt $timeout;
+ } else {
+ global timeout;
+ if [info exists timeout] {
+ set tmt $timeout;
+ } else {
+ set tmt 60;
+ }
+ }
+ gdb_expect $tmt {
+ -re "\\*\\*\\* DOSEXIT code.*" {
+ if { $message != "" } {
+ fail "$message";
+ }
+ gdb_suppress_entire_file "GDB died";
+ return -1;
+ }
+ -re "Ending remote debugging.*$mi_gdb_prompt\[ \]*$" {
+ if ![isnative] then {
+ warning "Can`t communicate to remote target."
+ }
+ gdb_exit
+ gdb_start
+ set result -1
+ }
+ -re "(${question_string})$" {
+ send_gdb "$response_string\n";
+ exp_continue;
+ }
+ -re "Undefined.* command:.*$mi_gdb_prompt\[ \]*$" {
+ perror "Undefined command \"$command\"."
+ fail "$message"
+ set result 1
+ }
+ -re "Ambiguous command.*$mi_gdb_prompt\[ \]*$" {
+ perror "\"$command\" is not a unique command name."
+ fail "$message"
+ set result 1
+ }
+ -re "\[\r\n\]*($pattern)\[\r\n\]+$mi_gdb_prompt\[ \]*$" {
+ if ![string match "" $message] then {
+ pass "$message"
+ }
+ set result 0
+ }
+ -re "Program exited with code \[0-9\]+.*$mi_gdb_prompt\[ \]*$" {
+ if ![string match "" $message] then {
+ set errmsg "$message: the program exited"
+ } else {
+ set errmsg "$command: the program exited"
+ }
+ fail "$errmsg"
+ return -1
+ }
+ -re "The program is not being run.*$mi_gdb_prompt\[ \]*$" {
+ if ![string match "" $message] then {
+ set errmsg "$message: the program is no longer running"
+ } else {
+ set errmsg "$command: the program is no longer running"
+ }
+ fail "$errmsg"
+ return -1
+ }
+ -re ".*$mi_gdb_prompt\[ \]*$" {
+ if ![string match "" $message] then {
+ fail "$message"
+ }
+ set result 1
+ }
+ "<return>" {
+ send_gdb "\n"
+ perror "Window too small."
+ fail "$message"
+ }
+ -re "\\(y or n\\) " {
+ send_gdb "n\n"
+ perror "Got interactive prompt."
+ fail "$message"
+ }
+ eof {
+ perror "Process no longer exists"
+ if { $message != "" } {
+ fail "$message"
+ }
+ return -1
+ }
+ full_buffer {
+ perror "internal buffer is full."
+ fail "$message"
+ }
+ timeout {
+ if ![string match "" $message] then {
+ fail "$message (timeout)"
+ }
+ set result 1
+ }
+ }
+ return $result
+}
+
+#
+# MI run command. (A modified version of gdb_run_cmd)
+#
+
+# In patterns, the newline sequence ``\r\n'' is matched explicitly as
+# ``.*$'' could swallow up output that we attempt to match elsewhere.
+
+proc mi_run_cmd {args} {
+ global suppress_flag
+ if { $suppress_flag } {
+ return -1
+ }
+ global mi_gdb_prompt
+
+ if [target_info exists gdb_init_command] {
+ send_gdb "[target_info gdb_init_command]\n";
+ gdb_expect 30 {
+ -re "$mi_gdb_prompt$" { }
+ default {
+ perror "gdb_init_command for target failed";
+ return;
+ }
+ }
+ }
+
+ if [target_info exists use_gdb_stub] {
+ if [target_info exists gdb,do_reload_on_run] {
+ # Specifying no file, defaults to the executable
+ # currently being debugged.
+ if { [mi_gdb_load ""] < 0 } {
+ return;
+ }
+ send_gdb "000-exec-continue\n";
+ gdb_expect 60 {
+ -re "Continu\[^\r\n\]*\[\r\n\]" {}
+ default {}
+ }
+ return;
+ }
+
+ if [target_info exists gdb,start_symbol] {
+ set start [target_info gdb,start_symbol];
+ } else {
+ set start "start";
+ }
+
+ # HACK: Should either use 000-jump or fix the target code
+ # to better handle RUN.
+ send_gdb "jump *$start\n"
+ warning "Using CLI jump command, expect run-to-main FAIL"
+ return
+ }
+
+ send_gdb "000-exec-run $args\n"
+ gdb_expect {
+ -re "000\\^running\r\n${mi_gdb_prompt}" {
+ }
+ timeout {
+ perror "Unable to start target"
+ return
+ }
+ }
+ # NOTE: Shortly after this there will be a ``000*stopping,...(gdb)''
+}
+
+#
+# Just like run-to-main but works with the MI interface
+#
+
+proc mi_run_to_main { } {
+ global suppress_flag
+ if { $suppress_flag } {
+ return -1
+ }
+
+ global mi_gdb_prompt
+ global hex
+ global decimal
+ global srcdir
+ global subdir
+ global binfile
+ global srcfile
+
+ set test "mi run-to-main"
+ mi_delete_breakpoints
+ mi_gdb_reinitialize_dir $srcdir/$subdir
+ mi_gdb_load ${binfile}
+
+ mi_gdb_test "200-break-insert main" \
+ "200\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*\",line=\"\[0-9\]*\",times=\"0\"\}" \
+ "breakpoint at main"
+
+ mi_run_cmd
+ gdb_expect {
+ -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"main\",args=\(\\\[\\\]\|\{\}\),file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
+ pass "$test"
+ return 0
+ }
+ -re ".*$mi_gdb_prompt$" {
+ fail "$test (2)"
+ }
+ timeout {
+ fail "$test (timeout)"
+ return -1
+ }
+ }
+}
+
+
+# Next to the next statement
+
+proc mi_next { test } {
+ global suppress_flag
+ if { $suppress_flag } {
+ return -1
+ }
+ global mi_gdb_prompt
+ send_gdb "220-exec-next\n"
+ gdb_expect {
+ -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{].*[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
+ pass "$test"
+ return 0
+ }
+ timeout {
+ fail "$test"
+ return -1
+ }
+ }
+}
+
+
+# Step to the next statement
+
+proc mi_step { test } {
+ global suppress_flag
+ if { $suppress_flag } {
+ return -1
+ }
+ global mi_gdb_prompt
+ send_gdb "220-exec-step\n"
+ gdb_expect {
+ -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"end-stepping-range\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
+ pass "$test"
+ return 0
+ }
+ timeout {
+ fail "$test"
+ return -1
+ }
+ }
+}
+
+# cmd should not include the number or newline (i.e. "exec-step 3", not
+# "220-exec-step 3\n"
+
+# Can not match -re ".*\r\n${mi_gdb_prompt}", because of false positives
+# after the first prompt is printed.
+
+proc mi_run_to_helper { cmd reason func args file line extra test } {
+ global suppress_flag
+ if { $suppress_flag } {
+ return -1
+ }
+ global mi_gdb_prompt
+ global hex
+ global decimal
+ send_gdb "220-$cmd\n"
+ gdb_expect {
+ -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\".*$file\",line=\"$line\"\}$extra\r\n$mi_gdb_prompt$" {
+ pass "$test"
+ return 0
+ }
+ -re "220\\^running\r\n${mi_gdb_prompt}220\\*stopped,reason=\"$reason\",thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\".*\",args=\[\\\[\{\].*\[\\\]\}\],file=\".*\",line=\"\[0-9\]*\"\}.*\r\n$mi_gdb_prompt$" {
+ fail "$test (stopped at wrong place)"
+ return -1
+ }
+ -re "220\\^running\r\n${mi_gdb_prompt}.*\r\n${mi_gdb_prompt}$" {
+ fail "$test (unknown output after running)"
+ return -1
+ }
+ timeout {
+ fail "$test (timeout)"
+ return -1
+ }
+ }
+}
+
+proc mi_run_to { cmd reason func args file line extra test } {
+ mi_run_to_helper "$cmd" "$reason" "$func" "\\\[$args\\\]" \
+ "$file" "$line" "$extra" "$test"
+}
+
+proc mi_next_to { func args file line test } {
+ mi_run_to "exec-next" "end-stepping-range" "$func" "$args" \
+ "$file" "$line" "" "$test"
+}
+
+proc mi_step_to { func args file line test } {
+ mi_run_to "exec-step" "end-stepping-range" "$func" "$args" \
+ "$file" "$line" "" "$test"
+}
+
+proc mi_finish_to { func args file line result ret test } {
+ mi_run_to "exec-finish" "function-finished" "$func" "$args" \
+ "$file" "$line" \
+ ",gdb-result-var=\"$result\",return-value=\"$ret\"" \
+ "$test"
+}
+
+proc mi_continue_to { bkptno func args file line test } {
+ mi_run_to "exec-continue" "breakpoint-hit\",bkptno=\"$bkptno" \
+ "$func" "$args" "$file" "$line" "" "$test"
+}
+
+proc mi0_run_to { cmd reason func args file line extra test } {
+ mi_run_to_helper "$cmd" "$reason" "$func" "\{$args\}" \
+ "$file" "$line" "$extra" "$test"
+}
+
+proc mi0_next_to { func args file line test } {
+ mi0_run_to "exec-next" "end-stepping-range" "$func" "$args" \
+ "$file" "$line" "" "$test"
+}
+
+proc mi0_step_to { func args file line test } {
+ mi0_run_to "exec-step" "end-stepping-range" "$func" "$args" \
+ "$file" "$line" "" "$test"
+}
+
+proc mi0_finish_to { func args file line result ret test } {
+ mi0_run_to "exec-finish" "function-finished" "$func" "$args" \
+ "$file" "$line" \
+ ",gdb-result-var=\"$result\",return-value=\"$ret\"" \
+ "$test"
+}
+
+proc mi0_continue_to { bkptno func args file line test } {
+ mi0_run_to "exec-continue" "breakpoint-hit\",bkptno=\"$bkptno" \
+ "$func" "$args" "$file" "$line" "" "$test"
+}
diff --git a/gdb/testsuite/lib/trace-support.exp b/gdb/testsuite/lib/trace-support.exp
new file mode 100644
index 00000000000..4765791b817
--- /dev/null
+++ b/gdb/testsuite/lib/trace-support.exp
@@ -0,0 +1,307 @@
+# Copyright (C) 1998 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
+
+
+#
+# Support procedures for trace testing
+#
+
+
+#
+# Procedure: gdb_target_supports_trace
+# Returns true if GDB is connected to a target that supports tracing.
+# Allows tests to abort early if not running on a trace-aware target.
+#
+
+proc gdb_target_supports_trace { } {
+ global gdb_prompt
+
+ send_gdb "tstatus\n"
+ gdb_expect {
+ -re "\[Tt\]race can only be run on.*$gdb_prompt $" {
+ return 0
+ }
+ -re "\[Tt\]race can not be run on.*$gdb_prompt $" {
+ return 0
+ }
+ -re "\[Tt\]arget does not support.*$gdb_prompt $" {
+ return 0
+ }
+ -re ".*\[Ee\]rror.*$gdb_prompt $" {
+ return 0
+ }
+ -re ".*\[Ww\]arning.*$gdb_prompt $" {
+ return 0
+ }
+ -re ".*$gdb_prompt $" {
+ return 1
+ }
+ timeout {
+ return 0
+ }
+ }
+}
+
+
+#
+# Procedure: gdb_delete_tracepoints
+# Many of the tests depend on setting tracepoints at various places and
+# running until that tracepoint is reached. At times, we want to start
+# with a clean slate with respect to tracepoints, so this utility proc
+# lets us do this without duplicating this code everywhere.
+#
+
+proc gdb_delete_tracepoints {} {
+ global gdb_prompt
+
+ send_gdb "delete tracepoints\n"
+ gdb_expect 30 {
+ -re "Delete all tracepoints.*y or n.*$" {
+ send_gdb "y\n";
+ exp_continue
+ }
+ -re ".*$gdb_prompt $" { # This happens if there were no tracepoints }
+ timeout {
+ perror "Delete all tracepoints in delete_tracepoints (timeout)"
+ return
+ }
+ }
+ send_gdb "info tracepoints\n"
+ gdb_expect 30 {
+ -re "No tracepoints.*$gdb_prompt $" {}
+ -re "$gdb_prompt $" { perror "tracepoints not deleted" ; return }
+ timeout { perror "info tracepoints (timeout)" ; return }
+ }
+}
+
+#
+# Procedure: gdb_trace_setactions
+# Define actions for a tracepoint.
+# Arguments:
+# testname -- identifying string for pass/fail output
+# tracepoint -- to which tracepoint do these actions apply? (optional)
+# args -- list of actions to be defined.
+# Returns:
+# zero -- success
+# non-zero -- failure
+
+proc gdb_trace_setactions { testname tracepoint args } {
+ global gdb_prompt;
+
+ set state 0;
+ set passfail "pass";
+ send_gdb "actions $tracepoint\n";
+ set expected_result "";
+ gdb_expect 5 {
+ -re "No tracepoint number .*$gdb_prompt $" {
+ fail $testname
+ return 1;
+ }
+ -re "Enter actions for tracepoint $tracepoint.*>" {
+ if { [llength $args] > 0 } {
+ set lastcommand "[lindex $args $state]";
+ send_gdb "[lindex $args $state]\n";
+ incr state;
+ set expected_result [lindex $args $state];
+ incr state;
+ } else {
+ send_gdb "end\n";
+ }
+ exp_continue;
+ }
+ -re "\(.*\)\[\r\n\]+\[ \t]*> $" {
+ if { $expected_result != "" } {
+ regsub "^\[^\r\n\]+\[\r\n\]+" "$expect_out(1,string)" "" out;
+ if ![regexp $expected_result $out] {
+ set passfail "fail";
+ }
+ set expected_result "";
+ }
+ if { $state < [llength $args] } {
+ send_gdb "[lindex $args $state]\n";
+ incr state;
+ set expected_result [lindex $args $state];
+ incr state;
+ } else {
+ send_gdb "end\n";
+ set expected_result "";
+ }
+ exp_continue;
+ }
+ -re "\(.*\)$gdb_prompt $" {
+ if { $expected_result != "" } {
+ if ![regexp $expected_result $expect_out(1,string)] {
+ set passfail "fail";
+ }
+ set expected_result "";
+ }
+ if { [llength $args] < $state } {
+ set passfail "fail";
+ }
+ }
+ default {
+ set passfail "fail";
+ }
+ }
+ if { $testname != "" } {
+ $passfail $testname;
+ }
+ if { $passfail == "pass" } then {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+#
+# Procedure: gdb_tfind_test
+# Find a specified trace frame.
+# Arguments:
+# testname -- identifying string for pass/fail output
+# tfind_arg -- frame (line, PC, etc.) identifier
+# exp_res -- Expected result of frame test
+# args -- Test expression
+# Returns:
+# zero -- success
+# non-zero -- failure
+#
+
+proc gdb_tfind_test { testname tfind_arg exp_res args } {
+ global gdb_prompt;
+
+ if { "$args" != "" } {
+ set expr "$exp_res";
+ set exp_res "$args";
+ } else {
+ set expr "(int) \$trace_frame";
+ }
+ set passfail "fail";
+
+ gdb_test "tfind $tfind_arg" "" ""
+ send_gdb "printf \"x \%d x\\n\", $expr\n";
+ gdb_expect 10 {
+ -re "x (-*\[0-9\]+) x" {
+ if { $expect_out(1,string) == $exp_res } {
+ set passfail "pass";
+ }
+ exp_continue;
+ }
+ -re "$gdb_prompt $" { }
+ }
+ $passfail "$testname";
+ if { $passfail == "pass" } then {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+#
+# Procedure: gdb_readexpr
+# Arguments:
+# gdb_expr -- the expression whose value is desired
+# Returns:
+# the value of gdb_expr, as evaluated by gdb.
+# [FIXME: returns -1 on error, which is sometimes a legit value]
+#
+
+proc gdb_readexpr { gdb_expr } {
+ global gdb_prompt;
+
+ set result -1;
+ send_gdb "print $gdb_expr\n"
+ gdb_expect 5 {
+ -re "\[$\].*= (\[0-9\]+).*$gdb_prompt $" {
+ set result $expect_out(1,string);
+ }
+ -re "$gdb_prompt $" { }
+ default { }
+ }
+ return $result;
+}
+
+#
+# Procedure: gdb_gettpnum
+# Arguments:
+# tracepoint (optional): if supplied, set a tracepoint here.
+# Returns:
+# the tracepoint ID of the most recently set tracepoint.
+#
+
+proc gdb_gettpnum { tracepoint } {
+ global gdb_prompt;
+
+ if { $tracepoint != "" } {
+ gdb_test "trace $tracepoint" "" ""
+ }
+ return [gdb_readexpr "\$tpnum"];
+}
+
+
+#
+# Procedure: gdb_find_function_baseline
+# Arguments:
+# func_name -- name of source function
+# Returns:
+# Sourcefile line of function definition (open curly brace),
+# or -1 on failure. Caller must check return value.
+# Note:
+# Works only for open curly brace at beginning of source line!
+#
+
+proc gdb_find_function_baseline { func_name } {
+ global gdb_prompt;
+
+ set baseline -1;
+
+ send_gdb "list $func_name\n"
+# gdb_expect {
+# -re "\[\r\n\]\[\{\].*$gdb_prompt $" {
+# set baseline 1
+# }
+# }
+}
+
+#
+# Procedure: gdb_find_function_baseline
+# Arguments:
+# filename: name of source file of desired function.
+# Returns:
+# Sourcefile line of function definition (open curly brace),
+# or -1 on failure. Caller must check return value.
+# Note:
+# Works only for open curly brace at beginning of source line!
+#
+
+proc gdb_find_recursion_test_baseline { filename } {
+ global gdb_prompt;
+
+ set baseline -1;
+
+ gdb_test "list $filename:1" "" ""
+ send_gdb "search gdb_recursion_test line 0\n"
+ gdb_expect {
+ -re "(\[0-9\]+)\[\t \]+\{.*line 0.*$gdb_prompt $" {
+ set baseline $expect_out(1,string);
+ }
+ -re "$gdb_prompt $" { }
+ default { }
+ }
+ return $baseline;
+}