]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Merge with mainline; merge tag carlton_dictionary-20021011-merge.
authorDavid Carlton <carlton@bactrian.org>
Fri, 11 Oct 2002 22:23:08 +0000 (22:23 +0000)
committerDavid Carlton <carlton@bactrian.org>
Fri, 11 Oct 2002 22:23:08 +0000 (22:23 +0000)
163 files changed:
ChangeLog
Makefile.in
bfd/ChangeLog
bfd/Makefile.am
bfd/Makefile.in
bfd/archures.c
bfd/bfd-in2.h
bfd/coff-arm.c
bfd/cofflink.c
bfd/config.bfd
bfd/configure
bfd/configure.in
bfd/cpu-mips.c
bfd/doc/ChangeLog
bfd/doc/Makefile.am
bfd/doc/Makefile.in
bfd/ecoff.c
bfd/elf.c
bfd/elf32-arm.h
bfd/elf32-i386.c
bfd/elf32-m32r.c
bfd/elf32-sh.c
bfd/elf32-sh64.c
bfd/elf32-vax.c
bfd/elf64-alpha.c
bfd/elf64-ppc.c
bfd/elf64-sh64.c
bfd/elf64-x86-64.c
bfd/elflink.c
bfd/elflink.h
bfd/elfxx-ia64.c
bfd/elfxx-mips.c
bfd/libbfd.h
bfd/linker.c
bfd/opncls.c
bfd/reloc.c
bfd/targets.c
bfd/version.h
bfd/xcofflink.c
configure
configure.in
gdb/ChangeLog
gdb/MAINTAINERS
gdb/Makefile.in
gdb/NEWS
gdb/blockframe.c
gdb/c-exp.y
gdb/config/djgpp/fnchange.lst
gdb/config/i386/i386gnu.mt
gdb/config/i386/i386sco5.mt
gdb/config/i386/i386v4.mt
gdb/config/i386/ncr3000.mt
gdb/config/i386/nm-i386sco.h
gdb/config/i386/tm-i386sol2.h
gdb/config/i386/tm-i386v4.h [deleted file]
gdb/config/i386/tm-i386v42mp.h
gdb/config/i386/tm-ptx.h
gdb/config/i386/xm-i386sco.h
gdb/config/mips/tm-irix3.h
gdb/config/mips/tm-irix6.h
gdb/config/rs6000/tm-rs6000.h
gdb/config/tm-sysv4.h
gdb/cp-valprint.c
gdb/defs.h
gdb/demangle.c
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/doc/gdbint.texinfo
gdb/dwarf2read.c
gdb/event-loop.c
gdb/event-top.c
gdb/frame.h
gdb/gdb-events.c
gdb/gdb-events.h
gdb/gdb-events.sh
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/gdbtypes.c
gdb/gnu-nat.c
gdb/gnu-nat.h
gdb/gnu-v3-abi.c
gdb/infcmd.c
gdb/inferior.h
gdb/infrun.c
gdb/jv-exp.y
gdb/m32r-stub.c
gdb/mi/ChangeLog
gdb/mi/gdbmi.texinfo
gdb/mi/mi-cmd-disas.c
gdb/mi/mi-cmd-var.c
gdb/mi/mi-main.c
gdb/mi/mi-out.c
gdb/mi/mi-out.h
gdb/mips-tdep.c
gdb/objc-exp.y
gdb/objc-lang.c
gdb/objc-lang.h
gdb/p-exp.y
gdb/rs6000-tdep.c
gdb/sh-tdep.c
gdb/stabsread.c
gdb/stack.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/annota1.exp
gdb/testsuite/gdb.base/shlib-call.exp
gdb/testsuite/gdb.mi/ChangeLog
gdb/testsuite/gdb.mi/mi-return.exp
gdb/testsuite/gdb.mi/mi-stack.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/mi0-basics.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-break.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-console.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-disassemble.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-eval.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-hack-cli.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-read-memory.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-regs.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-return.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-simplerun.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-stack.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-stepi.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-until.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-var-block.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-var-child.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-var-cmd.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-var-display.exp [deleted file]
gdb/testsuite/gdb.mi/mi0-watch.exp [deleted file]
gdb/tracepoint.c
gdb/tui/ChangeLog
gdb/tui/tui-hooks.c
gdb/tui/tui.c
gdb/tui/tuiDisassem.c
gdb/tui/tuiLayout.c
gdb/tui/tuiSource.c
gdb/tui/tuiSourceWin.c
gdb/tui/tuiWin.c
gdb/ui-out.c
gdb/ui-out.h
gdb/utils.c
gdb/v850ice.c
gdb/version.in
include/elf/ChangeLog
include/elf/mips.h
include/elf/sh.h
include/opcode/ChangeLog
include/opcode/mips.h
libiberty/ChangeLog
libiberty/cplus-dem.c
opcodes/ChangeLog
opcodes/mips-dis.c
opcodes/mips-opc.c
sim/arm/ChangeLog
sim/arm/wrapper.c
sim/ppc/ChangeLog
sim/ppc/hw_disk.c
sim/sh/ChangeLog
sim/sh/gencode.c
sim/sh/interp.c
sim/v850/ChangeLog
sim/v850/simops.c

index a970f0e5e19a8651dd57e3c825f8f37d754a63e7..db8247aa18335560c782505f3fb59b9b72fc0146 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,86 @@
+2002-10-07  Svein E. Seldal  <Svein.Seldal@solidas.com>
+
+       * configure.in: Add tic4x target.
+
+2002-10-03  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+       * Makefile.tpl: Make SET_LIB_PATH substitution more autoconfy.
+       * Makefile.tpl: Make RPATH_ENVVAR substitution more autoconfy.
+       * configure.in: Make SET_LIB_PATH substitution more autoconfy.
+       * configure.in: Make RPATH_ENVVAR substitution more autoconfy.
+       * Makefile.in: Regenerate.
+
+2002-10-02  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+       * Makefile.tpl: Eliminate reference to all-gui, all-libproc.
+       * Makefile.in: Regenerate.
+
+       * Makefile.def: Remove order dependency comments.
+       * Makefile.tpl: Add explicit install-install dependencies.
+       * Makefile.in: Regenerate.
+
+       * Makefile.tpl: Remove material now in src-release.  (Finally!)
+       * Makefile.in: Regenerate.
+
+       * configure: Restore my original patch by syncing with gcc version.
+
+       * Bring following over from gcc:
+
+2002-09-30  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * configure.in (s390*-*-linux*): Enable libgcj.
+
+2002-10-02  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+       * Makefile.in: Regenerate.  This really ought to fix things. :sigh:
+
+2002-10-02  Alan Modra  <amodra@bigpond.net.au>
+
+       * configure: Move stray lines back to where they belong.
+
+2002-10-01  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+       * Makefile.tpl: Insert configure-target target, for src-release.
+
+       * configure: Finish reverting change which Andrew Cagney started
+       reverting.  Should fix bustage.
+
+       * src-release (BINUTILS_SUPPORT_DIRS): Add cpu directory.
+       * src-release: New file.  Contains material for making net
+       releases for gdb, binutils, et al., formerly in Makefile.in.
+
+2002-09-30  Nick Clifton  <nickc@redhat.com>
+
+       * cpu: New top level directory.  Intended to hold input files for
+       CGEN which have FSF copyright assignment.
+       * Makefile.in (BINUTILS_SUPPORT_DIRS): Add cpu directory.
+
+2002-09-29  Andrew Cagney  <ac131313@redhat.com>
+
+       Revert below (note that src does not contain Makefile.tpl):
+       * Makefile.tpl: Make subsituted variables more autoconfy.
+       * Makefile.in: Regenerate.
+
+2002-09-29  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+       * configure: Revert accidentally applied changes.
+
+       * Makefile.tpl: Make more autoconf-friendly.
+       * Makefile.in: Regenerate.
+       * configure: Make substitution more autoconf-like.
+
+2002-09-28  Richard Earnshaw  <rearnsha@arm.com>
+
+       * configure.in (arm-*-coff, strongarm-*-coff, xscale-*-coff): Use a
+       single entry to handle all these.
+       (arm-*-elf, strongarm-*-elf, xscale-*-elf): Likewise.  Also enable
+       libjava on arm-*-elf.
+
+2002-09-27  Geoffrey Keating  <geoffk@apple.com>
+
+       * configure.in (powerpc-*-darwin*): Don't configure BFD, TK, or the
+       things that depend on them.
+
 2002-09-25  Nathanael Nerode  <neroden@gcc.gnu.org>
 
        * Makefile.tpl: Make subsituted variables more autoconfy.
index d90547df9106d60f7212353e07e5961b76cba241..ce4bffa88a4c54b18382f4c72dc819a89c4f2d6f 100644 (file)
@@ -124,9 +124,6 @@ NM = nm
 
 LD = ld
 
-BZIPPROG = bzip2
-MD5PROG = md5sum
-
 # These values are substituted by configure.
 DEFAULT_YACC = @DEFAULT_YACC@
 DEFAULT_LEX = @DEFAULT_LEX@
@@ -181,8 +178,7 @@ RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \
 CC_FOR_BUILD = $(CC)
 CXX_FOR_BUILD = $(CXX)
 
-SUBDIRS = "this is set via configure, don't edit this"
-OTHERS = 
+SUBDIRS = @configdirs@
 
 # This is set by the configure script to the list of directories which
 # should be built using the target tools.
@@ -205,11 +201,11 @@ BUILD_CONFIGARGS = @build_configargs@
 
 # This is set by configure to REALLY_SET_LIB_PATH if --enable-shared
 # was used.
-SET_LIB_PATH =
+SET_LIB_PATH = @SET_LIB_PATH@
 
 # This is the name of the environment variable used for the path to
 # the libraries.  This may be changed by configure.in.
-RPATH_ENVVAR = LD_LIBRARY_PATH
+RPATH_ENVVAR = @RPATH_ENVVAR@
 
 # This is the list of directories that may be needed in RPATH_ENVVAR
 # so that programs built for the host machine work.
@@ -657,11 +653,6 @@ CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES)
 
 # This is a list of the install targets for all of the modules which are
 # compiled using $(FLAGS_TO_PASS).
-# We put install-opcodes before install-binutils because the installed
-# binutils might be on PATH, and they might need the shared opcodes
-# library.
-# We put install-tcl before install-itcl because itcl wants to run a
-# program on installation which uses the Tcl libraries.
 INSTALL_MODULES = \
        install-ash \
        install-autoconf \
@@ -1262,12 +1253,8 @@ $(CONFIGURE_BUILD_MODULES):
 
 # This rule is used to build the modules which use FLAGS_TO_PASS.  To
 # build a target all-X means to cd to X and make all.
-#
-# all-gui, and all-libproc are handled specially because
-# they are still experimental, and if they fail to build, that
-# shouldn't stop "make all".
-.PHONY: $(ALL_MODULES) all-gui all-libproc
-$(ALL_MODULES) all-gui all-libproc:
+.PHONY: $(ALL_MODULES)
+$(ALL_MODULES):
        @dir=`echo $@ | sed -e 's/all-//'`; \
        if [ -f ./$${dir}/Makefile ] ; then \
          r=`${PWD}`; export r; \
@@ -1681,7 +1668,6 @@ configure-target-gperf: $(ALL_GCC_CXX)
 all-target-gperf: all-target-libiberty all-target-libstdc++-v3
 all-gprof: all-libiberty all-bfd all-opcodes all-intl
 all-grep: all-libiberty
-all-gui: all-gdb all-libproc
 all-guile:
 all-gzip: all-libiberty
 all-hello: all-libiberty
@@ -1744,11 +1730,22 @@ all-fastjar: all-zlib all-libiberty
 configure-target-fastjar: configure-target-zlib
 all-target-fastjar: configure-target-fastjar all-target-zlib all-target-libiberty
 configure-target-libiberty: $(ALL_GCC_C)
+configure-target: $(CONFIGURE_TARGET_MODULES)
 all-target: $(ALL_TARGET_MODULES)
 install-target: $(INSTALL_TARGET_MODULES)
 install-gdb: install-tcl install-tk install-itcl install-tix install-libgui
 install-sid: install-tcl install-tk
 
+# We put install-opcodes before install-binutils because the installed
+# binutils might be on PATH, and they might need the shared opcodes
+# library.
+install-binutils: install-opcodes
+
+# We put install-tcl before install-itcl because itcl wants to run a
+# program on installation which uses the Tcl libraries.
+install-itcl: install-tcl
+
+
 # Dependencies of all-target-foo on configure-target-foo.
 all-target-libstdc++-v3: configure-target-libstdc++-v3
 all-target-newlib: configure-target-newlib
@@ -1807,290 +1804,6 @@ Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag)
        $(SHELL) ./config.status
 
 #
-# Support for building net releases
-
-# Files in devo used in any net release.
-# ChangeLog omitted because it may refer to files which are not in this
-# distribution (perhaps it would be better to include it anyway).
-DEVO_SUPPORT= README Makefile.in configure configure.in \
-       config.guess config.if config.sub config move-if-change \
-       mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \
-       COPYING COPYING.LIB install-sh config-ml.in symlink-tree \
-       mkinstalldirs ltconfig ltmain.sh missing ylwrap \
-       libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh
-
-# Files in devo/etc used in any net release.
-# ChangeLog omitted because it may refer to files which are not in this
-# distribution (perhaps it would be better to include it anyway).
-ETC_SUPPORT= Makefile.in configure configure.in standards.texi \
-       make-stds.texi standards.info* configure.texi configure.info* \
-       configbuild.* configdev.*
-
-
-# When you use `make setup-dirs' or `make taz' you should always redefine
-# this macro.
-SUPPORT_FILES = list-of-support-files-for-tool-in-question
-
-# NOTE: No double quotes in the below.  It is used within shell script
-# as VER="$(VER)"
-VER = `        if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \
-         sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
-       elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \
-         sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \
-       elif test -f $(TOOL)/version.in; then \
-         head -1 $(TOOL)/version.in; \
-       elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \
-         sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \
-       else \
-         echo VERSION; \
-       fi`
-PACKAGE = $(TOOL)
-
-.PHONY: taz
-taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
-       $(MAKE) -f Makefile.in do-proto-toplev \
-               TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(SUPPORT_FILES)"
-       $(MAKE) -f Makefile.in do-md5sum \
-               TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(SUPPORT_FILES)"
-       $(MAKE) -f Makefile.in do-tar \
-               TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(SUPPORT_FILES)"
-       $(MAKE) -f Makefile.in do-bz2 \
-               TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(SUPPORT_FILES)"
-
-.PHONY: gdb-tar
-gdb-tar: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
-       $(MAKE) -f Makefile.in do-proto-toplev \
-               TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(SUPPORT_FILES)"
-       $(MAKE) -f Makefile.in do-md5sum \
-               TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(SUPPORT_FILES)"
-       $(MAKE) -f Makefile.in do-djunpack \
-               TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(SUPPORT_FILES)"
-       $(MAKE) -f Makefile.in do-tar \
-               TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(SUPPORT_FILES)"
-
-.PHONY: gdb-taz
-gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
-       $(MAKE) -f Makefile.in gdb-tar \
-               TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(SUPPORT_FILES)"
-       $(MAKE) -f Makefile.in do-bz2 \
-               TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(SUPPORT_FILES)"
-
-.PHONY: do-proto-toplev
-do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex
-       echo "==> Making $(PACKAGE)-$(VER)/"
-       # Take out texinfo from a few places.
-       sed -e '/^all\.normal: /s/\all-texinfo //' \
-           -e '/^      install-texinfo /d' \
-       <Makefile.in >tmp
-       mv -f tmp Makefile.in
-       #
-       ./configure sun4
-       [ -z "$(CONFIGURE_TARGET_MODULES)" ] \
-         || $(MAKE) $(CONFIGURE_TARGET_MODULES) \
-           ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \
-           CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)"
-       # Make links, and run "make diststuff" or "make info" when needed.
-       rm -rf proto-toplev ; mkdir proto-toplev
-       set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \
-       for d in $$dirs ; do \
-         if [ -d $$d ]; then \
-           if [ ! -f $$d/Makefile ] ; then true ; \
-           elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \
-               (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \
-           elif grep '^info:' $$d/Makefile >/dev/null ; then \
-               (cd $$d ; $(MAKE) info ) || exit 1 ; \
-           fi ; \
-           if [ -d $$d/proto-$$d.dir ]; then \
-             ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \
-           else \
-             ln -s ../$$d proto-toplev/$$d ; \
-           fi ; \
-         else ln -s ../$$d proto-toplev/$$d ; fi ; \
-       done
-       cd etc && $(MAKE) info
-       $(MAKE) distclean
-       #
-       mkdir proto-toplev/etc
-       (cd proto-toplev/etc; \
-        for i in $(ETC_SUPPORT); do \
-               ln -s ../../etc/$$i . ; \
-        done)
-       #
-       # Take out texinfo from configurable dirs
-       rm proto-toplev/configure.in
-       sed -e '/^host_tools=/s/texinfo //' \
-           <configure.in >proto-toplev/configure.in
-       #
-       mkdir proto-toplev/texinfo
-       ln -s ../../texinfo/texinfo.tex         proto-toplev/texinfo/
-       if test -r texinfo/util/tex3patch ; then \
-         mkdir proto-toplev/texinfo/util && \
-         ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \
-       else true; fi
-       chmod -R og=u . || chmod og=u `find . -print`
-       #
-       # Create .gmo files from .po files.
-       for f in `find . -name '*.po' -type f -print`; do \
-            msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \
-       done
-       #
-       -rm -f $(PACKAGE)-$(VER)
-       ln -s proto-toplev $(PACKAGE)-$(VER)
-
-.PHONY: do-tar
-do-tar:
-       echo "==> Making $(PACKAGE)-$(VER).tar"
-       -rm -f $(PACKAGE)-$(VER).tar
-       find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \
-               | tar cTfh - $(PACKAGE)-$(VER).tar
-
-.PHONY: do-bz2
-do-bz2:
-       echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2"
-       -rm -f $(PACKAGE)-$(VER).tar.bz2
-       $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar
-
-.PHONY: do-md5sum
-do-md5sum:
-       echo "==> Adding md5 checksum to top-level directory"
-       cd proto-toplev && find * -follow -name CVS -prune -o -type f -print \
-               | xargs $(MD5PROG) > ../md5.sum
-       mv md5.sum proto-toplev
-
-.PHONY: do-djunpack
-do-djunpack:
-       echo "==> Adding updated djunpack.bat to top-level directory"
-       echo - 's /gdb-[0-9\.]*/gdb-'"$(VER)"'/'
-       sed < djunpack.bat > djunpack.new \
-               -e 's/gdb-[0-9][0-9\.]*/gdb-'"$(VER)"'/'
-       mv djunpack.new djunpack.bat
-       -rm -f proto-toplev/djunpack.bat
-       ln -s ../djunpack.bat proto-toplev/djunpack.bat
-
-TEXINFO_SUPPORT= texinfo/texinfo.tex
-DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT)
-
-.PHONY: gas.tar.bz2
-GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep
-gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas
-       $(MAKE) -f Makefile.in taz TOOL=gas \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(GAS_SUPPORT_DIRS)"
-
-# The FSF "binutils" release includes gprof and ld.
-.PHONY: binutils.tar.bz2
-BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep
-binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils
-       $(MAKE) -f Makefile.in taz TOOL=binutils \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)"
-
-.PHONY: gas+binutils.tar.bz2
-GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof
-gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas
-       $(MAKE) -f Makefile.in taz TOOL=gas \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(GASB_SUPPORT_DIRS)"
-
-GNATS_SUPPORT_DIRS=include libiberty send-pr
-gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats
-       $(MAKE) -f  Makefile.in taz TOOL=gnats \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
-
-.PHONY: gdb.tar.bz2
-GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl
-gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
-       $(MAKE) -f Makefile.in gdb-taz TOOL=gdb \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
-.PHONY: gdb.tar
-gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
-       $(MAKE) -f Makefile.in gdb-tar TOOL=gdb \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
-
-DEJAGNU_SUPPORT_DIRS=  tcl expect libiberty
-.PHONY: dejagnu.tar.bz2
-dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu
-       $(MAKE) -f Makefile.in taz TOOL=dejagnu \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)"
-
-.PHONY: gdb+dejagnu.tar.bz2
-GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu
-gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
-       $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
-.PHONY: gdb+dejagnu.tar
-gdb+dejagnu.tar: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb
-       $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE=gdb+dejagnu \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)"
-
-.PHONY: insight.tar.bz2
-INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui
-insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
-       $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=insight \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
-.PHONY: insight.tar
-insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
-       $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE=insight \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)"
-
-.PHONY: insight+dejagnu.tar.bz2
-INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu
-insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
-       $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
-.PHONY: insight+dejagnu.tar
-insight+dejagnu.tar: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb
-       $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE="insight+dejagnu" \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)"
-
-.PHONY: newlib.tar.bz2
-NEWLIB_SUPPORT_DIRS=libgloss
-# taz configures for the sun4 target which won't configure newlib.
-# We need newlib configured so that the .info files are made.
-# Unfortunately, it is not enough to just configure newlib separately:
-# taz will build the .info files but since SUBDIRS won't contain newlib,
-# distclean won't be run (leaving Makefile, config.status, and the tmp files
-# used in building the .info files, eg: *.def, *.ref).
-# The problem isn't solvable however without a lot of extra work because
-# target libraries are built in subdir $(target_alias) which gets nuked during
-# the make distclean.  For now punt on the issue of shipping newlib info files
-# with newlib net releases and wait for a day when some native target (sun4?)
-# supports newlib (if only minimally).
-newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
-       $(MAKE) -f Makefile.in taz TOOL=newlib \
-               MD5PROG="$(MD5PROG)" \
-               SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
-               DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib
 
 .NOEXPORT:
 MAKEOVERRIDES=
index 27bff18c33909b3a401ab3b5b1d61097b07127cd..c5636f2b218a349b77a75eb599c4230bd5a620dc 100644 (file)
@@ -1,3 +1,196 @@
+2002-10-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+       * elf32-sh.c (sh_elf_optimized_tls_reloc, sh_elf_mkobject,
+       sh_elf_object_p, dtpoff_base): New functions.
+       (sh_elf_howto_table): Add TLS relocs.
+       (sh_reloc_map): Likewise.
+       (sh_elf_info_to_howto): Support TLS relocs.
+       (elf_sh_link_hash_entry): Add tls_type and tls_tpoff32.
+       (sh_elf_hash_entry, sh_elf_tdata, sh_elf_local_got_tls_type):
+       New macros.
+       (sh_elf_obj_tdata): New.
+       (elf_sh_link_hash_table): Add tls_ldm_got.
+       (sh_elf_link_hash_table_create): Clear refcount of tls_ldm_got.
+       (allocate_dynrelocs): Support TLS relocs.
+       (sh_elf_size_dynamic_sections): Likewise.
+       (sh_elf_relocate_section): Support TLS relocs.  Don't try to find
+       .rela.got section when found already.  Return false after printing
+       error about unresolvable relocation.
+       (sh_elf_gc_sweep_hook): Support TLS relocs.
+       (sh_elf_check_relocs): Likewise.
+       (sh_elf_finish_dynamic_symbol): Likewise.
+       (bfd_elf32_mkobject, elf_backend_object_p): Define for TLS case.
+       * reloc.c: Add SH TLS relocs.
+       * bfd-in2.h, libbfd.h: Regenerate.
+
+2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
+
+       * Makefile.am: Run dep-am.
+       (BFD32_LIBS): Add simple.lo.
+       (BFD32_LIBS_CFILES): Add simple.c.
+       * Makefile.in: Regenerated.
+       * bfd-in2.h: Regenerated.
+       * simple.c: New file.
+
+2002-10-11  Alan Modra  <amodra@bigpond.net.au>
+
+       * coff-arm.c (record_arm_to_thumb_glue): Avoid type-punned pointers.
+       (record_thumb_to_arm_glue): Likewise.
+       * ecoff.c (ecoff_link_add_externals): Likewise.
+       * elf32-arm.h (record_arm_to_thumb_glue): Likewise.
+       (record_thumb_to_arm_glue): Likewise.
+       * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise.
+       * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
+       * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise.
+       * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
+       * elf64-ppc.c (func_desc_adjust): Likewise.
+       * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise.
+       (sh64_elf64_create_dynamic_sections): Likewise.
+       * elflink.c (_bfd_elf_create_got_section): Likewise.
+       (_bfd_elf_create_dynamic_sections): Likewise.
+       (_bfd_elf_create_linker_section): Likewise.
+       * elflink.h (elf_add_default_symbol): Likewise.
+       (elf_link_create_dynamic_sections): Likewise.
+       (NAME(bfd_elf,size_dynamic_sections)): Likewise.
+       * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Likewise.
+       * elfxx-mips.c (mips_elf_create_got_section): Likewise.
+       (_bfd_mips_elf_add_symbol_hook): Likewise.
+       (_bfd_mips_elf_create_dynamic_sections): Likewise.
+       * linker.c (generic_link_add_symbol_list): Likewise.
+       * xcofflink.c (xcoff_link_add_symbols): Likewise.
+
+       * elfxx-ia64.c (oor_brl, oor_ip): Conditionally define.
+
+       * elf64-ppc.c (edit_opd): Only zero opd syms when function is
+       completely removed.  Correct local sym adjustment.
+
+2002-10-10  Stephen Clarke <stephen.clarke@superh.com>
+
+       * elf32-sh.c (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le):
+       Correct mistake in calculation of address of .got.
+       * elf64-sh64.c (elf_sh64_pic_plt_entry_be,
+       elf_sh64_pic_plt_entry_le): Likewise.
+
+2002-10-09  Richard Shann <richard.shann@superh.com>
+           Stephen Clarke <stephen.clarke@superh.com>
+
+       * Makefile.am: Add entries for elf32-sh64-lin.c and
+       elf64-sh64-lin.c. Regenerate.
+       * Makefile.in: Regenerate.
+       * config.bfd:  Change sh64eb-*-linux* and sh64-*-linux*
+       to use sh64 vectors rather than sh vectors.
+       * configure.in: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
+       bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
+       * configure: Regenerate.
+       * elf32-sh64-lin.c: New file.
+       * elf64-sh64-lin.c: New file.
+       * targets.c: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec,
+       bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec.
+       
+2002-10-08  H.J. Lu <hjl@gnu.org>
+
+       * elf32-i386.c (elf_i386_relocate_section): Re-arrange the
+       IE->LE transition for R_386_TLS_IE.
+
+2002-10-08  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf64-ppc.c (edit_opd): Correct test for discarded sections.
+
+2002-10-07  Mark Elbrecht  <snowball3@softhome.net>
+
+       * cofflink.c (mark_relocs): Don't mark relocations in excluded
+       sections.
+
+2002-10-07  Alan Modra  <amodra@bigpond.net.au>
+
+       * elflink.h (elf_link_input_bfd): Remove BFD_VERSION_DATE dependent
+       code.
+
+       * elf64-ppc.c (ppc64_elf_build_stubs): Increment .glink indx.
+
+2002-10-06  Alan Modra  <amodra@bigpond.net.au>
+
+       * opncls.c: Formatting.
+       (_bfd_new_bfd): Use a smaller section hash table.
+
+2002-10-05  Alexandre Oliva  <aoliva@redhat.com>
+
+       * elfxx-mips.c (mips_elf_create_dynamic_relocation): Set the type
+       of the other two relocations packed with a REL32 to NONE.
+
+2002-10-02  Stephen Clarke <stephen.clarke@superh.com>
+
+       * elf32-sh.c (elf_sh_link_hash_entry): Add gotplt_refcount.
+       (sh_elf_link_hash_newfunc): Initialize it.
+       (allocate_dynrelocs): Transfer gotplt refs from plt.refcount
+       to got.refcount for symbols that are forced local or when
+       we have direct got refs.
+       (sh_elf_gc_sweep_hook): Adjust gotplt_refcount.  Use it
+       to correctly adjust got.refcount and plt.refcount.
+       (sh_elf_copy_indirect_symbol): Copy gotplt_refcount across.
+       (sh_elf_check_relocs): Increment gotplt_refcount.
+
+2002-10-01  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf32-i386.c (elf_i386_relocate_section): Fix
+       movl foo@indntpoff, %eax IE->LE transition.
+
+2002-10-01  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf64-x86-64.c (elf64_x86_64_relocate_section): Change TLSGD
+       sequence and its transitions.
+
+2002-10-01  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf32-i386.c (elf_i386_relocate_section): Resolve R_386_TLS_LDO_32
+       to st_value + addend in non-code sections.
+       * elf64-x86-64.c (elf64_x86_64_relocate_section): Resolve
+       R_X86_64_DTPOFF32 to st_value + addend in non-code sections.
+
+2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
+           Ken Raeburn  <raeburn@cygnus.com>
+           Aldy Hernandez  <aldyh@redhat.com>
+           Eric Christopher  <echristo@redhat.com>
+           Richard Sandiford  <rsandifo@redhat.com>
+
+       * archures.c (bfd_mach_mips4120, bfd_mach_mips5400): New.
+       (bfd_mach_mips5500): New.
+       * cpu-mips.c (I_mips4120, I_mips5400, I_mips5500): New.
+       (arch_info_struct): Add corresponding entries here.
+       * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_4120,
+       E_MIPS_MACH_5400 and E_MIPS_MACH_5500.
+       (_bfd_mips_elf_final_write_processing): Handle bfd_mach_mips4120,
+       bfd_mach_mips5400 and bfd_mach_mips5500.
+       (_bfd_mips_elf_mach_extends_p): New function.
+       (_bfd_mips_elf_merge_private_bfd_data): Use it to help merge
+       the EF_MIPS_MACH flags.
+       * bfd-in2.h: Regenerate.
+
+2002-09-28  Jason Thorpe  <thorpej@wasabisystems.com>
+
+       * elf32-vax.c (elf_vax_size_dynamic_section): Don't strip
+       .got sections.
+
+2002-09-28  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf.c (map_sections_to_segments): Correct test for start of
+       writable section in the same page as end of read-only section.
+
+2002-09-27  Matt Thomas  <matt@3am-software.com>
+
+       * elf32-vax.c (elf_vax_check_relocs): Remove unused
+       local_got_refcounts usage.  Remove allocation of got slot.
+       (elf_vax_gc_sweep_hook): Remove unused local_got_refcounts usage.
+       Remove de-allocation of got slot.
+       (elf_vax_size_dynamic_section): Fix some indentation.  Add hash
+       traversal for elf_vax_instantiate_got_entries.  Allow empty .got
+       sections to be GC'ed.
+       (elf_vax_instantiate_got_entries): New function.
+       (elf_vax_relocate_section): Simplify R_VAX_GOT32 handling.  Remove
+       tests that are now handled by elf_vax_instantiate_got_entries.
+       Assert GOT entry falls within .got section size.  Remove redundant
+       comparisions.  Fix comments.
+
 2002-09-27  Jakub Jelinek  <jakub@redhat.com>
 
        * reloc.c: Add x86-64 TLS relocs.
        * elfcode.h (elf_slurp_reloc_table_from_section): Check
        for overflow.
 
-2002-09-17  Stan Cox <scox@redhat.com> 
+2002-09-17  Stan Cox <scox@redhat.com>
 
        * elf64-mips.c (mips_elf64_be_swap_reloca_out): Handle type2 and type3.
        (mips_elf64_final_gp): Don't make up gp value.
 2002-09-10  Michael Snyder  <msnyder@redhat.com>
 
        * irix-core.c (do_sections, do_sections64): New functions.
-       (irix_core_core_file_p): Call new functions do_sections, 
+       (irix_core_core_file_p): Call new functions do_sections,
        do_sections64, depending on corefile (32-bit or 64-bit).
 
 2002-09-09  Richard Henderson  <rth@redhat.com>
 
 2002-09-04  Kevin Buettner  <kevinb@redhat.com>
 
-       * config.bfd (mips*-*-irix6*): Add new ABI vectors.  Make n32 default
-       vector.
+       * config.bfd (mips*-*-irix6*): Add new ABI vectors.  Make n32 default
+       vector.
 
 2002-09-02  Nick Clifton  <nickc@redhat.com>
 
        (v850_elf_relax_section): Replace caching of external symbols
        with caching of internal symbols obtained from calling
        bfd_elf_get_elf_syms().
-        Fixup problems with freeing cached allocated memory blocks.
+       Fixup problems with freeing cached allocated memory blocks.
 
 2002-09-02  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT
        value if .init is an SHmedia function.  Similarly for DT_FINI.
        * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.
-       
+
 2002-08-23  Stephen Clarke <stephen.clarke@superh.com>
 
        * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize
 2002-08-22  Kaz Kojima <kkojima@rr.iij4u.or.jp>
 
        * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple
-       byte read when reading the return address register column. 
+       byte read when reading the return address register column.
 
 2002-08-22  Nick Clifton  <nickc@redhat.com>
 
        argument declaration.
 
 2002-08-19  Elena Zannoni <ezannoni@redhat.com>
-        * archures.c (bfd_mach_ppc_e500): Added.
-        * bfd-in2.h: Rebuilt.
+
+       * archures.c (bfd_mach_ppc_e500): Added.
+       * bfd-in2.h: Rebuilt.
        * cpu-powerpc.c (bfd_powerpc_archs): Added e500.
 
 2002-08-19  Alan Modra  <amodra@bigpond.net.au>
 2002-08-17  Andrew Cagney  <ac131313@redhat.com>
 
        * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to
-       `bfd_byte'.
+       `bfd_byte'.
 
 2002-08-17  Stan Cox  <scox@redhat.com>
 
        * bfd/elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect
        symbols when looking for section referred to by a relocation.
        * bfd/elf64-sh.c (sh_elf64_gc_mark_hook): Likewise.
-       
+
 2002-08-15  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-i370.c: Move reloc enum to include/elf/i370.h.
 
 2002-08-09  Graeme Peterson  <gp@qnx.com>
 
-       * Makefile.am: Add entries for elf32-ppcqnx.c, and add 
+       * Makefile.am: Add entries for elf32-ppcqnx.c, and add
        elf32-qnx.h dependency to elfarmqnx-nabi.c and elf32-i386qnx.c.
        * Makefile.in: Regenerate.
        * config.bfd: Add support for powerpc{le}-*-nto targets.
index 0aa98e3b87f81924084017bb576a7cecdd0dcfab..d55e5c9faddba7fd4ac4d99c643e11eb9f00704b 100644 (file)
@@ -32,7 +32,7 @@ BFD32_LIBS = \
        format.lo init.lo libbfd.lo opncls.lo reloc.lo \
        section.lo syms.lo targets.lo hash.lo linker.lo \
        srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \
-       merge.lo dwarf2.lo
+       merge.lo dwarf2.lo simple.lo
 
 BFD64_LIBS = archive64.lo
 
@@ -41,7 +41,7 @@ BFD32_LIBS_CFILES = \
        format.c init.c libbfd.c opncls.c reloc.c \
        section.c syms.c targets.c hash.c linker.c \
        srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \
-       merge.c dwarf2.c
+       merge.c dwarf2.c simple.c
 
 BFD64_LIBS_CFILES = archive64.c
 
@@ -242,6 +242,7 @@ BFD32_BACKENDS = \
        elf32-sh-lin.lo \
        elf32-sh64.lo \
        elf32-sh64-com.lo \
+       elf32-sh64-lin.lo \
        elf32-sh-nbsd.lo \
        elf32-sh64-nbsd.lo \
        elf32-shqnx.lo \
@@ -401,6 +402,7 @@ BFD32_BACKENDS_CFILES = \
        elf32-ppcqnx.c \
        elf32-sh64.c \
        elf32-sh64-com.c \
+       elf32-sh64-lin.c \
        elf32-s390.c \
        elf32-sh.c \
        elf32-sh-lin.c \
@@ -497,6 +499,7 @@ BFD64_BACKENDS = \
        elf64-mips.lo \
        elf64-mmix.lo \
        elf64-sh64.lo \
+       elf64-sh64-lin.lo \
        elf64-sh64-nbsd.lo \
        elf64-ppc.lo \
        elf64-s390.lo \
@@ -525,6 +528,7 @@ BFD64_BACKENDS_CFILES = \
        elf64-ppc.c \
        elf64-s390.c \
        elf64-sh64.c \
+       elf64-sh64-lin.c \
        elf64-sh64-nbsd.c \
        elf64-sparc.c \
        elf64.c \
@@ -900,6 +904,7 @@ merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
 dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
+simple.lo: simple.c $(INCDIR)/filenames.h
 archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h
 cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h
 cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h
@@ -1260,6 +1265,11 @@ elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h \
   $(INCDIR)/elf/reloc-macros.h $(srcdir)/../opcodes/sh64-opc.h
+elf32-sh64-lin.lo: elf32-sh64-lin.c elf32-sh64.c $(INCDIR)/filenames.h \
+  elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+  $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
+  elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+  elf32-target.h
 elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \
@@ -1578,6 +1588,10 @@ elf64-sh64.lo: elf64-sh64.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
   elf64-target.h
+elf64-sh64-lin.lo: elf64-sh64-lin.c elf64-sh64.c $(INCDIR)/filenames.h \
+  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
+  $(INCDIR)/elf/reloc-macros.h elf64-target.h
 elf64-sh64-nbsd.lo: elf64-sh64-nbsd.c elf64-sh64.c \
   $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
index 4816c1718b0bac6369daf4a070c18ead777d0ce1..e7518bc4255ebf09e9193f49a6fcb04813a13890 100644 (file)
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
 
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -156,7 +156,7 @@ BFD32_LIBS = \
        format.lo init.lo libbfd.lo opncls.lo reloc.lo \
        section.lo syms.lo targets.lo hash.lo linker.lo \
        srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \
-       merge.lo dwarf2.lo
+       merge.lo dwarf2.lo simple.lo
 
 
 BFD64_LIBS = archive64.lo
@@ -166,7 +166,7 @@ BFD32_LIBS_CFILES = \
        format.c init.c libbfd.c opncls.c reloc.c \
        section.c syms.c targets.c hash.c linker.c \
        srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \
-       merge.c dwarf2.c
+       merge.c dwarf2.c simple.c
 
 
 BFD64_LIBS_CFILES = archive64.c
@@ -370,6 +370,7 @@ BFD32_BACKENDS = \
        elf32-sh-lin.lo \
        elf32-sh64.lo \
        elf32-sh64-com.lo \
+       elf32-sh64-lin.lo \
        elf32-sh-nbsd.lo \
        elf32-sh64-nbsd.lo \
        elf32-shqnx.lo \
@@ -530,6 +531,7 @@ BFD32_BACKENDS_CFILES = \
        elf32-ppcqnx.c \
        elf32-sh64.c \
        elf32-sh64-com.c \
+       elf32-sh64-lin.c \
        elf32-s390.c \
        elf32-sh.c \
        elf32-sh-lin.c \
@@ -627,6 +629,7 @@ BFD64_BACKENDS = \
        elf64-mips.lo \
        elf64-mmix.lo \
        elf64-sh64.lo \
+       elf64-sh64-lin.lo \
        elf64-sh64-nbsd.lo \
        elf64-ppc.lo \
        elf64-s390.lo \
@@ -656,6 +659,7 @@ BFD64_BACKENDS_CFILES = \
        elf64-ppc.c \
        elf64-s390.c \
        elf64-sh64.c \
+       elf64-sh64-lin.c \
        elf64-sh64-nbsd.c \
        elf64-sparc.c \
        elf64.c \
@@ -785,7 +789,7 @@ LTLIBRARIES =  $(bfdlib_LTLIBRARIES)
 libbfd_la_OBJECTS =  archive.lo archures.lo bfd.lo cache.lo coffgen.lo \
 corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo \
 syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo \
-ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo archive64.lo
+ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo simple.lo archive64.lo
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -949,7 +953,7 @@ maintainer-clean-recursive:
        dot_seen=no; \
        rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
          rev="$$subdir $$rev"; \
-         test "$$subdir" != "." || dot_seen=yes; \
+         test "$$subdir" = "." && dot_seen=yes; \
        done; \
        test "$$dot_seen" = "no" && rev=". $$rev"; \
        target=`echo $@ | sed s/-recursive//`; \
@@ -1430,6 +1434,7 @@ merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \
 dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h
+simple.lo: simple.c $(INCDIR)/filenames.h
 archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h
 cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h
 cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h
@@ -1790,6 +1795,11 @@ elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h \
   $(INCDIR)/elf/reloc-macros.h $(srcdir)/../opcodes/sh64-opc.h
+elf32-sh64-lin.lo: elf32-sh64-lin.c elf32-sh64.c $(INCDIR)/filenames.h \
+  elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
+  $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \
+  elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
+  elf32-target.h
 elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \
@@ -2108,6 +2118,10 @@ elf64-sh64.lo: elf64-sh64.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \
   elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \
   elf64-target.h
+elf64-sh64-lin.lo: elf64-sh64-lin.c elf64-sh64.c $(INCDIR)/filenames.h \
+  $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \
+  $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \
+  $(INCDIR)/elf/reloc-macros.h elf64-target.h
 elf64-sh64-nbsd.lo: elf64-sh64-nbsd.c elf64-sh64.c \
   $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h elf-bfd.h \
   $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \
index 3f0ba7bb65e36f6f6520c275c21d69b99b16b82d..f84fc136d1ec96785c58479d28b49e7e0cab6131 100644 (file)
@@ -129,11 +129,14 @@ DESCRIPTION
 .#define bfd_mach_mips4010             4010
 .#define bfd_mach_mips4100             4100
 .#define bfd_mach_mips4111             4111
+.#define bfd_mach_mips4120             4120
 .#define bfd_mach_mips4300             4300
 .#define bfd_mach_mips4400             4400
 .#define bfd_mach_mips4600             4600
 .#define bfd_mach_mips4650             4650
 .#define bfd_mach_mips5000             5000
+.#define bfd_mach_mips5400             5400
+.#define bfd_mach_mips5500             5500
 .#define bfd_mach_mips6000             6000
 .#define bfd_mach_mips8000             8000
 .#define bfd_mach_mips10000            10000
index c7dfe3358644106cddca54afbfdcab703f1948fb..5f226d40f485d1bb661875a9fce07310a80f6776 100644 (file)
@@ -1,7 +1,7 @@
 /* DO NOT EDIT!  -*- buffer-read-only: t -*-  This file is automatically 
    generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", 
    "section.c", "archures.c", "reloc.c", "syms.c", "bfd.c", "archive.c", 
-   "corefile.c", "targets.c" and "format.c".
+   "corefile.c", "targets.c", "format.c", "linker.c" and "simple.c".
    Run "make headers" in your build bfd/ to regenerate.  */
 
 /* Main header file for the bfd library -- portable access to object files.
@@ -1524,11 +1524,14 @@ enum bfd_architecture
 #define bfd_mach_mips4010              4010
 #define bfd_mach_mips4100              4100
 #define bfd_mach_mips4111              4111
+#define bfd_mach_mips4120              4120
 #define bfd_mach_mips4300              4300
 #define bfd_mach_mips4400              4400
 #define bfd_mach_mips4600              4600
 #define bfd_mach_mips4650              4650
 #define bfd_mach_mips5000              5000
+#define bfd_mach_mips5400              5400
+#define bfd_mach_mips5500              5500
 #define bfd_mach_mips6000              6000
 #define bfd_mach_mips8000              8000
 #define bfd_mach_mips10000             10000
@@ -2502,6 +2505,14 @@ field in the instruction.  */
   BFD_RELOC_SH_IMM_HI16,
   BFD_RELOC_SH_IMM_HI16_PCREL,
   BFD_RELOC_SH_PT_16,
+  BFD_RELOC_SH_TLS_GD_32,
+  BFD_RELOC_SH_TLS_LD_32,
+  BFD_RELOC_SH_TLS_LDO_32,
+  BFD_RELOC_SH_TLS_IE_32,
+  BFD_RELOC_SH_TLS_LE_32,
+  BFD_RELOC_SH_TLS_DTPMOD32,
+  BFD_RELOC_SH_TLS_DTPOFF32,
+  BFD_RELOC_SH_TLS_TPOFF32,
 
 /* Thumb 23-, 12- and 9-bit pc-relative branches.  The lowest bit must
 be zero and is not stored in the instruction.  */
@@ -4118,6 +4129,17 @@ bfd_set_format PARAMS ((bfd *abfd, bfd_format format));
 const char *
 bfd_format_string PARAMS ((bfd_format format));
 
+/* Extracted from linker.c.  */
+boolean
+bfd_link_split_section PARAMS ((bfd *abfd, asection *sec));
+
+#define bfd_link_split_section(abfd, sec) \
+       BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
+
+/* Extracted from simple.c.  */
+bfd_byte *
+bfd_simple_get_relocated_section_contents PARAMS ((bfd *abfd, asection *sec, bfd_byte *outbuf));
+
 #ifdef __cplusplus
 }
 #endif
index 5e7f907a9594af9f16291157b597f48449a7c25f..25256a8b7bb38734c2dabc208556a90408f761b4 100644 (file)
@@ -1881,6 +1881,7 @@ record_arm_to_thumb_glue (info, h)
   register asection *               s;
   char *                            tmp_name;
   struct coff_link_hash_entry *     myh;
+  struct bfd_link_hash_entry *      bh;
   struct coff_arm_link_hash_table * globals;
   bfd_vma val;
   bfd_size_type amt;
@@ -1915,10 +1916,10 @@ record_arm_to_thumb_glue (info, h)
      though the section isn't allocated yet, this is where we will be putting
      it.  */
 
+  bh = NULL;
   val = globals->arm_glue_size + 1;
   bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name,
-                               BSF_GLOBAL, s, val, NULL, true, false,
-                               (struct bfd_link_hash_entry **) & myh);
+                               BSF_GLOBAL, s, val, NULL, true, false, &bh);
 
   free (tmp_name);
 
@@ -1937,6 +1938,7 @@ record_thumb_to_arm_glue (info, h)
   register asection *                s;
   char *                             tmp_name;
   struct coff_link_hash_entry *      myh;
+  struct bfd_link_hash_entry *       bh;
   struct coff_arm_link_hash_table *  globals;
   bfd_vma val;
   bfd_size_type amt;
@@ -1967,12 +1969,13 @@ record_thumb_to_arm_glue (info, h)
       return; /* we've already seen this guy */
     }
 
+  bh = NULL;
   val = globals->thumb_glue_size + 1;
   bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name,
-                               BSF_GLOBAL, s, val, NULL, true, false,
-                               (struct bfd_link_hash_entry **) &myh);
+                               BSF_GLOBAL, s, val, NULL, true, false, &bh);
 
   /* If we mark it 'thumb', the disassembler will do a better job.  */
+  myh = (struct coff_link_hash_entry *) bh;
   myh->class = C_THUMBEXTFUNC;
 
   free (tmp_name);
@@ -1989,11 +1992,10 @@ record_thumb_to_arm_glue (info, h)
 
   sprintf (tmp_name, globals->support_old_code ? BACK_FROM_ARM : CHANGE_TO_ARM, name);
 
-  myh = NULL;
+  bh = NULL;
   val = globals->thumb_glue_size + (globals->support_old_code ? 8 : 4);
   bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name,
-                               BSF_LOCAL, s, val, NULL, true, false,
-                               (struct bfd_link_hash_entry **) & myh);
+                               BSF_LOCAL, s, val, NULL, true, false, &bh);
 
   free (tmp_name);
 
index eb9388fc71ed5d4ad35adc687968317573715ce7..c1302ee878a28d0dc9dfbe6845ee04c47815a1c1 100644 (file)
@@ -1322,6 +1322,9 @@ mark_relocs (finfo, input_bfd)
 
       if ((a->flags & SEC_RELOC) == 0 || a->reloc_count  < 1)
        continue;
+      /* Don't mark relocs in excluded sections.  */
+      if (a->output_section == bfd_abs_section_ptr)
+       continue;
 
       /* Read in the relocs.  */
       internal_relocs = _bfd_coff_read_internal_relocs
index 4aabfedaf53fe59e96ed83863098e4ce0ff85c35..85f1ea2d5c0b62d790e0840c689147b843b3e342 100644 (file)
@@ -934,12 +934,12 @@ case "${targ}" in
     targ_underscore=yes
     ;;
   sh64eb-*-linux*)
-    targ_defvec=bfd_elf32_shblin_vec
-    targ_selvecs="bfd_elf32_shblin_vec bfd_elf32_sh64_vec bfd_elf64_sh64_vec bfd_elf32_sh_vec"
+    targ_defvec=bfd_elf32_sh64blin_vec
+    targ_selvecs="bfd_elf32_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf32_shblin_vec bfd_elf32_shlin_vec"
     ;;
   sh64-*-linux*)
-    targ_defvec=bfd_elf32_shlin_vec
-    targ_selvecs="bfd_elf32_shlin_vec bfd_elf32_sh64l_vec bfd_elf64_sh64l_vec bfd_elf32_shl_vec"
+    targ_defvec=bfd_elf32_sh64lin_vec
+    targ_selvecs="bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf32_shlin_vec bfd_elf32_shblin_vec"
     ;;
 #endif /* BFD64 */
 
index 2ca10f7e37f50b06cc68eb3fc9c3a7f9357ad15c..997eb740d191f3c20c7a5a1524932a36de7aafda 100755 (executable)
@@ -6117,6 +6117,8 @@ do
     # which needs it but does not list it.  Should be fixed in right place.
     bfd_elf32_sh64_vec)                tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
     bfd_elf32_sh64l_vec)       tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+    bfd_elf32_sh64lin_vec)     tb="$tb elf32-sh64-lin.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+    bfd_elf32_sh64blin_vec)    tb="$tb elf32-sh64-lin.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
     bfd_elf32_sh64lnbsd_vec)   tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
     bfd_elf32_sh64nbsd_vec)    tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
     bfd_elf32_sh_vec)          tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
@@ -6153,6 +6155,8 @@ do
     bfd_elf64_s390_vec)                tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_sh64_vec)                tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64l_vec)       tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+    bfd_elf64_sh64lin_vec)     tb="$tb elf64-sh64-lin.lo elf64.lo $elf" target_size=64 ;;
+    bfd_elf64_sh64blin_vec)    tb="$tb elf64-sh64-lin.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64lnbsd_vec)   tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64nbsd_vec)    tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sparc_vec)       tb="$tb elf64-sparc.lo elf64.lo $elf"; target_size=64 ;;
index ba38dd423b2d44c20ac0ab54a487950a88384e21..e6b4f9c9592cc7dddc1389eb84baf63e74ea09d8 100644 (file)
@@ -618,6 +618,8 @@ do
     # which needs it but does not list it.  Should be fixed in right place.
     bfd_elf32_sh64_vec)                tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
     bfd_elf32_sh64l_vec)       tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+    bfd_elf32_sh64lin_vec)     tb="$tb elf32-sh64-lin.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
+    bfd_elf32_sh64blin_vec)    tb="$tb elf32-sh64-lin.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;;
     bfd_elf32_sh64lnbsd_vec)   tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
     bfd_elf32_sh64nbsd_vec)    tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;;
     bfd_elf32_sh_vec)          tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;;
@@ -654,6 +656,8 @@ do
     bfd_elf64_s390_vec)                tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;;
     bfd_elf64_sh64_vec)                tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64l_vec)       tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;;
+    bfd_elf64_sh64lin_vec)     tb="$tb elf64-sh64-lin.lo elf64.lo $elf" target_size=64 ;;
+    bfd_elf64_sh64blin_vec)    tb="$tb elf64-sh64-lin.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64lnbsd_vec)   tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sh64nbsd_vec)    tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;;
     bfd_elf64_sparc_vec)       tb="$tb elf64-sparc.lo elf64.lo $elf"; target_size=64 ;;
index d5343ff31ef25e723196c3b52168c02ab03929bc..75e84c227c6a4cf23eee702c8962387687710709 100644 (file)
@@ -67,11 +67,14 @@ enum
   I_mips4010,
   I_mips4100,
   I_mips4111,
+  I_mips4120,
   I_mips4300,
   I_mips4400,
   I_mips4600,
   I_mips4650,
   I_mips5000,
+  I_mips5400,
+  I_mips5500,
   I_mips6000,
   I_mips8000,
   I_mips10000,
@@ -93,11 +96,14 @@ static const bfd_arch_info_type arch_info_struct[] =
   N (64, 64, bfd_mach_mips4010, "mips:4010",      false, NN(I_mips4010)),
   N (64, 64, bfd_mach_mips4100, "mips:4100",      false, NN(I_mips4100)),
   N (64, 64, bfd_mach_mips4111, "mips:4111",      false, NN(I_mips4111)),
+  N (64, 64, bfd_mach_mips4120, "mips:4120",      false, NN(I_mips4120)),
   N (64, 64, bfd_mach_mips4300, "mips:4300",      false, NN(I_mips4300)),
   N (64, 64, bfd_mach_mips4400, "mips:4400",      false, NN(I_mips4400)),
   N (64, 64, bfd_mach_mips4600, "mips:4600",      false, NN(I_mips4600)),
   N (64, 64, bfd_mach_mips4650, "mips:4650",      false, NN(I_mips4650)),
   N (64, 64, bfd_mach_mips5000, "mips:5000",      false, NN(I_mips5000)),
+  N (64, 64, bfd_mach_mips5400, "mips:5400",      false, NN(I_mips5400)),
+  N (64, 64, bfd_mach_mips5500, "mips:5500",      false, NN(I_mips5500)),
   N (32, 32, bfd_mach_mips6000, "mips:6000",      false, NN(I_mips6000)),
   N (64, 64, bfd_mach_mips8000, "mips:8000",      false, NN(I_mips8000)),
   N (64, 64, bfd_mach_mips10000,"mips:10000",     false, NN(I_mips10000)),
index f20113c7f70e160a1f4496515024c80b957106e7..b04830c22e01e29e2aa26d7bd06ad214c7458b7c 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
+
+       * Makefile.am (BFD_H_DEP): Add simple.c and linker.c.
+       * Makefile.in: Regenerated.
+
 2002-08-29  John David Anglin  <dave@hiauly1.hia.nrc.ca>
 
        * chew.c (paramstuff, outputdots, perform, bang and usage): Remove
index 0787143fcd9de0d24a36eba0ffd063f67f0aeda1..da51daf9cd915c95f0eb3c16e524c732f65219e5 100644 (file)
@@ -248,6 +248,8 @@ BFD_H_DEP = \
        $(srcdir)/../corefile.c         \
        $(srcdir)/../targets.c          \
        $(srcdir)/../format.c           \
+       $(srcdir)/../linker.c           \
+       $(srcdir)/../simple.c           \
        $(srcdir)/header.sed            \
        $(srcdir)/proto.str             \
        $(srcdir)/../version.h          \
index 66a19d1adb88f01d1f2f923966e247e1bfc323ae..d4599e2b6a26f17085a86cea298b9610baa7c59b 100644 (file)
@@ -1,6 +1,6 @@
-# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
 
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -216,6 +216,8 @@ BFD_H_DEP = \
        $(srcdir)/../corefile.c         \
        $(srcdir)/../targets.c          \
        $(srcdir)/../format.c           \
+       $(srcdir)/../linker.c           \
+       $(srcdir)/../simple.c           \
        $(srcdir)/header.sed            \
        $(srcdir)/proto.str             \
        $(srcdir)/../version.h          \
@@ -244,7 +246,7 @@ DIST_COMMON =  ChangeLog Makefile.am Makefile.in
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
-TAR = gtar
+TAR = tar
 GZIP_ENV = --best
 all: all-redirect
 .SUFFIXES:
@@ -330,7 +332,7 @@ uninstall-info:
        else ii=; fi; \
        list='$(INFO_DEPS)'; \
        for file in $$list; do \
-         test -z "$$ii" \
+         test -z "$ii" \
            || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
        done
        @$(NORMAL_UNINSTALL)
index 47b65822340abe7a1f4a5a0c167fb09f8f005ac2..4f129f602f6eafa2c38ffa26c58369e6b20b2788 100644 (file)
@@ -3837,7 +3837,7 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
     = backend->debug_swap.swap_ext_in;
   bfd_size_type external_ext_size = backend->debug_swap.external_ext_size;
   unsigned long ext_count;
-  struct ecoff_link_hash_entry **sym_hash;
+  struct bfd_link_hash_entry **sym_hash;
   char *ext_ptr;
   char *ext_end;
   bfd_size_type amt;
@@ -3846,10 +3846,10 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
 
   amt = ext_count;
   amt *= sizeof (struct bfd_link_hash_entry *);
-  sym_hash = (struct ecoff_link_hash_entry **) bfd_alloc (abfd, amt);
+  sym_hash = (struct bfd_link_hash_entry **) bfd_alloc (abfd, amt);
   if (!sym_hash)
     return false;
-  ecoff_data (abfd)->sym_hashes = sym_hash;
+  ecoff_data (abfd)->sym_hashes = (struct ecoff_link_hash_entry **) sym_hash;
 
   ext_ptr = (char *) external_ext;
   ext_end = ext_ptr + ext_count * external_ext_size;
@@ -3980,15 +3980,13 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext)
 
       name = ssext + esym.asym.iss;
 
-      h = NULL;
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, name,
              (flagword) (esym.weakext ? BSF_WEAK : BSF_GLOBAL),
-             section, value, (const char *) NULL, true, true,
-             (struct bfd_link_hash_entry **) &h)))
+             section, value, (const char *) NULL, true, true, sym_hash)))
        return false;
 
-      *sym_hash = h;
+      h = (struct ecoff_link_hash_entry *) *sym_hash;
 
       /* If we are building an ECOFF hash table, save the external
         symbol information.  */
index b8a300e4a64ae13cc1954d1cc2236e53f1332082..c1e2d118071e25c92919e180b627a680b7d249d6 100644 (file)
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3317,8 +3317,9 @@ map_sections_to_segments (abfd)
        }
       else if (! writable
               && (hdr->flags & SEC_READONLY) == 0
-              && (BFD_ALIGN (last_hdr->lma + last_hdr->_raw_size, maxpagesize)
-                  == hdr->lma))
+              && (((last_hdr->lma + last_hdr->_raw_size - 1)
+                   & ~(maxpagesize - 1))
+                  != (hdr->lma & ~(maxpagesize - 1))))
        {
          /* We don't want to put a writable section in a read only
              segment, unless they are on the same page in memory
index 2d59601fd022aaafec11e29d93b0ce387c5b490c..029bbe2513ba3383d50d6863e9f39ca25a44df60 100644 (file)
@@ -427,6 +427,7 @@ record_arm_to_thumb_glue (link_info, h)
   asection * s;
   char * tmp_name;
   struct elf_link_hash_entry * myh;
+  struct bfd_link_hash_entry * bh;
   struct elf32_arm_link_hash_table * globals;
   bfd_vma val;
 
@@ -460,11 +461,11 @@ record_arm_to_thumb_glue (link_info, h)
   /* The only trick here is using hash_table->arm_glue_size as the value. Even
      though the section isn't allocated yet, this is where we will be putting
      it.  */
+  bh = NULL;
   val = globals->arm_glue_size + 1;
   _bfd_generic_link_add_one_symbol (link_info, globals->bfd_of_glue_owner,
                                    tmp_name, BSF_GLOBAL, s, val,
-                                   NULL, true, false,
-                                   (struct bfd_link_hash_entry **) &myh);
+                                   NULL, true, false, &bh);
 
   free (tmp_name);
 
@@ -482,6 +483,7 @@ record_thumb_to_arm_glue (link_info, h)
   asection *s;
   char *tmp_name;
   struct elf_link_hash_entry *myh;
+  struct bfd_link_hash_entry *bh;
   struct elf32_arm_link_hash_table *hash_table;
   char bind;
   bfd_vma val;
@@ -513,13 +515,14 @@ record_thumb_to_arm_glue (link_info, h)
       return;
     }
 
+  bh = NULL;
   val = hash_table->thumb_glue_size + 1;
   _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner,
                                    tmp_name, BSF_GLOBAL, s, val,
-                                   NULL, true, false,
-                                   (struct bfd_link_hash_entry **) &myh);
+                                   NULL, true, false, &bh);
 
   /* If we mark it 'Thumb', the disassembler will do a better job.  */
+  myh = (struct elf_link_hash_entry *) bh;
   bind = ELF_ST_BIND (myh->type);
   myh->type = ELF_ST_INFO (bind, STT_ARM_TFUNC);
 
@@ -536,13 +539,11 @@ record_thumb_to_arm_glue (link_info, h)
 
   sprintf (tmp_name, CHANGE_TO_ARM, name);
 
-  myh = NULL;
-
+  bh = NULL;
   val = hash_table->thumb_glue_size + 4,
   _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner,
                                    tmp_name, BSF_LOCAL, s, val,
-                                   NULL, true, false,
-                                   (struct bfd_link_hash_entry **) &myh);
+                                   NULL, true, false, &bh);
 
   free (tmp_name);
 
index b71d78eb073dbb46a9f1fb893499153966c0c3ba..483b8a5589aed0311eeb15bc9f0c3c5c7bde2b50 100644 (file)
@@ -2617,36 +2617,40 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
                  BFD_ASSERT (rel->r_offset >= 1);
                  val = bfd_get_8 (input_bfd, contents + rel->r_offset - 1);
                  BFD_ASSERT (rel->r_offset + 4 <= input_section->_raw_size);
-                 if (val != 0xa1)
-                   {
-                     BFD_ASSERT (rel->r_offset >= 2);
-                     type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2);
-                   }
                  if (val == 0xa1)
                    {
                      /* movl foo, %eax.  */
-                     bfd_put_8 (output_bfd, 0xb8, contents + rel->r_offset - 2);
-                   }
-                 else if (type == 0x8b)
-                   {
-                     /* movl */
-                     BFD_ASSERT ((val & 0xc7) == 0x05);
-                     bfd_put_8 (output_bfd, 0xc7,
-                                contents + rel->r_offset - 2);
-                     bfd_put_8 (output_bfd, 0xc0 | ((val >> 3) & 7),
-                                contents + rel->r_offset - 1);
+                     bfd_put_8 (output_bfd, 0xb8, contents + rel->r_offset - 1);
                    }
-                 else if (type == 0x03)
+                 else
                    {
-                     /* addl */
-                     BFD_ASSERT ((val & 0xc7) == 0x05);
-                     bfd_put_8 (output_bfd, 0x81,
-                                contents + rel->r_offset - 2);
-                     bfd_put_8 (output_bfd, 0xc0 | ((val >> 3) & 7),
-                                contents + rel->r_offset - 1);
+                     BFD_ASSERT (rel->r_offset >= 2);
+                     type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2);
+                     switch (type)
+                       {
+                       case 0x8b:
+                         /* movl */
+                         BFD_ASSERT ((val & 0xc7) == 0x05);
+                         bfd_put_8 (output_bfd, 0xc7,
+                                    contents + rel->r_offset - 2);
+                         bfd_put_8 (output_bfd,
+                                    0xc0 | ((val >> 3) & 7),
+                                    contents + rel->r_offset - 1);
+                         break;
+                       case 0x03:
+                         /* addl */
+                         BFD_ASSERT ((val & 0xc7) == 0x05);
+                         bfd_put_8 (output_bfd, 0x81,
+                                    contents + rel->r_offset - 2);
+                         bfd_put_8 (output_bfd,
+                                    0xc0 | ((val >> 3) & 7),
+                                    contents + rel->r_offset - 1);
+                         break;
+                       default:
+                         BFD_FAIL ();
+                         break;
+                       }
                    }
-                 else
-                   BFD_FAIL ();
                  bfd_put_32 (output_bfd, -tpoff (info, relocation),
                              contents + rel->r_offset);
                  continue;
@@ -2926,7 +2930,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
          break;
 
        case R_386_TLS_LDO_32:
-         if (info->shared)
+         if (info->shared || (input_section->flags & SEC_CODE) == 0)
            relocation -= dtpoff_base (info);
          else
            /* When converting LDO to LE, we must negate.  */
index a2e9e0baafe38c380b20ae422ac8b9244a4fb9a6..8adb1e2f61103da7854764f2a649820d7c92382c 100644 (file)
@@ -847,6 +847,7 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
         section already exists a new one is created that follows it which
         screws of _SDA_BASE_ address calcs because output_offset != 0.  */
       struct elf_link_hash_entry *h;
+      struct bfd_link_hash_entry *bh;
       asection *s = bfd_get_section_by_name (abfd, ".sdata");
 
       /* The following code was cobbled from elf32-ppc.c and elflink.c.  */
@@ -863,10 +864,10 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
          bfd_set_section_alignment (abfd, s, 2);
        }
 
-      h = (struct elf_link_hash_entry *)
-       bfd_link_hash_lookup (info->hash, "_SDA_BASE_", false, false, false);
+      bh = bfd_link_hash_lookup (info->hash, "_SDA_BASE_",
+                                false, false, false);
 
-      if ((h == NULL || h->root.type == bfd_link_hash_undefined)
+      if ((bh == NULL || bh->type == bfd_link_hash_undefined)
          && !(_bfd_generic_link_add_one_symbol (info,
                                                 abfd,
                                                 "_SDA_BASE_",
@@ -876,8 +877,9 @@ m32r_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
                                                 (const char *) NULL,
                                                 false,
                                                 get_elf_backend_data (abfd)->collect,
-                                                (struct bfd_link_hash_entry **) &h)))
+                                                &bh)))
        return false;
+      h = (struct elf_link_hash_entry *) bh;
       h->type = STT_OBJECT;
     }
 
index c8bbe7152dbe10b3251c0cd2291181ce8a79a34a..53d2841e6e6f7b45f400391eb5718358dc1302a3 100644 (file)
@@ -59,6 +59,12 @@ static bfd_byte *sh_elf_get_relocated_section_contents
 static void sh_elf_copy_indirect_symbol
   PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *,
           struct elf_link_hash_entry *));
+static int sh_elf_optimized_tls_reloc
+  PARAMS ((struct bfd_link_info *, int, int));
+static boolean sh_elf_mkobject
+  PARAMS((bfd *));
+static boolean sh_elf_object_p
+  PARAMS((bfd *));
 static boolean sh_elf_check_relocs
   PARAMS ((bfd *, struct bfd_link_info *, asection *,
           const Elf_Internal_Rela *));
@@ -82,6 +88,8 @@ static boolean create_got_section
   PARAMS((bfd *, struct bfd_link_info *));
 static boolean sh_elf_create_dynamic_sections
   PARAMS ((bfd *, struct bfd_link_info *));
+static bfd_vma dtpoff_base
+  PARAMS ((struct bfd_link_info *));
 static asection * sh_elf_gc_mark_hook
   PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *,
           struct elf_link_hash_entry *, Elf_Internal_Sym *));
@@ -713,14 +721,119 @@ static reloc_howto_type sh_elf_howto_table[] =
   EMPTY_HOWTO (141),
   EMPTY_HOWTO (142),
   EMPTY_HOWTO (143),
-  EMPTY_HOWTO (144),
-  EMPTY_HOWTO (145),
-  EMPTY_HOWTO (146),
-  EMPTY_HOWTO (147),
-  EMPTY_HOWTO (148),
-  EMPTY_HOWTO (149),
-  EMPTY_HOWTO (150),
-  EMPTY_HOWTO (151),
+
+  HOWTO (R_SH_TLS_GD_32,       /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
+        false,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_bitfield, /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* */
+        "R_SH_TLS_GD_32",      /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_LD_32,       /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
+        false,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_bitfield, /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* */
+        "R_SH_TLS_LD_32",      /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_LDO_32,      /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
+        false,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_bitfield, /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* */
+        "R_SH_TLS_LDO_32",     /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_IE_32,       /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
+        false,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_bitfield, /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* */
+        "R_SH_TLS_IE_32",      /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_LE_32,       /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
+        false,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_bitfield, /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* */
+        "R_SH_TLS_LE_32",      /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_DTPMOD32,    /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
+        false,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_bitfield, /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* */
+        "R_SH_TLS_DTPMOD32",   /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_DTPOFF32,    /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
+        false,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_bitfield, /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* */
+        "R_SH_TLS_DTPOFF32",   /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
+  HOWTO (R_SH_TLS_TPOFF32,     /* type */
+        0,                     /* rightshift */
+        2,                     /* size (0 = byte, 1 = short, 2 = long) */
+        32,                    /* bitsize */
+        false,                 /* pc_relative */
+        0,                     /* bitpos */
+        complain_overflow_bitfield, /* complain_on_overflow */
+        bfd_elf_generic_reloc, /* */
+        "R_SH_TLS_TPOFF32",    /* name */
+        true,                  /* partial_inplace */
+        0xffffffff,            /* src_mask */
+        0xffffffff,            /* dst_mask */
+        false),                /* pcrel_offset */
+
   EMPTY_HOWTO (152),
   EMPTY_HOWTO (153),
   EMPTY_HOWTO (154),
@@ -1776,6 +1889,14 @@ static const struct elf_reloc_map sh_reloc_map[] =
   { BFD_RELOC_VTABLE_ENTRY, R_SH_GNU_VTENTRY },
   { BFD_RELOC_SH_LOOP_START, R_SH_LOOP_START },
   { BFD_RELOC_SH_LOOP_END, R_SH_LOOP_END },
+  { BFD_RELOC_SH_TLS_GD_32, R_SH_TLS_GD_32 },
+  { BFD_RELOC_SH_TLS_LD_32, R_SH_TLS_LD_32 },
+  { BFD_RELOC_SH_TLS_LDO_32, R_SH_TLS_LDO_32 },
+  { BFD_RELOC_SH_TLS_IE_32, R_SH_TLS_IE_32 },
+  { BFD_RELOC_SH_TLS_LE_32, R_SH_TLS_LE_32 },
+  { BFD_RELOC_SH_TLS_DTPMOD32, R_SH_TLS_DTPMOD32 },
+  { BFD_RELOC_SH_TLS_DTPOFF32, R_SH_TLS_DTPOFF32 },
+  { BFD_RELOC_SH_TLS_TPOFF32, R_SH_TLS_TPOFF32 },
   { BFD_RELOC_32_GOT_PCREL, R_SH_GOT32 },
   { BFD_RELOC_32_PLT_PCREL, R_SH_PLT32 },
   { BFD_RELOC_SH_COPY, R_SH_COPY },
@@ -1874,6 +1995,7 @@ sh_elf_info_to_howto (abfd, cache_ptr, dst)
   BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_2 || r > R_SH_LAST_INVALID_RELOC_2);
   BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_3 || r > R_SH_LAST_INVALID_RELOC_3);
   BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_4 || r > R_SH_LAST_INVALID_RELOC_4);
+  BFD_ASSERT (r < R_SH_FIRST_INVALID_RELOC_5 || r > R_SH_LAST_INVALID_RELOC_5);
 
   cache_ptr->howto = &sh_elf_howto_table[r];
 }
@@ -3047,7 +3169,7 @@ static const bfd_byte elf_sh_pic_plt_entry_be[PLT_ENTRY_SIZE] =
   0x6f, 0xf0, 0xff, 0xf0, /* nop */
   0x6f, 0xf0, 0xff, 0xf0, /* nop */
   0xce, 0x00, 0x01, 0x10, /* movi  -GOT_BIAS, r17 */
-  0x00, 0xca, 0x45, 0x10, /* sub.l r12, r17, r17 */
+  0x00, 0xc8, 0x45, 0x10, /* add.l r12, r17, r17 */
   0x89, 0x10, 0x09, 0x90, /* ld.l  r17, 8, r25 */
   0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */
   0x89, 0x10, 0x05, 0x10, /* ld.l  r17, 4, r17 */
@@ -3067,7 +3189,7 @@ static const bfd_byte elf_sh_pic_plt_entry_le[PLT_ENTRY_SIZE] =
   0xf0, 0xff, 0xf0, 0x6f, /* nop */
   0xf0, 0xff, 0xf0, 0x6f, /* nop */
   0x10, 0x01, 0x00, 0xce, /* movi  -GOT_BIAS, r17 */
-  0x10, 0x45, 0xca, 0x00, /* sub.l r12, r17, r17 */
+  0x10, 0x45, 0xc8, 0x00, /* add.l r12, r17, r17 */
   0x90, 0x09, 0x10, 0x89, /* ld.l  r17, 8, r25 */
   0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */
   0x10, 0x05, 0x10, 0x89, /* ld.l  r17, 4, r17 */
@@ -3388,8 +3510,47 @@ struct elf_sh_link_hash_entry
 
   /* Track dynamic relocs copied for this symbol.  */
   struct elf_sh_dyn_relocs *dyn_relocs;
+
+  bfd_signed_vma gotplt_refcount;
+
+  enum {
+    GOT_UNKNOWN = 0, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE
+  } tls_type;
+
+  /* If true, R_SH_TLS_TPOFF32 relocation is generated.  */
+  boolean tls_tpoff32;
 };
 
+#define sh_elf_hash_entry(ent) ((struct elf_sh_link_hash_entry *)(ent))
+
+struct sh_elf_obj_tdata
+{
+  struct elf_obj_tdata root;
+
+  /* tls_type for each local got entry.  */
+  char *local_got_tls_type;
+};
+
+#define sh_elf_tdata(abfd) \
+  ((struct sh_elf_obj_tdata *) (abfd)->tdata.any)
+
+#define sh_elf_local_got_tls_type(abfd) \
+  (sh_elf_tdata (abfd)->local_got_tls_type)
+
+/* Override the generic function because we need to store sh_elf_obj_tdata
+   as the specific tdata.  */
+
+static boolean
+sh_elf_mkobject (abfd)
+     bfd *abfd;
+{
+  bfd_size_type amt = sizeof (struct sh_elf_obj_tdata);
+  abfd->tdata.any = bfd_zalloc (abfd, amt);
+  if (abfd->tdata.any == NULL)
+    return false;
+  return true;
+}
+                 
 /* sh ELF linker hash table.  */
 
 struct elf_sh_link_hash_table
@@ -3407,6 +3568,13 @@ struct elf_sh_link_hash_table
 
   /* Small local sym to section mapping cache.  */
   struct sym_sec_cache sym_sec;
+
+  /* A counter or offset to track a TLS got entry.  */
+  union
+    {
+      bfd_signed_vma refcount;
+      bfd_vma offset;
+    } tls_ldm_got;
 };
 
 /* Traverse an sh ELF linker hash table.  */
@@ -3452,9 +3620,12 @@ sh_elf_link_hash_newfunc (entry, table, string)
 
       eh = (struct elf_sh_link_hash_entry *) ret;
       eh->dyn_relocs = NULL;
+      eh->gotplt_refcount = 0;
 #ifdef INCLUDE_SHMEDIA
       ret->datalabel_got_offset = (bfd_vma) -1;
 #endif
+      ret->tls_type = GOT_UNKNOWN;
+      ret->tls_tpoff32 = false;
     }
 
   return (struct bfd_hash_entry *) ret;
@@ -3488,6 +3659,7 @@ sh_elf_link_hash_table_create (abfd)
   ret->sdynbss = NULL;
   ret->srelbss = NULL;
   ret->sym_sec.abfd = NULL;
+  ret->tls_ldm_got.refcount = 0;
 
   return &ret->root.root;
 }
@@ -3579,13 +3751,16 @@ sh_elf_create_dynamic_sections (abfd, info)
     {
       /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
         .plt section.  */
-      struct elf_link_hash_entry *h = NULL;
+      struct elf_link_hash_entry *h;
+      struct bfd_link_hash_entry *bh = NULL;
+
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
              (bfd_vma) 0, (const char *) NULL, false,
-             get_elf_backend_data (abfd)->collect,
-             (struct bfd_link_hash_entry **) &h)))
+             get_elf_backend_data (abfd)->collect, &bh)))
        return false;
+
+      h = (struct elf_link_hash_entry *) bh;
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
@@ -3867,6 +4042,18 @@ allocate_dynrelocs (h, inf)
   info = (struct bfd_link_info *) inf;
   htab = sh_elf_hash_table (info);
 
+  eh = (struct elf_sh_link_hash_entry *) h;
+  if ((h->got.refcount > 0
+      || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL))
+      && eh->gotplt_refcount > 0)
+    {
+      /* The symbol has been forced local, or we have some direct got refs,
+         so treat all the gotplt refs as got refs. */
+      h->got.refcount += eh->gotplt_refcount;
+      if (h->plt.refcount >= eh->gotplt_refcount)
+       h->plt.refcount -= eh->gotplt_refcount;
+    }
+
   if (htab->root.dynamic_sections_created
       && h->plt.refcount > 0)
     {
@@ -3928,6 +4115,7 @@ allocate_dynrelocs (h, inf)
     {
       asection *s;
       boolean dyn;
+      int tls_type = sh_elf_hash_entry (h)->tls_type;
 
       /* Make sure this symbol is output as a dynamic symbol.
         Undefined weak syms won't yet be marked as dynamic.  */
@@ -3954,14 +4142,23 @@ allocate_dynrelocs (h, inf)
       h->got.offset = s->_raw_size;
 #endif
       s->_raw_size += 4;
+      /* R_SH_TLS_GD needs 2 consecutive GOT slots.  */
+      if (tls_type == GOT_TLS_GD)
+       s->_raw_size += 4;
       dyn = htab->root.dynamic_sections_created;
-      if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
+      /* R_SH_TLS_IE_32 needs one dynamic relocation,
+        R_SH_TLS_GD needs one if local symbol and two if global.  */
+      if ((tls_type == GOT_TLS_GD && h->dynindx == -1)
+         || tls_type == GOT_TLS_IE)
+       htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+      else if (tls_type == GOT_TLS_GD)
+       htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela);
+      else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h))
        htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
     }
   else
     h->got.offset = (bfd_vma) -1;
 
-  eh = (struct elf_sh_link_hash_entry *) h;
   if (eh->dyn_relocs == NULL)
     return true;
 
@@ -3992,6 +4189,9 @@ allocate_dynrelocs (h, inf)
     }
   else
     {
+      if (sh_elf_hash_entry (h)->tls_tpoff32)
+       goto keep;
+
       /* For the non-shared case, discard space for relocs against
         symbols which turn out to need copy relocs or are not
         dynamic.  */
@@ -4099,6 +4299,7 @@ sh_elf_size_dynamic_sections (output_bfd, info)
     {
       bfd_signed_vma *local_got;
       bfd_signed_vma *end_local_got;
+      char *local_tls_type;
       bfd_size_type locsymcount;
       Elf_Internal_Shdr *symtab_hdr;
       asection *srel;
@@ -4144,6 +4345,7 @@ sh_elf_size_dynamic_sections (output_bfd, info)
       locsymcount *= 2;
 #endif
       end_local_got = local_got + locsymcount;
+      local_tls_type = sh_elf_local_got_tls_type (ibfd);
       s = htab->sgot;
       srel = htab->srelgot;
       for (; local_got < end_local_got; ++local_got)
@@ -4152,14 +4354,28 @@ sh_elf_size_dynamic_sections (output_bfd, info)
            {
              *local_got = s->_raw_size;
              s->_raw_size += 4;
+             if (*local_tls_type == GOT_TLS_GD)
+               s->_raw_size += 4;
              if (info->shared)
                srel->_raw_size += sizeof (Elf32_External_Rela);
            }
          else
            *local_got = (bfd_vma) -1;
+         ++local_tls_type;
        }
     }
 
+  if (htab->tls_ldm_got.refcount > 0)
+    {
+      /* Allocate 2 got entries and 1 dynamic reloc for R_SH_TLS_LD_32
+        relocs.  */
+      htab->tls_ldm_got.offset = htab->sgot->_raw_size;
+      htab->sgot->_raw_size += 8;
+      htab->srelgot->_raw_size += sizeof (Elf32_External_Rela);
+    }
+  else
+    htab->tls_ldm_got.offset = -1;
+
   /* Allocate global sym .plt and .got entries, and space for global
      sym dynamic relocs.  */
   elf_link_hash_traverse (&htab->root, allocate_dynrelocs, (PTR) info);
@@ -4295,6 +4511,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
   asection *sgotplt;
   asection *splt;
   asection *sreloc;
+  asection *srelgot;
 
   htab = sh_elf_hash_table (info);
   symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
@@ -4306,6 +4523,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
   sgotplt = htab->sgotplt;
   splt = htab->splt;
   sreloc = NULL;
+  srelgot = NULL;
 
   rel = relocs;
   relend = relocs + input_section->reloc_count;
@@ -4321,6 +4539,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
       bfd_vma addend = (bfd_vma) 0;
       bfd_reloc_status_type r;
       int seen_stt_datalabel = 0;
+      bfd_vma off;
+      int tls_type;
 
       r_symndx = ELF32_R_SYM (rel->r_info);
 
@@ -4342,6 +4562,8 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
              && r_type <= (int) R_SH_LAST_INVALID_RELOC_3)
          || (   r_type >= (int) R_SH_FIRST_INVALID_RELOC_4
              && r_type <= (int) R_SH_LAST_INVALID_RELOC_4)
+         || (   r_type >= (int) R_SH_FIRST_INVALID_RELOC_5
+             && r_type <= (int) R_SH_LAST_INVALID_RELOC_5)
          || (r_type >= (int) R_SH_FIRST_INVALID_RELOC_2
              && r_type <= (int) R_SH_LAST_INVALID_RELOC_2))
        {
@@ -4512,15 +4734,18 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                             with them here.  */
                          || ((input_section->flags & SEC_DEBUGGING) != 0
                              && (h->elf_link_hash_flags
-                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0))))
+                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0)))
+                 || (sec->output_section == NULL
+                     && (sh_elf_hash_entry (h)->tls_type == GOT_TLS_IE
+                         || sh_elf_hash_entry (h)->tls_type == GOT_TLS_GD)))
                relocation = 0;
              else if (sec->output_section == NULL)
                {
                  (*_bfd_error_handler)
-                   (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
+                   (_("%s: unresolvable relocation against symbol `%s' from %s section"),
                     bfd_archive_filename (input_bfd), h->root.root.string,
                     bfd_get_section_name (input_bfd, input_section));
-                 relocation = 0;
+                 return false;
                }
              else
                relocation = ((h->root.u.def.value
@@ -4765,7 +4990,6 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 
          if (h != NULL)
            {
-             bfd_vma off;
              boolean dyn;
 
              off = h->got.offset;
@@ -4823,8 +5047,6 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            }
          else
            {
-             bfd_vma off;
-
 #ifdef INCLUDE_SHMEDIA
              if (rel->r_addend)
                {
@@ -4858,11 +5080,14 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 
                  if (info->shared)
                    {
-                     asection *srelgot;
                      Elf_Internal_Rela outrel;
 
-                     srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
-                     BFD_ASSERT (srelgot != NULL);
+                     if (srelgot == NULL)
+                       {
+                         srelgot = bfd_get_section_by_name (dynobj,
+                                                            ".rela.got");
+                         BFD_ASSERT (srelgot != NULL);
+                       }
 
                      outrel.r_offset = (sgot->output_section->vma
                                         + sgot->output_offset
@@ -4996,6 +5221,450 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                                   rel->r_offset, sec, start, end);
            break;
          }
+
+       case R_SH_TLS_GD_32:
+       case R_SH_TLS_IE_32:
+         r_type = sh_elf_optimized_tls_reloc (info, r_type, h == NULL);
+         tls_type = GOT_UNKNOWN;
+         if (h == NULL && local_got_offsets)
+           tls_type = sh_elf_local_got_tls_type (input_bfd) [r_symndx];
+         else if (h != NULL)
+           {
+             tls_type = sh_elf_hash_entry (h)->tls_type;
+             if (! info->shared
+                 && (h->dynindx == -1
+                     || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))
+                 && (tls_type == GOT_TLS_IE
+                     || sh_elf_hash_entry (h)->tls_tpoff32))
+               r_type = R_SH_TLS_LE_32;
+           }
+
+         if (r_type == R_SH_TLS_GD_32 && tls_type == GOT_TLS_IE)
+           r_type = R_SH_TLS_IE_32;
+
+         if (r_type == R_SH_TLS_LE_32)
+           {
+             bfd_vma offset;
+             unsigned short insn;
+             int indx;
+             Elf_Internal_Rela outrel;
+
+             if (ELF32_R_TYPE (rel->r_info) == R_SH_TLS_GD_32)
+               {
+                 /* GD->LE transition:
+                      mov.l 1f,r4; mova 2f,r0; mov.l 2f,r1; add r0,r1;
+                      jsr @r1; add r12,r4; bra 3f; nop; .align 2; 
+                      1: .long x$TLSGD; 2: .long __tls_get_addr@PLT; 3:
+                    We change it into:
+                      mov.l 1f,r4; stc gbr,r0; add r4,r0; nop;
+                      nop; nop; ...
+                      1: .long x@TPOFF; 2: .long __tls_get_addr@PLT; 3:.  */
+
+                 offset = rel->r_offset;
+                 BFD_ASSERT (offset >= 16);
+                 /* Size of GD instructions is 16 or 18.  */
+                 offset -= 16;
+                 insn = bfd_get_16 (input_bfd, contents + offset + 0);
+                 if ((insn & 0xff00) == 0xc700)
+                   {
+                     BFD_ASSERT (offset >= 2);
+                     offset -= 2;
+                     insn = bfd_get_16 (input_bfd, contents + offset + 0);
+                   }
+
+                 BFD_ASSERT ((insn & 0xff00) == 0xd400);
+                 insn = bfd_get_16 (input_bfd, contents + offset + 2);
+                 BFD_ASSERT ((insn & 0xff00) == 0xc700);
+                 insn = bfd_get_16 (input_bfd, contents + offset + 4);
+                 BFD_ASSERT ((insn & 0xff00) == 0xd100);
+                 insn = bfd_get_16 (input_bfd, contents + offset + 6);
+                 BFD_ASSERT (insn == 0x310c);
+                 insn = bfd_get_16 (input_bfd, contents + offset + 8);
+                 BFD_ASSERT (insn == 0x410b);
+                 insn = bfd_get_16 (input_bfd, contents + offset + 10);
+                 BFD_ASSERT (insn == 0x34cc);
+
+                 bfd_put_16 (output_bfd, 0x0012, contents + offset + 2);
+                 bfd_put_16 (output_bfd, 0x304c, contents + offset + 4);
+                 bfd_put_16 (output_bfd, 0x0009, contents + offset + 6);
+                 bfd_put_16 (output_bfd, 0x0009, contents + offset + 8);
+                 bfd_put_16 (output_bfd, 0x0009, contents + offset + 10);
+               }
+             else
+               {
+                 int index;
+
+                 /* IE->LE transition:
+                    mov.l 1f,r0; stc gbr,rN; mov.l @(r0,r12),rM;
+                    bra 2f; add ...; .align 2; 1: x@GOTTPOFF; 2:
+                    We change it into:
+                    mov.l .Ln,rM; stc gbr,rN; nop; ...;
+                    1: x@TPOFF; 2:.  */
+
+                 offset = rel->r_offset;
+                 BFD_ASSERT (offset >= 16);
+                 /* Size of IE instructions is 10 or 12.  */
+                 offset -= 10;
+                 insn = bfd_get_16 (input_bfd, contents + offset + 0);
+                 if ((insn & 0xf0ff) == 0x0012)
+                   {
+                     BFD_ASSERT (offset >= 2);
+                     offset -= 2;
+                     insn = bfd_get_16 (input_bfd, contents + offset + 0);
+                   }
+
+                 BFD_ASSERT ((insn & 0xff00) == 0xd000);
+                 index = insn & 0x00ff;
+                 insn = bfd_get_16 (input_bfd, contents + offset + 2);
+                 BFD_ASSERT ((insn & 0xf0ff) == 0x0012);
+                 insn = bfd_get_16 (input_bfd, contents + offset + 4);
+                 BFD_ASSERT ((insn & 0xf0ff) == 0x00ce);
+                 insn = 0xd000 | (insn & 0x0f00) | index;
+                 bfd_put_16 (output_bfd, insn, contents + offset + 0);
+                 bfd_put_16 (output_bfd, 0x0009, contents + offset + 4);
+               }
+
+             if (sreloc == NULL)
+               {
+                 const char *name;
+
+                 name = (bfd_elf_string_from_elf_section
+                         (input_bfd,
+                          elf_elfheader (input_bfd)->e_shstrndx,
+                          elf_section_data (input_section)->rel_hdr.sh_name));
+                 if (name == NULL)
+                   return false;
+
+                 BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+                             && strcmp (bfd_get_section_name (input_bfd,
+                                                              input_section),
+                                        name + 5) == 0);
+
+                 sreloc = bfd_get_section_by_name (dynobj, name);
+                 BFD_ASSERT (sreloc != NULL);
+               }
+
+             indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+             outrel.r_offset = (input_section->output_section->vma
+                                + input_section->output_offset
+                                + rel->r_offset);
+             outrel.r_info = ELF32_R_INFO (indx, R_SH_TLS_TPOFF32);
+             if (indx == 0)
+               outrel.r_addend = relocation - dtpoff_base (info);
+             else
+               outrel.r_addend = 0;
+             bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+                                        (((Elf32_External_Rela *)
+                                          sreloc->contents)
+                                         + sreloc->reloc_count));
+             ++sreloc->reloc_count;
+
+             continue;
+           }
+
+         sgot = htab->sgot;
+         if (sgot == NULL)
+           abort ();
+
+         if (h != NULL)
+           off = h->got.offset;
+         else
+           {
+             if (local_got_offsets == NULL)
+               abort ();
+
+             off = local_got_offsets[r_symndx];
+           }
+
+         if ((off & 1) != 0)
+           off &= ~1;
+          else
+           {
+             Elf_Internal_Rela outrel;
+             Elf32_External_Rela *loc;
+             int dr_type, indx;
+
+             if (srelgot == NULL)
+               {
+                 srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+                 BFD_ASSERT (srelgot != NULL);
+               }
+
+             outrel.r_offset = (sgot->output_section->vma
+                                + sgot->output_offset + off);
+
+             indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+             dr_type = (r_type == R_SH_TLS_GD_32 ? R_SH_TLS_DTPMOD32 :
+                        R_SH_TLS_TPOFF32);
+             if (dr_type == R_SH_TLS_TPOFF32 && indx == 0)
+               outrel.r_addend = relocation - dtpoff_base (info);
+             else
+               outrel.r_addend = 0;
+             outrel.r_info = ELF32_R_INFO (indx, dr_type);
+             loc = (Elf32_External_Rela *) srelgot->contents;
+             loc += srelgot->reloc_count++;
+             bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+
+             if (r_type == R_SH_TLS_GD_32)
+               {
+                 if (indx == 0)
+                   {
+                     bfd_put_32 (output_bfd,
+                                 relocation - dtpoff_base (info),
+                                 sgot->contents + off + 4);
+                   }
+                 else
+                   {
+                     outrel.r_info = ELF32_R_INFO (indx,
+                                                   R_SH_TLS_DTPOFF32);
+                     outrel.r_offset += 4;
+                     outrel.r_addend = 0;
+                     srelgot->reloc_count++;
+                     loc++;
+                     bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+                                               loc);
+                   }
+               }
+
+             if (h != NULL)
+               h->got.offset |= 1;
+             else
+               local_got_offsets[r_symndx] |= 1;
+           }
+
+         if (off >= (bfd_vma) -2)
+           abort ();
+
+         if (r_type == (int) ELF32_R_TYPE (rel->r_info))
+           relocation = sgot->output_offset + off;
+         else
+           {
+             bfd_vma offset;
+             unsigned short insn;
+
+             /* GD->IE transition:
+                  mov.l 1f,r4; mova 2f,r0; mov.l 2f,r1; add r0,r1;
+                  jsr @r1; add r12,r4; bra 3f; nop; .align 2;
+                  1: .long x$TLSGD; 2: .long __tls_get_addr@PLT; 3:
+                We change it into:
+                  mov.l 1f,r0; stc gbr,r4; mov.l @(r0,r12),r0; add r4,r0;
+                  nop; nop; bra 3f; nop; .align 2;
+                  1: .long x@TPOFF; 2:...; 3:.  */
+
+             offset = rel->r_offset;
+             BFD_ASSERT (offset >= 16);
+             /* Size of GD instructions is 16 or 18.  */
+             offset -= 16;
+             insn = bfd_get_16 (input_bfd, contents + offset + 0);
+             if ((insn & 0xff00) == 0xc700)
+               {
+                 BFD_ASSERT (offset >= 2);
+                 offset -= 2;
+                 insn = bfd_get_16 (input_bfd, contents + offset + 0);
+               }
+
+             BFD_ASSERT ((insn & 0xff00) == 0xd400);
+
+             /* Replace mov.l 1f,R4 with mov.l 1f,r0.  */
+             bfd_put_16 (output_bfd, insn & 0xf0ff, contents + offset);
+
+             insn = bfd_get_16 (input_bfd, contents + offset + 2);
+             BFD_ASSERT ((insn & 0xff00) == 0xc700);
+             insn = bfd_get_16 (input_bfd, contents + offset + 4);
+             BFD_ASSERT ((insn & 0xff00) == 0xd100);
+             insn = bfd_get_16 (input_bfd, contents + offset + 6);
+             BFD_ASSERT (insn == 0x310c);
+             insn = bfd_get_16 (input_bfd, contents + offset + 8);
+             BFD_ASSERT (insn == 0x410b);
+             insn = bfd_get_16 (input_bfd, contents + offset + 10);
+             BFD_ASSERT (insn == 0x34cc);
+
+             bfd_put_16 (output_bfd, 0x0412, contents + offset + 2);
+             bfd_put_16 (output_bfd, 0x00ce, contents + offset + 4);
+             bfd_put_16 (output_bfd, 0x304c, contents + offset + 6);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 8);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 10);
+
+             bfd_put_32 (output_bfd, sgot->output_offset + off,
+                         contents + rel->r_offset);
+
+             continue;
+         }
+
+         addend = rel->r_addend;
+
+         goto final_link_relocate;
+
+       case R_SH_TLS_LD_32:
+         if (! info->shared)
+           {
+             bfd_vma offset;
+             unsigned short insn;
+
+             /* LD->LE transition:
+                  mov.l 1f,r4; mova 2f,r0; mov.l 2f,r1; add r0,r1;
+                  jsr @r1; add r12,r4; bra 3f; nop; .align 2;
+                  1: .long x$TLSLD; 2: .long __tls_get_addr@PLT; 3:
+                We change it into:
+                  stc gbr,r0; nop; nop; nop;
+                  nop; nop; bra 3f; ...; 3:.  */
+
+             offset = rel->r_offset;
+             BFD_ASSERT (offset >= 16);
+             /* Size of LD instructions is 16 or 18.  */
+             offset -= 16;
+             insn = bfd_get_16 (input_bfd, contents + offset + 0);
+             if ((insn & 0xff00) == 0xc700)
+               {
+                 BFD_ASSERT (offset >= 2);
+                 offset -= 2;
+                 insn = bfd_get_16 (input_bfd, contents + offset + 0);
+               }
+
+             BFD_ASSERT ((insn & 0xff00) == 0xd400);
+             insn = bfd_get_16 (input_bfd, contents + offset + 2);
+             BFD_ASSERT ((insn & 0xff00) == 0xc700);
+             insn = bfd_get_16 (input_bfd, contents + offset + 4);
+             BFD_ASSERT ((insn & 0xff00) == 0xd100);
+             insn = bfd_get_16 (input_bfd, contents + offset + 6);
+             BFD_ASSERT (insn == 0x310c);
+             insn = bfd_get_16 (input_bfd, contents + offset + 8);
+             BFD_ASSERT (insn == 0x410b);
+             insn = bfd_get_16 (input_bfd, contents + offset + 10);
+             BFD_ASSERT (insn == 0x34cc);
+
+             bfd_put_16 (output_bfd, 0x0012, contents + offset + 0);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 2);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 4);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 6);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 8);
+             bfd_put_16 (output_bfd, 0x0009, contents + offset + 10);
+
+             continue;
+           }
+
+         sgot = htab->sgot;
+         if (sgot == NULL)
+           abort ();
+
+         off = htab->tls_ldm_got.offset;
+         if (off & 1)
+           off &= ~1;
+         else
+           {
+             Elf_Internal_Rela outrel;
+             Elf32_External_Rela *loc;
+
+             srelgot = htab->srelgot;
+             if (srelgot == NULL)
+               abort ();
+
+             outrel.r_offset = (sgot->output_section->vma
+                                + sgot->output_offset + off);
+             outrel.r_addend = 0;
+             outrel.r_info = ELF32_R_INFO (0, R_SH_TLS_DTPMOD32);
+             loc = (Elf32_External_Rela *) srelgot->contents;
+             loc += srelgot->reloc_count++;
+             bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc);
+             htab->tls_ldm_got.offset |= 1;
+           }
+
+         relocation = sgot->output_offset + off;
+         addend = rel->r_addend;
+
+         goto final_link_relocate;
+
+       case R_SH_TLS_LDO_32:
+         if (! info->shared)
+           {
+             int indx;
+             Elf_Internal_Rela outrel;
+
+             if (sreloc == NULL)
+               {
+                 const char *name;
+
+                 name = (bfd_elf_string_from_elf_section
+                         (input_bfd,
+                          elf_elfheader (input_bfd)->e_shstrndx,
+                          elf_section_data (input_section)->rel_hdr.sh_name));
+                 if (name == NULL)
+                   return false;
+
+                 BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+                             && strcmp (bfd_get_section_name (input_bfd,
+                                                              input_section),
+                                        name + 5) == 0);
+
+                 sreloc = bfd_get_section_by_name (dynobj, name);
+                 BFD_ASSERT (sreloc != NULL);
+               }
+
+             indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+             outrel.r_offset = (input_section->output_section->vma
+                                + input_section->output_offset
+                                + rel->r_offset);
+             outrel.r_info = ELF32_R_INFO (indx, R_SH_TLS_TPOFF32);
+             if (indx == 0)
+               outrel.r_addend = relocation - dtpoff_base (info);
+             else
+               outrel.r_addend = 0;
+             bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+                                        (((Elf32_External_Rela *)
+                                          sreloc->contents)
+                                         + sreloc->reloc_count));
+             ++sreloc->reloc_count;
+
+             continue;
+           }
+         else
+           relocation -= dtpoff_base (info);
+
+         addend = rel->r_addend;
+         goto final_link_relocate;
+
+       case R_SH_TLS_LE_32:
+         {
+           int indx;
+           Elf_Internal_Rela outrel;
+
+           if (sreloc == NULL)
+             {
+               const char *name;
+
+               name = (bfd_elf_string_from_elf_section
+                       (input_bfd,
+                        elf_elfheader (input_bfd)->e_shstrndx,
+                        elf_section_data (input_section)->rel_hdr.sh_name));
+               if (name == NULL)
+                 return false;
+
+               BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+                           && strcmp (bfd_get_section_name (input_bfd,
+                                                            input_section),
+                                      name + 5) == 0);
+
+               sreloc = bfd_get_section_by_name (dynobj, name);
+               BFD_ASSERT (sreloc != NULL);
+             }
+
+           indx = (h && h->dynindx != -1) ? h->dynindx : 0;
+           outrel.r_offset = (input_section->output_section->vma
+                              + input_section->output_offset
+                              + rel->r_offset);
+           outrel.r_info = ELF32_R_INFO (indx, R_SH_TLS_TPOFF32);
+           if (indx == 0)
+             outrel.r_addend = relocation - dtpoff_base (info);
+           else
+             outrel.r_addend = 0;
+           bfd_elf32_swap_reloca_out (output_bfd, &outrel,
+                                      (((Elf32_External_Rela *)
+                                        sreloc->contents)
+                                       + sreloc->reloc_count));
+           ++sreloc->reloc_count;
+
+           continue;
+         }
        }
 
     relocation_done:
@@ -5143,6 +5812,20 @@ sh_elf_get_relocated_section_contents (output_bfd, link_info, link_order,
   return NULL;
 }
 
+/* Return the base VMA address which should be subtracted from real addresses
+   when resolving @dtpoff relocation.
+   This is PT_TLS segment p_vaddr.  */
+
+static bfd_vma
+dtpoff_base (info)
+     struct bfd_link_info *info;
+{
+ /* If tls_segment is NULL, we should have signalled an error already.  */
+ if (elf_hash_table (info)->tls_segment == NULL)
+   return 0;
+  return elf_hash_table (info)->tls_segment->start;
+}
+
 static asection *
 sh_elf_gc_mark_hook (sec, info, rel, h, sym)
      asection *sec;
@@ -5200,6 +5883,7 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
   const Elf_Internal_Rela *rel, *relend;
   unsigned long r_symndx;
   struct elf_link_hash_entry *h;
+  struct elf_sh_link_hash_entry *eh;
 
   elf_section_data (sec)->local_dynrel = NULL;
 
@@ -5209,8 +5893,15 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
 
   relend = relocs + sec->reloc_count;
   for (rel = relocs; rel < relend; rel++)
-    switch (ELF32_R_TYPE (rel->r_info))
+    switch (sh_elf_optimized_tls_reloc (info, ELF32_R_TYPE (rel->r_info),
+                                  ELF32_R_SYM (rel->r_info)
+                                  >= symtab_hdr->sh_info))
       {
+      case R_SH_TLS_LD_32:
+       if (sh_elf_hash_table (info)->tls_ldm_got.refcount > 0)
+         sh_elf_hash_table (info)->tls_ldm_got.refcount -= 1;
+       break;
+
       case R_SH_GOT32:
       case R_SH_GOTOFF:
       case R_SH_GOTPC:
@@ -5230,6 +5921,8 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
       case R_SH_GOTPC_MEDHI16:
       case R_SH_GOTPC_HI16:
 #endif
+      case R_SH_TLS_GD_32:
+      case R_SH_TLS_IE_32:
        r_symndx = ELF32_R_SYM (rel->r_info);
        if (r_symndx >= symtab_hdr->sh_info)
          {
@@ -5302,10 +5995,15 @@ sh_elf_gc_sweep_hook (abfd, info, sec, relocs)
        if (r_symndx >= symtab_hdr->sh_info)
          {
            h = sym_hashes[r_symndx - symtab_hdr->sh_info];
-           if (h->got.refcount > 0)
+           eh = (struct elf_sh_link_hash_entry *) h;
+           if (eh->gotplt_refcount > 0)
+             {
+               eh->gotplt_refcount -= 1;
+               if (h->plt.refcount > 0)
+                 h->plt.refcount -= 1;
+             }
+           else if (h->got.refcount > 0)
              h->got.refcount -= 1;
-           if (h->plt.refcount > 0)
-             h->plt.refcount -= 1;
          }
        else if (local_got_refcounts != NULL)
          {
@@ -5365,10 +6063,42 @@ sh_elf_copy_indirect_symbol (bed, dir, ind)
       edir->dyn_relocs = eind->dyn_relocs;
       eind->dyn_relocs = NULL;
     }
+  edir->gotplt_refcount = eind->gotplt_refcount;
+  eind->gotplt_refcount = 0;
+
+  if (ind->root.type == bfd_link_hash_indirect
+      && dir->got.refcount <= 0)
+    {
+      edir->tls_type = eind->tls_type;
+      eind->tls_type = GOT_UNKNOWN;
+    }
 
   _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
 }
 
+static int
+sh_elf_optimized_tls_reloc (info, r_type, is_local)
+     struct bfd_link_info *info;
+     int r_type;
+     int is_local;
+{
+  if (info->shared)
+    return r_type;
+
+  switch (r_type)
+    {
+    case R_SH_TLS_GD_32:
+    case R_SH_TLS_IE_32:
+      if (is_local)
+       return R_SH_TLS_LE_32;
+      return R_SH_TLS_IE_32;
+    case R_SH_TLS_LD_32:
+      return R_SH_TLS_LE_32;
+    }
+
+  return r_type;
+}
+
 /* Look through the relocs for a section during the first phase.
    Since we don't do .gots or .plts, we just need to consider the
    virtual table relocs for gc.  */
@@ -5390,6 +6120,8 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
   asection *sgot;
   asection *srelgot;
   asection *sreloc;
+  unsigned int r_type;
+  int tls_type, old_tls_type;
 
   sgot = NULL;
   srelgot = NULL;
@@ -5415,15 +6147,27 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
       unsigned long r_symndx;
 
       r_symndx = ELF32_R_SYM (rel->r_info);
+      r_type = ELF32_R_TYPE (rel->r_info);
+
       if (r_symndx < symtab_hdr->sh_info)
        h = NULL;
       else
        h = sym_hashes[r_symndx - symtab_hdr->sh_info];
 
+      r_type = sh_elf_optimized_tls_reloc (info, r_type, h == NULL);
+      if (! info->shared
+         && r_type == R_SH_TLS_IE_32
+         && h != NULL
+         && h->root.type != bfd_link_hash_undefined
+         && h->root.type != bfd_link_hash_undefweak
+         && (h->dynindx == -1
+             || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
+       r_type = R_SH_TLS_LE_32;
+
       /* Some relocs require a global offset table.  */
       if (htab->sgot == NULL)
        {
-         switch (ELF32_R_TYPE (rel->r_info))
+         switch (r_type)
            {
            case R_SH_GOTPLT32:
            case R_SH_GOT32:
@@ -5451,6 +6195,9 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
            case R_SH_GOTPC_MEDHI16:
            case R_SH_GOTPC_HI16:
 #endif
+           case R_SH_TLS_GD_32:
+           case R_SH_TLS_LD_32:
+           case R_SH_TLS_IE_32:
              if (dynobj == NULL)
                htab->root.dynobj = dynobj = abfd;
              if (! create_got_section (dynobj, info))
@@ -5462,7 +6209,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
            }
        }
 
-      switch (ELF32_R_TYPE (rel->r_info))
+      switch (r_type)
        {
          /* This relocation describes the C++ object vtable hierarchy.
             Reconstruct it for later use during GC.  */
@@ -5479,6 +6226,12 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
          break;
 
        force_got:
+       case R_SH_TLS_IE_32:
+         if (info->shared)
+           info->flags |= DF_STATIC_TLS;
+
+         /* FALLTHROUGH */
+       case R_SH_TLS_GD_32:
        case R_SH_GOT32:
 #ifdef INCLUDE_SHMEDIA
        case R_SH_GOT_LOW16:
@@ -5488,8 +6241,24 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
        case R_SH_GOT10BY4:
        case R_SH_GOT10BY8:
 #endif
+         switch (r_type)
+           {
+           default:
+             tls_type = GOT_NORMAL;
+             break;
+           case R_SH_TLS_GD_32:
+             tls_type = GOT_TLS_GD;
+             break;
+           case R_SH_TLS_IE_32:
+             tls_type = GOT_TLS_IE;
+             break;
+           }
+
          if (h != NULL)
-           h->got.refcount += 1;
+           {
+             h->got.refcount += 1;
+             old_tls_type = sh_elf_hash_entry (h)->tls_type;
+           }
          else
            {
              bfd_signed_vma *local_got_refcounts;
@@ -5508,14 +6277,54 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
                     codelabel local GOT offsets.  */
                  size *= 2;
 #endif
+                 size += symtab_hdr->sh_info;
                  local_got_refcounts = ((bfd_signed_vma *)
                                         bfd_zalloc (abfd, size));
                  if (local_got_refcounts == NULL)
                    return false;
                  elf_local_got_refcounts (abfd) = local_got_refcounts;
+#ifdef         INCLUDE_SHMEDIA
+                 /* Take care of both the datalabel and codelabel local
+                    GOT offsets.  */
+                 sh_elf_local_got_tls_type (abfd)
+                   = (char *) (local_got_refcounts + 2 * symtab_hdr->sh_info);
+#else
+                 sh_elf_local_got_tls_type (abfd)
+                   = (char *) (local_got_refcounts + symtab_hdr->sh_info);
+#endif
                }
              local_got_refcounts[r_symndx] += 1;
+             old_tls_type = sh_elf_local_got_tls_type (abfd) [r_symndx];
+           }
+
+         /* If a TLS symbol is accessed using IE at least once,
+            there is no point to use dynamic model for it.  */
+         if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN
+             && (old_tls_type != GOT_TLS_GD || tls_type != GOT_TLS_IE))
+           {
+             if (old_tls_type == GOT_TLS_IE && tls_type == GOT_TLS_GD)
+               tls_type = GOT_TLS_IE;
+             else
+               {
+                 (*_bfd_error_handler)
+                   (_("%s: `%s' accessed both as normal and thread local symbol"),
+                    bfd_archive_filename (abfd), h->root.root.string);
+                 return false;
+               }
            }
+
+         if (old_tls_type != tls_type)
+           {
+             if (h != NULL)
+               sh_elf_hash_entry (h)->tls_type = tls_type;
+             else
+               sh_elf_local_got_tls_type (abfd) [r_symndx] = tls_type;
+           }
+
+         break;
+
+       case R_SH_TLS_LD_32:
+         sh_elf_hash_table(info)->tls_ldm_got.refcount += 1;
          break;
 
        case R_SH_GOTPLT32:
@@ -5539,6 +6348,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
 
          h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT;
          h->plt.refcount += 1;
+         ((struct elf_sh_link_hash_entry *) h)->gotplt_refcount += 1;
 
          break;
 
@@ -5597,7 +6407,7 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
             symbol.  */
          if ((info->shared
               && (sec->flags & SEC_ALLOC) != 0
-              && (ELF32_R_TYPE (rel->r_info) != R_SH_REL32
+              && (r_type != R_SH_REL32
                   || (h != NULL
                       && (! info->symbolic
                           || h->root.type == bfd_link_hash_defweak
@@ -5687,11 +6497,110 @@ sh_elf_check_relocs (abfd, info, sec, relocs)
                }
 
              p->count += 1;
-             if (ELF32_R_TYPE (rel->r_info) == R_SH_REL32)
+             if (r_type == R_SH_REL32)
                p->pc_count += 1;
            }
 
          break;
+
+       case R_SH_TLS_LE_32:
+         if (info->shared)
+           {
+             (*_bfd_error_handler) (_("%s: TLS local exec code cannot be linked into shared objects"),
+                                    bfd_archive_filename (abfd));
+             return false;
+           }
+
+         if (ELF32_R_TYPE (rel->r_info) == R_SH_TLS_LD_32)
+           break;
+
+         /* FALLTHROUGH */
+       case R_SH_TLS_LDO_32:
+         /* We make a R_SH_TLS_TPOFF32 relocation. Count it as a
+            copy relocation.  */
+         if (! info->shared)
+           {
+             struct elf_sh_dyn_relocs *p;
+             struct elf_sh_dyn_relocs **head;
+
+             if (dynobj == NULL)
+               htab->root.dynobj = dynobj = abfd;
+
+             if (sreloc == NULL)
+               {
+                 const char *name;
+
+                 name = (bfd_elf_string_from_elf_section
+                         (abfd,
+                          elf_elfheader (abfd)->e_shstrndx,
+                          elf_section_data (sec)->rel_hdr.sh_name));
+                 if (name == NULL)
+                   return false;
+
+                 BFD_ASSERT (strncmp (name, ".rela", 5) == 0
+                             && strcmp (bfd_get_section_name (abfd, sec),
+                                        name + 5) == 0);
+
+                 sreloc = bfd_get_section_by_name (dynobj, name);
+                 if (sreloc == NULL)
+                   {
+                     flagword flags;
+
+                     sreloc = bfd_make_section (dynobj, name);
+                     flags = (SEC_HAS_CONTENTS | SEC_READONLY
+                              | SEC_IN_MEMORY | SEC_LINKER_CREATED);
+                     if ((sec->flags & SEC_ALLOC) != 0)
+                       flags |= SEC_ALLOC | SEC_LOAD;
+                     if (sreloc == NULL
+                         || ! bfd_set_section_flags (dynobj, sreloc, flags)
+                         || ! bfd_set_section_alignment (dynobj, sreloc, 2))
+                       return false;
+                   }
+                 elf_section_data (sec)->sreloc = sreloc;
+                 if (sec->flags & SEC_READONLY)
+                   info->flags |= DF_TEXTREL;
+               }
+
+             /* If this is a global symbol, we count the number of
+                relocations we need for this symbol.  */
+             if (h != NULL)
+               head = &((struct elf_sh_link_hash_entry *) h)->dyn_relocs;
+             else
+               {
+                 asection *s;
+
+                 /* Track dynamic relocs needed for local syms too.  */
+                 s = bfd_section_from_r_symndx (abfd, &htab->sym_sec,
+                                                sec, r_symndx);
+                 if (s == NULL)
+                   return false;
+
+                 head = ((struct elf_sh_dyn_relocs **)
+                         &elf_section_data (s)->local_dynrel);
+               }
+
+             p = *head;
+             if (p == NULL || p->sec != sec)
+               {
+                 bfd_size_type amt = sizeof (*p);
+                 p = ((struct elf_sh_dyn_relocs *) bfd_alloc (dynobj, amt));
+                 if (p == NULL)
+                   return false;
+                 p->next = *head;
+                 *head = p;
+                 p->sec = sec;
+                 p->count = 0;
+                 p->pc_count = 0;
+               }
+
+             p->count += 1;
+             if (h)
+               sh_elf_hash_entry (h)->tls_tpoff32 = true;
+           }
+         break;
+
+       default:
+         break;
        }
     }
 
@@ -5812,6 +6721,29 @@ sh_elf_merge_private_data (ibfd, obfd)
 }
 #endif /* not sh_elf_merge_private_data */
 
+/* Override the generic function because we need to store sh_elf_obj_tdata
+   as the specific tdata.  We set also the machine architecture from flags
+   here.  */
+
+static boolean
+sh_elf_object_p (abfd)
+  bfd *abfd;
+{
+  struct sh_elf_obj_tdata *new_tdata;
+  bfd_size_type amt = sizeof (struct sh_elf_obj_tdata);
+
+  if (sh_elf_set_mach_from_flags (abfd) == false)
+    return false;
+
+  /* Allocate our special target data.  */
+  new_tdata = bfd_zalloc (abfd, amt);
+  if (new_tdata == NULL)
+    return false;
+  new_tdata->root = *abfd->tdata.elf_obj_data;
+  abfd->tdata.any = new_tdata;
+  return true;
+}
+
 /* Finish up dynamic symbol handling.  We set the contents of various
    dynamic sections here.  */
 
@@ -5968,7 +6900,9 @@ sh_elf_finish_dynamic_symbol (output_bfd, info, h, sym)
        }
     }
 
-  if (h->got.offset != (bfd_vma) -1)
+  if (h->got.offset != (bfd_vma) -1
+      && sh_elf_hash_entry (h)->tls_type != GOT_TLS_GD
+      && sh_elf_hash_entry (h)->tls_type != GOT_TLS_IE)
     {
       asection *sgot;
       asection *srel;
@@ -6257,7 +7191,8 @@ sh_elf_reloc_type_class (rela)
 #define elf_backend_relocate_section   sh_elf_relocate_section
 #define bfd_elf32_bfd_get_relocated_section_contents \
                                        sh_elf_get_relocated_section_contents
-#define elf_backend_object_p           sh_elf_set_mach_from_flags
+#define bfd_elf32_mkobject             sh_elf_mkobject
+#define elf_backend_object_p           sh_elf_object_p
 #define bfd_elf32_bfd_set_private_bfd_flags \
                                        sh_elf_set_private_flags
 #define bfd_elf32_bfd_copy_private_bfd_data \
index 7a38fb22410a0c782e2229b5436e9da248c53813..844a6a43e279162f5b38786781af17a1fbb9815b 100644 (file)
@@ -411,16 +411,19 @@ sh64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
       if (h == NULL)
        {
          /* No previous datalabel symbol.  Make one.  */
+         struct bfd_link_hash_entry *bh = NULL;
+         struct elf_backend_data *bed = get_elf_backend_data (abfd);
+
          if (! _bfd_generic_link_add_one_symbol (info, abfd, dl_name,
                                                  flags, *secp, *valp,
                                                  *namep, false,
-                                                 get_elf_backend_data (abfd)->collect,
-                                                 (struct bfd_link_hash_entry **) &h))
+                                                 bed->collect, &bh))
            {
              free (dl_name);
              return false;
            }
 
+         h = (struct elf_link_hash_entry *) bh;
          h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
          h->type = STT_DATALABEL;
        }
index 068578bb24575bed2f9d1020b7c2f3858463e194..0d42b728f4093ed6d55bd3c1e3a7e11343d1039b 100644 (file)
@@ -417,6 +417,11 @@ struct elf_vax_link_hash_table
 static boolean elf_vax_discard_copies
   PARAMS ((struct elf_vax_link_hash_entry *, PTR));
 
+/* Declare this now that the above structures are defined.  */
+
+static boolean elf_vax_instantiate_got_entries
+  PARAMS ((struct elf_link_hash_entry *, PTR));
+
 /* Traverse an VAX ELF linker hash table.  */
 
 #define elf_vax_link_hash_traverse(table, func, info)                  \
@@ -567,7 +572,6 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
   bfd *dynobj;
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes;
-  bfd_signed_vma *local_got_refcounts;
   const Elf_Internal_Rela *rel;
   const Elf_Internal_Rela *rel_end;
   asection *sgot;
@@ -580,7 +584,6 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
   dynobj = elf_hash_table (info)->dynobj;
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
-  local_got_refcounts = elf_local_got_refcounts (abfd);
 
   sgot = NULL;
   srelgot = NULL;
@@ -651,18 +654,6 @@ elf_vax_check_relocs (abfd, info, sec, relocs)
                {
                  h->got.refcount = 1;
                  eh->got_addend = rel->r_addend;
-
-                 /* Make sure this symbol is output as a dynamic symbol.  */
-                 if (h->dynindx == -1)
-                   {
-                     if (!bfd_elf32_link_record_dynamic_symbol (info, h))
-                       return false;
-                   }
-
-                 /* Allocate space in the .got section.  */
-                 sgot->_raw_size += 4;
-                 /* Allocate relocation space.  */
-                 srelgot->_raw_size += sizeof (Elf32_External_Rela);
                }
              else
                {
@@ -900,25 +891,18 @@ elf_vax_gc_sweep_hook (abfd, info, sec, relocs)
 {
   Elf_Internal_Shdr *symtab_hdr;
   struct elf_link_hash_entry **sym_hashes;
-  bfd_signed_vma *local_got_refcounts;
   const Elf_Internal_Rela *rel, *relend;
   unsigned long r_symndx;
   struct elf_link_hash_entry *h;
   bfd *dynobj;
-  asection *sgot;
-  asection *srelgot;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
   sym_hashes = elf_sym_hashes (abfd);
-  local_got_refcounts = elf_local_got_refcounts (abfd);
 
   dynobj = elf_hash_table (info)->dynobj;
   if (dynobj == NULL)
     return true;
 
-  sgot = bfd_get_section_by_name (dynobj, ".got");
-  srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
-
   relend = relocs + sec->reloc_count;
   for (rel = relocs; rel < relend; rel++)
     {
@@ -930,29 +914,7 @@ elf_vax_gc_sweep_hook (abfd, info, sec, relocs)
            {
              h = sym_hashes[r_symndx - symtab_hdr->sh_info];
              if (h->got.refcount > 0)
-               {
-                 --h->got.refcount;
-                 if (h->got.refcount == 0)
-                   {
-                     /* We don't need the .got entry any more.  */
-                     sgot->_raw_size -= 4;
-                     srelgot->_raw_size -= sizeof (Elf32_External_Rela);
-                   }
-               }
-           }
-         else if (local_got_refcounts != NULL)
-           {
-             if (local_got_refcounts[r_symndx] > 0)
-               {
-                 --local_got_refcounts[r_symndx];
-                 if (local_got_refcounts[r_symndx] == 0)
-                   {
-                     /* We don't need the .got entry any more.  */
-                     sgot->_raw_size -= 4;
-                     if (info->shared)
-                       srelgot->_raw_size -= sizeof (Elf32_External_Rela);
-                   }
-               }
+               --h->got.refcount;
            }
          break;
 
@@ -1219,8 +1181,15 @@ elf_vax_size_dynamic_sections (output_bfd, info)
      fill them in in the relocate_section routine.  */
   if (info->shared && info->symbolic)
     elf_vax_link_hash_traverse (elf_vax_hash_table (info),
-                                elf_vax_discard_copies,
-                                (PTR) NULL);
+                               elf_vax_discard_copies,
+                               (PTR) NULL);
+
+  /* If this is a -Bsymbolic shared link or a static link, we need to 
+     discard all the got entries we've recorded.  Otherwise, we need to
+     instantiate (allocate space for them).  */
+  elf_link_hash_traverse (elf_hash_table (info),
+                         elf_vax_instantiate_got_entries,
+                         (PTR) info);
 
   /* The check_relocs and adjust_dynamic_symbol entry points have
      determined the sizes of the various dynamic sections.  Allocate
@@ -1390,6 +1359,60 @@ elf_vax_discard_copies (h, ignore)
   return true;
 }
 
+/* This function is called via elf_link_hash_traverse.  It looks for entries
+   that have GOT or PLT (.GOT) references.  If creating a static object or a
+   shared object with -Bsymbolic, it resets the reference count back to 0
+   and sets the offset to -1 so normal PC32 relocation will be done.  If
+   creating a shared object or executable, space in the .got and .rela.got
+   will be reserved for the symbol.  */
+
+/*ARGSUSED*/
+static boolean
+elf_vax_instantiate_got_entries (h, infoptr)
+     struct elf_link_hash_entry *h;
+     PTR infoptr;
+{
+  struct bfd_link_info *info = (struct bfd_link_info *) infoptr;
+  bfd *dynobj;
+  asection *sgot;
+  asection *srelgot;
+  
+  /* We don't care about non-GOT (and non-PLT) entries.  */
+  if (h->got.refcount <= 0 && h->plt.refcount <= 0)
+    return true;
+
+  dynobj = elf_hash_table (info)->dynobj;
+  if (dynobj == NULL)
+    return true;
+
+  sgot = bfd_get_section_by_name (dynobj, ".got");
+  srelgot = bfd_get_section_by_name (dynobj, ".rela.got");
+
+  if (!elf_hash_table (info)->dynamic_sections_created
+      || (info->shared && info->symbolic))
+    {
+      h->got.refcount = 0;
+      h->got.offset = (bfd_vma) -1;
+      h->plt.refcount = 0;
+      h->plt.offset = (bfd_vma) -1;
+    }
+  else if (h->got.refcount > 0)
+    {
+      /* Make sure this symbol is output as a dynamic symbol.  */
+      if (h->dynindx == -1)
+       {
+         if (!bfd_elf32_link_record_dynamic_symbol (info, h))
+           return false;
+       }
+
+      /* Allocate space in the .got and .rela.got sections.  */
+      sgot->_raw_size += 4;
+      srelgot->_raw_size += sizeof (Elf32_External_Rela);
+    }
+
+  return true;
+}
+
 /* Relocate an VAX ELF section.  */
 
 static boolean
@@ -1537,8 +1560,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
        case R_VAX_GOT32:
          /* Relocation is to the address of the entry for this symbol
             in the global offset table.  */
-         if (h != NULL
-             && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
+         if (h == NULL || h->got.offset == (bfd_vma) -1)
            break;
 
          /* Relocation is the offset of the entry for this symbol in
@@ -1547,18 +1569,6 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
          {
            bfd_vma off;
 
-           if (!elf_hash_table (info)->dynamic_sections_created
-               || (h == NULL)
-               || (info->shared
-                && info->symbolic
-                && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)))
-             {
-               /* This is actually a static link, or it is a -Bsymbolic link
-                  and the symbol is defined locally or there is no symbol.
-                  Change the GOT32 entry to a PC32 entry.  */
-               break;
-             }
-
            if (sgot == NULL)
              {
                sgot = bfd_get_section_by_name (dynobj, ".got");
@@ -1568,6 +1578,7 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
            BFD_ASSERT (h != NULL);
            off = h->got.offset;
            BFD_ASSERT (off != (bfd_vma) -1);
+           BFD_ASSERT (off < sgot->_raw_size);
 
            if (info->shared
                && h->dynindx == -1
@@ -1596,15 +1607,12 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
              }
 
            relocation = sgot->output_offset + off;
-           /* Neither GOT relocation uses the addend.  */
+           /* The GOT relocation uses the addend.  */
            rel->r_addend = 0;
 
-           if (r_type == R_VAX_GOT32)
-             {
-               /* Change the reference to be indirect */
-               contents[rel->r_offset - 1] |= 0x10;
-               relocation += sgot->output_section->vma;
-             }
+           /* Change the reference to be indirect.  */
+           contents[rel->r_offset - 1] |= 0x10;
+           relocation += sgot->output_section->vma;
          }
          break;
 
@@ -1828,11 +1836,11 @@ elf_vax_relocate_section (output_bfd, info, input_bfd, input_section,
          break;
        }
 
-      /* VAX PCREL relocations are from the end of relocation, not the start */
+      /* VAX PCREL relocations are from the end of relocation, not the start.  
+         So subtract the difference from the relocation amount since we can't
+         add it to the offset.  */
       if (howto->pc_relative && howto->pcrel_offset)
-       {
-         relocation -= bfd_get_reloc_size(howto);
-       }
+       relocation -= bfd_get_reloc_size(howto);
 
       r = _bfd_final_link_relocate (howto, input_bfd, input_section,
                                    contents, rel->r_offset,
index e1d095d523125c54d7ebf43ac15013570297911e..59730173603f606cea6482c58b1bc3aa17f92c73 100644 (file)
@@ -2480,6 +2480,7 @@ elf64_alpha_create_dynamic_sections (abfd, info)
 {
   asection *s;
   struct elf_link_hash_entry *h;
+  struct bfd_link_hash_entry *bh;
 
   /* We need to create .plt, .rela.plt, .got, and .rela.got sections.  */
 
@@ -2495,13 +2496,13 @@ elf64_alpha_create_dynamic_sections (abfd, info)
 
   /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
      .plt section.  */
-  h = NULL;
+  bh = NULL;
   if (! (_bfd_generic_link_add_one_symbol
         (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
          (bfd_vma) 0, (const char *) NULL, false,
-         get_elf_backend_data (abfd)->collect,
-         (struct bfd_link_hash_entry **) &h)))
+         get_elf_backend_data (abfd)->collect, &bh)))
     return false;
+  h = (struct elf_link_hash_entry *) bh;
   h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
 
@@ -2539,13 +2540,13 @@ elf64_alpha_create_dynamic_sections (abfd, info)
      dynobj's .got section.  We don't do this in the linker script
      because we don't want to define the symbol if we are not creating
      a global offset table.  */
-  h = NULL;
+  bh = NULL;
   if (!(_bfd_generic_link_add_one_symbol
        (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL,
         alpha_elf_tdata(abfd)->got, (bfd_vma) 0, (const char *) NULL,
-        false, get_elf_backend_data (abfd)->collect,
-        (struct bfd_link_hash_entry **) &h)))
+        false, get_elf_backend_data (abfd)->collect, &bh)))
     return false;
+  h = (struct elf_link_hash_entry *) bh;
   h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
 
index 91610aae7e8782580395211a48fb491f932ec7f8..da7c53f6e3a33eef83dd60a64921fcca3457664e 100644 (file)
@@ -3166,6 +3166,7 @@ func_desc_adjust (h, inf)
        {
          bfd *abfd;
          asymbol *newsym;
+         struct bfd_link_hash_entry *bh;
 
          abfd = h->root.u.undef.abfd;
          newsym = bfd_make_empty_symbol (abfd);
@@ -3176,13 +3177,14 @@ func_desc_adjust (h, inf)
          if (h->root.type == bfd_link_hash_undefweak)
            newsym->flags |= BSF_WEAK;
 
+         bh = &fdh->root;
          if ( !(_bfd_generic_link_add_one_symbol
                 (info, abfd, newsym->name, newsym->flags,
-                 newsym->section, newsym->value, NULL, false, false,
-                 (struct bfd_link_hash_entry **) &fdh)))
+                 newsym->section, newsym->value, NULL, false, false, &bh)))
            {
              return false;
            }
+         fdh = (struct elf_link_hash_entry *) bh;
          fdh->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
        }
 
@@ -3675,12 +3677,16 @@ edit_opd (obfd, info)
              break;
            }
 
-         if (sym_sec->output_section == bfd_abs_section_ptr)
-           {
-             /* OK, we've found a function that's excluded from the
-                link.  */
-             need_edit = true;
-           }
+         /* opd entries are always for functions defined in the
+            current input bfd.  If the symbol isn't defined in the
+            input bfd, then we won't be using the function in this
+            bfd;  It must be defined in a linkonce section in another
+            bfd, or is weak.  It's also possible that we are
+            discarding the function due to a linker script /DISCARD/,
+            which we test for via the output_section.  */
+         if (sym_sec->owner != ibfd
+             || sym_sec->output_section == bfd_abs_section_ptr)
+           need_edit = true;
 
          offset += 24;
        }
@@ -3754,10 +3760,11 @@ edit_opd (obfd, info)
                                                              sym->st_shndx);
                    }
 
-                 skip = sym_sec->output_section == bfd_abs_section_ptr;
+                 skip = (sym_sec->owner != ibfd
+                         || sym_sec->output_section == bfd_abs_section_ptr);
                  if (skip)
                    {
-                     if (h != NULL)
+                     if (h != NULL && sym_sec->owner == ibfd)
                        {
                          /* Arrange for the function descriptor sym
                             to be dropped.  */
@@ -3797,8 +3804,7 @@ edit_opd (obfd, info)
                             for the function descriptor sym which we
                             don't have at the moment.  So keep an
                             array of adjustments.  */ 
-                         adjust[(rel->r_offset + wptr - rptr) / 24]
-                           = wptr - rptr;
+                         adjust[rel->r_offset / 24] = wptr - rptr;
                        }
 
                      if (wptr != rptr)
@@ -5161,6 +5167,7 @@ ppc64_elf_build_stubs (info)
            }
          bfd_put_32 (htab->sglink->owner,
                      B_DOT | ((htab->sglink->contents - p) & 0x3fffffc), p);
+         indx++;
          p += 4;
        }
       htab->sglink->_cooked_size = p - htab->sglink->contents;
index 4fb695f1011831f6fca00c7f23eaada3d6b81ac8..67a04ad67c2d52ce666f377654a73c415a044870 100644 (file)
@@ -2915,16 +2915,19 @@ sh64_elf64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
       if (h == NULL)
        {
          /* No previous datalabel symbol.  Make one.  */
+         struct bfd_link_hash_entry *bh = NULL;
+         struct elf_backend_data *bed = get_elf_backend_data (abfd);
+
          if (! _bfd_generic_link_add_one_symbol (info, abfd, dl_name,
                                                  flags, *secp, *valp,
                                                  *namep, false,
-                                                 get_elf_backend_data (abfd)->collect,
-                                                 (struct bfd_link_hash_entry **) &h))
+                                                 bed->collect, &bh))
            {
              free (dl_name);
              return false;
            }
 
+         h = (struct elf_link_hash_entry *) bh;
          h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF;
          h->type = STT_DATALABEL;
        }
@@ -3108,7 +3111,7 @@ static const bfd_byte elf_sh64_pic_plt_entry_be[PLT_ENTRY_SIZE] =
   0x6f, 0xf0, 0xff, 0xf0, /* nop */
   0x6f, 0xf0, 0xff, 0xf0, /* nop */
   0xce, 0x00, 0x01, 0x10, /* movi  -GOT_BIAS, r17 */
-  0x00, 0xcb, 0x45, 0x10, /* sub   r12, r17, r17 */
+  0x00, 0xc9, 0x45, 0x10, /* add   r12, r17, r17 */
   0x8d, 0x10, 0x09, 0x90, /* ld.q  r17, 16, r25 */
   0x6b, 0xf1, 0x66, 0x00, /* ptabs r25, tr0 */
   0x8d, 0x10, 0x05, 0x10, /* ld.q  r17, 8, r17 */
@@ -3128,7 +3131,7 @@ static const bfd_byte elf_sh64_pic_plt_entry_le[PLT_ENTRY_SIZE] =
   0xf0, 0xff, 0xf0, 0x6f, /* nop */
   0xf0, 0xff, 0xf0, 0x6f, /* nop */
   0x10, 0x01, 0x00, 0xce, /* movi  -GOT_BIAS, r17 */
-  0x10, 0x45, 0xcb, 0x00, /* sub   r12, r17, r17 */
+  0x10, 0x45, 0xc9, 0x00, /* add   r12, r17, r17 */
   0x90, 0x09, 0x10, 0x8d, /* ld.q  r17, 16, r25 */
   0x00, 0x66, 0xf1, 0x6b, /* ptabs r25, tr0 */
   0x10, 0x05, 0x10, 0x8d, /* ld.q  r17, 8, r17 */
@@ -3287,13 +3290,15 @@ sh64_elf64_create_dynamic_sections (abfd, info)
     {
       /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
         .plt section.  */
-      struct elf_link_hash_entry *h = NULL;
+      struct elf_link_hash_entry *h;
+      struct bfd_link_hash_entry *bh = NULL;
+
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
-             (bfd_vma) 0, (const char *) NULL, false,
-             get_elf_backend_data (abfd)->collect,
-             (struct bfd_link_hash_entry **) &h)))
+             (bfd_vma) 0, (const char *) NULL, false, bed->collect, &bh)))
        return false;
+
+      h = (struct elf_link_hash_entry *) bh;
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
index fa2f2ee5ec1ebf17d4ddf8b801b0a36f033e88c4..cbb961f370a0c5cc801eab493381d07ba0532581 100644 (file)
@@ -2224,31 +2224,32 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
              if (ELF64_R_TYPE (rel->r_info) == R_X86_64_TLSGD)
                {
                  unsigned int i;
-                 static unsigned char tlsgd[7]
-                   = { 0x66, 0x66, 0x66, 0x66, 0x48, 0x8d, 0x3d };
+                 static unsigned char tlsgd[8]
+                   = { 0x66, 0x48, 0x8d, 0x3d, 0x66, 0x66, 0x48, 0xe8 };
 
                  /* GD->LE transition.
-                    .long 0x66666666; leaq foo@tlsgd(%rip), %rdi
-                    callq __tls_get_addr@plt
+                    .byte 0x66; leaq foo@tlsgd(%rip), %rdi
+                    .word 0x6666; rex64; call __tls_get_addr@plt
                     Change it into:
                     movq %fs:0, %rax
                     leaq foo@tpoff(%rax), %rax */
-                 BFD_ASSERT (rel->r_offset >= 7);
-                 for (i = 0; i < 7; i++)
+                 BFD_ASSERT (rel->r_offset >= 4);
+                 for (i = 0; i < 4; i++)
                    BFD_ASSERT (bfd_get_8 (input_bfd,
-                                          contents + rel->r_offset - 7 + i)
+                                          contents + rel->r_offset - 4 + i)
                                == tlsgd[i]);
-                 BFD_ASSERT (rel->r_offset + 9 <= input_section->_raw_size);
-                 BFD_ASSERT (bfd_get_8 (input_bfd,
-                                        contents + rel->r_offset + 4)
-                             == 0xe8);
+                 BFD_ASSERT (rel->r_offset + 12 <= input_section->_raw_size);
+                 for (i = 0; i < 4; i++)
+                   BFD_ASSERT (bfd_get_8 (input_bfd,
+                                          contents + rel->r_offset + 4 + i)
+                               == tlsgd[i+4]);
                  BFD_ASSERT (rel + 1 < relend);
                  BFD_ASSERT (ELF64_R_TYPE (rel[1].r_info) == R_X86_64_PLT32);
-                 memcpy (contents + rel->r_offset - 7,
+                 memcpy (contents + rel->r_offset - 4,
                          "\x64\x48\x8b\x04\x25\0\0\0\0\x48\x8d\x80\0\0\0",
                          16);
                  bfd_put_32 (output_bfd, tpoff (info, relocation),
-                             contents + rel->r_offset + 5);
+                             contents + rel->r_offset + 8);
                  /* Skip R_X86_64_PLT32.  */
                  rel++;
                  continue;
@@ -2397,27 +2398,28 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
          else
            {
              unsigned int i;
-             static unsigned char tlsgd[7]
-               = { 0x66, 0x66, 0x66, 0x66, 0x48, 0x8d, 0x3d };
+             static unsigned char tlsgd[8]
+               = { 0x66, 0x48, 0x8d, 0x3d, 0x66, 0x66, 0x48, 0xe8 };
 
              /* GD->IE transition.
-                .long 0x66666666; leaq foo@tlsgd(%rip), %rdi
-                callq __tls_get_addr@plt
+                .byte 0x66; leaq foo@tlsgd(%rip), %rdi
+                .word 0x6666; rex64; call __tls_get_addr@plt
                 Change it into:
                 movq %fs:0, %rax
                 addq foo@gottpoff(%rip), %rax */
-             BFD_ASSERT (rel->r_offset >= 7);
-             for (i = 0; i < 7; i++)
+             BFD_ASSERT (rel->r_offset >= 4);
+             for (i = 0; i < 4; i++)
                BFD_ASSERT (bfd_get_8 (input_bfd,
-                                      contents + rel->r_offset - 7 + i)
+                                      contents + rel->r_offset - 4 + i)
                            == tlsgd[i]);
-             BFD_ASSERT (rel->r_offset + 9 <= input_section->_raw_size);
-             BFD_ASSERT (bfd_get_8 (input_bfd,
-                                    contents + rel->r_offset + 4)
-                         == 0xe8);
+             BFD_ASSERT (rel->r_offset + 12 <= input_section->_raw_size);
+             for (i = 0; i < 4; i++)
+               BFD_ASSERT (bfd_get_8 (input_bfd,
+                                      contents + rel->r_offset + 4 + i)
+                           == tlsgd[i+4]);
              BFD_ASSERT (rel + 1 < relend);
              BFD_ASSERT (ELF64_R_TYPE (rel[1].r_info) == R_X86_64_PLT32);
-             memcpy (contents + rel->r_offset - 7,
+             memcpy (contents + rel->r_offset - 4,
                      "\x64\x48\x8b\x04\x25\0\0\0\0\x48\x03\x05\0\0\0",
                      16);
 
@@ -2426,9 +2428,9 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
                            - rel->r_offset
                            - input_section->output_section->vma
                            - input_section->output_offset
-                           - 9);
+                           - 12);
              bfd_put_32 (output_bfd, relocation,
-                         contents + rel->r_offset + 5);
+                         contents + rel->r_offset + 8);
              /* Skip R_X86_64_PLT32.  */
              rel++;
              continue;
@@ -2496,7 +2498,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section,
          break;
 
        case R_X86_64_DTPOFF32:
-         if (info->shared)
+         if (info->shared || (input_section->flags & SEC_CODE) == 0)
            relocation -= dtpoff_base (info);
          else
            relocation = tpoff (info, relocation);
index f8cc645ad76f528e806ffb3ae4c46b635d0fd297..d6da588a1537965b0c4b41f062d6178148ac20e8 100644 (file)
@@ -33,6 +33,7 @@ _bfd_elf_create_got_section (abfd, info)
   flagword flags;
   register asection *s;
   struct elf_link_hash_entry *h;
+  struct bfd_link_hash_entry *bh;
   struct elf_backend_data *bed = get_elf_backend_data (abfd);
   int ptralign;
 
@@ -79,12 +80,13 @@ _bfd_elf_create_got_section (abfd, info)
         (or .got.plt) section.  We don't do this in the linker script
         because we don't want to define the symbol if we are not creating
         a global offset table.  */
-      h = NULL;
+      bh = NULL;
       if (!(_bfd_generic_link_add_one_symbol
            (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
             bed->got_symbol_offset, (const char *) NULL, false,
-            bed->collect, (struct bfd_link_hash_entry **) &h)))
+            bed->collect, &bh)))
        return false;
+      h = (struct elf_link_hash_entry *) bh;
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
@@ -151,13 +153,15 @@ _bfd_elf_create_dynamic_sections (abfd, info)
     {
       /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the
         .plt section.  */
-      struct elf_link_hash_entry *h = NULL;
+      struct elf_link_hash_entry *h;
+      struct bfd_link_hash_entry *bh = NULL;
+
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s,
              (bfd_vma) 0, (const char *) NULL, false,
-             get_elf_backend_data (abfd)->collect,
-             (struct bfd_link_hash_entry **) &h)))
+             get_elf_backend_data (abfd)->collect, &bh)))
        return false;
+      h = (struct elf_link_hash_entry *) bh;
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
 
@@ -546,29 +550,27 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults)
 
       if (lsect->sym_name)
        {
-         struct elf_link_hash_entry *h = NULL;
+         struct elf_link_hash_entry *h;
+         struct bfd_link_hash_entry *bh;
+
 #ifdef DEBUG
          fprintf (stderr, "Adding %s to section %s\n",
                   lsect->sym_name,
                   lsect->name);
 #endif
-         h = (struct elf_link_hash_entry *)
-           bfd_link_hash_lookup (info->hash, lsect->sym_name, false, false, false);
-
-         if ((h == NULL || h->root.type == bfd_link_hash_undefined)
-             && !(_bfd_generic_link_add_one_symbol (info,
-                                                    abfd,
-                                                    lsect->sym_name,
-                                                    BSF_GLOBAL,
-                                                    s,
-                                                    ((lsect->hole_size)
-                                                     ? s->_raw_size - lsect->hole_size + lsect->sym_offset
-                                                     : lsect->sym_offset),
-                                                    (const char *) NULL,
-                                                    false,
-                                                    get_elf_backend_data (abfd)->collect,
-                                                    (struct bfd_link_hash_entry **) &h)))
-           return (elf_linker_section_t *)0;
+         bh = bfd_link_hash_lookup (info->hash, lsect->sym_name,
+                                    false, false, false);
+
+         if ((bh == NULL || bh->type == bfd_link_hash_undefined)
+             && !(_bfd_generic_link_add_one_symbol
+                  (info, abfd, lsect->sym_name, BSF_GLOBAL, s,
+                   (lsect->hole_size
+                    ? s->_raw_size - lsect->hole_size + lsect->sym_offset
+                    : lsect->sym_offset),
+                   (const char *) NULL, false,
+                   get_elf_backend_data (abfd)->collect, &bh)))
+           return (elf_linker_section_t *) 0;
+         h = (struct elf_link_hash_entry *) bh;
 
          if ((defaults->which != LINKER_SECTION_SDATA)
              && (defaults->which != LINKER_SECTION_SDATA2))
@@ -579,7 +581,7 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults)
 
          if (info->shared
              && ! _bfd_elf_link_record_dynamic_symbol (info, h))
-           return (elf_linker_section_t *)0;
+           return (elf_linker_section_t *) 0;
        }
     }
 
index 85160e90257c6f1261081d46044842d1d44f65e4..23ea241fbdc10e15c6da3c5b5c4049d81bcb2068 100644 (file)
@@ -921,6 +921,7 @@ elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
   boolean size_change_ok;
   char *shortname;
   struct elf_link_hash_entry *hi;
+  struct bfd_link_hash_entry *bh;
   struct elf_backend_data *bed;
   boolean collect;
   boolean dynamic;
@@ -979,11 +980,12 @@ elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
 
   if (! override)
     {
+      bh = &hi->root;
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, shortname, BSF_INDIRECT, bfd_ind_section_ptr,
-             (bfd_vma) 0, name, false, collect,
-             (struct bfd_link_hash_entry **) &hi)))
+             (bfd_vma) 0, name, false, collect, &bh)))
        return false;
+      hi = (struct elf_link_hash_entry *) bh;
     }
   else
     {
@@ -1098,11 +1100,12 @@ elf_add_default_symbol (abfd, info, h, name, sym, psec, value,
     }
   else
     {
+      bh = &hi->root;
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, shortname, BSF_INDIRECT,
-             bfd_ind_section_ptr, (bfd_vma) 0, name, false,
-             collect, (struct bfd_link_hash_entry **) &hi)))
+             bfd_ind_section_ptr, (bfd_vma) 0, name, false, collect, &bh)))
        return false;
+      hi = (struct elf_link_hash_entry *) bh;
 
       /* If there is a duplicate definition somewhere, then HI may not
         point to an indirect symbol.  We will have reported an error
@@ -2292,6 +2295,7 @@ elf_link_create_dynamic_sections (abfd, info)
   flagword flags;
   register asection *s;
   struct elf_link_hash_entry *h;
+  struct bfd_link_hash_entry *bh;
   struct elf_backend_data *bed;
 
   if (! is_elf_hash_table (info))
@@ -2384,12 +2388,12 @@ elf_link_create_dynamic_sections (abfd, info)
      creating a .dynamic section.  We don't want to define it if there
      is no .dynamic section, since on some ELF platforms the start up
      code examines it to decide how to initialize the process.  */
-  h = NULL;
+  bh = NULL;
   if (! (_bfd_generic_link_add_one_symbol
         (info, abfd, "_DYNAMIC", BSF_GLOBAL, s, (bfd_vma) 0,
-         (const char *) NULL, false, get_elf_backend_data (abfd)->collect,
-         (struct bfd_link_hash_entry **) &h)))
+         (const char *) 0, false, get_elf_backend_data (abfd)->collect, &bh)))
     return false;
+  h = (struct elf_link_hash_entry *) bh;
   h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
 
@@ -3326,19 +3330,20 @@ NAME(bfd_elf,size_dynamic_sections) (output_bfd, soname, rpath,
              unsigned int cdeps;
              struct bfd_elf_version_deps *n;
              struct elf_link_hash_entry *h;
+             struct bfd_link_hash_entry *bh;
 
              cdeps = 0;
              for (n = t->deps; n != NULL; n = n->next)
                ++cdeps;
 
              /* Add a symbol representing this version.  */
-             h = NULL;
+             bh = NULL;
              if (! (_bfd_generic_link_add_one_symbol
                     (info, dynobj, t->name, BSF_GLOBAL, bfd_abs_section_ptr,
                      (bfd_vma) 0, (const char *) NULL, false,
-                     get_elf_backend_data (dynobj)->collect,
-                     (struct bfd_link_hash_entry **) &h)))
+                     get_elf_backend_data (dynobj)->collect, &bh)))
                return false;
+             h = (struct elf_link_hash_entry *) bh;
              h->elf_link_hash_flags &= ~ ELF_LINK_NON_ELF;
              h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
              h->type = STT_OBJECT;
@@ -6815,20 +6820,12 @@ elf_link_input_bfd (finfo, input_bfd)
                           || h->root.type == bfd_link_hash_defweak)
                          && elf_discarded_section (h->root.u.def.section))
                        {
-#if BFD_VERSION_DATE < 20031005
                          if ((o->flags & SEC_DEBUGGING) != 0)
                            {
-#if BFD_VERSION_DATE > 20021005
-                             (*finfo->info->callbacks->warning)
-                               (finfo->info,
-                                _("warning: relocation against removed section; zeroing"),
-                                NULL, input_bfd, o, rel->r_offset);
-#endif
                              BFD_ASSERT (r_symndx != 0);
                              memset (rel, 0, sizeof (*rel));
                            }
                          else
-#endif
                            {
                              if (! ((*finfo->info->callbacks->undefined_symbol)
                                     (finfo->info, h->root.root.string,
@@ -6844,23 +6841,15 @@ elf_link_input_bfd (finfo, input_bfd)
 
                      if (sec != NULL && elf_discarded_section (sec))
                        {
-#if BFD_VERSION_DATE < 20031005
                          if ((o->flags & SEC_DEBUGGING) != 0
                              || (sec->flags & SEC_LINK_ONCE) != 0)
                            {
-#if BFD_VERSION_DATE > 20021005
-                             (*finfo->info->callbacks->warning)
-                               (finfo->info,
-                                _("warning: relocation against removed section"),
-                                NULL, input_bfd, o, rel->r_offset);
-#endif
                              BFD_ASSERT (r_symndx != 0);
                              rel->r_info
                                = ELF_R_INFO (0, ELF_R_TYPE (rel->r_info));
                              rel->r_addend = 0;
                            }
                          else
-#endif
                            {
                              boolean ok;
                              const char *msg
index 2a29347365f297c32c1e5e0f73de783ea5d6074a..5da8e43b7f8ede321cfa5d679d20da1aaa96baf0 100644 (file)
@@ -647,13 +647,14 @@ static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] =
    not support brl, and so it gets emulated by the kernel.  */
 #undef USE_BRL
 
+#ifdef USE_BRL
 static const bfd_byte oor_brl[16] =
 {
   0x05, 0x00, 0x00, 0x00, 0x01, 0x00,  /*  [MLX]        nop.m 0            */
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  /*               brl.sptk.few tgt;; */
   0x00, 0x00, 0x00, 0xc0
 };
-
+#else
 static const bfd_byte oor_ip[48] =
 {
   0x04, 0x00, 0x00, 0x00, 0x01, 0x00,  /*  [MLX]        nop.m 0            */
@@ -666,6 +667,7 @@ static const bfd_byte oor_ip[48] =
   0x60, 0x80, 0x04, 0x80, 0x03, 0x00,  /*               mov b6=r16         */
   0x60, 0x00, 0x80, 0x00               /*               br b6;;            */
 };
+#endif
 \f
 /* These functions do relaxation for IA-64 ELF.
 
@@ -1282,6 +1284,7 @@ elfNN_ia64_aix_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
        {
          struct elf_backend_data *bed;
          struct elfNN_ia64_link_hash_table *ia64_info;
+         struct bfd_link_hash_entry *bh = NULL;
 
          bed = get_elf_backend_data (abfd);
          ia64_info = elfNN_ia64_hash_table (info);
@@ -1290,9 +1293,10 @@ elfNN_ia64_aix_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
                (info, abfd, *namep, BSF_GLOBAL,
                 bfd_get_section_by_name (abfd, ".bss"),
                 bed->got_symbol_offset, (const char *) NULL, false,
-                bed->collect, (struct bfd_link_hash_entry **) &h)))
+                bed->collect, &bh)))
            return false;
 
+         h = (struct elf_link_hash_entry *) bh;
          h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
          h->type = STT_OBJECT;
 
index 72f9a6bfdee873325026988d57330bfa2cda1395..9584bde083635c255bddbfeb69eb923095ff772d 100644 (file)
@@ -364,6 +364,7 @@ static INLINE int elf_mips_isa PARAMS ((flagword));
 static INLINE char* elf_mips_abi_name PARAMS ((bfd *));
 static void mips_elf_irix6_finish_dynamic_symbol
   PARAMS ((bfd *, const char *, Elf_Internal_Sym *));
+static boolean _bfd_mips_elf_mach_extends_p PARAMS ((flagword, flagword));
 
 /* This will be used when we sort the dynamic relocation records.  */
 static bfd *reldyn_sorting_bfd;
@@ -1900,6 +1901,7 @@ mips_elf_create_got_section (abfd, info)
   flagword flags;
   register asection *s;
   struct elf_link_hash_entry *h;
+  struct bfd_link_hash_entry *bh;
   struct mips_got_info *g;
   bfd_size_type amt;
 
@@ -1919,13 +1921,14 @@ mips_elf_create_got_section (abfd, info)
   /* Define the symbol _GLOBAL_OFFSET_TABLE_.  We don't do this in the
      linker script because we don't want to define the symbol if we
      are not creating a global offset table.  */
-  h = NULL;
+  bh = NULL;
   if (! (_bfd_generic_link_add_one_symbol
         (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s,
          (bfd_vma) 0, (const char *) NULL, false,
-         get_elf_backend_data (abfd)->collect,
-         (struct bfd_link_hash_entry **) &h)))
+         get_elf_backend_data (abfd)->collect, &bh)))
     return false;
+
+  h = (struct elf_link_hash_entry *) bh;
   h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
   h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
   h->type = STT_OBJECT;
@@ -2937,6 +2940,10 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec,
         know where the shared library will wind up at load-time.  */
       outrel[0].r_info = ELF_R_INFO (output_bfd, (unsigned long) indx,
                                     R_MIPS_REL32);
+      outrel[1].r_info = ELF_R_INFO (output_bfd, (unsigned long) 0,
+                                    R_MIPS_NONE);
+      outrel[2].r_info = ELF_R_INFO (output_bfd, (unsigned long) 0,
+                                    R_MIPS_NONE);
 
       /* Adjust the output offset of the relocation to reference the
         correct location in the output file.  */
@@ -3058,9 +3065,18 @@ _bfd_elf_mips_mach (flags)
     case E_MIPS_MACH_4111:
       return bfd_mach_mips4111;
 
+    case E_MIPS_MACH_4120:
+      return bfd_mach_mips4120;
+
     case E_MIPS_MACH_4650:
       return bfd_mach_mips4650;
 
+    case E_MIPS_MACH_5400:
+      return bfd_mach_mips5400;
+
+    case E_MIPS_MACH_5500:
+      return bfd_mach_mips5500;
+
     case E_MIPS_MACH_SB1:
       return bfd_mach_mips_sb1;
 
@@ -3815,15 +3831,17 @@ _bfd_mips_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp)
       && strcmp (*namep, "__rld_obj_head") == 0)
     {
       struct elf_link_hash_entry *h;
+      struct bfd_link_hash_entry *bh;
 
       /* Mark __rld_obj_head as dynamic.  */
-      h = NULL;
+      bh = NULL;
       if (! (_bfd_generic_link_add_one_symbol
             (info, abfd, *namep, BSF_GLOBAL, *secp,
              (bfd_vma) *valp, (const char *) NULL, false,
-             get_elf_backend_data (abfd)->collect,
-             (struct bfd_link_hash_entry **) &h)))
+             get_elf_backend_data (abfd)->collect, &bh)))
        return false;
+
+      h = (struct elf_link_hash_entry *) bh;
       h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_OBJECT;
@@ -3879,6 +3897,7 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info)
      struct bfd_link_info *info;
 {
   struct elf_link_hash_entry *h;
+  struct bfd_link_hash_entry *bh;
   flagword flags;
   register asection *s;
   const char * const *namep;
@@ -3937,13 +3956,14 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info)
     {
       for (namep = mips_elf_dynsym_rtproc_names; *namep != NULL; namep++)
        {
-         h = NULL;
+         bh = NULL;
          if (! (_bfd_generic_link_add_one_symbol
                 (info, abfd, *namep, BSF_GLOBAL, bfd_und_section_ptr,
                  (bfd_vma) 0, (const char *) NULL, false,
-                 get_elf_backend_data (abfd)->collect,
-                 (struct bfd_link_hash_entry **) &h)))
+                 get_elf_backend_data (abfd)->collect, &bh)))
            return false;
+
+         h = (struct elf_link_hash_entry *) bh;
          h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
          h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
          h->type = STT_SECTION;
@@ -3979,26 +3999,17 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info)
 
   if (!info->shared)
     {
-      h = NULL;
-      if (SGI_COMPAT (abfd))
-       {
-         if (!(_bfd_generic_link_add_one_symbol
-               (info, abfd, "_DYNAMIC_LINK", BSF_GLOBAL, bfd_abs_section_ptr,
-                (bfd_vma) 0, (const char *) NULL, false,
-                get_elf_backend_data (abfd)->collect,
-                (struct bfd_link_hash_entry **) &h)))
-           return false;
-       }
-      else
-       {
-         /* For normal mips it is _DYNAMIC_LINKING.  */
-         if (!(_bfd_generic_link_add_one_symbol
-               (info, abfd, "_DYNAMIC_LINKING", BSF_GLOBAL,
-                bfd_abs_section_ptr, (bfd_vma) 0, (const char *) NULL, false,
-                get_elf_backend_data (abfd)->collect,
-                (struct bfd_link_hash_entry **) &h)))
-           return false;
-       }
+      const char *name;
+
+      name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING";
+      bh = NULL;
+      if (!(_bfd_generic_link_add_one_symbol
+           (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr,
+            (bfd_vma) 0, (const char *) NULL, false,
+            get_elf_backend_data (abfd)->collect, &bh)))
+       return false;
+
+      h = (struct elf_link_hash_entry *) bh;
       h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
       h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
       h->type = STT_SECTION;
@@ -4015,26 +4026,15 @@ _bfd_mips_elf_create_dynamic_sections (abfd, info)
          s = bfd_get_section_by_name (abfd, ".rld_map");
          BFD_ASSERT (s != NULL);
 
-         h = NULL;
-         if (SGI_COMPAT (abfd))
-           {
-             if (!(_bfd_generic_link_add_one_symbol
-                   (info, abfd, "__rld_map", BSF_GLOBAL, s,
-                    (bfd_vma) 0, (const char *) NULL, false,
-                    get_elf_backend_data (abfd)->collect,
-                    (struct bfd_link_hash_entry **) &h)))
-               return false;
-           }
-         else
-           {
-             /* For normal mips the symbol is __RLD_MAP.  */
-             if (!(_bfd_generic_link_add_one_symbol
-                   (info, abfd, "__RLD_MAP", BSF_GLOBAL, s,
-                    (bfd_vma) 0, (const char *) NULL, false,
-                    get_elf_backend_data (abfd)->collect,
-                    (struct bfd_link_hash_entry **) &h)))
-               return false;
-           }
+         name = SGI_COMPAT (abfd) ? "__rld_map" : "__RLD_MAP";
+         bh = NULL;
+         if (!(_bfd_generic_link_add_one_symbol
+               (info, abfd, name, BSF_GLOBAL, s,
+                (bfd_vma) 0, (const char *) NULL, false,
+                get_elf_backend_data (abfd)->collect, &bh)))
+           return false;
+
+         h = (struct elf_link_hash_entry *) bh;
          h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF;
          h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR;
          h->type = STT_OBJECT;
@@ -5935,10 +5935,22 @@ _bfd_mips_elf_final_write_processing (abfd, linker)
       val = E_MIPS_ARCH_3 | E_MIPS_MACH_4111;
       break;
 
+    case bfd_mach_mips4120:
+      val = E_MIPS_ARCH_3 | E_MIPS_MACH_4120;
+      break;
+
     case bfd_mach_mips4650:
       val = E_MIPS_ARCH_3 | E_MIPS_MACH_4650;
       break;
 
+    case bfd_mach_mips5400:
+      val = E_MIPS_ARCH_4 | E_MIPS_MACH_5400;
+      break;
+
+    case bfd_mach_mips5500:
+      val = E_MIPS_ARCH_4 | E_MIPS_MACH_5500;
+      break;
+
     case bfd_mach_mips5000:
     case bfd_mach_mips8000:
     case bfd_mach_mips10000:
@@ -7637,6 +7649,26 @@ _bfd_mips_elf_final_link (abfd, info)
   return true;
 }
 \f
+/* Return true if machine EXTENSION is an extension of machine BASE,
+   meaning that it should be safe to link code for the two machines
+   and set the output machine to EXTENSION.  EXTENSION and BASE are
+   both submasks of EF_MIPS_MACH.  */
+
+static boolean
+_bfd_mips_elf_mach_extends_p (base, extension)
+     flagword base, extension;
+{
+  /* The vr5500 ISA is an extension of the core vr5400 ISA, but doesn't
+     include the multimedia stuff.  It seems better to allow vr5400
+     and vr5500 code to be merged anyway, since many libraries will
+     just use the core ISA.  Perhaps we could add some sort of ASE
+     flag if this ever proves a problem.  */
+  return (base == 0
+         || (base == E_MIPS_MACH_5400 && extension == E_MIPS_MACH_5500)
+         || (base == E_MIPS_MACH_4100 && extension == E_MIPS_MACH_4111)
+         || (base == E_MIPS_MACH_4100 && extension == E_MIPS_MACH_4120));
+}
+
 /* Merge backend specific data from an object file to the output
    object file when linking.  */
 
@@ -7743,10 +7775,9 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
 
       /* If either has no machine specified, just compare the general isa's.
         Some combinations of machines are ok, if the isa's match.  */
-      if (! new_mach
-         || ! old_mach
-         || new_mach == old_mach
-         )
+      if (new_mach == old_mach
+         || _bfd_mips_elf_mach_extends_p (new_mach, old_mach)
+         || _bfd_mips_elf_mach_extends_p (old_mach, new_mach))
        {
          /* Don't warn about mixing code using 32-bit ISAs, or mixing code
             using 64-bit ISAs.  They will normally use the same data sizes
@@ -7763,8 +7794,11 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
          else
            {
              /* Do we need to update the mach field?  */
-             if (old_mach == 0 && new_mach != 0) 
-               elf_elfheader (obfd)->e_flags |= new_mach;
+             if (_bfd_mips_elf_mach_extends_p (old_mach, new_mach))
+               {
+                 elf_elfheader (obfd)->e_flags &= ~EF_MIPS_MACH;
+                 elf_elfheader (obfd)->e_flags |= new_mach;
+               }
 
              /* Do we need to update the ISA field?  */
              if (new_isa > old_isa)
index 96e55d7c54750b5685bc0d7ea4a614a473b9bf2c..ef001f335308b302e3e743334aa84a8b3156d45a 100644 (file)
@@ -1005,6 +1005,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_SH_IMM_HI16",
   "BFD_RELOC_SH_IMM_HI16_PCREL",
   "BFD_RELOC_SH_PT_16",
+  "BFD_RELOC_SH_TLS_GD_32",
+  "BFD_RELOC_SH_TLS_LD_32",
+  "BFD_RELOC_SH_TLS_LDO_32",
+  "BFD_RELOC_SH_TLS_IE_32",
+  "BFD_RELOC_SH_TLS_LE_32",
+  "BFD_RELOC_SH_TLS_DTPMOD32",
+  "BFD_RELOC_SH_TLS_DTPOFF32",
+  "BFD_RELOC_SH_TLS_TPOFF32",
   "BFD_RELOC_THUMB_PCREL_BRANCH9",
   "BFD_RELOC_THUMB_PCREL_BRANCH12",
   "BFD_RELOC_THUMB_PCREL_BRANCH23",
index 242f8bd7625de2a78d9e1df12b4f69117acae91a..e44ac6c6c9d79e3246749a30c390f307cb3a219e 100644 (file)
@@ -1305,6 +1305,7 @@ generic_link_add_symbol_list (abfd, info, symbol_count, symbols, collect)
          const char *name;
          const char *string;
          struct generic_link_hash_entry *h;
+         struct bfd_link_hash_entry *bh;
 
          name = bfd_asymbol_name (p);
          if (((p->flags & BSF_INDIRECT) != 0
@@ -1326,12 +1327,12 @@ generic_link_add_symbol_list (abfd, info, symbol_count, symbols, collect)
          else
            string = NULL;
 
-         h = NULL;
+         bh = NULL;
          if (! (_bfd_generic_link_add_one_symbol
                 (info, abfd, name, p->flags, bfd_get_section (p),
-                 p->value, string, false, collect,
-                 (struct bfd_link_hash_entry **) &h)))
+                 p->value, string, false, collect, &bh)))
            return false;
+         h = (struct generic_link_hash_entry *) bh;
 
          /* If this is a constructor symbol, and the linker didn't do
              anything with it, then we want to just pass the symbol
index cdf08df05dd4c1500f31655988781aea83f88709..af8ff7e4a63585a1707e906b3a13a651b49c96a1 100644 (file)
@@ -63,7 +63,9 @@ _bfd_new_bfd ()
   nbfd->direction = no_direction;
   nbfd->iostream = NULL;
   nbfd->where = 0;
-  if (!bfd_hash_table_init (&nbfd->section_htab, bfd_section_hash_newfunc))
+  if (!bfd_hash_table_init_n (&nbfd->section_htab,
+                             bfd_section_hash_newfunc,
+                             251))
     {
       free (nbfd);
       return NULL;
@@ -124,7 +126,7 @@ FUNCTION
        bfd_openr
 
 SYNOPSIS
-        bfd *bfd_openr(const char *filename, const char *target);
+       bfd *bfd_openr(const char *filename, const char *target);
 
 DESCRIPTION
        Open the file @var{filename} (using <<fopen>>) with the target
@@ -134,7 +136,8 @@ DESCRIPTION
        that function.
 
        If <<NULL>> is returned then an error has occured.   Possible errors
-       are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> or <<system_call>> error.
+       are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> or
+       <<system_call>> error.
 */
 
 bfd *
@@ -179,28 +182,28 @@ bfd_openr (filename, target)
        the file descriptor too, even though we didn't open it.  */
 /*
 FUNCTION
-         bfd_fdopenr
+       bfd_fdopenr
 
 SYNOPSIS
-         bfd *bfd_fdopenr(const char *filename, const char *target, int fd);
+       bfd *bfd_fdopenr(const char *filename, const char *target, int fd);
 
 DESCRIPTION
-         <<bfd_fdopenr>> is to <<bfd_fopenr>> much like <<fdopen>> is to <<fopen>>.
-        It opens a BFD on a file already described by the @var{fd}
-        supplied.
-
-        When the file is later <<bfd_close>>d, the file descriptor will be closed.
-
-        If the caller desires that this file descriptor be cached by BFD
-        (opened as needed, closed as needed to free descriptors for
-        other opens), with the supplied @var{fd} used as an initial
-        file descriptor (but subject to closure at any time), call
-        bfd_set_cacheable(bfd, 1) on the returned BFD.  The default is to
-        assume no cacheing; the file descriptor will remain open until
-        <<bfd_close>>, and will not be affected by BFD operations on other
-        files.
-
-         Possible errors are <<bfd_error_no_memory>>, <<bfd_error_invalid_target>> and <<bfd_error_system_call>>.
+       <<bfd_fdopenr>> is to <<bfd_fopenr>> much like <<fdopen>> is to
+       <<fopen>>.  It opens a BFD on a file already described by the
+       @var{fd} supplied.
+
+       When the file is later <<bfd_close>>d, the file descriptor will
+       be closed.  If the caller desires that this file descriptor be
+       cached by BFD (opened as needed, closed as needed to free
+       descriptors for other opens), with the supplied @var{fd} used as
+       an initial file descriptor (but subject to closure at any time),
+       call bfd_set_cacheable(bfd, 1) on the returned BFD.  The default
+       is to assume no cacheing; the file descriptor will remain open
+       until <<bfd_close>>, and will not be affected by BFD operations
+       on other files.
+
+       Possible errors are <<bfd_error_no_memory>>,
+       <<bfd_error_invalid_target>> and <<bfd_error_system_call>>.
 */
 
 bfd *
@@ -389,10 +392,10 @@ SYNOPSIS
 
 DESCRIPTION
 
-       Close a BFD. If the BFD was open for writing,
-       then pending operations are completed and the file written out
-       and closed. If the created file is executable, then
-       <<chmod>> is called to mark it as such.
+       Close a BFD. If the BFD was open for writing, then pending
+       operations are completed and the file written out and closed.
+       If the created file is executable, then <<chmod>> is called
+       to mark it as such.
 
        All memory attached to the BFD is released.
 
@@ -431,7 +434,7 @@ bfd_close (abfd)
 
       if (stat (abfd->filename, &buf) == 0)
        {
-         unsigned int mask = umask (0);
+         unsigned int mask = umask (0);
 
          umask (mask);
          chmod (abfd->filename,
@@ -453,10 +456,10 @@ SYNOPSIS
        boolean bfd_close_all_done(bfd *);
 
 DESCRIPTION
-       Close a BFD.  Differs from <<bfd_close>>
-       since it does not complete any pending operations.  This
-       routine would be used if the application had just used BFD for
-       swapping and didn't want to use any of the writing code.
+       Close a BFD.  Differs from <<bfd_close>> since it does not
+       complete any pending operations.  This routine would be used
+       if the application had just used BFD for swapping and didn't
+       want to use any of the writing code.
 
        If the created file is executable, then <<chmod>> is called
        to mark it as such.
@@ -507,10 +510,9 @@ SYNOPSIS
        bfd *bfd_create(const char *filename, bfd *templ);
 
 DESCRIPTION
-       Create a new BFD in the manner of
-       <<bfd_openw>>, but without opening a file. The new BFD
-       takes the target from the target used by @var{template}. The
-       format is always set to <<bfd_object>>.
+       Create a new BFD in the manner of <<bfd_openw>>, but without
+       opening a file. The new BFD takes the target from the target
+       used by @var{template}. The format is always set to <<bfd_object>>.
 */
 
 bfd *
index 71f17402be095b7508a2cdde607d3e212279e7a4..23e49342c87bc44f93ca7e9bfe7e1acdcdebbcf8 100644 (file)
@@ -2575,6 +2575,22 @@ ENUMX
   BFD_RELOC_SH_IMM_HI16_PCREL
 ENUMX
   BFD_RELOC_SH_PT_16
+ENUMX
+  BFD_RELOC_SH_TLS_GD_32
+ENUMX
+  BFD_RELOC_SH_TLS_LD_32
+ENUMX
+  BFD_RELOC_SH_TLS_LDO_32
+ENUMX
+  BFD_RELOC_SH_TLS_IE_32
+ENUMX
+  BFD_RELOC_SH_TLS_LE_32
+ENUMX
+  BFD_RELOC_SH_TLS_DTPMOD32
+ENUMX
+  BFD_RELOC_SH_TLS_DTPOFF32
+ENUMX
+  BFD_RELOC_SH_TLS_TPOFF32
 ENUMDOC
   Hitachi SH relocs.  Not all of these appear in object files.
 
index b9be8e7535f196f3193ced8451aa7d78a60d11ea..adc8bd638ec04c894b73cafa4e02959c5f697d47 100644 (file)
@@ -559,6 +559,8 @@ extern const bfd_target bfd_elf32_powerpcqnx_vec;
 extern const bfd_target bfd_elf32_s390_vec;
 extern const bfd_target bfd_elf32_sh64_vec;
 extern const bfd_target bfd_elf32_sh64l_vec;
+extern const bfd_target bfd_elf32_sh64lin_vec;
+extern const bfd_target bfd_elf32_sh64blin_vec;
 extern const bfd_target bfd_elf32_sh64lnbsd_vec;
 extern const bfd_target bfd_elf32_sh64nbsd_vec;
 extern const bfd_target bfd_elf32_sh_vec;
@@ -595,6 +597,8 @@ extern const bfd_target bfd_elf64_powerpcle_vec;
 extern const bfd_target bfd_elf64_s390_vec;
 extern const bfd_target bfd_elf64_sh64_vec;
 extern const bfd_target bfd_elf64_sh64l_vec;
+extern const bfd_target bfd_elf64_sh64lin_vec;
+extern const bfd_target bfd_elf64_sh64blin_vec;
 extern const bfd_target bfd_elf64_sh64lnbsd_vec;
 extern const bfd_target bfd_elf64_sh64nbsd_vec;
 extern const bfd_target bfd_elf64_sparc_vec;
index 5a98d1c9699e74f252f11a986b6e67a7b1ac4ecf..a440678861b4226e3c911e6b70ce63a806da56af 100644 (file)
@@ -1 +1 @@
-#define BFD_VERSION_DATE 20020927
+#define BFD_VERSION_DATE 20021011
index a869d7d3d6d9838c44a7f85bf7c9e6122a4586c0..e4e4755cddbff26ac8633c46e7a3ed021c253900 100644 (file)
@@ -1986,6 +1986,7 @@ xcoff_link_add_symbols (abfd, info)
                      && h->descriptor == NULL)
                    {
                      struct xcoff_link_hash_entry *hds;
+                     struct bfd_link_hash_entry *bh;
 
                      hds = xcoff_link_hash_lookup (xcoff_hash_table (info),
                                                    h->root.root.string + 1,
@@ -1994,13 +1995,14 @@ xcoff_link_add_symbols (abfd, info)
                        goto error_return;
                      if (hds->root.type == bfd_link_hash_new)
                        {
+                         bh = &hds->root;
                          if (! (_bfd_generic_link_add_one_symbol
                                 (info, abfd, hds->root.root.string,
                                  (flagword) 0, bfd_und_section_ptr,
                                  (bfd_vma) 0, (const char *) NULL, false,
-                                 true,
-                                 (struct bfd_link_hash_entry **) &hds)))
+                                 true, &bh)))
                            goto error_return;
+                         hds = (struct xcoff_link_hash_entry *) bh;
                        }
                      hds->flags |= XCOFF_DESCRIPTOR;
                      BFD_ASSERT ((hds->flags & XCOFF_CALLED) == 0
index 6d4b7fab9bdba71f3b32be6ef2cfb11110f88c2d..ec9bebf5020d75a0affd77fb5117f039107f1ee3 100755 (executable)
--- a/configure
+++ b/configure
@@ -1356,8 +1356,7 @@ EOF
                 rm -f ${subdir}/Makefile.tm2
                 sedtemp=sed.$$
                 cat >$sedtemp <<EOF
-s:^SUBDIRS[    ]*=.*$:SUBDIRS = ${configdirs}:
-s:^NONSUBDIRS[         ]*=.*$:NONSUBDIRS = ${noconfigdirs}:
+s:@configdirs@:${configdirs}:
 EOF
                 sed -f $sedtemp \
                     ${subdir}/Makefile.tem > ${subdir}/Makefile.tm2
index e4a3ae58c4d46d142a1886026d10985ef6554f0a..87dd2c6dc4120799eac36ec250ef42e458195e99 100644 (file)
@@ -331,6 +331,12 @@ case "${target}" in
   arc-*-*)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
     ;;
+  arm-*-coff | strongarm-*-coff | xscale-*-coff)
+    noconfigdirs="$noconfigdirs ${libgcj}"
+    ;;
+  arm-*-elf* | strongarm-*-elf* | xscale-*-elf*)
+    noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+    ;;
   arm-*-pe*)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
     ;;
@@ -346,18 +352,6 @@ case "${target}" in
   thumb-*-oabi)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
     ;;
-  strongarm-*-elf)
-    noconfigdirs="$noconfigdirs ${libgcj}"
-    ;;
-  strongarm-*-coff)
-    noconfigdirs="$noconfigdirs ${libgcj}"
-    ;;
-  xscale-*-elf)
-    noconfigdirs="$noconfigdirs target-libffi target-qthreads"
-    ;;
-  xscale-*-coff)
-    noconfigdirs="$noconfigdirs ${libgcj}"
-    ;;
   thumb-*-pe)
     noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
     ;;
@@ -367,7 +361,7 @@ case "${target}" in
   avr-*-*)
     noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}"
     ;;
-  c4x-*-*)
+  c4x-*-* | tic4x-*-*)
     noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}"
     ;;
   c54x*-*-* | tic54x-*-*)
@@ -427,10 +421,6 @@ case "${target}" in
   i[34567]86-*-freebsd*)
     noconfigdirs="$noconfigdirs target-newlib target-libgloss"
     ;;
-  s390*-*-linux*)
-    # The libffi port is not yet in the GCC tree
-    noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
-    ;;
   i[3456]86-*-linux*)
     # This section makes it possible to build newlib natively on linux.
     # If we are using a cross compiler then don't configure newlib.
@@ -527,6 +517,9 @@ case "${target}" in
   powerpc-*-beos*)
     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
     ;;
+  powerpc-*-darwin*)
+    noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb tk itcl tix libgui gprof ${libgcj}"
+    ;;
   powerpc-*-eabi)
     noconfigdirs="$noconfigdirs ${libgcj}"
     ;;
@@ -1328,20 +1321,23 @@ esac
 # If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
 # binutils tools will find libbfd.so.
 if test "${shared}" = "yes" ; then
-  sed -e 's/^SET_LIB_PATH[     ]*=.*$/SET_LIB_PATH = $(REALLY_SET_LIB_PATH)/' \
-      Makefile > Makefile.tem
-  rm -f Makefile
-  mv -f Makefile.tem Makefile
-
-  case "${host}" in
-  *-*-hpux*)
-    sed -e 's/^RPATH_ENVVAR[   ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \
-       Makefile > Makefile.tem
-    rm -f Makefile
-    mv -f Makefile.tem Makefile
-    ;;
-  esac
+  SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)"
+else
+  SET_LIB_PATH=
 fi
+sed -e "s/@SET_LIB_PATH@/${SET_LIB_PATH}/" Makefile > Makefile.tem
+rm -f Makefile
+mv -f Makefile.tem Makefile
+
+
+case "${host}" in
+  *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;;
+  *) RPATH_ENVVAR=LD_LIBRARY_PATH ;;
+esac
+sed -e "s/@RPATH_ENVVAR@/${RPATH_ENVVAR}/" Makefile > Makefile.tem
+rm -f Makefile
+mv -f Makefile.tem Makefile
+
 
 # Base args.  Strip norecursion, cache-file, srcdir, host, build, target.
 # These are the ones we might not want to pass down to subconfigures.
index 709fa89a82bc0f9204ef2fbeabf7be627ad5118b..eb9a49782dca4977a9df2ff41d8dd9d6a29a98ef 100644 (file)
        * remote-sds.c (getmessage): Add semicolon after 'retry' label to
        pacify GCC.
 
+2002-10-11  Martin M. Hunt  <hunt@redhat.com>
+
+       * utils.c (string_to_core_addr): After turning string into
+       a number, convert to a CORE_ADDR using INTEGER_TO_ADDRESS
+       which will do necessary sign-extension, etc.
+
+2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
+
+       * c-exp.y (THIS): Delete token and grammar rule.
+       (yylex): Don't return THIS.
+       * cp-valprint.c (vtbl_ptr_name_old): Delete.
+       (cp_is_vtbl_ptr_type): Don't check vtbl_ptr_name_old.
+       * demangle.c (cplus_markers): Update comment.  Put '$'
+       first.  Remove CPLUS_MARKER.
+       (_initialize_demangler): Don't call set_cplus_marker_for_demangling.
+       * jv-exp.y (THIS): Delete token and grammar rule.
+       (yylex): Don't return THIS.
+       * mips-tdep.c (mips_dump_tdep): Don't dump CPLUS_MARKER.
+       * objc-exp.y (THIS): Delete token and grammar rule.
+       (yylex): Don't return THIS.
+       * p-exp.y (yylex): Remove reference to CPLUS_MARKER.
+       * stabsread.c (vptr_name, vb_name): Replace CPLUS_MARKER with '$'.
+       (read_member_functions): Likewise for opname.
+       (read_tilde_fields): Use is_cplus_marker.
+
+       * defs.h (CPLUS_MARKER): Don't define.
+       * config/tm-sysv4.h (CPLUS_MARKER): Likewise.
+       * config/i386/xm-i386sco.h (CPLUS_MARKER): Likewise.
+       * config/mips/tm-irix3.h (CPLUS_MARKER): Likewise.
+       * config/mips/tm-irix6.h (CPLUS_MARKER): Likewise.
+       * config/rs6000/tm-rs6000.h (CPLUS_MARKER): Likewise.
+
+       * config/i386/tm-i386v4.h: Delete file.
+       * config/djgpp/fnchange.lst: Delete tm-i386v4.h.
+       * config/i386/tm-i386sol2.h: Include "i386/tm-i386.h" instead.
+       * config/i386/tm-i386v42mp.h: Include "i386/tm-i386.h" instead.
+       * config/i386/tm-ptx.h: Include "i386/tm-i386.h" instead.
+       * config/i386/i386gnu.mt (TM_FILE): Use tm-i386.h.
+       * config/i386/i386sco5.mt (TM_FILE): Likewise.
+       * config/i386/i386v4.mt (TM_FILE): Likewise.
+       * config/i386/ncr3000.mt (TM_FILE): Likewise.
+
+2002-10-10  Marko Mlinar  <markom@opencores.org>
+
+       * infrun.c (resume): Convert #ifdef HAVE_NONSTEPPABLE_WATCHPOINT into C,
+       accidentially not commited 2002-10-09
+       * gdbarch.h, gdbarch.c: Re-generate.
+
+2002-10-09  Marko Mlinar  <markom@opencores.org>
+
+       * infrun.c (resume): Convert #ifdef HAVE_NONSTEPPABLE_WATCHPOINT into C.
+       * gdbarch.sh (HAVE_NONSTEPPABLE_WATCHPOINT): Add.
+       * gdbarch.h, gdbarch.c: Re-generate.
+
+2002-10-08  Petr Sorfa <petrs@caldera.com>
+
+       Revised and re-submitted by John Wolfe <jlw@caldera.com>
+
+       Move the Dwarf 2 abbrev table to a per-compilation-unit structure,
+       so we can work on more than one compilation unit at a time.  This
+       helps prepare GDB to handle inter-CU die references.
+       * dwarf2read.c (ABBREV_HASH_SIZE): moved definition forward in
+       the code to be defined before struct comp_unit_head.
+       (comp_unit_head): Added new members - offset, cu_head,
+       begin_die, next and dwarf2_abbrevs.
+       (dwarf2_abbrevs): Removed single static var; now member of
+       struct comp_unit_head.
+       dwarf2_build_psymtabs_hard): Complete new struct comp_unit_head
+       members.
+       (psymtab_to_symtab_1): Changed to work with the new
+       struct comp_unit_head.
+       (dwarf2_read_abbrevs): Now accepts a cu_header parameter and
+       constructs the dwarf2_abbrevs[] inside the cu_header.
+       (dwarf2_empty_abbrev_table): Now expects a ptr to a
+       dwarf2_abbrev table to clean up.
+       (dwarf2_lookup_abbrev): Now accepts a cu_header parameter and
+       handling of dwarf2_abbrevs inside the cu_header.
+       (read_partial_die): Now supports the call to the new
+       dwarf2_lookup_abbrev.
+       (read_full_die): Now supports the call to the new
+       dwarf2_lookup_abbrev.
+
+2002-10-06  Christopher Faylor  <cgf@redhat.com>
+
+       * Makefile.in (install-gdbtk): Add missing continuation backslash to
+       insure that shell variables, such as "transformed_name" are propagated
+       to later shell statements in rule.
+
+2002-10-06  Mark Kettenis  <kettenis@gnu.org>
+
+       * config/i386/nm-i386sco.h: Add protection against
+       multiple-inclusion.  Include "i386/nm-i386v.h".
+       (REGISTER_U_ADDR): Remove define.
+       (i386_register_u_addr): Remove prototype.
+
+2002-10-04  Michael Snyder  <msnyder@redhat.com>
+
+       * m32r-stub.c (handle_exception): Make sure exception is "trap"
+       before treating it as a single-step event.
+
+2002-10-03  Adam Fedor  <fedor@gnu.org>
+
+       * objc-lang.c: ARI fixes.  Change string.h to gdb_string.h.
+       (objc_demangle): Remove assignment in if statements, Replace
+       free with xfree.
+       (add_msglist): Likewise.
+       (end_msglist): Likewise.
+       (complare_selectors): Likewise.
+       (selectors_info): Likewise.
+       (compare_classes): Likewise.
+       (classes_info): Likewise.
+       (print_object_command): Likewise.
+       (find_objc_msgcall_submethod): Replace PTR with void *.
+       * objc-lang.h: Remove check for __STDC__.
+
+2002-10-03  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * ui-out.h (ui_out_field_fmt_int): New prototype.
+       * ui-out.c (ui_out_field_fmt_int): New function allowing specification
+       of field width and alignment.
+       * stack.c (print_frame_info_base): When printing frame level, use
+       ui_out_field_fmt_int with a width of 2 and left alignment.  Fix for
+       PR gdb/192
+
+2002-10-03  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * MAINTAINERS: Add self to Write After Approval list.
+
+2002-10-02  Elena Zannoni  <ezannoni@redhat.com>
+
+       * infcmd.c (interrupt_target_command_wrapper): Delete.
+       (interrupt_target_command): Make non static.
+       (nofp_registers_info): Make static.
+       * stack.c (return_command_wrapper): Delete.
+       (return_command): Make non static.
+
+2002-10-02  Elena Zannoni  <ezannoni@redhat.com>
+
+       * event-top.c (gdb_setup_readline): New function. Code moved from
+       _initialize_event_loop().
+       (_initialize_event_loop): Call gdb_setup_readline().
+
+2002-10-02  Andrew Cagney  <ac131313@redhat.com>
+
+       * infrun.c (resume): Convert #ifdef CANNOT_STEP_BREAKPOINT into C.
+       * gdbarch.sh (CANNOT_STEP_BREAKPOINT): Add.
+       * gdbarch.h, gdbarch.c: Re-generate.
+
+2002-10-02  Daniel Jacobowitz  <drow@mvista.com>
+
+       Fix PR gdb/778
+       * gdbtypes.c (fill_in_vptr_fieldno): Call check_typedef
+       before recursing.
+       * gnu-v3-abi.c (gnuv3_virtual_fn_field): Check return value
+       of fill_in_vptr_fieldno.
+
+2002-10-02  Elena Zannoni  <ezannoni@redhat.com>
+
+       * inferior.h (registers_info, stepi_command, nexti_command,
+       continue_command, interrupt_target_command): Export from infcmd.c.
+       * frame.h (args_info, selected_frame_level_changed_hook,
+       return_command): Export from stack.c.
+       * v850ice.c (stepi_command, nexti_command, continue_command): use
+       prototypes from inferior.h.
+       * tracepoint.c (registers_info, args_info, locals_info): Use
+       prototypes from frame.h and inferior.h.
+       * Makefile.in (mi-main.o): Add dependency on frame.h.
+
+2002-10-02  Andrew Cagney  <ac131313@redhat.com>
+
+       * rs6000-tdep.c (rs6000_store_struct_return): Store struct_return
+       value in register 3 adjusted by ppc_gp0_regnum.
+
+       * rs6000-tdep.c (skip_prologue): Bias alloca_reg by ppc_gp0_regnum.
+
+2002-10-02  Marko Mlinar <markom@opencores.org>
+
+        * MAINTAINERS: Add myself to the Write After Approval list.
+
+2002-10-01  Alexandre Oliva  <aoliva@redhat.com>
+
+       * mips-tdep.c (mips_find_abi_section): .mdebug.abi64 is the name
+       of the section for the N64 ABI, fixed.
+
+       * config/mips/tm-irix6.h: Include solib.h.
+
+2002-10-01  Elena Zannoni  <ezannoni@redhat.com>
+
+       * dwarf2read.c (dwarf_stack_op_name): Recognize more dwarf3 and
+       GNU operators.
+
+2002-10-01  Andrew Cagney  <ac131313@redhat.com>
+
+       * NEWS: Mention that MI syntax, selected by "mi" changed to "mi2"
+       and that "mi0" syntax has been removed.
+
+2002-09-30  David Carlton  <carlton@math.stanford.edu>
+
+       * Makefile.in (ppc-sysv-tdep.o): Depend on gdb_string_h.
+       * ppc-sysv-tdep.c: #include "gdb_string.h".
+       * remote-sds.c (getmessage): Add semicolon after 'retry' label to
+       pacify GCC.
+
+2002-10-01  Andrew Cagney  <ac131313@redhat.com>
+
+       * rs6000-tdep.c (rs6000_gdbarch_init): For powerpc:7400, fix
+       "vrsave"'s register number.
+
+2002-09-30  Andrew Cagney  <ac131313@redhat.com>
+
+       * mips-tdep.c (mips_frame_saved_pc): When a generic dummy frame,
+       use frame_unwind_signed_register to obtain the PC.
+       (mips_frame_chain): Handle a generic dummy frame.
+       (mips_init_extra_frame_info): When a generic dummy frame, don't
+       re-compute the frame base.
+       (mips_pop_frame): Handle generic dummy frames.
+       (mips_gdbarch_init): When generic dummy frames, set
+       use_generic_dummy_frames, push_dummy_frame to
+       generic_push_dummy_frame, pc_in_call_dummy to
+       generic_pc_in_call_dummy, and save_dummy_frame_top_of_stack to
+       generic_save_dummy_frame_tos.
+
+2002-09-30  Andrew Cagney  <ac131313@redhat.com>
+
+       * blockframe.c (generic_find_dummy_frame): Rewrite.  Only test
+       against TOP when TOP was explictly set.
+       (generic_push_dummy_frame): Set TOP to zero.
+
+2002-09-30  Elena Zannoni  <ezannoni@redhat.com>
+
+       * event-loop.c (start_event_loop): Rename variable 'result' to
+       'gdb_result', to avoid conflicts with upcoming intepreters changes.
+
+2002-09-30  Keith Seitz  <keiths@redhat.com>
+
+       * gdb-events.sh (selected_thread_changed): New event.
+       * gdb-events.c: Regenerated.
+       * gdb-events.h: Regenerated.
+
+2002-09-30  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       * MAINTAINERS: Add self to Write After Approval list.
+
+2002-09-30  Fernando Nasser  <fnasser@redhat.com>
+
+       * disasm.c: New file.  
+       * disasm.h: New file.  
+       * mi/mi-cmd-disas.c (gdb_dis_asm_read_memory): Moved to disasm.c.
+       (compare_lines): Ditto.
+       (dump_insns): Ditto.
+       (do_mixed_source_and_assembly): Moved to disasm.c. Added uiout
+       argument.
+       (do_assembly_only): Ditto.
+       (do_disassembly): Renamed to gdb_disassembly and moved to
+       disasm.c.  Sdded uiout argument.
+       * Makefile.in: Add new files.  Reorder SFILES list. Update
+       dependencies.  Include libgdb.a later in the insight executable.
+
+2002-09-29  Andrew Cagney  <ac131313@redhat.com>
+
+       * config/djgpp/fnchange.lst: Rename bfd/elf64-alpha.c and
+       bfd/elf64-alpha-fbsd.c.
+
+2002-09-29  Andrew Cagney  <ac131313@redhat.com>
+
+       * config/djgpp/fnchange.lst: Rename i386gnu-nat.c and
+       i386gnu-tdep.c.
+
+2002-09-29  Andrew Cagney  <ac131313@redhat.com>
+
+       * gnu-nat.h (debug): Use __FILE__ and __LINE__ instead of
+       __FUNCTION__.
+       * gnu-nat.c (do_mach_notify_no_senders): Replace __FUNCTION__ with
+       function name.
+       (do_mach_notify_port_deleted, do_mach_notify_msg_accepted): Ditto.
+       (do_mach_notify_port_destroyed, do_mach_notify_send_once): Ditto.
+       (S_proc_setmsgport_reply, S_proc_getmsgport_reply): Ditto.
+       (S_msg_sig_post_reply): Ditto.
+       
+2002-09-28  Corinna Vinschen  <vinschen@redhat.com>
+
+       * sh-tdep.c (sh_use_struct_convention): Use definition according
+       to ABI.
+       (sh_push_arguments): Store in register with correct endianess.
+       (sh_default_store_return_value): Ditto.
+       (sh_gdbarch_init): Set sizeof long double to 8.
+
+2002-09-27  Mark Kettenis  <kettenis@gnu.org>
+
+       * defs.h: Move inclusion of "ansidecl.h" before "gdb_locale.h".
+       Fix some whitespace problems.
+
 2002-09-27  David Carlton  <carlton@math.stanford.edu>
 
        * Makefile.in (cris-tdep.o): Depend on gdb_string_h.
 
 2002-09-22  Fernando Nasser  <fnasser@redhat.com>
 
-       * source.c (get_current__or_default_source_symtab_and_line): Initialize
+       * source.c (get_current_or_default_source_symtab_and_line): Initialize
        sal.pc and sal.end fields.
        (get_current_or_default_source_symtab_and_line): Ditto.
        * breakpoint.c (parse_breakpoint_sals): Use correct accessor function
@@ -10604,9 +10896,9 @@ Wed Apr 24 14:22:21 2002  Andrew Cagney  <cagney@redhat.com>
        * breakpoint.c (break_at_finish_command): Export.
        (break_at_finish_at_depth_command): Export.
        (tbreak_at_finish_command): Export.
-       (_initialize_breakpoint): Delete "xbreak" and "tbreak" commands.
+       (_initialize_breakpoint): Delete "xbreak" and "txbreak" commands.
        * hppa-tdep.c (_initialize_hppa_tdep): Add "xbreak" and
-       "tbreak" commands, which are HPPA specific.
+       "txbreak" commands, which are HPPA specific.
 
        * printcmd.c (disassemble_command): Remove an ancient
        artifact of an old merge.
index 710609d1f7794bb1a742e9bac0015e7cdbda299f..a392f5a8435e7c8d84962a260122e8a349f5082e 100644 (file)
@@ -391,6 +391,7 @@ Martin Hunt                                 hunt@redhat.com
 Jim Ingham                                     jingham@apple.com
 Daniel Jacobowitz                              dan@debian.org
 Andreas Jaeger                                 aj@suse.de
+Jeff Johnston                                  jjohnstn@redhat.com
 Geoff Keating                                  geoffk@redhat.com
 Mark Kettenis                                  kettenis@gnu.org
 Jim Kingdon                                    jkingdon@engr.sgi.com  ++
@@ -403,10 +404,12 @@ Glen McCready                                     gkm@redhat.com
 Greg McGary                                    greg@mcgary.org
 Jason Merrill                                  jason@redhat.com
 David S. Miller                                        davem@redhat.com
+Marko Mlinar                                    markom@opencores.org
 Alan Modra                                     amodra@bigpond.net.au
 Jason Molenda                                  jmolenda@apple.com
 Pierre Muller                                  muller@sources.redhat.com
 Fernando Nasser                                        fnasser@redhat.com
+Hans-Peter Nilsson                             hp@bitrange.com
 David O'Brien                                  obrien@freebsd.org
 Alexandre Oliva                                        aoliva@redhat.com
 Tom Rix                                                trix@redhat.com
index 30b931f73e5a3f77bd1fb89567f21f3534412164..ed359957d2d9018be4dc8b36206dccfec4f9cb49 100644 (file)
@@ -530,30 +530,31 @@ TARGET_FLAGS_TO_PASS = \
 # SFILES is used in building the distribution archive.
 
 SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
-       ax-general.c ax-gdb.c bcache.c blockframe.c breakpoint.c \
-       charset.c \
-       buildsym.c c-exp.y c-lang.c c-typeprint.c c-valprint.c \
-       coffread.c \
-       complaints.c completer.c corefile.c cp-valprint.c dbxread.c \
-       demangle.c dictionary.c dwarfread.c \
-       dwarf2read.c elfread.c environ.c eval.c \
-       event-loop.c event-top.c \
-       expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \
-       findvar.c regcache.c gdbarch.c arch-utils.c gdbtypes.c osabi.c \
-       inf-loop.c infcmd.c inflow.c infrun.c language.c \
-       kod.c kod-cisco.c \
-       ui-out.c cli-out.c \
-       varobj.c wrapper.c \
+       ax-general.c ax-gdb.c \
+       bcache.c blockframe.c breakpoint.c buildsym.c builtin-regs.c \
+       c-exp.y c-lang.c c-typeprint.c c-valprint.c \
+       charset.c cli-out.c coffread.c complaints.c completer.c corefile.c \
+       cp-abi.c cp-support.c cp-valprint.c \
+       dbxread.c demangle.c dictionary.c \
+       disasm.c doublest.c dwarfread.c dwarf2read.c \
+       elfread.c environ.c eval.c event-loop.c event-top.c expprint.c \
+       f-exp.y f-lang.c f-typeprint.c f-valprint.c findvar.c frame.c \
+       gdbarch.c arch-utils.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \
+       hpacc-abi.c \
+       inf-loop.c infcmd.c inflow.c infrun.c \
        jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \
-       m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c main.c maint.c \
-       memattr.c mem-break.c minsyms.c mipsread.c nlmread.c objfiles.c \
-       p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c \
-       macrotab.c macroexp.c macrocmd.c macroscope.c \
-       printcmd.c remote.c scm-exp.c scm-lang.c \
-       scm-valprint.c source.c stabsread.c stack.c symfile.c \
-       symmisc.c symtab.c linespec.c target.c thread.c top.c tracepoint.c \
-       typeprint.c utils.c valarith.c valops.c valprint.c values.c \
-       serial.c ser-unix.c mdebugread.c \
+       kod.c kod-cisco.c \
+       language.c linespec.c \
+       m2-exp.y m2-lang.c m2-typeprint.c m2-valprint.c \
+       macrotab.c macroexp.c macrocmd.c macroscope.c main.c maint.c \
+       mdebugread.c memattr.c mem-break.c minsyms.c mipsread.c \
+       nlmread.c \
+       objfiles.c osabi.c \
+       p-exp.y p-lang.c p-typeprint.c p-valprint.c parse.c printcmd.c \
+       regcache.c remote.c \
+       scm-exp.c scm-lang.c scm-valprint.c serial.c ser-unix.c source.c \
+       stabsread.c stack.c std-regs.c symfile.c symmisc.c symtab.c \
+       target.c thread.c top.c tracepoint.c typeprint.c \
        tui/tui.c tui/tui.h tui/tuiCommand.c tui/tuiCommand.h \
        tui/tuiData.c tui/tuiData.h tui/tuiDataWin.c tui/tuiDataWin.h \
        tui/tuiDisassem.c tui/tuiDisassem.h tui/tuiGeneralWin.c \
@@ -562,10 +563,9 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
        tui/tuiSource.h tui/tuiSourceWin.c tui/tuiSourceWin.h \
        tui/tuiStack.c tui/tuiStack.h tui/tuiWin.c tui/tuiWin.h \
        tui/tui-file.h tui/tui-file.c tui/tui-out.c tui/tui-hooks.c \
-       ui-file.h ui-file.c \
-       frame.c doublest.c \
-       builtin-regs.c std-regs.c \
-       gnu-v2-abi.c gnu-v3-abi.c hpacc-abi.c cp-abi.c cp-support.c
+       ui-out.c utils.c ui-file.h ui-file.c \
+       valarith.c valops.c valprint.c values.c varobj.c \
+       wrapper.c
 
 LINTFILES = $(SFILES) $(YYFILES) $(CONFIG_SRCS) init.c
 
@@ -639,6 +639,7 @@ defs_h = defs.h $(config_h) $(gdb_locale_h) $(gdb_signals_h) $(ansidecl_h) \
        $(libiberty_h) $(progress_h) $(bfd_h) $(tui_h) $(ui_file_h) $(xm_h) \
        $(nm_h) $(tm_h) $(fopen_same_h) $(gdbarch_h) $(arch_utils_h)
 dictionary_h = dictionary.h
+disasm_h = disasm.h
 doublest_h = doublest.h $(floatformat_h)
 dst_h = dst.h
 dwarf2cfi_h = dwarf2cfi.h
@@ -829,7 +830,8 @@ TAGFILES_NO_SRCDIR = $(SFILES) $(HFILES_NO_SRCDIR) $(ALLDEPFILES) \
 TAGFILES_WITH_SRCDIR = $(HFILES_WITH_SRCDIR)
 
 COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o regcache.o \
-       charset.o dictionary.o \
+       charset.o dictionary.o disasm.o \
+       charset.o disasm.o \
        source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \
        symtab.o symfile.o symmisc.o linespec.o infcmd.o infrun.o \
        expprint.o environ.o stack.o thread.o \
@@ -1622,6 +1624,8 @@ dictionary.o: dictionary.c $(defs_h) $(dictionary_h) $(gdb_obstack_h) \
        $(symtab_h) $(buildsym_h) $(gdb_assert_h)
 dink32-rom.o: dink32-rom.c $(defs_h) $(gdbcore_h) $(target_h) $(monitor_h) \
        $(serial_h) $(symfile_h) $(inferior_h) $(regcache_h)
+disasm.o: disasm.c $(defs_h) $(gdb_string_h) $(target_h) $(value_h) \
+       $(disasm_h) $(ui_out_h)
 doublest.o: doublest.c $(defs_h) $(doublest_h) $(floatformat_h) \
        $(gdb_assert_h) $(gdb_string_h) $(gdbtypes_h)
 dpx2-nat.o: dpx2-nat.c $(defs_h) $(gdbcore_h) $(gdb_string_h)
@@ -2345,7 +2349,7 @@ install-gdbtk:
        else \
          true ; \
        fi ; \
-       $(SHELL) $(srcdir)/../mkinstalldirs $(bindir)
+       $(SHELL) $(srcdir)/../mkinstalldirs $(bindir); \
        $(INSTALL_PROGRAM) insight$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \
        $(SHELL) $(srcdir)/../mkinstalldirs $(GDBTK_LIBRARY) ; \
        $(SHELL) $(srcdir)/../mkinstalldirs $(libdir)/insight$(GDBTK_VERSION) ; \
@@ -2381,7 +2385,7 @@ insight$(EXEEXT): gdbtk-main.o main.o libgdb.a $(CONFIG_OBS) $(ADD_DEPS) \
                $(CDEPS) $(TDEPLIBS)
        rm -f insight$(EXEEXT)
        $(HLDENV) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
-               -o insight$(EXEEXT) gdbtk-main.o main.o libgdb.a $(CONFIG_OBS)\
+               -o insight$(EXEEXT) gdbtk-main.o main.o $(CONFIG_OBS) libgdb.a \
                $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
 
 gdbres.o: $(srcdir)/gdbtk/gdb.rc $(srcdir)/gdbtk/gdbtool.ico
@@ -2476,7 +2480,7 @@ mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c $(defs_h) $(mi_cmds_h) \
        $(mi_getopt_h) $(gdb_events_h) $(gdb_h)
        $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-break.c
 mi-cmd-disas.o: $(srcdir)/mi/mi-cmd-disas.c $(defs_h) $(target_h) $(value_h) \
-       $(mi_cmds_h) $(mi_getopt_h) $(ui_out_h) $(gdb_string_h)
+       $(mi_cmds_h) $(mi_getopt_h) $(ui_out_h) $(gdb_string_h) $(disasm_h)
        $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-cmd-disas.c
 mi-cmd-stack.o: $(srcdir)/mi/mi-cmd-stack.c $(defs_h) $(target_h) $(frame_h) \
        $(value_h) $(mi_cmds_h) $(ui_out_h) $(symtab_h) $(dictionary_h)
@@ -2497,7 +2501,7 @@ mi-main.o: $(srcdir)/mi/mi-main.c $(defs_h) $(target_h) $(inferior_h) \
        $(gdb_string_h) $(top_h) $(gdbthread_h) $(mi_cmds_h) $(mi_parse_h) \
        $(mi_getopt_h) $(mi_console_h) $(ui_out_h) $(mi_out_h) \
        $(event_loop_h) $(event_top_h) $(gdbcore_h) $(value_h) $(regcache_h) \
-       $(gdb_h)
+       $(gdb_h) $(frame_h)
        $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-main.c
 mi-out.o: $(srcdir)/mi/mi-out.c $(defs_h) $(ui_out_h) $(mi_out_h)
        $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/mi/mi-out.c
index 8dfa54ce5da88ecce679830823d302a0f37a26d0..4ce063e0794b4ae31a0a308b52a441cedc5a8a23 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,15 @@
 
 *** Changes since GDB 5.3:
 
+* Default MI syntax changed to "mi2".
+
+The default MI (machine interface) syntax, enabled by the command line
+option "-i=mi", has been changed to "mi2".  The previous MI syntax,
+"mi1", can be enabled by sepcifying the option "-i=mi1".
+
+Support for the original "mi0" syntax (included in GDB 5.0) has been
+removed.
+
 * REMOVED configurations and files
 
 V850EA ISA                             
index 674285d7074a5db57e98d60af14b1a261f01dadd..eba45a377d9192e283d50b9d25c779d4d24bc55e 100644 (file)
@@ -1151,8 +1151,8 @@ static struct dummy_frame *dummy_frame_stack = NULL;
 
 /* Function: find_dummy_frame(pc, fp, sp)
 
-   Search the stack of dummy frames for one matching the given PC, FP
-   and SP.  Unlike PC_IN_CALL_DUMMY, this function doesn't need to
+   Search the stack of dummy frames for one matching the given PC and
+   FP/SP.  Unlike PC_IN_CALL_DUMMY, this function doesn't need to
    adjust for DECR_PC_AFTER_BREAK.  This is because it is only legal
    to call this function after the PC has been adjusted.  */
 
@@ -1163,12 +1163,37 @@ generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp)
 
   for (dummyframe = dummy_frame_stack; dummyframe != NULL;
        dummyframe = dummyframe->next)
-    if ((pc >= dummyframe->call_lo && pc < dummyframe->call_hi)
-       && (fp == dummyframe->fp
-           || fp == dummyframe->sp
-           || fp == dummyframe->top))
-      /* The frame in question lies between the saved fp and sp, inclusive */
+    {
+      /* Does the PC fall within the dummy frame's breakpoint
+         instruction.  If not, discard this one.  */
+      if (!(pc >= dummyframe->call_lo && pc < dummyframe->call_hi))
+       continue;
+      /* Does the FP match?  */
+      if (dummyframe->top != 0)
+       {
+         /* If the target architecture explicitly saved the
+            top-of-stack before the inferior function call, assume
+            that that same architecture will always pass in an FP
+            (frame base) value that eactly matches that saved TOS.
+            Don't check the saved SP and SP as they can lead to false
+            hits.  */
+         if (fp != dummyframe->top)
+           continue;
+       }
+      else
+       {
+         /* An older target that hasn't explicitly or implicitly
+             saved the dummy frame's top-of-stack.  Try matching the
+             FP against the saved SP and FP.  NOTE: If you're trying
+             to fix a problem with GDB not correctly finding a dummy
+             frame, check the comments that go with FRAME_ALIGN() and
+             SAVE_DUMMY_FRAME_TOS().  */
+         if (fp != dummyframe->fp && fp != dummyframe->sp)
+           continue;
+       }
+      /* The FP matches this dummy frame.  */
       return dummyframe->regcache;
+    }
 
   return 0;
 }
@@ -1265,7 +1290,7 @@ generic_push_dummy_frame (void)
 
   dummy_frame->pc = read_pc ();
   dummy_frame->sp = read_sp ();
-  dummy_frame->top = dummy_frame->sp;
+  dummy_frame->top = 0;
   dummy_frame->fp = fp;
   regcache_cpy (dummy_frame->regcache, current_regcache);
   dummy_frame->next = dummy_frame_stack;
index 376f6d56370c7d8f340ccfb972acf724a866ab10..1f344c47b7bd3913e67fc902b0a85726dad1793a 100644 (file)
@@ -199,7 +199,6 @@ static int parse_number (char *, int, int, YYSTYPE *);
 %token <opcode> ASSIGN_MODIFY
 
 /* C++ */
-%token THIS
 %token TRUEKEYWORD
 %token FALSEKEYWORD
 
@@ -532,11 +531,6 @@ exp        :       STRING
        ;
 
 /* C++.  */
-exp    :       THIS
-                       { write_exp_elt_opcode (OP_THIS);
-                         write_exp_elt_opcode (OP_THIS); }
-       ;
-
 exp     :       TRUEKEYWORD    
                         { write_exp_elt_opcode (OP_LONG);
                           write_exp_elt_type (builtin_type_bool);
@@ -1615,17 +1609,6 @@ yylex ()
           {
             if (STREQN (tokstart, "true", 4))
               return TRUEKEYWORD;
-
-            if (STREQN (tokstart, "this", 4))
-              {
-                static const char this_name[] =
-                { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' };
-                
-                if (lookup_symbol (this_name, expression_context_block,
-                                   VAR_NAMESPACE, (int *) NULL,
-                                   (struct symtab **) NULL))
-                  return THIS;
-              }
           }
       break;
     case 3:
index b8a9eb8ea68fdc608a94f2cd56315a64a5b956c0..4d9fa8334cd20e55a0dc93977831270c7ea3bb4b 100644 (file)
@@ -28,6 +28,8 @@
 @V@/bfd/elf32-sh-nbsd.c @V@/bfd/e32shn.c
 @V@/bfd/elf32-sh64.c @V@/bfd/e32sh64.c
 @V@/bfd/elf32-sh64-nbsd.c @V@/bfd/e32sh64n.c
+@V@/bfd/elf64-alpha.c @V@/bfd/e64alphf.c
+@V@/bfd/elf64-alpha-fbsd.c @V@/bfd/e64alph.c
 @V@/bfd/elf64-sh64.c @V@/bfd/e64sh64.c
 @V@/bfd/elf64-sh64-nbsd.c @V@/bfd/e64sh64n.c
 @V@/dejagnu/baseboards/mn10200-cygmon.exp @V@/dejagnu/baseboards/mn10200cygmon.exp
@@ -86,7 +88,6 @@
 @V@/gdb/config/i386/nm-i386v42mp.h @V@/gdb/config/i386/nm-v42mp.h
 @V@/gdb/config/i386/tm-i386mk.h @V@/gdb/config/i386/tm-mk.h
 @V@/gdb/config/i386/tm-i386sol2.h @V@/gdb/config/i386/tm-sol2.h
-@V@/gdb/config/i386/tm-i386v4.h @V@/gdb/config/i386/tm-v4.h
 @V@/gdb/config/i386/tm-i386v42mp.h @V@/gdb/config/i386/tm-v42mp.h
 @V@/gdb/config/i386/xm-i386mach.h @V@/gdb/config/i386/xm-mach.h
 @V@/gdb/config/i386/xm-i386mk.h @V@/gdb/config/i386/xm-mk.h
 @V@/gdb/i386-linux-tdep.c @V@/gdb/i386linux-tdep.c
 @V@/gdb/i386bsd-nat.c @V@/gdb/i3bsd-nat.c
 @V@/gdb/i386bsd-tdep.c @V@/gdb/i3bsd-tdep.c
+@V@/gdb/i386gnu-nat.c @V@/gdb/i3gnu-nat.c
+@V@/gdb/i386gnu-tdep.c @V@/gdb/i3gnu-tdep.c
 @V@/gdb/i386nbsd-nat.c @V@/gdb/i3nbsd-nat.c
 @V@/gdb/i386nbsd-tdep.c @V@/gdb/i3nbsd-tdep.c
 @V@/gdb/ia64-aix-nat.c @V@/gdb/ia64aix-nat.c
index dc3edd2dbb282ee52758f5c65a27a580353e4cba..2029e99bbfc1f46eb78e067522add29d29ab6387 100644 (file)
@@ -1,3 +1,3 @@
 # Target: Intel 386 running the GNU Hurd
 TDEPFILES= i386-tdep.o i387-tdep.o i386gnu-tdep.o
-TM_FILE= tm-i386v4.h
+TM_FILE= tm-i386.h
index ace2258a91f91254df29127143018c23b77e42fe..11ab55f2c2fdf758df7b2146f73f82254f88e26d 100644 (file)
@@ -1,3 +1,3 @@
 # Target: Intel 386 running SCO Open Server 5
 TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386v4.h
+TM_FILE= tm-i386.h
index c22b6755985ab009f2642cf37a919401a334f542..d1b8c26726ccf2d73e81cabf87cccf6628f7d82b 100644 (file)
@@ -1,3 +1,3 @@
 # Target: Intel 386 running SVR4
 TDEPFILES= i386-tdep.o i387-tdep.o
-TM_FILE= tm-i386v4.h
+TM_FILE= tm-i386.h
index 11bc47426e6a294b1726d6026979f2d8917ac4e3..4773daec1b6a2ffd2d4f9c6208e512dc805d88fd 100644 (file)
@@ -1,3 +1,3 @@
 # Target: Intel 386 running SVR4
 TDEPFILES= i386-tdep.o i387-tdep.o solib.o solib-svr4.o solib-legacy.o
-TM_FILE= tm-i386v4.h
+TM_FILE= tm-i386.h
index e3bdc2df97c4c89d5187845b39708d0416b981b7..ec7a3bd97d98c11d87651cfa39ef71d851822c45 100644 (file)
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#define REGISTER_U_ADDR(addr, blockend, regno) \
-       (addr) = i386_register_u_addr ((blockend),(regno));
+#ifndef NM_I386SCO_H
+#define NM_I386SCO_H
 
-extern int i386_register_u_addr (int, int);
+#include "i386/nm-i386v.h"
 
 /* When calling functions on SCO, sometimes we get an error writing some
    of the segment registers.  This would appear to be a kernel
    bug/non-feature.  */
 #define CANNOT_STORE_REGISTER(regno) ((regno) == 14 || (regno) == 15)
+
+#endif /* nm-i386sco.h */
index 35d63d168659563b63c6dda98b3daa7787b3cacc..5a79f67dabc5ddb9e6007555e495ec530851922b 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef TM_I386SOL2_H
 #define TM_I386SOL2_H 1
 
-#include "i386/tm-i386v4.h"
+#include "i386/tm-i386.h"
 
 /* The SunPRO compiler puts out 0 instead of the address in N_SO symbols,
    and for SunPRO 3.0, N_FUN symbols too.  */
diff --git a/gdb/config/i386/tm-i386v4.h b/gdb/config/i386/tm-i386v4.h
deleted file mode 100644 (file)
index 9363327..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Macro definitions for GDB on an Intel i386 running SVR4.
-   Copyright 1991, 1994, 1995, 1998, 1999, 2000, 2002
-   Free Software Foundation, Inc.
-   Written by Fred Fish at Cygnus Support (fnf@cygnus.com)
-
-   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.  */
-
-#ifndef TM_I386V4_H
-#define TM_I386V4_H 1
-
-/* Pick up most of what we need from the generic i386 target include file.  */
-#include "i386/tm-i386.h"
-
-/* It is unknown which, if any, SVR4 assemblers do not accept dollar signs
-   in identifiers.  The default in G++ is to use dots instead, for all SVR4
-   systems, so we make that our default also.  FIXME: There should be some
-   way to get G++ to tell us what CPLUS_MARKER it is using, perhaps by
-   stashing it in the debugging information as part of the name of an
-   invented symbol ("gcc_cplus_marker$" for example). */
-
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
-
-#endif /* ifndef TM_I386V4_H */
index 5671e42944c06aeb93b0f106b1229701fa78f6a7..527fdbb1226caf3711511b1532825d5d1478ae3a 100644 (file)
@@ -24,7 +24,7 @@
 
 /* pick up more generic x86 sysv4 stuff */
 
-#include "i386/tm-i386v4.h"
+#include "i386/tm-i386.h"
 
 /* define to select for other sysv4.2mp weirdness (see procfs.c) */
 
index 8d773c8c292f54f901c77c2ee8ba4863e30c893c..2b7a86c74c3562aa5620d87f2141657986b58799 100644 (file)
@@ -30,7 +30,7 @@
 #include <sys/reg.h>
 
 #ifdef SEQUENT_PTX4
-#include "i386/tm-i386v4.h"
+#include "i386/tm-i386.h"
 #else /* !SEQUENT_PTX4 */
 #include "i386/tm-i386.h"
 #endif
index 920ebbb3c4d66aef458126af6f8e5e6f402015dc..72552c93341ceda930f5aa4d23ea7177c1f8ecef 100644 (file)
@@ -33,8 +33,3 @@
    GDB does not currently support the termio/job control combination.  */
 #undef HAVE_TERMIO
 #define HAVE_TERMIOS
-
-/* SCO's assembler doesn't grok dollar signs in identifiers.
-   So we use dots instead.  This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
index 11859e59a5d4d66cc88b233998494b477094d83a..c298a391f8037401feb2d628adcb767d0ef9346b 100644 (file)
 
 #include "mips/tm-bigmips.h"
 
-/* SGI's assembler doesn't grok dollar signs in identifiers.
-   So we use dots instead.  This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
-
 /* Redefine register numbers for SGI. */
 
 #undef NUM_REGS
index 6a91ebc6239ca772d254f9feb04e77d04501a6ef..ce9c2261854a3168998eb262c2b8e8672879fdbc 100644 (file)
    Boston, MA 02111-1307, USA.  */
 
 #include "mips/tm-bigmips64.h"
-
-/* SGI's assembler doesn't grok dollar signs in identifiers.
-   So we use dots instead.  This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
+#include "solib.h"
 
 /* Redefine register numbers for SGI. */
 
index ea0c0734f309f2310f38e14e81b80707fb0213f9..478e9bd164b1fc0c4cdd7006a4399d0255298273 100644 (file)
 
 #define TEXT_SEGMENT_BASE      0x10000000
 
-/* AIX's assembler doesn't grok dollar signs in identifiers.
-   So we use dots instead.  This item must be coordinated with G++. */
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
-
 /* Return whether PC in function NAME is in code that should be skipped when
    single-stepping.  */
 
index 35b95eb71f8927285ca3233e6af4a36d7ff24ef2..9a39af20d832027b94532a0784e8ec0858715c08 100644 (file)
@@ -35,13 +35,3 @@ extern int in_plt_section (CORE_ADDR, char *);
    where the function itself actually starts.  If not, return 0.  */
 
 #define SKIP_TRAMPOLINE_CODE(pc)  find_solib_trampoline_target (pc)
-
-/* It is unknown which, if any, SVR4 assemblers do not accept dollar signs
-   in identifiers.  The default in G++ is to use dots instead, for all SVR4
-   systems, so we make that our default also.  FIXME: There should be some
-   way to get G++ to tell us what CPLUS_MARKER it is using, perhaps by
-   stashing it in the debugging information as part of the name of an
-   invented symbol ("gcc_cplus_marker$" for example). */
-
-#undef CPLUS_MARKER
-#define CPLUS_MARKER '.'
index 28dc0259c24cc34ddafed4da9d5483976ed3c17c..f362d8475369202fe4771f9be4b4796dc4a48474 100644 (file)
@@ -161,21 +161,13 @@ cp_print_class_method (char *valaddr,
     }
 }
 
-/* This was what it was for gcc 2.4.5 and earlier.  */
-static const char vtbl_ptr_name_old[] =
-{
-  CPLUS_MARKER, 'v', 't', 'b', 'l', '_', 'p', 't', 'r', '_', 
-  't', 'y', 'p', 'e', 0
-};
-
-/* It was changed to this after 2.4.5.  */
+/* GCC versions after 2.4.5 use this.  */
 const char vtbl_ptr_name[] = "__vtbl_ptr_type";
 
-/* HP aCC uses different names */
+/* HP aCC uses different names */
 const char hpacc_vtbl_ptr_name[] = "__vfp";
 const char hpacc_vtbl_ptr_type_name[] = "__vftyp";
 
-
 /* Return truth value for assertion that TYPE is of the type
    "pointer to virtual function".  */
 
@@ -184,9 +176,7 @@ cp_is_vtbl_ptr_type (struct type *type)
 {
   char *typename = type_name_no_tag (type);
 
-  return (typename != NULL
-         && (STREQ (typename, vtbl_ptr_name)
-             || STREQ (typename, vtbl_ptr_name_old)));
+  return (typename != NULL && !strcmp (typename, vtbl_ptr_name));
 }
 
 /* Return truth value for the assertion that TYPE is of the type
index 235d285238a81bcc4870434e460849ee7d879a2c..7491727993c33407ad863bd40bdf81594bf687d6 100644 (file)
 #ifndef DEFS_H
 #define DEFS_H
 
-#include "config.h"            /* Generated by configure */
+#include "config.h"            /* Generated by configure.  */
+
 #include <stdio.h>
-#include <errno.h>             /* System call error return status */
+#include <errno.h>             /* System call error return status */
 #include <limits.h>
 
 #ifdef HAVE_STDDEF_H
 #include <stddef.h>
 #else
-#include <sys/types.h>         /* for size_t */
+#include <sys/types.h>         /* For size_t.  */
 #endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
+/* First include ansidecl.h so we can use the various macro definitions
+   here and in all subsequent file inclusions.  */
+
+#include "ansidecl.h"
+
 #include "gdb_locale.h"
 
 /* For ``enum target_signal''.  */
 #include "gdb/signals.h"
 
-/* Just in case they're not defined in stdio.h. */
+/* Just in case they're not defined in stdio.h.  */
 
 #ifndef SEEK_SET
 #define SEEK_SET 0
 #define SEEK_CUR 1
 #endif
 
-/* First include ansidecl.h so we can use the various macro definitions
-   here and in all subsequent file inclusions.  */
-
-#include "ansidecl.h"
-
-#include <stdarg.h>            /* for va_list */
+#include <stdarg.h>            /* For va_list.  */
 
 #include "libiberty.h"
 
@@ -156,10 +157,6 @@ typedef bfd_vma CORE_ADDR;
 #define STREQ(a,b) (*(a) == *(b) ? !strcmp ((a), (b)) : 0)
 #define STREQN(a,b,c) (*(a) == *(b) ? !strncmp ((a), (b), (c)) : 0)
 
-/* The character GNU C++ uses to build identifiers that must be unique from
-   the program's identifiers (such as $this and $$vptr).  */
-#define CPLUS_MARKER '$'       /* May be overridden to '.' for SysV */
-
 /* Check if a character is one of the commonly used C++ marker characters.  */
 extern int is_cplus_marker (int);
 
index 1fd69be4c58f5c15327bc1881c7aa2ba758d66c7..2b9579bc59ca7691396a1b57f746b5ace2306dbb 100644 (file)
@@ -150,24 +150,18 @@ set_demangling_style (char *style)
   set_demangling_command ((char *) NULL, 0, (struct cmd_list_element *) NULL);
 }
 
-/* In order to allow a single demangler executable to demangle strings
-   using various common values of CPLUS_MARKER, as well as any specific
-   one set at compile time, we maintain a string containing all the
-   commonly used ones, and check to see if the marker we are looking for
-   is in that string.  CPLUS_MARKER is usually '$' on systems where the
-   assembler can deal with that.  Where the assembler can't, it's usually
-   '.' (but on many systems '.' is used for other things).  We put the
-   current defined CPLUS_MARKER first (which defaults to '$'), followed
-   by the next most common value, followed by an explicit '$' in case
-   the value of CPLUS_MARKER is not '$'.
-
-   We could avoid this if we could just get g++ to tell us what the actual
-   cplus marker character is as part of the debug information, perhaps by
-   ensuring that it is the character that terminates the gcc<n>_compiled
-   marker symbol (FIXME). */
-
-static char cplus_markers[] =
-{CPLUS_MARKER, '.', '$', '\0'};
+/* G++ uses a special character to indicate certain internal names.  Which
+   character it is depends on the platform:
+   - Usually '$' on systems where the assembler will accept that
+   - Usually '.' otherwise (this includes most sysv4-like systems and most
+     ELF targets)
+   - Occasionally '_' if neither of the above is usable
+
+   We check '$' first because it is the safest, and '.' often has another
+   meaning.  We don't currently try to handle '_' because the precise forms
+   of the names are different on those targets.  */
+
+static char cplus_markers[] = {'$', '.', '\0'};
 
 int
 is_cplus_marker (int c)
@@ -204,5 +198,4 @@ Use `set demangle-style' without arguments for a list of demangling styles.",
 
   /* Set the default demangling style chosen at compilation time. */
   set_demangling_style (DEFAULT_DEMANGLING_STYLE);
-  set_cplus_marker_for_demangling (CPLUS_MARKER);
 }
index 362e05679fb1f5d545878a89872b34477eb002df..72544a03909dc1f87ec316dd18f067cc07b706be 100644 (file)
@@ -1,3 +1,34 @@
+2002-10-11  Klee Dienes  <kdienes@apple.com>
+
+       * gdb.texinfo (Registers): Mention vector registers as well as
+       floating registers in the documentation for 'info registers' and
+       'info all-registers'.
+
+2002-10-11  Daniel Jacobowitz  <drow@mvista.com>
+
+       * gdbint.texinfo (CPLUS_MARKER): Remove item.
+
+2002-10-03  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * gdbint.texinfo (Item Output Functions): Add new ui_out_field_fmt_int
+       interface definition.
+
+2002-10-03  Marko Mlinar   <markom@opencores.org>
+
+       * gdb.texinfo (Target Commands): Add or1k target specific
+       commands.
+       * gdb.texinfo (Contributors): Add myself to the contributors list.
+
+2002-10-01  Andrew Cagney  <ac131313@redhat.com>
+
+       * gdb.texinfo (Mode Options): Update --interpreter option.  "mi2"
+       and "mi1" instead of "mi1" and "mi0".
+
+2002-09-29  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       * gdb.texinfo (Packets): Fix typos "alligned".
+       Correct z3/Z3 description.  Correct z4/Z4 title.
+
 2002-09-27  Andrew Cagney  <ac131313@redhat.com>
 
        * all-cfg.texi: Use @sc for GDB and GCC.  Update copyright.
index 7e93c229491dd8235bdbe5d3a0816772a9e37686..56db6ca04fe95ccbdf8294e8bcc7473d7e25dc5a 100644 (file)
@@ -394,6 +394,7 @@ Michael Tiemann contributed SPARC support.
 Tim Tucker contributed support for the Gould NP1 and Gould Powernode.
 Pace Willison contributed Intel 386 support.
 Jay Vosburgh contributed Symmetry support.
+Marko Mlinar contributed OpenRISC 1000 support.
 
 Andreas Schwab contributed M68K @sc{gnu}/Linux support.
 
@@ -1127,10 +1128,12 @@ Use the interpreter @var{interp} for interface with the controlling
 program or device.  This option is meant to be set by programs which
 communicate with @value{GDBN} using it as a back end.
 
-@samp{--interpreter=mi} (or @samp{--interpreter=mi1}) causes
-@value{GDBN} to use the @dfn{gdb/mi interface} (@pxref{GDB/MI, , The
-@sc{gdb/mi} Interface}). The older @sc{gdb/mi} interface, included in
-@value{GDBN} version 5.0 can be selected with @samp{--interpreter=mi0}.
+@samp{--interpreter=mi} (or @samp{--interpreter=mi2}) causes
+@value{GDBN} to use the current @dfn{@sc{gdb/mi} interface}
+(@pxref{GDB/MI, , The @sc{gdb/mi} Interface}).  The previous @sc{gdb/mi}
+interface, included in @value{GDBN} version 5.3, can be selected with
+@samp{--interpreter=mi1}.  Earlier @sc{gdb/mi} interfaces
+are not supported.
 
 @item -write
 @cindex @code{--write}
@@ -5554,13 +5557,13 @@ your machine.
 @kindex info registers
 @item info registers
 Print the names and values of all registers except floating-point
-registers (in the selected stack frame).
+and vector registers (in the selected stack frame).
 
 @kindex info all-registers
 @cindex floating point registers
 @item info all-registers
 Print the names and values of all registers, including floating-point
-registers.
+and vector registers (in the selected stack frame).
 
 @item info registers @var{regname} @dots{}
 Print the @dfn{relativized} value of each specified register @var{regname}.
@@ -11648,6 +11651,7 @@ configurations.
 * M68K::                        Motorola M68K
 @c OBSOLETE * M88K::                        Motorola M88K
 * MIPS Embedded::               MIPS Embedded
+* OpenRISC 1000::               OpenRisc 1000
 * PA::                          HP PA Embedded
 * PowerPC:                      PowerPC
 * SH::                          Hitachi SH
@@ -12236,6 +12240,130 @@ forever because it has no way of knowing how long the program is going
 to run before stopping.
 @end table
 
+@node OpenRISC 1000
+@subsection OpenRISC 1000
+@cindex OpenRISC 1000
+
+@cindex or1k boards
+See OR1k Architecture document (@uref{www.opencores.org}) for more information
+about platform and commands.
+
+@table @code
+
+@kindex target jtag
+@item target jtag jtag://@var{host}:@var{port}
+
+Connects to remote JTAG server.
+JTAG remote server can be either an or1ksim or JTAG server,
+connected via parallel port to the board.
+
+Example: @code{target jtag jtag://localhost:9999}
+
+@kindex or1ksim
+@item or1ksim @var{command}
+If connected to @code{or1ksim} OpenRISC 1000 Architectural
+Simulator, proprietary commands can be executed.
+
+@kindex info or1k spr
+@item info or1k spr
+Displays spr groups.
+
+@item info or1k spr @var{group}
+@itemx info or1k spr @var{groupno}
+Displays register names in selected group.
+
+@item info or1k spr @var{group} @var{register}
+@itemx info or1k spr @var{register}
+@itemx info or1k spr @var{groupno} @var{registerno}
+@itemx info or1k spr @var{registerno}
+Shows information about specified spr register.
+
+@kindex spr
+@item spr @var{group} @var{register} @var{value}
+@itemx spr @var{register @var{value}}
+@itemx spr @var{groupno} @var{registerno @var{value}}
+@itemx spr @var{registerno @var{value}}
+Writes @var{value} to specified spr register.
+@end table
+
+Some implementations of OpenRISC 1000 Architecture also have hardware trace.
+It is very similar to @value{GDBN} trace, except it does not interfere with normal
+program execution and is thus much faster.  Hardware breakpoints/watchpoint
+triggers can be set using:
+@table @code
+@item $LEA/$LDATA
+Load effective address/data
+@item $SEA/$SDATA
+Store effective address/data
+@item $AEA/$ADATA
+Access effective address ($SEA or $LEA) or data ($SDATA/$LDATA)
+@item $FETCH
+Fetch data
+@end table
+
+When triggered, it can capture low level data, like: @code{PC}, @code{LSEA},
+@code{LDATA}, @code{SDATA}, @code{READSPR}, @code{WRITESPR}, @code{INSTR}.
+
+@code{htrace} commands:
+@cindex OpenRISC 1000 htrace
+@table @code
+@kindex hwatch
+@item hwatch @var{conditional}
+Set hardware watchpoint on combination of Load/Store Effecive Address(es)
+or Data.  For example:
+
+@code{hwatch ($LEA == my_var) && ($LDATA < 50) || ($SEA == my_var) && ($SDATA >= 50)}
+
+@code{hwatch ($LEA == my_var) && ($LDATA < 50) || ($SEA == my_var) && ($SDATA >= 50)}
+
+@kindex htrace info
+@item htrace info
+Display information about current HW trace configuration.
+
+@kindex htrace trigger
+@item htrace trigger @var{conditional}
+Set starting criteria for HW trace.
+
+@kindex htrace qualifier
+@item htrace qualifier @var{conditional}
+Set acquisition qualifier for HW trace.
+
+@kindex htrace stop
+@item htrace stop @var{conditional}
+Set HW trace stopping criteria.
+
+@kindex htrace record
+@item htrace record @var{[data]*}
+Selects the data to be recorded, when qualifier is met and HW trace was
+triggered.
+
+@kindex htrace enable
+@item htrace enable
+@kindex htrace disable
+@itemx htrace disable
+Enables/disables the HW trace.
+
+@kindex htrace rewind
+@item htrace rewind @var{[filename]}
+Clears currently recorded trace data.
+
+If filename is specified, new trace file is made and any newly collected data
+will be written there.
+
+@kindex htrace print
+@item htrace print @var{[start [len]]}
+Prints trace buffer, using current record configuration.
+
+@kindex htrace mode continuous
+@item htrace mode continuous
+Set continuous trace mode.
+
+@kindex htrace mode suspend
+@item htrace mode suspend
+Set suspend trace mode.
+
+@end table
+
 @node PowerPC
 @subsection PowerPC
 
@@ -15053,7 +15181,7 @@ Reserved for future use.
 
 Read @var{length} bytes of memory starting at address @var{addr}.
 Neither @value{GDBN} nor the stub assume that sized memory transfers are
-assumed using word alligned accesses. FIXME: @emph{A word aligned memory
+assumed using word aligned accesses. FIXME: @emph{A word aligned memory
 transfer mechanism is needed.}
 
 Reply:
@@ -15061,7 +15189,7 @@ Reply:
 @item @var{XX@dots{}}
 @var{XX@dots{}} is mem contents. Can be fewer bytes than requested if able
 to read only part of the data.  Neither @value{GDBN} nor the stub assume
-that sized memory transfers are assumed using word alligned
+that sized memory transfers are assumed using word aligned
 accesses. FIXME: @emph{A word aligned memory transfer mechanism is
 needed.}
 @item E@var{NN}
@@ -15353,7 +15481,7 @@ for an error
 @cindex @code{z3} packet
 @cindex @code{Z3} packet
 
-Insert (@code{Z3}) or remove (@code{z3}) a write watchpoint.
+Insert (@code{Z3}) or remove (@code{z3}) a read watchpoint.
 
 Reply:
 @table @samp
@@ -15365,8 +15493,8 @@ not supported
 for an error
 @end table
 
-@item @code{z}@code{4}@code{,}@var{addr}@code{,}@var{length} --- remove read watchpoint @strong{(draft)}
-@item @code{Z}@code{4}@code{,}@var{addr}@code{,}@var{length} --- insert read watchpoint @strong{(draft)}
+@item @code{z}@code{4}@code{,}@var{addr}@code{,}@var{length} --- remove access watchpoint @strong{(draft)}
+@item @code{Z}@code{4}@code{,}@var{addr}@code{,}@var{length} --- insert access watchpoint @strong{(draft)}
 @cindex @code{z4} packet
 @cindex @code{Z4} packet
 
index 1c3743bd08cab24759d78d4edf86b7673f85e81d..87dd5b6f128252c07c5049ec2e1369c9f9918910 100644 (file)
@@ -1011,6 +1011,13 @@ This function outputs a value of an @code{int} variable.  It uses the
 the name of the field.
 @end deftypefun
 
+@deftypefun void ui_out_field_fmt_int (struct ui_out *@var{uiout}, int @var{width}, enum ui_align @var{alignment}, const char *@var{fldname}, int @var{value})
+This function outputs a value of an @code{int} variable.  It differs from
+@code{ui_out_field_int} in that the caller specifies the desired @var{width} and @var{alignment} of the output.
+@var{fldname} specifies
+the name of the field.
+@end deftypefun
+
 @deftypefun void ui_out_field_core_addr (struct ui_out *@var{uiout}, const char *@var{fldname}, CORE_ADDR @var{address})
 This function outputs an address.
 @end deftypefun
@@ -3062,13 +3069,6 @@ Return non-zero if register @var{regnum} can represent data values in a
 non-standard form.
 @xref{Target Architecture Definition, , Using Different Register and Memory Data Representations}.
 
-@item CPLUS_MARKER
-@findex CPLUS_MARKERz
-Define this to expand into the character that G@t{++} uses to distinguish
-compiler-generated identifiers from programmer-specified identifiers.
-By default, this expands into @code{'$'}.  Most System V targets should
-define this to @code{'.'}.
-
 @item DBX_PARM_SYMBOL_CLASS
 @findex DBX_PARM_SYMBOL_CLASS
 Hook for the @code{SYMBOL_CLASS} of a parameter when decoding DBX symbol
index a186a59694488335cb5643df6e7b950346855f39..d3ff19053f8f41c2ad9e03abe29e464d6e77dd72 100644 (file)
@@ -162,6 +162,11 @@ unsigned int dwarf_eh_frame_size;
 
 /* local data types */
 
+/* We hold several abbreviation tables in memory at the same time. */
+#ifndef ABBREV_HASH_SIZE
+#define ABBREV_HASH_SIZE 121
+#endif
+
 /* The data in a compilation unit header, after target2host
    translation, looks like this.  */
 struct comp_unit_head
@@ -174,6 +179,29 @@ struct comp_unit_head
     unsigned int offset_size;  /* size of file offsets; either 4 or 8 */
     unsigned int initial_length_size; /* size of the length field; either
                                          4 or 12 */
+
+    /* Offset to the first byte of this compilation unit header in the 
+     * .debug_info section, for resolving relative reference dies. */
+
+    unsigned int offset;
+
+    /* Pointer to this compilation unit header in the .debug_info
+     * section */
+
+    char *cu_head_ptr;
+
+    /* Pointer to the first die of this compilatio unit.  This will
+     * be the first byte following the compilation unit header. */
+
+    char *first_die_ptr;
+
+    /* Pointer to the next compilation unit header in the program. */
+
+    struct comp_unit_head *next;
+
+    /* DWARF abbreviation table associated with this compilation unit */
+
+    struct abbrev_info *dwarf2_abbrevs[ABBREV_HASH_SIZE];
   };
 
 /* The line number information for a compilation unit (found in the
@@ -312,17 +340,10 @@ struct dwarf_block
     char *data;
   };
 
-/* We only hold one compilation unit's abbrevs in
-   memory at any one time.  */
-#ifndef ABBREV_HASH_SIZE
-#define ABBREV_HASH_SIZE 121
-#endif
 #ifndef ATTR_ALLOC_CHUNK
 #define ATTR_ALLOC_CHUNK 4
 #endif
 
-static struct abbrev_info *dwarf2_abbrevs[ABBREV_HASH_SIZE];
-
 /* A hash table of die offsets for following references.  */
 #ifndef REF_HASH_SIZE
 #define REF_HASH_SIZE 1021
@@ -686,11 +707,12 @@ static void psymtab_to_symtab_1 (struct partial_symtab *);
 
 char *dwarf2_read_section (struct objfile *, file_ptr, unsigned int);
 
-static void dwarf2_read_abbrevs (bfd *, unsigned int);
+static void dwarf2_read_abbrevs (bfd *abfd, struct comp_unit_head *cu_header);
 
 static void dwarf2_empty_abbrev_table (PTR);
 
-static struct abbrev_info *dwarf2_lookup_abbrev (unsigned int);
+static struct abbrev_info *dwarf2_lookup_abbrev (unsigned int,
+                                         const struct comp_unit_head *cu_header);
 
 static char *read_partial_die (struct partial_die_info *,
                               bfd *, char *,
@@ -1211,9 +1233,14 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
                 (long) (beg_of_comp_unit - dwarf_info_buffer));
          return;
        }
+      /* Complete the cu_header */
+      cu_header.offset = beg_of_comp_unit - dwarf_info_buffer;
+      cu_header.first_die_ptr = info_ptr;
+      cu_header.cu_head_ptr = beg_of_comp_unit;
+
       /* Read the abbrevs for this compilation unit into a table */
-      dwarf2_read_abbrevs (abfd, cu_header.abbrev_offset);
-      make_cleanup (dwarf2_empty_abbrev_table, NULL);
+      dwarf2_read_abbrevs (abfd, &cu_header);
+      make_cleanup (dwarf2_empty_abbrev_table, cu_header.dwarf2_abbrevs);
 
       /* Read the compilation unit die */
       info_ptr = read_partial_die (&comp_unit_die, abfd, info_ptr,
@@ -1560,8 +1587,8 @@ psymtab_to_symtab_1 (struct partial_symtab *pst)
   info_ptr = read_comp_unit_head (&cu_header, info_ptr, abfd);
 
   /* Read the abbrevs for this compilation unit  */
-  dwarf2_read_abbrevs (abfd, cu_header.abbrev_offset);
-  make_cleanup (dwarf2_empty_abbrev_table, NULL);
+  dwarf2_read_abbrevs (abfd, &cu_header);
+  make_cleanup (dwarf2_empty_abbrev_table, cu_header.dwarf2_abbrevs);
 
   dies = read_comp_unit (info_ptr, abfd, &cu_header);
 
@@ -3344,17 +3371,18 @@ dwarf2_read_section (struct objfile *objfile, file_ptr offset,
    in a hash table.  */
 
 static void
-dwarf2_read_abbrevs (bfd *abfd, unsigned int offset)
+dwarf2_read_abbrevs (bfd *abfd, struct comp_unit_head *cu_header)
 {
   char *abbrev_ptr;
   struct abbrev_info *cur_abbrev;
   unsigned int abbrev_number, bytes_read, abbrev_name;
   unsigned int abbrev_form, hash_number;
 
-  /* empty the table */
-  dwarf2_empty_abbrev_table (NULL);
+  /* Initialize dwarf2 abbrevs */
+  memset (cu_header->dwarf2_abbrevs, 0,
+          ABBREV_HASH_SIZE*sizeof (struct abbrev_info *));
 
-  abbrev_ptr = dwarf_abbrev_buffer + offset;
+  abbrev_ptr = dwarf_abbrev_buffer + cu_header->abbrev_offset;
   abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
   abbrev_ptr += bytes_read;
 
@@ -3393,8 +3421,8 @@ dwarf2_read_abbrevs (bfd *abfd, unsigned int offset)
        }
 
       hash_number = abbrev_number % ABBREV_HASH_SIZE;
-      cur_abbrev->next = dwarf2_abbrevs[hash_number];
-      dwarf2_abbrevs[hash_number] = cur_abbrev;
+      cur_abbrev->next = cu_header->dwarf2_abbrevs[hash_number];
+      cu_header->dwarf2_abbrevs[hash_number] = cur_abbrev;
 
       /* Get next abbreviation.
          Under Irix6 the abbreviations for a compilation unit are not
@@ -3408,7 +3436,7 @@ dwarf2_read_abbrevs (bfd *abfd, unsigned int offset)
        break;
       abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read);
       abbrev_ptr += bytes_read;
-      if (dwarf2_lookup_abbrev (abbrev_number) != NULL)
+      if (dwarf2_lookup_abbrev (abbrev_number, cu_header) != NULL)
        break;
     }
 }
@@ -3417,15 +3445,18 @@ dwarf2_read_abbrevs (bfd *abfd, unsigned int offset)
 
 /* ARGSUSED */
 static void
-dwarf2_empty_abbrev_table (PTR ignore)
+dwarf2_empty_abbrev_table (PTR ptr_to_abbrevs_table)
 {
   int i;
   struct abbrev_info *abbrev, *next;
+  struct abbrev_info **abbrevs;
+
+  abbrevs = (struct abbrev_info **)ptr_to_abbrevs_table;
 
   for (i = 0; i < ABBREV_HASH_SIZE; ++i)
     {
       next = NULL;
-      abbrev = dwarf2_abbrevs[i];
+      abbrev = abbrevs[i];
       while (abbrev)
        {
          next = abbrev->next;
@@ -3433,20 +3464,20 @@ dwarf2_empty_abbrev_table (PTR ignore)
          xfree (abbrev);
          abbrev = next;
        }
-      dwarf2_abbrevs[i] = NULL;
+      abbrevs[i] = NULL;
     }
 }
 
 /* Lookup an abbrev_info structure in the abbrev hash table.  */
 
 static struct abbrev_info *
-dwarf2_lookup_abbrev (unsigned int number)
+dwarf2_lookup_abbrev (unsigned int number, const struct comp_unit_head *cu_header)
 {
   unsigned int hash_number;
   struct abbrev_info *abbrev;
 
   hash_number = number % ABBREV_HASH_SIZE;
-  abbrev = dwarf2_abbrevs[hash_number];
+  abbrev = cu_header->dwarf2_abbrevs[hash_number];
 
   while (abbrev)
     {
@@ -3478,7 +3509,7 @@ read_partial_die (struct partial_die_info *part_die, bfd *abfd,
   if (!abbrev_number)
     return info_ptr;
 
-  abbrev = dwarf2_lookup_abbrev (abbrev_number);
+  abbrev = dwarf2_lookup_abbrev (abbrev_number, cu_header);
   if (!abbrev)
     {
       error ("Dwarf Error: Could not find abbrev number %d.", abbrev_number);
@@ -3622,7 +3653,7 @@ read_full_die (struct die_info **diep, bfd *abfd, char *info_ptr,
       return info_ptr;
     }
 
-  abbrev = dwarf2_lookup_abbrev (abbrev_number);
+  abbrev = dwarf2_lookup_abbrev (abbrev_number, cu_header);
   if (!abbrev)
     {
       error ("Dwarf Error: could not find abbrev number %d.", abbrev_number);
@@ -5960,6 +5991,18 @@ dwarf_stack_op_name (register unsigned op)
       return "DW_OP_xderef_size";
     case DW_OP_nop:
       return "DW_OP_nop";
+      /* DWARF 3 extensions.  */
+    case DW_OP_push_object_address:
+      return "DW_OP_push_object_address";
+    case DW_OP_call2:
+      return "DW_OP_call2";
+    case DW_OP_call4:
+      return "DW_OP_call4";
+    case DW_OP_call_ref:
+      return "DW_OP_call_ref";
+      /* GNU extensions.  */
+    case DW_OP_GNU_push_tls_address:
+      return "DW_OP_GNU_push_tls_address";
     default:
       return "OP_<unknown>";
     }
index 03eb41c6b1674df45ac2f06467e3ea27df09b455..0fa37c11f96d3e693fff9232a2e0352304480f30 100644 (file)
@@ -392,10 +392,12 @@ start_event_loop (void)
      longer any event sources registered. */
   while (1)
     {
-      int result = catch_errors (gdb_do_one_event, 0, "", RETURN_MASK_ALL);
-      if (result < 0)
+      int gdb_result;
+
+      gdb_result = catch_errors (gdb_do_one_event, 0, "", RETURN_MASK_ALL);
+      if (gdb_result < 0)
        break;
-      if (result == 0)
+      if (gdb_result == 0)
        {
          /* FIXME: this should really be a call to a hook that is
             interface specific, because interfaces can display the
index 86c658d030ec905434fd5af40beb18c72138cee6..9d871d6590625a79c37bd128d4c5f13357da1903 100644 (file)
@@ -1117,8 +1117,12 @@ set_async_prompt (char *args, int from_tty, struct cmd_list_element *c)
    interface, i.e. via a callback function (rl_callback_read_char),
    and hook up instream to the event loop. */
 void
-_initialize_event_loop (void)
+gdb_setup_readline (void)
 {
+  /* This function is a noop for the sync case.  The assumption is that
+     the sync setup is ALL done in gdb_init, and we would only mess it up
+     here.  The sync stuff should really go away over time. */
+
   if (event_loop_p)
     {
       /* If the input stream is connected to a terminal, turn on
@@ -1153,9 +1157,6 @@ _initialize_event_loop (void)
          register it with the event loop. */
       input_fd = fileno (instream);
 
-      /* Tell gdb to use the cli_command_loop as the main loop. */
-      command_loop_hook = cli_command_loop;
-
       /* Now we need to create the event sources for the input file
          descriptor. */
       /* At this point in time, this is the only event source that we
@@ -1166,3 +1167,15 @@ _initialize_event_loop (void)
       add_file_handler (input_fd, stdin_event_handler, 0);
     }
 }
+
+void
+_initialize_event_loop (void)
+{
+  gdb_setup_readline ();
+
+  if (event_loop_p && command_loop_hook == NULL)
+    {
+      /* Tell gdb to use the cli_command_loop as the main loop. */
+      command_loop_hook = cli_command_loop;
+    }
+}
index 79bb3d95a6f55db2cf861103d855d4796ebb32d2..849566bd8b670bf87df550fe0a18c3eca552e387 100644 (file)
@@ -373,4 +373,13 @@ extern int frame_register_read (struct frame_info *frame, int regnum,
 extern int frame_map_name_to_regnum (const char *name, int strlen);
 extern const char *frame_map_regnum_to_name (int regnum);
 
+/* From stack.c.  */
+extern void args_info (char *, int);
+
+extern void locals_info (char *, int);
+
+extern void (*selected_frame_level_changed_hook) (int);
+
+extern void return_command (char *, int);
+
 #endif /* !defined (FRAME_H)  */
index e32d0e49d63bd8b788d004504cb3d14e0a77d4d5..63ee3bc400bd271cbda60d8590f552ee388a96a1 100644 (file)
@@ -139,6 +139,16 @@ selected_frame_level_changed_event (int level)
   current_event_hooks->selected_frame_level_changed (level);
 }
 
+void
+selected_thread_changed_event (int thread_num)
+{
+  if (gdb_events_debug)
+    fprintf_unfiltered (gdb_stdlog, "selected_thread_changed_event\n");
+  if (!current_event_hooks->selected_thread_changed)
+    return;
+  current_event_hooks->selected_thread_changed (thread_num);
+}
+
 #endif
 
 #if WITH_GDB_EVENTS
@@ -173,6 +183,7 @@ enum gdb_event
   architecture_changed,
   target_changed,
   selected_frame_level_changed,
+  selected_thread_changed,
   nr_gdb_events
 };
 
@@ -211,6 +222,11 @@ struct selected_frame_level_changed
     int level;
   };
 
+struct selected_thread_changed
+  {
+    int thread_num;
+  };
+
 struct event
   {
     enum gdb_event type;
@@ -224,6 +240,7 @@ struct event
        struct tracepoint_delete tracepoint_delete;
        struct tracepoint_modify tracepoint_modify;
        struct selected_frame_level_changed selected_frame_level_changed;
+       struct selected_thread_changed selected_thread_changed;
       }
     data;
   };
@@ -319,6 +336,15 @@ queue_selected_frame_level_changed (int level)
   append (event);
 }
 
+static void
+queue_selected_thread_changed (int thread_num)
+{
+  struct event *event = XMALLOC (struct event);
+  event->type = selected_thread_changed;
+  event->data.selected_thread_changed.thread_num = thread_num;
+  append (event);
+}
+
 void
 gdb_events_deliver (struct gdb_events *vector)
 {
@@ -374,6 +400,10 @@ gdb_events_deliver (struct gdb_events *vector)
          vector->selected_frame_level_changed
            (event->data.selected_frame_level_changed.level);
          break;
+       case selected_thread_changed:
+         vector->selected_thread_changed
+           (event->data.selected_thread_changed.thread_num);
+         break;
        }
       delivering_events = event->next;
       xfree (event);
@@ -395,6 +425,7 @@ _initialize_gdb_events (void)
   queue_event_hooks.architecture_changed = queue_architecture_changed;
   queue_event_hooks.target_changed = queue_target_changed;
   queue_event_hooks.selected_frame_level_changed = queue_selected_frame_level_changed;
+  queue_event_hooks.selected_thread_changed = queue_selected_thread_changed;
 #endif
 
   c = add_set_cmd ("eventdebug", class_maintenance, var_zinteger,
index c3332d7a808e50b3e0a338cfb9a182f3d1935b4c..4836568f3c49d6506289aee57ba73b96059e3c52 100644 (file)
@@ -61,6 +61,7 @@ typedef void (gdb_events_tracepoint_modify_ftype) (int number);
 typedef void (gdb_events_architecture_changed_ftype) (void);
 typedef void (gdb_events_target_changed_ftype) (void);
 typedef void (gdb_events_selected_frame_level_changed_ftype) (int level);
+typedef void (gdb_events_selected_thread_changed_ftype) (int thread_num);
 
 
 /* gdb-events: object. */
@@ -76,6 +77,7 @@ struct gdb_events
     gdb_events_architecture_changed_ftype *architecture_changed;
     gdb_events_target_changed_ftype *target_changed;
     gdb_events_selected_frame_level_changed_ftype *selected_frame_level_changed;
+    gdb_events_selected_thread_changed_ftype *selected_thread_changed;
   };
 
 
@@ -91,6 +93,7 @@ extern void tracepoint_modify_event (int number);
 extern void architecture_changed_event (void);
 extern void target_changed_event (void);
 extern void selected_frame_level_changed_event (int level);
+extern void selected_thread_changed_event (int thread_num);
 
 
 /* When GDB_EVENTS are not being used, completly disable them. */
@@ -105,6 +108,7 @@ extern void selected_frame_level_changed_event (int level);
 #define architecture_changed_event() 0
 #define target_changed_event() 0
 #define selected_frame_level_changed_event(level) 0
+#define selected_thread_changed_event(thread_num) 0
 #endif
 
 /* Install custom gdb-events hooks. */
index ed3340b0e4e6572aa19c7323fad1739f489b8a14..458e4b60b9c34bd60ca71e376875674c29721e0b 100755 (executable)
@@ -67,6 +67,7 @@ f:void:tracepoint_modify:int number:number
 f:void:architecture_changed:void
 f:void:target_changed:void
 f:void:selected_frame_level_changed:int level:level
+f:void:selected_thread_changed:int thread_num:thread_num
 #*:void:annotate_starting_hook:void
 #*:void:annotate_stopped_hook:void
 #*:void:annotate_signalled_hook:void
index bc27aaeef6a7f6c2c377c09703829ba8b588df00..fe40062d3d5f5bca3779d477e1890264318c3243 100644 (file)
@@ -269,6 +269,8 @@ struct gdbarch
   gdbarch_elf_make_msymbol_special_ftype *elf_make_msymbol_special;
   gdbarch_coff_make_msymbol_special_ftype *coff_make_msymbol_special;
   const char * name_of_malloc;
+  int cannot_step_breakpoint;
+  int have_nonsteppable_watchpoint;
 };
 
 
@@ -427,6 +429,8 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   "malloc",
+  0,
+  0,
   /* startup_gdbarch() */
 };
 
@@ -804,6 +808,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of elf_make_msymbol_special, invalid_p == 0 */
   /* Skip verify of coff_make_msymbol_special, invalid_p == 0 */
   /* Skip verify of name_of_malloc, invalid_p == 0 */
+  /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
+  /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
   buf = ui_file_xstrdup (log, &dummy);
   make_cleanup (xfree, buf);
   if (strlen (buf) > 0)
@@ -993,6 +999,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->cannot_fetch_register
                         /*CANNOT_FETCH_REGISTER ()*/);
 #endif
+#ifdef CANNOT_STEP_BREAKPOINT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: CANNOT_STEP_BREAKPOINT # %s\n",
+                      XSTRING (CANNOT_STEP_BREAKPOINT));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: CANNOT_STEP_BREAKPOINT = %d\n",
+                      CANNOT_STEP_BREAKPOINT);
+#endif
 #ifdef CANNOT_STORE_REGISTER
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
@@ -1372,6 +1386,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->get_saved_register
                         /*GET_SAVED_REGISTER ()*/);
 #endif
+#ifdef HAVE_NONSTEPPABLE_WATCHPOINT
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
+                      XSTRING (HAVE_NONSTEPPABLE_WATCHPOINT));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT = %d\n",
+                      HAVE_NONSTEPPABLE_WATCHPOINT);
+#endif
 #ifdef INIT_EXTRA_FRAME_INFO
 #if GDB_MULTI_ARCH
   /* Macro might contain `[{}]' when not multi-arch */
@@ -5024,6 +5046,40 @@ set_gdbarch_name_of_malloc (struct gdbarch *gdbarch,
   gdbarch->name_of_malloc = name_of_malloc;
 }
 
+int
+gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  /* Skip verify of cannot_step_breakpoint, invalid_p == 0 */
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_step_breakpoint called\n");
+  return gdbarch->cannot_step_breakpoint;
+}
+
+void
+set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch,
+                                    int cannot_step_breakpoint)
+{
+  gdbarch->cannot_step_breakpoint = cannot_step_breakpoint;
+}
+
+int
+gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  /* Skip verify of have_nonsteppable_watchpoint, invalid_p == 0 */
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_have_nonsteppable_watchpoint called\n");
+  return gdbarch->have_nonsteppable_watchpoint;
+}
+
+void
+set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch,
+                                          int have_nonsteppable_watchpoint)
+{
+  gdbarch->have_nonsteppable_watchpoint = have_nonsteppable_watchpoint;
+}
+
 
 /* Keep a registry of per-architecture data-pointers required by GDB
    modules. */
index 2f26cba9a13008ff44c72a29a681a7e685e5627d..c204cf0baaab6c59e681560084cfceda521276e2 100644 (file)
@@ -2579,6 +2579,38 @@ extern void set_gdbarch_name_of_malloc (struct gdbarch *gdbarch, const char * na
 #endif
 #endif
 
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STEP_BREAKPOINT)
+#define CANNOT_STEP_BREAKPOINT (0)
+#endif
+
+extern int gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch);
+extern void set_gdbarch_cannot_step_breakpoint (struct gdbarch *gdbarch, int cannot_step_breakpoint);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (CANNOT_STEP_BREAKPOINT)
+#error "Non multi-arch definition of CANNOT_STEP_BREAKPOINT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STEP_BREAKPOINT)
+#define CANNOT_STEP_BREAKPOINT (gdbarch_cannot_step_breakpoint (current_gdbarch))
+#endif
+#endif
+
+/* Default (value) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
+#define HAVE_NONSTEPPABLE_WATCHPOINT (0)
+#endif
+
+extern int gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch);
+extern void set_gdbarch_have_nonsteppable_watchpoint (struct gdbarch *gdbarch, int have_nonsteppable_watchpoint);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (HAVE_NONSTEPPABLE_WATCHPOINT)
+#error "Non multi-arch definition of HAVE_NONSTEPPABLE_WATCHPOINT"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (HAVE_NONSTEPPABLE_WATCHPOINT)
+#define HAVE_NONSTEPPABLE_WATCHPOINT (gdbarch_have_nonsteppable_watchpoint (current_gdbarch))
+#endif
+#endif
+
 extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
 
 
index 0ee74df6f446d81c47d40da185b052db8ba9035c..c18639e100e8fc973572ece138accfaaf69d9650 100755 (executable)
@@ -662,6 +662,8 @@ F:2:DWARF2_BUILD_FRAME_INFO:void:dwarf2_build_frame_info:struct objfile *objfile
 f:2:ELF_MAKE_MSYMBOL_SPECIAL:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym:::default_elf_make_msymbol_special::0
 f:2:COFF_MAKE_MSYMBOL_SPECIAL:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym:::default_coff_make_msymbol_special::0
 v::NAME_OF_MALLOC:const char *:name_of_malloc::::"malloc":"malloc"::0
+v::CANNOT_STEP_BREAKPOINT:int:cannot_step_breakpoint::::0:0::0
+v::HAVE_NONSTEPPABLE_WATCHPOINT:int:have_nonsteppable_watchpoint::::0:0::0
 EOF
 }
 
index 40223943b7c3e52f8c253012021cb1319a352925..3ef1828cd40efda9dfa819ab6124e6d021158ecc 100644 (file)
@@ -1276,13 +1276,12 @@ fill_in_vptr_fieldno (struct type *type)
          virtual (and hence we cannot share the table pointer).  */
       for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
        {
-         fill_in_vptr_fieldno (TYPE_BASECLASS (type, i));
-         if (TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type, i)) >= 0)
+         struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
+         fill_in_vptr_fieldno (baseclass);
+         if (TYPE_VPTR_FIELDNO (baseclass) >= 0)
            {
-             TYPE_VPTR_FIELDNO (type)
-               = TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type, i));
-             TYPE_VPTR_BASETYPE (type)
-               = TYPE_VPTR_BASETYPE (TYPE_BASECLASS (type, i));
+             TYPE_VPTR_FIELDNO (type) = TYPE_VPTR_FIELDNO (baseclass);
+             TYPE_VPTR_BASETYPE (type) = TYPE_VPTR_BASETYPE (baseclass);
              break;
            }
        }
index 59aad5dd7f328e25bcaf6b9fcfb154963a0e1990..e332dba3f3d61f40f055b0a3c81eb74224942071 100644 (file)
@@ -1759,31 +1759,31 @@ ill_rpc (char *fun)
 error_t
 do_mach_notify_no_senders (mach_port_t notify, mach_port_mscount_t count)
 {
-  return ill_rpc (__FUNCTION__);
+  return ill_rpc ("do_mach_notify_no_senders");
 }
 
 error_t
 do_mach_notify_port_deleted (mach_port_t notify, mach_port_t name)
 {
-  return ill_rpc (__FUNCTION__);
+  return ill_rpc ("do_mach_notify_port_deleted");
 }
 
 error_t
 do_mach_notify_msg_accepted (mach_port_t notify, mach_port_t name)
 {
-  return ill_rpc (__FUNCTION__);
+  return ill_rpc ("do_mach_notify_msg_accepted");
 }
 
 error_t
 do_mach_notify_port_destroyed (mach_port_t notify, mach_port_t name)
 {
-  return ill_rpc (__FUNCTION__);
+  return ill_rpc ("do_mach_notify_port_destroyed");
 }
 
 error_t
 do_mach_notify_send_once (mach_port_t notify)
 {
-  return ill_rpc (__FUNCTION__);
+  return ill_rpc ("do_mach_notify_send_once");
 }
 
 \f
@@ -1845,13 +1845,13 @@ error_t
 S_proc_setmsgport_reply (mach_port_t reply, error_t err,
                         mach_port_t old_msg_port)
 {
-  return ill_rpc (__FUNCTION__);
+  return ill_rpc ("S_proc_setmsgport_reply");
 }
 
 error_t
 S_proc_getmsgport_reply (mach_port_t reply, error_t err, mach_port_t msg_port)
 {
-  return ill_rpc (__FUNCTION__);
+  return ill_rpc ("S_proc_getmsgport_reply");
 }
 
 \f
@@ -1890,7 +1890,7 @@ S_msg_sig_post_untraced_reply (mach_port_t reply, error_t err)
 error_t
 S_msg_sig_post_reply (mach_port_t reply, error_t err)
 {
-  return ill_rpc (__FUNCTION__);
+  return ill_rpc ("S_msg_sig_post_reply");
 }
 
 \f
index cc430835f2c86056cc6c64f7ee2abf442f058fdc..bcdfe6e7779f8224bcec2ed7a513bca840906cd4 100644 (file)
@@ -96,6 +96,6 @@ extern int gnu_debug_flag;
 
 #define debug(msg, args...) \
  do { if (gnu_debug_flag) \
-        fprintf_unfiltered (gdb_stdlog, "%s: " msg "\r\n", __FUNCTION__ , ##args); } while (0)
+        fprintf_unfiltered (gdb_stdlog, "%s:%d: " msg "\r\n", __FILE__ , __LINE__ , ##args); } while (0)
 
 #endif /* __GNU_NAT_H__ */
index fbab8af0a18595a6e2575cd0d8d4956c710eedb5..2b4e01a78a4e21ebfe69cbc8d7d08c802461d259 100644 (file)
@@ -324,6 +324,9 @@ gnuv3_virtual_fn_field (struct value **value_p,
      type now.  */
   if (TYPE_VPTR_FIELDNO (vfn_base) < 0)
     fill_in_vptr_fieldno (vfn_base);
+  if (TYPE_VPTR_FIELDNO (vfn_base) < 0)
+    error ("Could not find virtual table pointer for class \"%s\".",
+          TYPE_TAG_NAME (vfn_base) ? TYPE_TAG_NAME (vfn_base) : "<unknown>");
 
   /* Now that we know which base class is defining our virtual
      function, cast our value to that baseclass.  This takes care of
index a1d030bbce55d8edd11b00349a7dfec82fe194e0..a36258152c71385af0741cc99e1a39dc9634d643 100644 (file)
 #include "parser-defs.h"
 #include "regcache.h"
 
-/* Functions exported for general use: */
-
-void nofp_registers_info (char *, int);
+/* Functions exported for general use, in inferior.h: */
 
 void all_registers_info (char *, int);
 
 void registers_info (char *, int);
 
-/* Local functions: */
+void nexti_command (char *, int);
+
+void stepi_command (char *, int);
 
 void continue_command (char *, int);
 
+void interrupt_target_command (char *args, int from_tty);
+
+/* Local functions: */
+
+static void nofp_registers_info (char *, int);
+
 static void print_return_value (int struct_return, struct type *value_type);
 
 static void finish_command_continuation (struct continuation_arg *);
@@ -72,8 +78,6 @@ static void float_info (char *, int);
 
 static void detach_command (char *, int);
 
-static void interrupt_target_command (char *args, int from_tty);
-
 static void unset_environment_command (char *, int);
 
 static void set_environment_command (char *, int);
@@ -92,10 +96,6 @@ static void step_1 (int, int, char *);
 static void step_once (int skip_subroutines, int single_inst, int count);
 static void step_1_continuation (struct continuation_arg *arg);
 
-void nexti_command (char *, int);
-
-void stepi_command (char *, int);
-
 static void next_command (char *, int);
 
 static void step_command (char *, int);
@@ -1729,7 +1729,7 @@ all_registers_info (char *addr_exp, int from_tty)
   registers_info (addr_exp, 1);
 }
 
-void
+static void
 nofp_registers_info (char *addr_exp, int from_tty)
 {
   registers_info (addr_exp, 0);
@@ -1891,14 +1891,7 @@ detach_command (char *args, int from_tty)
 
 /* Stop the execution of the target while running in async mode, in
    the backgound. */
-
 void
-interrupt_target_command_wrapper (char *args, int from_tty)
-{
-  interrupt_target_command (args, from_tty);
-}
-
-static void
 interrupt_target_command (char *args, int from_tty)
 {
   if (event_loop_p && target_can_async_p ())
index 8035ccd98251b220a398b376e383ca66863fed39..2cccda1103b99c9a434b1b3bad88ae4817d5caf6 100644 (file)
@@ -315,6 +315,16 @@ extern char *set_inferior_args (char *);
 
 extern void set_inferior_args_vector (int, char **);
 
+extern void registers_info (char *, int);
+
+extern void nexti_command (char *, int);
+
+extern void stepi_command (char *, int);
+
+extern void continue_command (char *, int);
+
+extern void interrupt_target_command (char *args, int from_tty);
+
 /* Last signal that the inferior received (why it stopped).  */
 
 extern enum target_signal stop_signal;
index 0f0c96b62ecf8ef54aea86846f7d62868274d3fe..0de1a6608d86e47e11c1dcd8a97dd3acaf405169 100644 (file)
@@ -231,13 +231,6 @@ a command like `return' or `jump' to continue execution.");
 #define HAVE_STEPPABLE_WATCHPOINT 1
 #endif
 
-#ifndef HAVE_NONSTEPPABLE_WATCHPOINT
-#define HAVE_NONSTEPPABLE_WATCHPOINT 0
-#else
-#undef  HAVE_NONSTEPPABLE_WATCHPOINT
-#define HAVE_NONSTEPPABLE_WATCHPOINT 1
-#endif
-
 #ifndef HAVE_CONTINUABLE_WATCHPOINT
 #define HAVE_CONTINUABLE_WATCHPOINT 0
 #else
@@ -870,13 +863,14 @@ resume (int step, enum target_signal sig)
          resume_ptid = inferior_ptid;
        }
 
-#ifdef CANNOT_STEP_BREAKPOINT
-      /* Most targets can step a breakpoint instruction, thus executing it
-         normally.  But if this one cannot, just continue and we will hit
-         it anyway.  */
-      if (step && breakpoints_inserted && breakpoint_here_p (read_pc ()))
-       step = 0;
-#endif
+      if (CANNOT_STEP_BREAKPOINT)
+       {
+         /* Most targets can step a breakpoint instruction, thus
+            executing it normally.  But if this one cannot, just
+            continue and we will hit it anyway.  */
+         if (step && breakpoints_inserted && breakpoint_here_p (read_pc ()))
+           step = 0;
+       }
       target_resume (resume_ptid, step, sig);
     }
 
index 70c228b957527853c43503e83ee59336120a8257..b4ae3401ea4ca0b4a4aea1ec22ea0a0fa6ee73f6 100644 (file)
@@ -179,7 +179,7 @@ static int parse_number (char *, int, int, YYSTYPE *);
 
 %token <opcode> ASSIGN_MODIFY
 
-%token THIS SUPER NEW
+%token SUPER NEW
 
 %left ','
 %right '=' ASSIGN_MODIFY
@@ -365,9 +365,6 @@ Primary:
 
 PrimaryNoNewArray:
        Literal
-|      THIS
-               { write_exp_elt_opcode (OP_THIS);
-                 write_exp_elt_opcode (OP_THIS); }
 |      '(' Expression ')'
 |      ClassInstanceCreationExpression
 |      FieldAccess
@@ -1167,17 +1164,6 @@ yylex ()
          yylval.lval = 1;
          return BOOLEAN_LITERAL;
        }
-      if (current_language->la_language == language_cplus
-         && STREQN (tokstart, "this", 4))
-       {
-         static const char this_name[] =
-                                { CPLUS_MARKER, 't', 'h', 'i', 's', '\0' };
-
-         if (lookup_symbol (this_name, expression_context_block,
-                            VAR_NAMESPACE, (int *) NULL,
-                            (struct symtab **) NULL))
-           return THIS;
-       }
       break;
     case 3:
       if (STREQN (tokstart, "int", 3))
index a691a657a23b8025144180444f70fb196d856879..2e69b4403ea56d336c5df2bf3458329c977be13b 100644 (file)
@@ -210,8 +210,16 @@ handle_exception(int exceptionVector)
   unsigned char   buf[16];
   int binary;
 
-  if (!finish_from_step())
-    return;            /* "false step": let the target continue */
+  /* Do not call finish_from_step() if this is not a trap #1
+   * (breakpoint trap).  Without this check, the finish_from_step()
+   * might interpret a system call trap as a single step trap.  This
+   * can happen if: the stub receives 's' and exits, but an interrupt
+   * was pending; the interrupt is now handled and causes the stub to
+   * be reentered because some function makes a system call.  
+   */
+  if (exceptionVector == 1)    /* Trap exception? */
+    if (!finish_from_step())   /* Go see if stepping state needs update. */
+      return;          /* "false step": let the target continue */
 
   gdb_m32r_vector = exceptionVector;
 
index a5d7af194d84bbc61b6a667221102429990ab13a..3cbd2ec12c93dafc50212705359b4f1484f9662f 100644 (file)
@@ -1,3 +1,41 @@
+2002-10-03  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * gdbmi.texinfo: Fix examples that show frames to remove
+       extraneous blank in level field.  Part of fix for PR gdb/192.
+        
+2002-10-03  Jeff Johnston  <jjohnstn@redhat.com>
+        
+       * mi-cmd-var.c (mi_cmd_var_update): Fix for PR gdb/672.  For m2, 
+       output list begin and end for "changelist" rather than tuple begin/end.
+       (varobj_update_one): For m2, add tuple begin and end for varobj 
+       update output.
+
+2002-10-02  Elena Zannoni  <ezannoni@redhat.com>
+
+       * mi-main.c (mi_cmd_exec_return): Don't use
+       return_command_wrapper, use return_command instead.
+       (mi_cmd_exec_interrupt): Don't use
+       interrupt_target_command_wrapper, use interrupt_target_command
+       instead.
+       (return_command_wrapper, interrupt_target_command_wrapper):
+       Delete.
+       Include frame.h.
+
+2002-10-01  Andrew Cagney  <ac131313@redhat.com>
+
+       * mi-main.c (mi2_command_loop): New function.
+       (mi0_command_loop): Delete function.
+       (_initialize_mi_main): Recognize, and default to, "mi2".  Do not
+       recognize "mi0".
+       * mi-out.c (mi_table_begin): Remove mi0 code.
+       (mi_table_body, mi_table_end): Ditto.
+       (mi_table_header, mi_open, mi_close): Ditto.
+
+2002-09-29  Andrew Cagney  <ac131313@redhat.com>
+
+       * mi-out.c (mi_version): New function.
+       * mi-out.h (mi_version): Declare.
+
 2002-09-27  Andrew Cagney  <ac131313@redhat.com>
 
        From 2002-07-12 Mo DeJong <supermo@bayarea.net>
index 6145dcf81e638be1a5d9473e7b1ea0b81eab046a..164b1e823b772df0e35f06b156aef6b0e98e09f3 100644 (file)
@@ -2034,7 +2034,7 @@ file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
 205^done
 (@value{GDBP})
 111-exec-return
-111^done,frame=@{level="0 ",func="callee3",
+111^done,frame=@{level="0",func="callee3",
 args=[@{name="strarg",
 value="0x11940 \"A string argument.\""@}],
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
@@ -2641,15 +2641,15 @@ functionality of @samp{-stack-list-arguments}.
 -stack-list-frames
 ^done,
 stack=[
-frame=@{level="0 ",addr="0x00010734",func="callee4",
+frame=@{level="0",addr="0x00010734",func="callee4",
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
-frame=@{level="1 ",addr="0x0001076c",func="callee3",
+frame=@{level="1",addr="0x0001076c",func="callee3",
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
-frame=@{level="2 ",addr="0x0001078c",func="callee2",
+frame=@{level="2",addr="0x0001078c",func="callee2",
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
-frame=@{level="3 ",addr="0x000107b4",func="callee1",
+frame=@{level="3",addr="0x000107b4",func="callee1",
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
-frame=@{level="4 ",addr="0x000107e0",func="main",
+frame=@{level="4",addr="0x000107e0",func="main",
 file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}]
 (@value{GDBP})
 -stack-list-arguments 0
@@ -2731,25 +2731,25 @@ Full stack backtrace:
 (@value{GDBP})
 -stack-list-frames
 ^done,stack=
-[frame=@{level="0 ",addr="0x0001076c",func="foo",
+[frame=@{level="0",addr="0x0001076c",func="foo",
   file="recursive2.c",line="11"@},
-frame=@{level="1 ",addr="0x000107a4",func="foo",
+frame=@{level="1",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@},
-frame=@{level="2 ",addr="0x000107a4",func="foo",
+frame=@{level="2",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@},
-frame=@{level="3 ",addr="0x000107a4",func="foo",
+frame=@{level="3",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@},
-frame=@{level="4 ",addr="0x000107a4",func="foo",
+frame=@{level="4",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@},
-frame=@{level="5 ",addr="0x000107a4",func="foo",
+frame=@{level="5",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@},
-frame=@{level="6 ",addr="0x000107a4",func="foo",
+frame=@{level="6",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@},
-frame=@{level="7 ",addr="0x000107a4",func="foo",
+frame=@{level="7",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@},
-frame=@{level="8 ",addr="0x000107a4",func="foo",
+frame=@{level="8",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@},
-frame=@{level="9 ",addr="0x000107a4",func="foo",
+frame=@{level="9",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@},
 frame=@{level="10",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@},
@@ -2764,11 +2764,11 @@ Show frames between @var{low_frame} and @var{high_frame}:
 (@value{GDBP})
 -stack-list-frames 3 5
 ^done,stack=
-[frame=@{level="3 ",addr="0x000107a4",func="foo",
+[frame=@{level="3",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@},
-frame=@{level="4 ",addr="0x000107a4",func="foo",
+frame=@{level="4",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@},
-frame=@{level="5 ",addr="0x000107a4",func="foo",
+frame=@{level="5",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@}]
 (@value{GDBP})
 @end smallexample
@@ -2779,7 +2779,7 @@ Show a single frame:
 (@value{GDBP})
 -stack-list-frames 3 3
 ^done,stack=
-[frame=@{level="3 ",addr="0x000107a4",func="foo",
+[frame=@{level="3",addr="0x000107a4",func="foo",
   file="recursive2.c",line="14"@}]
 (@value{GDBP})
 @end smallexample
@@ -3442,7 +3442,7 @@ number-of-threads="3"
 (@value{GDBP})
 -thread-select 3
 ^done,new-thread-id="3",
-frame=@{level="0 ",func="vprintf",
+frame=@{level="0",func="vprintf",
 args=[@{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""@},
 @{name="arg",value="0x2"@}],file="vprintf.c",line="31"@}
 (@value{GDBP})
index 85328d7cc17091397462d0e19ef8ac24f1b14113..168ca17166681dcadd7add926158cd95bc5db44a 100644 (file)
 #include "value.h"
 #include "mi-cmds.h"
 #include "mi-getopt.h"
-#include "ui-out.h"
 #include "gdb_string.h"
-
-/* Disassemble functions. FIXME: these do not really belong here. We
-   should get rid of all the duplicate code in gdb that does the same
-   thing: disassemble_command() and the gdbtk variation. */
-
-/* This Structure is used in mi_cmd_disassemble.
-   We need a different sort of line table from the normal one cuz we can't
-   depend upon implicit line-end pc's for lines to do the
-   reordering in this function.  */
-
-struct dis_line_entry
-{
-  int line;
-  CORE_ADDR start_pc;
-  CORE_ADDR end_pc;
-};
-
-/* This variable determines where memory used for disassembly is read from. */
-int gdb_disassemble_from_exec = -1;
-
-/* This is the memory_read_func for gdb_disassemble when we are
-   disassembling from the exec file. */
-static int
-gdb_dis_asm_read_memory (bfd_vma memaddr, bfd_byte * myaddr,
-                        unsigned int len, disassemble_info * info)
-{
-  extern struct target_ops exec_ops;
-  int res;
-
-  errno = 0;
-  res = xfer_memory (memaddr, myaddr, len, 0, 0, &exec_ops);
-
-  if (res == len)
-    return 0;
-  else if (errno == 0)
-    return EIO;
-  else
-    return errno;
-}
-
-static int
-compare_lines (const PTR mle1p, const PTR mle2p)
-{
-  struct dis_line_entry *mle1, *mle2;
-  int val;
-
-  mle1 = (struct dis_line_entry *) mle1p;
-  mle2 = (struct dis_line_entry *) mle2p;
-
-  val = mle1->line - mle2->line;
-
-  if (val != 0)
-    return val;
-
-  return mle1->start_pc - mle2->start_pc;
-}
-
-static int
-dump_insns (disassemble_info * di, CORE_ADDR low, CORE_ADDR high,
-           int how_many, struct ui_stream *stb)
-{
-  int num_displayed = 0;
-  CORE_ADDR pc;
-
-  /* parts of the symbolic representation of the address */
-  int unmapped;
-  char *filename = NULL;
-  char *name = NULL;
-  int offset;
-  int line;
-
-  for (pc = low; pc < high;)
-    {
-      QUIT;
-      if (how_many >= 0)
-       {
-         if (num_displayed >= how_many)
-           break;
-         else
-           num_displayed++;
-       }
-      ui_out_tuple_begin (uiout, NULL);
-      ui_out_field_core_addr (uiout, "address", pc);
-
-      if (!build_address_symbolic (pc, 0, &name, &offset, &filename,
-                                  &line, &unmapped))
-       {
-         /* We don't care now about line, filename and
-            unmapped. But we might in the future. */
-         ui_out_text (uiout, " <");
-         ui_out_field_string (uiout, "func-name", name);
-         ui_out_text (uiout, "+");
-         ui_out_field_int (uiout, "offset", offset);
-         ui_out_text (uiout, ">:\t");
-       }
-      if (filename != NULL)
-       xfree (filename);
-      if (name != NULL)
-       xfree (name);
-
-      ui_file_rewind (stb->stream);
-      pc += TARGET_PRINT_INSN (pc, di);
-      ui_out_field_stream (uiout, "inst", stb);
-      ui_file_rewind (stb->stream);
-      ui_out_tuple_end (uiout);
-      ui_out_text (uiout, "\n");
-    }
-  return num_displayed;
-}
-
-/* The idea here is to present a source-O-centric view of a
-   function to the user.  This means that things are presented
-   in source order, with (possibly) out of order assembly
-   immediately following.  */
-static void
-do_mixed_source_and_assembly (struct disassemble_info *di, int nlines,
-                             struct linetable_entry *le,
-                             CORE_ADDR low, CORE_ADDR high,
-                             struct symtab *symtab,
-                             int how_many, struct ui_stream *stb)
-{
-  int newlines = 0;
-  struct dis_line_entry *mle;
-  struct symtab_and_line sal;
-  int i;
-  int out_of_order = 0;
-  int next_line = 0;
-  CORE_ADDR pc;
-  int num_displayed = 0;
-
-  mle = (struct dis_line_entry *) alloca (nlines
-                                         * sizeof (struct dis_line_entry));
-
-  /* Copy linetable entries for this function into our data
-     structure, creating end_pc's and setting out_of_order as
-     appropriate.  */
-
-  /* First, skip all the preceding functions.  */
-
-  for (i = 0; i < nlines - 1 && le[i].pc < low; i++);
-
-  /* Now, copy all entries before the end of this function.  */
-
-  for (; i < nlines - 1 && le[i].pc < high; i++)
-    {
-      if (le[i].line == le[i + 1].line && le[i].pc == le[i + 1].pc)
-       continue;               /* Ignore duplicates */
-
-      /* Skip any end-of-function markers.  */
-      if (le[i].line == 0)
-       continue;
-
-      mle[newlines].line = le[i].line;
-      if (le[i].line > le[i + 1].line)
-       out_of_order = 1;
-      mle[newlines].start_pc = le[i].pc;
-      mle[newlines].end_pc = le[i + 1].pc;
-      newlines++;
-    }
-
-  /* If we're on the last line, and it's part of the function,
-     then we need to get the end pc in a special way.  */
-
-  if (i == nlines - 1 && le[i].pc < high)
-    {
-      mle[newlines].line = le[i].line;
-      mle[newlines].start_pc = le[i].pc;
-      sal = find_pc_line (le[i].pc, 0);
-      mle[newlines].end_pc = sal.end;
-      newlines++;
-    }
-
-  /* Now, sort mle by line #s (and, then by addresses within
-     lines). */
-
-  if (out_of_order)
-    qsort (mle, newlines, sizeof (struct dis_line_entry), compare_lines);
-
-  /* Now, for each line entry, emit the specified lines (unless
-     they have been emitted before), followed by the assembly code
-     for that line.  */
-
-  ui_out_list_begin (uiout, "asm_insns");
-
-  for (i = 0; i < newlines; i++)
-    {
-      int close_list = 1;
-      /* Print out everything from next_line to the current line.  */
-      if (mle[i].line >= next_line)
-       {
-         if (next_line != 0)
-           {
-             /* Just one line to print. */
-             if (next_line == mle[i].line)
-               {
-                 ui_out_tuple_begin (uiout, "src_and_asm_line");
-                 print_source_lines (symtab, next_line, mle[i].line + 1, 0);
-               }
-             else
-               {
-                 /* Several source lines w/o asm instructions associated. */
-                 for (; next_line < mle[i].line; next_line++)
-                   {
-                     ui_out_tuple_begin (uiout, "src_and_asm_line");
-                     print_source_lines (symtab, next_line, next_line + 1,
-                                         0);
-                     ui_out_list_begin (uiout, "line_asm_insn");
-                     ui_out_list_end (uiout);
-                     ui_out_tuple_end (uiout);
-                   }
-                 /* Print the last line and leave list open for
-                    asm instructions to be added. */
-                 ui_out_tuple_begin (uiout, "src_and_asm_line");
-                 print_source_lines (symtab, next_line, mle[i].line + 1, 0);
-               }
-           }
-         else
-           {
-             ui_out_tuple_begin (uiout, "src_and_asm_line");
-             print_source_lines (symtab, mle[i].line, mle[i].line + 1, 0);
-           }
-
-         next_line = mle[i].line + 1;
-         ui_out_list_begin (uiout, "line_asm_insn");
-         /* Don't close the list if the lines are not in order. */
-         if (i < (newlines - 1) && mle[i + 1].line <= mle[i].line)
-           close_list = 0;
-       }
-
-      num_displayed += dump_insns (di, mle[i].start_pc, mle[i].end_pc,
-                                  how_many, stb);
-      if (close_list)
-       {
-         ui_out_list_end (uiout);
-         ui_out_tuple_end (uiout);
-         ui_out_text (uiout, "\n");
-         close_list = 0;
-       }
-      if (how_many >= 0)
-       if (num_displayed >= how_many)
-         break;
-    }
-  ui_out_list_end (uiout);
-}
-
-
-static void
-do_assembly_only (disassemble_info * di, CORE_ADDR low,
-                 CORE_ADDR high, int how_many, struct ui_stream *stb)
-{
-  int num_displayed = 0;
-
-  ui_out_list_begin (uiout, "asm_insns");
-
-  num_displayed = dump_insns (di, low, high, how_many, stb);
-
-  ui_out_list_end (uiout);
-}
-
-enum mi_cmd_result
-do_disassembly (char *file_string,
-               int line_num,
-               int mixed_source_and_assembly,
-               int how_many, CORE_ADDR low, CORE_ADDR high)
-{
-  static disassemble_info di;
-  static int di_initialized;
-  /* To collect the instruction outputted from opcodes. */
-  static struct ui_stream *stb = NULL;
-  struct symtab *symtab = NULL;
-  struct linetable_entry *le = NULL;
-  int nlines = -1;
-
-  if (!di_initialized)
-    {
-      /* We don't add a cleanup for this, because the allocation of
-         the stream is done once only for each gdb run, and we need to
-         keep it around until the end. Hopefully there won't be any
-         errors in the init code below, that make this function bail
-         out. */
-      stb = ui_out_stream_new (uiout);
-      INIT_DISASSEMBLE_INFO_NO_ARCH (di, stb->stream,
-                                    (fprintf_ftype) fprintf_unfiltered);
-      di.flavour = bfd_target_unknown_flavour;
-      di.memory_error_func = dis_asm_memory_error;
-      di.print_address_func = dis_asm_print_address;
-      di_initialized = 1;
-    }
-
-  di.mach = TARGET_PRINT_INSN_INFO->mach;
-  if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
-    di.endian = BFD_ENDIAN_BIG;
-  else
-    di.endian = BFD_ENDIAN_LITTLE;
-
-  /* If gdb_disassemble_from_exec == -1, then we use the following heuristic to
-     determine whether or not to do disassembly from target memory or from the
-     exec file:
-
-     If we're debugging a local process, read target memory, instead of the
-     exec file.  This makes disassembly of functions in shared libs work
-     correctly.  Also, read target memory if we are debugging native threads.
-
-     Else, we're debugging a remote process, and should disassemble from the
-     exec file for speed.  However, this is no good if the target modifies its
-     code (for relocation, or whatever).  */
-
-  if (gdb_disassemble_from_exec == -1)
-    {
-      if (strcmp (target_shortname, "child") == 0
-         || strcmp (target_shortname, "procfs") == 0
-         || strcmp (target_shortname, "vxprocess") == 0
-         || strstr (target_shortname, "-threads") != NULL)
-       gdb_disassemble_from_exec = 0;  /* It's a child process, read inferior mem */
-      else
-       gdb_disassemble_from_exec = 1;  /* It's remote, read the exec file */
-    }
-
-  if (gdb_disassemble_from_exec)
-    di.read_memory_func = gdb_dis_asm_read_memory;
-  else
-    di.read_memory_func = dis_asm_read_memory;
-
-  /* Assume symtab is valid for whole PC range */
-  symtab = find_pc_symtab (low);
-
-  if (symtab != NULL && symtab->linetable != NULL)
-    {
-      /* Convert the linetable to a bunch of my_line_entry's.  */
-      le = symtab->linetable->item;
-      nlines = symtab->linetable->nitems;
-    }
-
-  if (!mixed_source_and_assembly || nlines <= 0
-      || symtab == NULL || symtab->linetable == NULL)
-    do_assembly_only (&di, low, high, how_many, stb);
-
-  else if (mixed_source_and_assembly)
-    do_mixed_source_and_assembly (&di, nlines, le, low,
-                                 high, symtab, how_many, stb);
-
-  gdb_flush (gdb_stdout);
-
-  return MI_CMD_DONE;
-}
+#include "ui-out.h"
+#include "disasm.h"
 
 /* The arguments to be passed on the command line and parsed here are:
 
@@ -498,8 +154,10 @@ mi_cmd_disassemble (char *command, char **argv, int argc)
        error ("mi_cmd_disassemble: No function contains specified address");
     }
 
-  retval = do_disassembly (file_string,
-                          line_num,
-                          mixed_source_and_assembly, how_many, low, high);
-  return retval;
+  gdb_disassembly (uiout,
+                  file_string,
+                  line_num,
+                  mixed_source_and_assembly, how_many, low, high);
+
+  return MI_CMD_DONE;
 }
index cb5e939e9f1a1035d96ed68b31b96a49b86cd968..114906609efb7d2615f369ec4c29b56fbaee4a0b 100644 (file)
@@ -405,6 +405,7 @@ mi_cmd_var_update (char *command, char **argv, int argc)
   struct varobj *var;
   struct varobj **rootlist;
   struct varobj **cr;
+  struct cleanup *cleanup;
   char *name;
   int nv;
 
@@ -419,10 +420,13 @@ mi_cmd_var_update (char *command, char **argv, int argc)
   if ((*name == '*') && (*(name + 1) == '\0'))
     {
       nv = varobj_list (&rootlist);
-      ui_out_tuple_begin (uiout, "changelist");
+      if (mi_version (uiout) <= 1)
+        cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "changelist");
+      else
+        cleanup = make_cleanup_ui_out_list_begin_end (uiout, "changelist");
       if (nv <= 0)
        {
-         ui_out_tuple_end (uiout);
+         do_cleanups (cleanup);
          return MI_CMD_DONE;
        }
       cr = rootlist;
@@ -432,7 +436,7 @@ mi_cmd_var_update (char *command, char **argv, int argc)
          cr++;
        }
       xfree (rootlist);
-      ui_out_tuple_end (uiout);
+      do_cleanups (cleanup);
     }
   else
     {
@@ -441,9 +445,12 @@ mi_cmd_var_update (char *command, char **argv, int argc)
       if (var == NULL)
        error ("mi_cmd_var_update: Variable object not found");
 
-      ui_out_tuple_begin (uiout, "changelist");
+      if (mi_version (uiout) <= 1)
+        cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, "changelist");
+      else
+        cleanup = make_cleanup_ui_out_list_begin_end (uiout, "changelist");
       varobj_update_one (var);
-      ui_out_tuple_end (uiout);
+      do_cleanups (cleanup);
     }
     return MI_CMD_DONE;
 }
@@ -457,6 +464,7 @@ varobj_update_one (struct varobj *var)
 {
   struct varobj **changelist;
   struct varobj **cc;
+  struct cleanup *cleanup = NULL;
   int nc;
 
   nc = varobj_update (&var, &changelist);
@@ -469,17 +477,25 @@ varobj_update_one (struct varobj *var)
     return 1;
   else if (nc == -1)
     {
+      if (mi_version (uiout) > 1)
+        cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
       ui_out_field_string (uiout, "name", varobj_get_objname(var));
       ui_out_field_string (uiout, "in_scope", "false");
+      if (mi_version (uiout) > 1)
+        do_cleanups (cleanup);
       return -1;
     }
   else if (nc == -2)
     {
+      if (mi_version (uiout) > 1)
+        cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
       ui_out_field_string (uiout, "name", varobj_get_objname (var));
       ui_out_field_string (uiout, "in_scope", "true");
       ui_out_field_string (uiout, "new_type", varobj_get_type(var));
       ui_out_field_int (uiout, "new_num_children", 
                           varobj_get_num_children(var));
+      if (mi_version (uiout) > 1)
+        do_cleanups (cleanup);
     }
   else
     {
@@ -487,9 +503,13 @@ varobj_update_one (struct varobj *var)
       cc = changelist;
       while (*cc != NULL)
        {
+         if (mi_version (uiout) > 1)
+           cleanup = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
          ui_out_field_string (uiout, "name", varobj_get_objname (*cc));
          ui_out_field_string (uiout, "in_scope", "true");
          ui_out_field_string (uiout, "type_changed", "false");
+         if (mi_version (uiout) > 1)
+           do_cleanups (cleanup);
          cc++;
        }
       xfree (changelist);
index 69dcc3ea79f2580a319951e60959c197d714684a..41775922def89bbdb06c8a8c355b1b2a60a4f490 100644 (file)
@@ -39,6 +39,8 @@
 #include "value.h"             /* for write_register_bytes() */
 #include "regcache.h"
 #include "gdb.h"
+#include "frame.h"
+
 #include <ctype.h>
 #include <sys/time.h>
 
@@ -99,12 +101,6 @@ static void mi_load_progress (const char *section_name,
                              unsigned long total_sent,
                              unsigned long grand_total);
 
-/* FIXME: these should go in some .h file, but infcmd.c doesn't have a
-   corresponding .h file. These wrappers will be obsolete anyway, once
-   we pull the plug on the sanitization. */
-extern void interrupt_target_command_wrapper (char *, int);
-extern void return_command_wrapper (char *, int);
-
 /* Command implementations. FIXME: Is this libgdb? No.  This is the MI
    layer that calls libgdb.  Any operation used in the below should be
    formalized. */
@@ -179,11 +175,11 @@ mi_cmd_exec_return (char *args, int from_tty)
   if (*args)
     /* Call return_command with from_tty argument equal to 0 so as to
        avoid being queried. */
-    return_command_wrapper (args, 0);
+    return_command (args, 0);
   else
     /* Call return_command with from_tty argument equal to 0 so as to
        avoid being queried. */
-    return_command_wrapper (NULL, 0);
+    return_command (NULL, 0);
 
   /* Because we have called return_command with from_tty = 0, we need
      to print the frame here. */
@@ -215,7 +211,7 @@ mi_cmd_exec_interrupt (char *args, int from_tty)
                 "mi_cmd_exec_interrupt: Inferior not executing.");
       return MI_CMD_ERROR;
     }
-  interrupt_target_command_wrapper (args, from_tty);
+  interrupt_target_command (args, from_tty);
   if (last_async_command)
     fputs_unfiltered (last_async_command, raw_stdout);
   fputs_unfiltered ("^done", raw_stdout);
@@ -1514,15 +1510,15 @@ mi_command_loop (int mi_version)
 }
 
 static void
-mi0_command_loop (void)
+mi1_command_loop (void)
 {
-  mi_command_loop (0);
+  mi_command_loop (1);
 }
 
 static void
-mi1_command_loop (void)
+mi2_command_loop (void)
 {
-  mi_command_loop (1);
+  mi_command_loop (2);
 }
 
 static void
@@ -1547,11 +1543,12 @@ _initialize_mi_main (void)
     return;
 
   /* If we're _the_ interpreter, take control. */
-  if (strcmp (interpreter_p, "mi0") == 0)
-    command_loop_hook = mi0_command_loop;
-  else if (strcmp (interpreter_p, "mi") == 0
-          || strcmp (interpreter_p, "mi1") == 0)
+  if (strcmp (interpreter_p, "mi") == 0)
+    command_loop_hook = mi2_command_loop;
+  else if (strcmp (interpreter_p, "mi1") == 0)
     command_loop_hook = mi1_command_loop;
+  else if (strcmp (interpreter_p, "mi2") == 0)
+    command_loop_hook = mi2_command_loop;
   else
     return;
 
index 947720bc10cc4dbc58137b3091d936636765ab96..f7156ca9c59286f0eba5e6a78281d4d531275422 100644 (file)
@@ -109,14 +109,6 @@ mi_table_begin (struct ui_out *uiout,
 {
   struct ui_out_data *data = ui_out_data (uiout);
   mi_open (uiout, tblid, ui_out_type_tuple);
-  if (data->mi_version == 0)
-    {
-      if (nr_rows == 0)
-       data->suppress_output = 1;
-      else
-       mi_open (uiout, "hdr", ui_out_type_list);
-      return;
-    }
   mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/,
                "nr_rows", nr_rows);
   mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/,
@@ -134,8 +126,6 @@ mi_table_body (struct ui_out *uiout)
     return;
   /* close the table header line if there were any headers */
   mi_close (uiout, ui_out_type_list);
-  if (data->mi_version == 0)
-    return;
   mi_open (uiout, "body", ui_out_type_list);
 }
 
@@ -146,11 +136,6 @@ mi_table_end (struct ui_out *uiout)
 {
   struct ui_out_data *data = ui_out_data (uiout);
   data->suppress_output = 0;
-  if (data->mi_version == 0)
-    {
-      mi_close (uiout, ui_out_type_tuple);
-      return;
-    }
   mi_close (uiout, ui_out_type_list); /* body */
   mi_close (uiout, ui_out_type_tuple);
 }
@@ -165,11 +150,6 @@ mi_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
   struct ui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
-  if (data->mi_version == 0)
-    {
-      mi_field_string (uiout, 0, width, alignment, 0, colhdr);
-      return;
-    }
   mi_open (uiout, NULL, ui_out_type_tuple);
   mi_field_int (uiout, 0, 0, 0, "width", width);
   mi_field_int (uiout, 0, 0, 0, "alignment", alignment);
@@ -361,10 +341,7 @@ mi_open (struct ui_out *uiout,
       fputc_unfiltered ('{', data->buffer);
       break;
     case ui_out_type_list:
-      if (data->mi_version == 0)
-       fputc_unfiltered ('{', data->buffer);
-      else
-       fputc_unfiltered ('[', data->buffer);
+      fputc_unfiltered ('[', data->buffer);
       break;
     default:
       internal_error (__FILE__, __LINE__, "bad switch");
@@ -382,10 +359,7 @@ mi_close (struct ui_out *uiout,
       fputc_unfiltered ('}', data->buffer);
       break;
     case ui_out_type_list:
-      if (data->mi_version == 0)
-       fputc_unfiltered ('}', data->buffer);
-      else
-       fputc_unfiltered (']', data->buffer);
+      fputc_unfiltered (']', data->buffer);
       break;
     default:
       internal_error (__FILE__, __LINE__, "bad switch");
@@ -428,6 +402,15 @@ mi_out_put (struct ui_out *uiout,
   ui_file_rewind (data->buffer);
 }
 
+/* Current MI version.  */
+
+int
+mi_version (struct ui_out *uiout)
+{
+  struct ui_out_data *data = ui_out_data (uiout);
+  return data->mi_version;
+}
+
 /* initalize private members at startup */
 
 struct ui_out *
index 1ae693f4761b34c4a2944c3243118174564f828b..817f2eb53b90872f865c846baea205b554f0a728 100644 (file)
@@ -30,4 +30,7 @@ extern void mi_out_put (struct ui_out *uiout, struct ui_file *stream);
 extern void mi_out_rewind (struct ui_out *uiout);
 extern void mi_out_buffered (struct ui_out *uiout, char *string);
 
+/* Return the version number of the current MI.  */
+extern int mi_version (struct ui_out *uiout);
+
 #endif /* MI_OUT_H */
index 95b288ce6da7c1dbd51e80a5d9343829bac47b33..39086066332a7b237ead1952b1384421eb92970e 100644 (file)
@@ -1704,7 +1704,14 @@ mips_frame_saved_pc (struct frame_info *frame)
   int pcreg = frame->signal_handler_caller ? PC_REGNUM
   : (proc_desc ? PROC_PC_REG (proc_desc) : RA_REGNUM);
 
-  if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
+  if (USE_GENERIC_DUMMY_FRAMES
+      && PC_IN_CALL_DUMMY (frame->pc, 0, 0))
+    {
+      LONGEST tmp;
+      frame_unwind_signed_register (frame, PC_REGNUM, &tmp);
+      saved_pc = tmp;
+    }
+  else if (proc_desc && PROC_DESC_IS_DUMMY (proc_desc))
     saved_pc = read_memory_integer (frame->frame - MIPS_SAVED_REGSIZE, MIPS_SAVED_REGSIZE);
   else
     saved_pc = read_next_frame_reg (frame, pcreg);
@@ -2421,6 +2428,15 @@ mips_frame_chain (struct frame_info *frame)
   if ((tmp = SKIP_TRAMPOLINE_CODE (saved_pc)) != 0)
     saved_pc = tmp;
 
+  if (USE_GENERIC_DUMMY_FRAMES
+      && PC_IN_CALL_DUMMY (saved_pc, 0, 0))
+    {
+      /* A dummy frame, uses SP not FP.  Get the old SP value.  If all
+         is well, frame->frame the bottom of the current frame will
+         contain that value.  */
+      return frame->frame;
+    }
+
   /* Look up the procedure descriptor for this PC.  */
   proc_desc = find_proc_desc (saved_pc, frame, 1);
   if (!proc_desc)
@@ -2436,8 +2452,10 @@ mips_frame_chain (struct frame_info *frame)
       /* The previous frame from a sigtramp frame might be frameless
         and have frame size zero.  */
       && !frame->signal_handler_caller
-      /* Check if this is a call dummy frame.  */
-      && frame->pc != CALL_DUMMY_ADDRESS ())
+      /* For a generic dummy frame, let get_frame_pointer() unwind a
+         register value saved as part of the dummy frame call.  */
+      && !(USE_GENERIC_DUMMY_FRAMES
+          && PC_IN_CALL_DUMMY (frame->pc, 0, 0)))
     return 0;
   else
     return get_frame_pointer (frame, proc_desc);
@@ -2467,6 +2485,15 @@ mips_init_extra_frame_info (int fromleaf, struct frame_info *fci)
       if (fci->pc == PROC_LOW_ADDR (proc_desc)
          && !PROC_DESC_IS_DUMMY (proc_desc))
        fci->frame = read_next_frame_reg (fci->next, SP_REGNUM);
+      else if (USE_GENERIC_DUMMY_FRAMES
+              && PC_IN_CALL_DUMMY (fci->pc, 0, 0))
+       /* Do not ``fix'' fci->frame.  It will have the value of the
+           generic dummy frame's top-of-stack (since the draft
+           fci->frame is obtained by returning the unwound stack
+           pointer) and that is what we want.  That way the fci->frame
+           value will match the top-of-stack value that was saved as
+           part of the dummy frames data.  */
+       /* Do nothing.  */;
       else
        fci->frame = get_frame_pointer (fci->next, proc_desc);
 
@@ -3783,9 +3810,16 @@ mips_pop_frame (void)
   register int regnum;
   struct frame_info *frame = get_current_frame ();
   CORE_ADDR new_sp = FRAME_FP (frame);
-
   mips_extra_func_info_t proc_desc = frame->extra_info->proc_desc;
 
+  if (USE_GENERIC_DUMMY_FRAMES
+      && PC_IN_CALL_DUMMY (frame->pc, 0, 0))
+    {
+      generic_pop_dummy_frame ();
+      flush_cached_frames ();
+      return;
+    }
+
   write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
   if (frame->saved_regs == NULL)
     FRAME_INIT_SAVED_REGS (frame);
@@ -5558,7 +5592,7 @@ mips_find_abi_section (bfd *abfd, asection *sect, void *obj)
     *abip = MIPS_ABI_O32;
   else if (strcmp (name, ".mdebug.abiN32") == 0)
     *abip = MIPS_ABI_N32;
-  else if (strcmp (name, ".mdebug.abiN64") == 0)
+  else if (strcmp (name, ".mdebug.abi64") == 0)
     *abip = MIPS_ABI_N64;
   else if (strcmp (name, ".mdebug.abiO64") == 0)
     *abip = MIPS_ABI_O64;
@@ -5956,22 +5990,38 @@ mips_gdbarch_init (struct gdbarch_info info,
 
   set_gdbarch_call_dummy_p (gdbarch, 1);
   set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
+#if OLD_STYLE_MIPS_DUMMY_FRAMES
   set_gdbarch_use_generic_dummy_frames (gdbarch, 0);
+#else
+  set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
+#endif
   set_gdbarch_call_dummy_location (gdbarch, AT_ENTRY_POINT);
   set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address);
   set_gdbarch_push_return_address (gdbarch, mips_push_return_address);
+#if OLD_STYLE_MIPS_DUMMY_FRAMES
   set_gdbarch_push_dummy_frame (gdbarch, mips_push_dummy_frame);
+#else
+  set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
+#endif
   set_gdbarch_pop_frame (gdbarch, mips_pop_frame);
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
   set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
   set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
   set_gdbarch_call_dummy_length (gdbarch, 0);
   set_gdbarch_fix_call_dummy (gdbarch, mips_fix_call_dummy);
+#if OLD_STYLE_MIPS_DUMMY_FRAMES
   set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_at_entry_point);
+#else
+  set_gdbarch_pc_in_call_dummy (gdbarch, generic_pc_in_call_dummy);
+#endif
   set_gdbarch_call_dummy_words (gdbarch, mips_call_dummy_words);
   set_gdbarch_sizeof_call_dummy_words (gdbarch, sizeof (mips_call_dummy_words));
   set_gdbarch_push_return_address (gdbarch, mips_push_return_address);
   set_gdbarch_frame_align (gdbarch, mips_frame_align);
+#if OLD_STYLE_MIPS_DUMMY_FRAMES
+#else
+  set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
+#endif
   set_gdbarch_register_convertible (gdbarch, mips_register_convertible);
   set_gdbarch_register_convert_to_virtual (gdbarch, 
                                           mips_register_convert_to_virtual);
@@ -6143,9 +6193,6 @@ mips_dump_tdep (struct gdbarch *current_gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                      "mips_dump_tdep: CAUSE_REGNUM = %d\n",
                      CAUSE_REGNUM);
-  fprintf_unfiltered (file,
-                     "mips_dump_tdep: CPLUS_MARKER = %c\n",
-                     CPLUS_MARKER);
   fprintf_unfiltered (file,
                      "mips_dump_tdep: DO_REGISTERS_INFO # %s\n",
                      XSTRING (DO_REGISTERS_INFO));
index 54b99b00610d977fe3ab4f3a0c897a53a19e241a..2ccc8824455209cd6b3b2c2aaf6d3bbce1816b65 100644 (file)
@@ -203,9 +203,6 @@ parse_number PARAMS ((char *, int, int, YYSTYPE *));
 
 %token <opcode> ASSIGN_MODIFY
 
-/* C++ */
-%token THIS
-
 %left ','
 %left ABOVE_COMMA
 %right '=' ASSIGN_MODIFY
@@ -613,14 +610,6 @@ exp     :  NSSTRING        /* ObjC NextStep NSString constant
                          write_exp_elt_opcode (OP_NSSTRING); }
        ;
 
-/* C++.  */
-exp    :       THIS
-                       { write_exp_elt_opcode (OP_THIS);
-                         write_exp_elt_opcode (OP_THIS); }
-       ;
-
-/* end of C++.  */
-
 block  :       BLOCKNAME
                        {
                          if ($1.sym != 0)
@@ -1631,18 +1620,6 @@ yylex ()
        return ENUM;
       if (STREQN (tokstart, "long", 4))
        return LONG;
-      if (current_language->la_language == language_cplus
-         && STREQN (tokstart, "this", 4))
-       {
-         static const char this_name[] = {
-           CPLUS_MARKER, 't', 'h', 'i', 's', '\0' 
-         };
-
-         if (lookup_symbol (this_name, expression_context_block,
-                            VAR_NAMESPACE, (int *) NULL,
-                            (struct symtab **) NULL))
-           return THIS;
-       }
       break;
     case 3:
       if (STREQN (tokstart, "int", 3))
index dc839518b2499c7abaf79af79ef38f0a324f13c7..0c749a2ebe5c370bd510e5cea4a742ca10fc9f06 100644 (file)
@@ -34,7 +34,7 @@
 #include "value.h"
 #include "symfile.h"
 #include "objfiles.h"
-#include "string.h"            /* for strchr */
+#include "gdb_string.h"                /* for strchr */
 #include "target.h"            /* for target_has_execution */
 #include "gdbcore.h"
 #include "gdbcmd.h"
@@ -266,9 +266,10 @@ objc_demangle (const char *mangled)
       while (*cp && *cp == '_')
        cp++;                   /* skip any initial underbars in class name */
 
-      if (!(cp = strchr(cp, '_')))     /* find first non-initial underbar */
+      cp = strchr(cp, '_');
+      if (!cp)                 /* find first non-initial underbar */
        {
-         free(demangled);      /* not mangled name */
+         xfree(demangled);     /* not mangled name */
          return NULL;
        }
       if (cp[1] == '_') {      /* easy case: no category name     */
@@ -277,9 +278,10 @@ objc_demangle (const char *mangled)
       }
       else {
        *cp++ = '(';            /* less easy case: category name */
-       if (!(cp = strchr(cp, '_')))
+       cp = strchr(cp, '_');
+       if (!cp)
          {
-           free(demangled);    /* not mangled name */
+           xfree(demangled);   /* not mangled name */
            return NULL;
          }
        *cp++ = ')';
@@ -739,7 +741,7 @@ add_msglist(struct stoken *str, int addcolon)
   s = (char *)xmalloc(len);
   strcpy(s, msglist_sel);
   strncat(s, p, plen);
-  free(msglist_sel);
+  xfree(msglist_sel);
   msglist_sel = s;
   if (addcolon) {
     s[len-2] = ':';
@@ -764,9 +766,9 @@ end_msglist(void)
   if (!selid)
     error("Can't find selector \"%s\"", p);
   write_exp_elt_longcst (selid);
-  free(p);
+  xfree(p);
   write_exp_elt_longcst (val); /* Number of args */
-  free(sel);
+  xfree(sel);
 
   return val;
 }
@@ -805,12 +807,14 @@ compare_selectors (void *a, void *b)
 {
   char *aname, *bname;
 
-  if ((aname = SYMBOL_SOURCE_NAME (*(struct symbol **) a)) == NULL ||
-      (bname = SYMBOL_SOURCE_NAME (*(struct symbol **) b)) == NULL)
+  aname = SYMBOL_SOURCE_NAME (*(struct symbol **) a);
+  bname = SYMBOL_SOURCE_NAME (*(struct symbol **) b);
+  if (aname == NULL || bname == NULL)
     error ("internal: compare_selectors(1)");
 
-  if ((aname = strchr(aname, ' ')) == NULL ||
-      (bname = strchr(bname, ' ')) == NULL)
+  aname = strchr(aname, ' ');
+  bname = strchr(bname, ' ');
+  if (aname == NULL || bname == NULL)
     error ("internal: compare_selectors(2)");
 
   return specialcmp (aname+1, bname+1);
@@ -870,7 +874,8 @@ selectors_info (char *regexp, int from_tty)
   ALL_MSYMBOLS (objfile, msymbol)
     {
       QUIT;
-      if ((name = SYMBOL_DEMANGLED_NAME (msymbol)) == NULL)
+      name = SYMBOL_DEMANGLED_NAME (msymbol);
+      if (name == NULL)
        name = SYMBOL_NAME (msymbol);
       if (name &&
         (name[0] == '-' || name[0] == '+') &&
@@ -902,7 +907,8 @@ selectors_info (char *regexp, int from_tty)
       ALL_MSYMBOLS (objfile, msymbol)
        {
          QUIT;
-         if ((name = SYMBOL_DEMANGLED_NAME (msymbol)) == NULL)
+         name = SYMBOL_DEMANGLED_NAME (msymbol);
+         if (name == NULL)
            name = SYMBOL_NAME (msymbol);
          if (name &&
             (name[0] == '-' || name[0] == '+') &&
@@ -927,7 +933,8 @@ selectors_info (char *regexp, int from_tty)
          char *p = asel;
 
          QUIT;
-         if ((name = SYMBOL_DEMANGLED_NAME (sym_arr[ix])) == NULL)
+         name = SYMBOL_DEMANGLED_NAME (sym_arr[ix]);
+         if (name == NULL)
            name = SYMBOL_NAME (sym_arr[ix]);
          name = strchr (name, ' ') + 1;
          if (p[0] && specialcmp(name, p) == 0)
@@ -958,8 +965,9 @@ compare_classes (void *a, void *b)
 {
   char *aname, *bname;
 
-  if ((aname = SYMBOL_SOURCE_NAME (*(struct symbol **) a)) == NULL ||
-      (bname = SYMBOL_SOURCE_NAME (*(struct symbol **) b)) == NULL)
+  aname = SYMBOL_SOURCE_NAME (*(struct symbol **) a);
+  bname = SYMBOL_SOURCE_NAME (*(struct symbol **) b);
+  if (aname == NULL || bname == NULL)
     error ("internal: compare_classes(1)");
 
   return specialcmp (aname+1, bname+1);
@@ -1009,7 +1017,8 @@ classes_info (char *regexp, int from_tty)
   ALL_MSYMBOLS (objfile, msymbol)
     {
       QUIT;
-      if ((name = SYMBOL_DEMANGLED_NAME (msymbol)) == NULL)
+      name = SYMBOL_DEMANGLED_NAME (msymbol);
+      if (name == NULL)
        name = SYMBOL_NAME (msymbol);
       if (name &&
         (name[0] == '-' || name[0] == '+') &&
@@ -1034,7 +1043,8 @@ classes_info (char *regexp, int from_tty)
       ALL_MSYMBOLS (objfile, msymbol)
        {
          QUIT;
-         if ((name = SYMBOL_DEMANGLED_NAME (msymbol)) == NULL)
+         name = SYMBOL_DEMANGLED_NAME (msymbol);
+         if (name == NULL)
            name = SYMBOL_NAME (msymbol);
          if (name &&
             (name[0] == '-' || name[0] == '+') &&
@@ -1052,7 +1062,8 @@ classes_info (char *regexp, int from_tty)
          char *p = aclass;
 
          QUIT;
-         if ((name = SYMBOL_DEMANGLED_NAME (sym_arr[ix])) == NULL)
+         name = SYMBOL_DEMANGLED_NAME (sym_arr[ix]);
+         if (name == NULL)
            name = SYMBOL_NAME (sym_arr[ix]);
          name += 2;
          if (p[0] && specialcmp(name, p) == 0)
@@ -1551,12 +1562,14 @@ print_object_command (char *args, int from_tty)
     do_cleanups (old_chain);
   }
 
-  if (!(function = find_function_in_inferior ("_NSPrintForDebugger")))
+  function = find_function_in_inferior ("_NSPrintForDebugger");
+  if (!function)
     error ("Unable to locate _NSPrintForDebugger in child process");
 
   description = call_function_by_hand (function, 1, &object);
 
-  if ((string_addr = value_as_long (description)) == 0)
+  string_addr = value_as_long (description);
+  if (string_addr == 0)
     error ("object returns null description");
 
   read_memory (string_addr + i++, &c, 1);
@@ -1658,7 +1671,7 @@ struct objc_submethod_helper_data {
 };
 
 int 
-find_objc_msgcall_submethod_helper (PTR arg)
+find_objc_msgcall_submethod_helper (void * arg)
 {
   struct objc_submethod_helper_data *s = 
     (struct objc_submethod_helper_data *) arg;
@@ -1681,7 +1694,7 @@ find_objc_msgcall_submethod (CORE_ADDR (*f) (CORE_ADDR, CORE_ADDR *),
   s.new_pc = new_pc;
 
   if (catch_errors (find_objc_msgcall_submethod_helper,
-                   (PTR) &s,
+                   (void *) &s,
                    "Unable to determine target of Objective-C method call (ignoring):\n",
                    RETURN_MASK_ALL) == 0) 
     return 1;
index 87e315b5c0663c79deede3ec2956dac60dcc47aa..9fd93e7a5fcddc9aa2b0c72810a575fd1fc3e329 100644 (file)
@@ -19,9 +19,7 @@
    Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#ifdef __STDC__                /* Forward decls for prototypes.  */
 struct value;
-#endif
 
 extern int objc_parse (void);          /* Defined in c-exp.y */
 
index f0939e7bbbf3ce43d58a92104f754817a24f167c..4dc99be8ce451968173cadb846aeb3194c2dc3c8 100644 (file)
@@ -1358,8 +1358,7 @@ yylex ()
         {
           /* here we search for 'this' like
              inserted in FPC stabs debug info */
-         static const char this_name[] =
-                                { /* CPLUS_MARKER,*/ 't', 'h', 'i', 's', '\0' };
+         static const char this_name[] = "this";
 
          if (lookup_symbol (this_name, expression_context_block,
                             VAR_NAMESPACE, (int *) NULL,
index e6a68ef202b7d079983895b3946277597ae1757b..53b9dd333e0bfcbc3a192d0dfce8e01611ab88c7 100644 (file)
@@ -465,6 +465,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
   int prev_insn_was_prologue_insn = 1;
   int num_skip_non_prologue_insns = 0;
   const struct bfd_arch_info *arch_info = gdbarch_bfd_arch_info (current_gdbarch);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
   
   /* Attempt to find the end of the prologue when no limit is specified.
      Note that refine_prologue_limit() has been written so that it may
@@ -694,7 +695,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
        {                       /* mr r31, r1 */
          fdata->frameless = 0;
          framep = 1;
-         fdata->alloca_reg = 31;
+         fdata->alloca_reg = (tdep->ppc_gp0_regnum + 31);
          continue;
 
          /* Another way to set up the frame pointer.  */
@@ -703,7 +704,8 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, struct rs6000_framedata *fdata)
        {                       /* addi rX, r1, 0x0 */
          fdata->frameless = 0;
          framep = 1;
-         fdata->alloca_reg = (op & ~0x38010000) >> 21;
+         fdata->alloca_reg = (tdep->ppc_gp0_regnum
+                              + ((op & ~0x38010000) >> 21));
          continue;
        }
       /* AltiVec related instructions.  */
@@ -1989,7 +1991,8 @@ rs6000_stab_reg_to_regnum (int num)
 static void
 rs6000_store_struct_return (CORE_ADDR addr, CORE_ADDR sp)
 {
-  write_register (3, addr);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+  write_register (tdep->ppc_gp0_regnum + 3, addr);
 }
 
 /* Write into appropriate registers a function return value
@@ -2793,7 +2796,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
        break;
       case bfd_mach_ppc_7400:
        tdep->ppc_vr0_regnum = 119;
-       tdep->ppc_vrsave_regnum = 153;
+       tdep->ppc_vrsave_regnum = 152;
        tdep->ppc_ev0_regnum = -1;
        tdep->ppc_ev31_regnum = -1;
        break;
index 7ac5b9ef57f3bc8924fc2a920cede5b5469cf234..c5e5bf457d2793daac229ad252e181807adf1f0f 100644 (file)
@@ -884,7 +884,14 @@ sh_saved_pc_after_call (struct frame_info *frame)
 static int
 sh_use_struct_convention (int gcc_p, struct type *type)
 {
+#if 0
   return (TYPE_LENGTH (type) > 1);
+#else
+  int len = TYPE_LENGTH (type);
+  int nelem = TYPE_NFIELDS (type);
+  return ((len != 1 && len != 2 && len != 4 && len != 8) || nelem != 1) &&
+         (len != 8 || TYPE_LENGTH (TYPE_FIELD_TYPE (type, 0)) != 4);
+#endif
 }
 
 static int
@@ -2045,8 +2052,11 @@ sh_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
       if (len < 4)
        {
          /* value gets right-justified in the register or stack word */
-         memcpy (valbuf + (4 - len),
-                 (char *) VALUE_CONTENTS (args[argnum]), len);
+         if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+           memcpy (valbuf + (4 - len),
+                   (char *) VALUE_CONTENTS (args[argnum]), len);
+         else
+           memcpy (valbuf, (char *) VALUE_CONTENTS (args[argnum]), len);
          val = valbuf;
        }
       else
@@ -2457,8 +2467,11 @@ sh_default_store_return_value (struct type *type, char *valbuf)
     {
       /* Add leading zeros to the value. */
       memset (buf, 0, REGISTER_RAW_SIZE (R0_REGNUM));
-      memcpy (buf + REGISTER_RAW_SIZE (R0_REGNUM) - TYPE_LENGTH (type),
-             valbuf, TYPE_LENGTH (type));
+      if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
+       memcpy (buf + REGISTER_RAW_SIZE (R0_REGNUM) - TYPE_LENGTH (type),
+               valbuf, TYPE_LENGTH (type));
+      else
+       memcpy (buf, valbuf, TYPE_LENGTH (type));
       write_register_bytes (REGISTER_BYTE (R0_REGNUM), buf, 
                            REGISTER_RAW_SIZE (R0_REGNUM));
     }
@@ -4544,7 +4557,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
   set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
   set_gdbarch_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
-  set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT);/*??should be 8?*/
+  set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
 
   set_gdbarch_use_generic_dummy_frames (gdbarch, 1);
   set_gdbarch_call_dummy_length (gdbarch, 0);
index 4697b4067e710e6afcf7bec0acfcdcf1fb1835fa..00634ac964e0e7b48221c9890f88beedf4642dcf 100644 (file)
@@ -185,10 +185,8 @@ resolve_symbol_reference (struct objfile *, struct symbol *, char *);
 
 void stabsread_clear_cache (void);
 
-static const char vptr_name[] =
-{'_', 'v', 'p', 't', 'r', CPLUS_MARKER, '\0'};
-static const char vb_name[] =
-{'_', 'v', 'b', CPLUS_MARKER, '\0'};
+static const char vptr_name[] = "_vptr$";
+static const char vb_name[] = "_vb$";
 
 /* Define this as 1 if a pcc declaration of a char or short argument
    gives the correct address.  Otherwise assume pcc gives the
@@ -3179,8 +3177,7 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
          /* This lets the user type "break operator+".
             We could just put in "+" as the name, but that wouldn't
             work for "*".  */
-         static char opname[32] =
-         {'o', 'p', CPLUS_MARKER};
+         static char opname[32] = "op$";
          char *o = opname + 3;
 
          /* Skip past '::'.  */
@@ -4138,8 +4135,9 @@ read_tilde_fields (struct field_info *fip, char **pp, struct type *type,
                   i >= TYPE_N_BASECLASSES (t);
                   --i)
                {
-                 if (!strncmp (TYPE_FIELD_NAME (t, i), vptr_name,
-                               sizeof (vptr_name) - 1))
+                 char *name = TYPE_FIELD_NAME (t, i);
+                 if (!strncmp (name, vptr_name, sizeof (vptr_name) - 2)
+                     && is_cplus_marker (name[sizeof (vptr_name) - 1]))
                    {
                      TYPE_VPTR_FIELDNO (type) = i;
                      goto gotit;
index 5d5248290500dc41915ba61544fb7aa847980558..37070b45adeee474aeba0bcd5693c09def5aa529 100644 (file)
@@ -51,9 +51,9 @@ void (*selected_frame_level_changed_hook) (int);
 
 void _initialize_stack (void);
 
-/* Prototypes for local functions. */
+void return_command (char *, int);
 
-static void return_command (char *, int);
+/* Prototypes for local functions. */
 
 static void down_command (char *, int);
 
@@ -359,7 +359,10 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args)
       /* Do this regardless of SOURCE because we don't have any source
          to list for this frame.  */
       if (level >= 0)
-       printf_filtered ("#%-2d ", level);
+        {
+          ui_out_text (uiout, "#");
+          ui_out_field_fmt_int (uiout, 2, ui_left, "level", level);
+        }
       annotate_function_call ();
       printf_filtered ("<function called from gdb>\n");
       annotate_frame_end ();
@@ -372,7 +375,10 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args)
       /* Do this regardless of SOURCE because we don't have any source
          to list for this frame.  */
       if (level >= 0)
-       printf_filtered ("#%-2d ", level);
+        {
+          ui_out_text (uiout, "#");
+          ui_out_field_fmt_int (uiout, 2, ui_left, "level", level);
+        }
       annotate_signal_handler_caller ();
       printf_filtered ("<signal handler called>\n");
       annotate_frame_end ();
@@ -549,8 +555,7 @@ print_frame (struct frame_info *fi,
   if (level >= 0)
     {
       ui_out_text (uiout, "#");
-      ui_out_field_fmt (uiout, "level", "%-2d", level);
-      ui_out_spaces (uiout, 1);
+      ui_out_field_fmt_int (uiout, 2, ui_left, "level", level);
     }
   if (addressprint)
     if (fi->pc != sal.pc || !sal.symtab || source == LOC_AND_ADDRESS)
@@ -1757,12 +1762,6 @@ down_command (char *count_exp, int from_tty)
 }
 \f
 void
-return_command_wrapper (char *retval_exp, int from_tty)
-{
-  return_command (retval_exp, from_tty);
-}
-
-static void
 return_command (char *retval_exp, int from_tty)
 {
   struct symbol *thisfun;
index 5736277965fe03476fb5ab997806dacc4f1254e5..43a345550fe251b259469538a40a331828b2ed59 100644 (file)
@@ -3,6 +3,39 @@
        * gdb.c++/namespace.exp: Add tests from within C::D::marker2.
        * gdb.c++/namespace.cc: Add namespace C and its contents.
 
+2002-10-02  Jim Blandy  <jimb@redhat.com>
+
+       * gdb.c++/casts.cc, gdb.c++/casts.exp: New test.
+
+2002-10-01  Andrew Cagney  <ac131313@redhat.com>
+
+       * mi1-basics.exp: Copy of mi1-basics.exp MIFLAGS set "-i=mi1".
+       * mi1-break.exp, mi1-console.exp, mi1-disassemble.exp: Ditto.
+       * mi1-eval.exp, mi1-hack-cli.exp, mi1-pthreads.exp: Ditto.
+       * mi1-read-memory.exp, mi1-regs.exp, mi1-return.exp: Ditto.
+       * mi1-simplerun.exp, mi1-stack.exp, mi1-stepi.exp: Ditto.
+       * mi1-until.exp, mi1-var-block.exp, mi1-var-child.exp: Ditto.
+       * mi1-var-cmd.exp, mi1-var-display.exp, mi1-watch.exp: Ditto.
+
+2002-09-29  Andrew Cagney  <ac131313@redhat.com>
+
+       * mi0-basics.exp, mi0-break.exp, mi0-console.exp: Delete.
+       * mi0-disassemble.exp, mi0-eval.exp: Delete.
+       * mi0-hack-cli.exp, mi0-read-memory.exp: Delete.
+       * mi0-regs.exp, mi0-return.exp, mi0-simplerun.exp: Delete.
+       * mi0-stack.exp, mi0-stepi.exp, mi0-until.exp: Delete.
+       * mi0-var-block.exp, mi0-var-child.exp: Delete.
+       * mi0-var-cmd.exp, mi0-var-display.exp, mi0-watch.exp: Delete.
+       
+2002-09-27  Kevin Buettner  <kevinb@redhat.com>
+
+       * gdb.base/annota1.exp (info break): Make directory components of
+       path optional since not all compilers emit this debug information.
+
+       * gdb.base/shlib-call.exp (step inside shr2): Don't fail if first
+       step ends up stepping out of the function instead of stopping on
+       the epilogue.
+
 2002-09-26  Keith Seitz  <keiths@redhat.com>
 
        * lib/insight-support.exp (gdbtk_start): Figure out where
index bda2bec397507a806cbc032e6c368ed43ab6483f..e4483e3b471365a0ea80f70cbe0033fe941f32e5 100644 (file)
@@ -115,7 +115,7 @@ gdb_expect {
 #
 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$" \
+ -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)" }
index dd88274d1be20313d1a9575fbc5ec30cec3bbeb9..8fe8b22da394c67f4848bf44c30ca060eac41136 100644 (file)
@@ -239,18 +239,27 @@ gdb_expect {
 
 #step -return
     send_gdb "step\n"
+    # A step at this point will either take us entirely out of
+    # the function or into the function's epilogue.  The exact
+    # behavior will differ depending upon upon whether or not
+    # the compiler emits line number information for the epilogue.
     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" }
+        -re "main \\(\\) at.*g = mainshr1\\(g\\);.*$gdb_prompt $" { 
+           pass "step out of shr2 to main"
+       }
+        -re ".*\\\}.*$gdb_prompt $" {
+           pass "step out of shr2 to main (stopped in shr2 epilogue)"
+           send_gdb "step\n"
+           gdb_expect {
+               -re "main \\(\\) at.*g = mainshr1\\(g\\);.*$gdb_prompt $" { pass "step out of shr2 epilogue to main"}
+               -re ".*$gdb_prompt $" { fail "step out of shr2 epilogue to main" }
+               timeout { fail "step out of shr2 epilogue to main (timeout)" }
+           }
+       }
+        -re ".*$gdb_prompt $" { fail "step out of shr2" }
         timeout { fail "step out of shr2 to main (timeout)" }
     }
+    
 
 #print mainshr1(1)
 send_gdb "print mainshr1(1)\n"
index eb9420b44f56128de3813f7575d582931b5fb9aa..d3830308095e1a6543c89e3c4936d2c29ea352c5 100644 (file)
@@ -1,3 +1,20 @@
+2002-10-03  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * mi-return.exp: Change expected frame output to remove extraneous
+       space in level field when frame level is single digit.  Part of
+       fix for PR gdb/192.
+       * mi-stack.exp: Ditto.
+       * mi1-return.exp: Ditto.
+       * mi1-stack.exp: Ditto.
+
+2002-10-03  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * mi-var-block.exp: Change expected output from -var-update
+       command to expect list format for "changelist".  Fix for
+       PR gdb/672.
+       * mi-var-cmd.exp: Ditto.
+       * mi-var-child: Ditto.
+
 2002-09-25  Keith Seitz  <keiths@redhat.com>
 
        * mi-pthreads.exp (get_mi_thread_list): Check if expect_out
index 318fa8e9d45e9948f702c8aa772e03c0497506de..1e7c863a7a8f20212775cf282305c65036b7addb 100644 (file)
@@ -80,7 +80,7 @@ proc test_return_simple {} {
 
     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 "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)"
        }
index 7af458e348d48965b4a5a04ab7b6b6686491b7ec..4c682e21e2f9ec45db2a9234a4f6b4319e8f04aa 100644 (file)
@@ -73,13 +73,13 @@ proc test_stack_frame_listing {} {
     # -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\",.*\}\\\]" \
+           "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\",.*\}\\\]" \
+           "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\",.*\}\\\]" \
+           "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" \
index 469839b033213e498779e38f82d291f99fad807b..506275c94a6efed8b226bf44bcdf3cf01536b083 100644 (file)
@@ -104,7 +104,7 @@ gdb_expect {
 # 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\"\}" \
+       "\\^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;"
@@ -155,7 +155,7 @@ mi_gdb_test "-var-evaluate-expression inner_foo" \
 clear_xfail *-*-*
 
 mi_gdb_test "-var-update foo" \
-       "\\^done,changelist=\{\}" \
+       "\\^done,changelist=\\\[\\\]" \
        "update foo: did not change"
 
 mi_gdb_test "-var-delete inner_foo" \
@@ -193,7 +193,7 @@ gdb_expect {
 # Desc: check that only cb is in scope (known gdb problem)
 setup_xfail *-*-*
 mi_gdb_test "-var-update foo2" \
-       "\\^done,changelist=\{FIXME\}" \
+       "\\^done,changelist=\\\[FIXME\\\]" \
        "update foo2 should be out of scope: KNOWN PROBLEM"
 clear_xfail *-*-*
 setup_xfail *-*-*
@@ -202,7 +202,7 @@ mi_gdb_test "-var-update foo" \
        "update foo should be out of scope: KNOWN PROBLEM"
 clear_xfail *-*-*
 mi_gdb_test "-var-update cb" \
-       "\\^done,changelist=\{\}" \
+       "\\^done,changelist=\\\[\\\]" \
        "update cb"
 
 # Test: c_variable-3.10
index 18b5a29d86fdf41bdcff34903cee8dd488194342..af058d5170d061d7a12140bc2b316e1f300ce8a2 100644 (file)
@@ -750,7 +750,7 @@ mi_gdb_test "-var-delete weird" \
 # Test: c_variable-5.1
 # Desc: check that nothing changed
 mi_gdb_test "-var-update *" \
-       "\\^done,changelist=\{\}" \
+       "\\^done,changelist=\\\[\\\]" \
        "update all vars. None changed"
 
 # Step over "struct_declarations.integer = 123;"
@@ -760,7 +760,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
 # 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\"\}" \
+       "\\^done,changelist=\\\[\{name=\"struct_declarations.integer\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
        "update all vars struct_declarations.integer"
 
 # Step over:
@@ -773,7 +773,7 @@ mi_execute_to "exec-step 3" "end-stepping-range" do_children_tests {} {.*var-cmd
 # 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\"\}" \
+       "\\^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;"
@@ -783,7 +783,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
 # 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\"\}" \
+       "\\^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;"
@@ -793,7 +793,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
 # 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\"\}" \
+       "\\^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;"
@@ -803,7 +803,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
 # 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\"\}" \
+       "\\^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;"
@@ -813,7 +813,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
 # 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\"\}" \
+       "\\^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:
@@ -830,7 +830,7 @@ mi_execute_to "exec-step 7" "end-stepping-range" do_children_tests {} {.*var-cmd
 # 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\"\}" \
+       "\\^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"
 
 
@@ -841,7 +841,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
 # 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\"\}" \
+       "\\^done,changelist=\\\[\{name=\"struct_declarations.func_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
        "update all vars struct_declarations.func_ptr changed"
 
 # Delete all variables
@@ -1133,7 +1133,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
 # 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\"\}" \
+       "\\^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;"
@@ -1143,7 +1143,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
 # 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\"\}" \
+       "\\^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"
 
 
@@ -1154,7 +1154,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
 # 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\"\}" \
+       "\\^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"
 
 
@@ -1165,7 +1165,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
 # 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\"\}" \
+       "\\^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"
 
 
@@ -1178,7 +1178,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
 # 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\"\}" \
+       "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 *-*-*
 
@@ -1193,7 +1193,7 @@ mi_step_to do_children_tests {} {.*var-cmd.c} $line "step $line"
 # 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\"\}" \
+       "\\^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"
 
 
index 8be0d8dc7d902cbf4ae78f60f62efa86cb7a47d0..26a91cf960b56b28b94a08c0c35acc0bffda0852 100644 (file)
@@ -176,7 +176,7 @@ mi_gdb_test "-var-create int * int" \
 # Test: c_variable-2.1
 # Desc: check whether values changed at do_block_tests
 mi_gdb_test "-var-update *" \
-       "\\^done,changelist=\{\}" \
+       "\\^done,changelist=\\\[\\\]" \
        "update all vars"
 
 # Step over "linteger = 1234;"
@@ -185,7 +185,7 @@ 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\"\}" \
+       "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
        "update all vars: linteger changed"
 
 # Step over "lpinteger = &linteger;"
@@ -194,7 +194,7 @@ 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\"\}" \
+       "\\^done,changelist=\\\[\{name=\"lpinteger\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
        "update all vars: lpinteger changed"
 
 # Step over "lcharacter = 'a';"
@@ -203,7 +203,7 @@ 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\"\}" \
+       "\\^done,changelist=\\\[\{name=\"lcharacter\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
        "update all vars: lcharacter changed"
 
 # Step over "lpcharacter = &lcharacter;"
@@ -212,7 +212,7 @@ 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\"\}" \
+       "\\^done,changelist=\\\[\{name=\"lpcharacter\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \
        "update all vars: lpcharacter changed"
 
 
@@ -234,7 +234,7 @@ mi_execute_to "exec-step 9" "end-stepping-range" "do_locals_tests" "" \
 # 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\"\}" \
+       "\\^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:
@@ -249,7 +249,7 @@ mi_execute_to "exec-step 4" "end-stepping-range" "do_locals_tests" "" \
 # 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\"\}" \
+       "\\^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
@@ -271,7 +271,7 @@ mi_execute_to "exec-step 8" "end-stepping-range" "do_locals_tests" "" \
 # 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\"\}" \
+       "\\^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"
 
 
@@ -421,7 +421,7 @@ mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\
 # 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\"\}" \
+       "\\^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=\".*\"\}" \
@@ -430,7 +430,7 @@ mi_step_to "subroutine1" "\{name=\"i\",value=\".*\"\},\{name=\"l\",value=\".*\"\
 # 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\"\}" \
+       "\\^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"
@@ -438,7 +438,7 @@ 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\"\}" \
+       "\\^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
@@ -538,15 +538,15 @@ mi_gdb_test "-break-insert incr_a" \
 mi_continue_to {.*} incr_a {.*} {.*var-cmd.c} {.*} {stop in incr_a}
 
 mi_gdb_test "-var-update selected_a" \
-  {\^done,changelist=\{name="selected_a",in_scope="true",new_type="char",new_num_children="0"\}} \
-  "update selected_a in incr_a"
+       "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",new_type=\"char\",new_num_children=\"0\"\}\\\]" \
+       "update selected_a in incr_a"
 
 mi_next "step a line in incr_a"
 mi_next "return from incr_a to do_special_tests"
 
 mi_gdb_test "-var-update selected_a" \
-  {\^done,changelist=\{name="selected_a",in_scope="true",new_type="int",new_num_children="0"\}} \
-  "update selected_a in do_special_tests"
+       "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",new_type=\"int\",new_num_children=\"0\"\}\\\]" \
+       "update selected_a in do_special_tests"
 
 mi_gdb_exit
 return 0
diff --git a/gdb/testsuite/gdb.mi/mi0-basics.exp b/gdb/testsuite/gdb.mi/mi0-basics.exp
deleted file mode 100644 (file)
index d463244..0000000
+++ /dev/null
@@ -1,174 +0,0 @@
-#   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
deleted file mode 100644 (file)
index b763587..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-#   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
deleted file mode 100644 (file)
index c900f68..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-# 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
-
-#
-# 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
deleted file mode 100644 (file)
index ca0b3a6..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-#   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
deleted file mode 100644 (file)
index 0b0ea08..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-#   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
deleted file mode 100644 (file)
index 3fc6c26..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-#   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
deleted file mode 100644 (file)
index 0bc2949..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#   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
deleted file mode 100644 (file)
index b6db903..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-#   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
deleted file mode 100644 (file)
index b396fe8..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-#   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
deleted file mode 100644 (file)
index 74ab042..0000000
+++ /dev/null
@@ -1,201 +0,0 @@
-#   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_execute_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
deleted file mode 100644 (file)
index 270aa84..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-#   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
deleted file mode 100644 (file)
index 456b2a1..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-#   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
deleted file mode 100644 (file)
index 1cf58a8..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-#   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
deleted file mode 100644 (file)
index 0232139..0000000
+++ /dev/null
@@ -1,228 +0,0 @@
-#   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
deleted file mode 100644 (file)
index 63a3368..0000000
+++ /dev/null
@@ -1,1333 +0,0 @@
-#   Copyright (C) 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
-
-# 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
deleted file mode 100644 (file)
index b9d1841..0000000
+++ /dev/null
@@ -1,523 +0,0 @@
-#   Copyright (C) 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
-
-# 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_execute_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_execute_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_execute_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
deleted file mode 100644 (file)
index 47f41a6..0000000
+++ /dev/null
@@ -1,627 +0,0 @@
-#   Copyright (C) 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
-
-# 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
deleted file mode 100644 (file)
index 8932cd9..0000000
+++ /dev/null
@@ -1,191 +0,0 @@
-#   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
index 7716eaf148b76916f28d6739c9cbefabfce13b6d..43559f2edd726f4871131a12fee6ae4ec0d87188 100644 (file)
@@ -74,10 +74,6 @@ extern int addressprint;     /* Print machine addresses? */
  */  
 
 extern void output_command (char *, int);
-extern void registers_info (char *, int);
-extern void args_info (char *, int);
-extern void locals_info (char *, int);
-
 
 /* If this definition isn't overridden by the header files, assume
    that isatty and fileno exist on this system.  */
index edff2bd9c07adeabfc42277dc2b99a250ffeb30d..8fdc4bcdfc3e219df63bee27624aa25918c97b60 100644 (file)
@@ -1,3 +1,22 @@
+2002-10-02  Elena Zannoni  <ezannoni@redhat.com>
+
+       * tui-hooks.c (selected_frame_level_changed_hook): Use the one
+       exported from frame.h.
+
+2002-09-29  Elena Zannoni  <ezannoni@redhat.com>
+
+       * tui.c (tui_show_source): Don't access current_source_symtab, use
+       accessor function instead.  Include source.h and symtab.h
+       * tuiDisassem.c (tuiShowDisassemAndUpdateSource,
+       tuiVerticalDisassemScroll): Use accessor functions for current
+       source line and symtab.  Include source.h.
+       * tuiLayout.c (_extractDisplayStartAddr): Use accessor functions
+       for current source line and symtab.  Include source.h.
+       * tuiWin.c (_makeVisibleWithNewHeight): Ditto.
+       * tuiSourceWin.c (tuiUpdateSourceWindowAsIs,
+       tuiHorizontalSourceScroll): Ditto.
+       * tuiSource.c (tuiVerticalSourceScroll): Ditto.
+
 2002-09-13  Stephane Carrez  <stcarrez@nerim.fr>
 
        * tui.c (tui_rl_switch_mode): Remove unecessary TUI switch printfs.
index 3beca39c782dba4677fd8ecd1c4297960d9fb25d..e1aad9f03b34817a5727805eb2b48507f737e102 100644 (file)
@@ -69,7 +69,6 @@
 int tui_target_has_run = 0;
 
 static void (* tui_target_new_objfile_chain) (struct objfile*);
-extern void (*selected_frame_level_changed_hook) (int);
 static void tui_event_loop (void);
 static void tui_command_loop (void);
 
index 81edd8b85c785249cabb34d6dd0dce44ba354610..a7c16bcbe0c5ce65614766743fb0398d70c4a1c4 100644 (file)
@@ -67,6 +67,8 @@
 #include "frame.h"
 #include "breakpoint.h"
 #include "inferior.h"
+#include "symtab.h"
+#include "source.h"
 
 /* Tells whether the TUI is active or not.  */
 int tui_active = 0;
@@ -543,10 +545,11 @@ _tuiReset (void)
 void
 tui_show_source (const char *file, int line)
 {
+  struct symtab_and_line cursal = get_current_source_symtab_and_line ();
   /* make sure that the source window is displayed */
   tuiAddWinToLayout (SRC_WIN);
 
-  tuiUpdateSourceWindowsWithLine (current_source_symtab, line);
+  tuiUpdateSourceWindowsWithLine (cursal.symtab, line);
   tuiUpdateLocatorFilename (file);
 }
 
index 50a6d0ef9f7b811d9a82a0c97d5a41a8322b0ad0..f79cc12ab66b48704eaa2b72da4bf029d268c1de 100644 (file)
@@ -44,6 +44,7 @@
 #include "breakpoint.h"
 #include "frame.h"
 #include "value.h"
+#include "source.h"
 
 #include "tui.h"
 #include "tuiData.h"
@@ -337,7 +338,7 @@ tuiShowDisassemAndUpdateSource (CORE_ADDR startAddr)
       tuiUpdateSourceWindow (srcWin, sal.symtab, val, TRUE);
       if (sal.symtab)
        {
-         current_source_symtab = sal.symtab;
+         set_current_source_symtab_and_line (&sal);
          tuiUpdateLocatorFilename (sal.symtab->filename);
        }
       else
@@ -415,12 +416,13 @@ tuiVerticalDisassemScroll (TuiScrollDirection scrollDirection,
       struct symtab *s;
       TuiLineOrAddress val;
       int maxLines, dir;
+      struct symtab_and_line cursal = get_current_source_symtab_and_line ();
 
       content = (TuiWinContent) disassemWin->generic.content;
-      if (current_source_symtab == (struct symtab *) NULL)
+      if (cursal.symtab == (struct symtab *) NULL)
        s = find_pc_symtab (selected_frame->pc);
       else
-       s = current_source_symtab;
+       s = cursal.symtab;
 
       /* account for hilite */
       maxLines = disassemWin->generic.height - 2;
index c3eae72c3c545d4c5f65ea779813dcd980a0d0a1..cddbd14342f64c8b0825e4d856432d161df5e469 100644 (file)
@@ -43,6 +43,7 @@
 #include "command.h"
 #include "symtab.h"
 #include "frame.h"
+#include "source.h"
 #include <ctype.h>
 
 #include "tui.h"
@@ -546,12 +547,13 @@ _extractDisplayStartAddr (void)
   TuiLayoutType curLayout = currentLayout ();
   CORE_ADDR addr;
   CORE_ADDR pc;
+  struct symtab_and_line cursal = get_current_source_symtab_and_line ();
 
   switch (curLayout)
     {
     case SRC_COMMAND:
     case SRC_DATA_COMMAND:
-      find_line_pc (current_source_symtab,
+      find_line_pc (cursal.symtab,
                    srcWin->detail.sourceInfo.startLineOrAddr.lineNo,
                    &pc);
       addr = pc;
index 0d59bf06b058993abe2b274ba6c2739e355102c7..f682786ce9e8c2b03741094a026a652c1339e64f 100644 (file)
@@ -337,11 +337,12 @@ tuiVerticalSourceScroll (TuiScrollDirection scrollDirection,
       TuiLineOrAddress l;
       struct symtab *s;
       TuiWinContent content = (TuiWinContent) srcWin->generic.content;
+      struct symtab_and_line cursal = get_current_source_symtab_and_line ();
 
-      if (current_source_symtab == (struct symtab *) NULL)
+      if (cursal.symtab == (struct symtab *) NULL)
        s = find_pc_symtab (selected_frame->pc);
       else
-       s = current_source_symtab;
+       s = cursal.symtab;
 
       if (scrollDirection == FORWARD_SCROLL)
        {
index 696b8b2471980514e4848a72c972fa2769aeecaf..c0c786836a3fdcbde9a8b60032e46e72fec79c7e 100644 (file)
@@ -45,6 +45,7 @@
 #include "frame.h"
 #include "breakpoint.h"
 #include "value.h"
+#include "source.h"
 
 #include "tui.h"
 #include "tuiData.h"
@@ -125,9 +126,12 @@ tuiUpdateSourceWindowAsIs (TuiWinInfoPtr winInfo, struct symtab *s,
       tuiUpdateExecInfo (winInfo);
       if (winInfo->generic.type == SRC_WIN)
        {
-         current_source_line = lineOrAddr.lineNo +
+         struct symtab_and_line sal;
+         
+         sal.line = lineOrAddr.lineNo +
            (winInfo->generic.contentSize - 2);
-         current_source_symtab = s;
+         sal.symtab = s;
+         set_current_source_symtab_and_line (&sal);
          /*
             ** If the focus was in the asm win, put it in the src
             ** win if we don't have a split layout
@@ -348,11 +352,12 @@ tuiHorizontalSourceScroll (TuiWinInfoPtr winInfo,
     {
       int offset;
       struct symtab *s;
+      struct symtab_and_line cursal = get_current_source_symtab_and_line ();
 
-      if (current_source_symtab == (struct symtab *) NULL)
+      if (cursal.symtab == (struct symtab *) NULL)
        s = find_pc_symtab (selected_frame->pc);
       else
-       s = current_source_symtab;
+       s = cursal.symtab;
 
       if (direction == LEFT_SCROLL)
        offset = winInfo->detail.sourceInfo.horizontalOffset + numToScroll;
index fe3b8e054be1d40325aedfcd1dea40319f65e795..38283b59da1e55ad559d9ac2965d35e51318350d 100644 (file)
@@ -53,6 +53,7 @@
 #include "frame.h"
 #include "cli/cli-cmds.h"
 #include "top.h"
+#include "source.h"
 
 #include "tui.h"
 #include "tuiData.h"
@@ -1364,6 +1365,8 @@ _makeVisibleWithNewHeight (TuiWinInfoPtr winInfo)
       if (winInfo->generic.content != (OpaquePtr) NULL)
        {
          TuiLineOrAddress lineOrAddr;
+         struct symtab_and_line cursal
+           = get_current_source_symtab_and_line ();
 
          if (winInfo->generic.type == SRC_WIN)
            lineOrAddr.lineNo =
@@ -1373,19 +1376,20 @@ _makeVisibleWithNewHeight (TuiWinInfoPtr winInfo)
              winInfo->detail.sourceInfo.startLineOrAddr.addr;
          freeWinContent (&winInfo->generic);
          tuiUpdateSourceWindow (winInfo,
-                                current_source_symtab, lineOrAddr, TRUE);
+                                cursal.symtab, lineOrAddr, TRUE);
        }
       else if (selected_frame != (struct frame_info *) NULL)
        {
          TuiLineOrAddress line;
-         extern int current_source_line;
+         struct symtab_and_line cursal = get_current_source_symtab_and_line ();
+
 
          s = find_pc_symtab (selected_frame->pc);
          if (winInfo->generic.type == SRC_WIN)
-           line.lineNo = current_source_line;
+           line.lineNo = cursal.line;
          else
            {
-             find_line_pc (s, current_source_line, &line.addr);
+             find_line_pc (s, cursal.line, &line.addr);
            }
          tuiUpdateSourceWindow (winInfo, s, line, TRUE);
        }
index 4a4a9228540c7d077f342a8de59a11677637f30f..da7740f4ca66eb7229b23f412aecb723fbd39f1d 100644 (file)
@@ -485,6 +485,23 @@ ui_out_field_int (struct ui_out *uiout,
   uo_field_int (uiout, fldno, width, align, fldname, value);
 }
 
+void
+ui_out_field_fmt_int (struct ui_out *uiout,
+                      int input_width,
+                      enum ui_align input_align,
+                     const char *fldname,
+                     int value)
+{
+  int fldno;
+  int width;
+  int align;
+  struct ui_out_level *current = current_level (uiout);
+
+  verify_field (uiout, &fldno, &width, &align);
+
+  uo_field_int (uiout, fldno, input_width, input_align, fldname, value);
+}
+
 void
 ui_out_field_core_addr (struct ui_out *uiout,
                        const char *fldname,
index 797c2fe960d3e2c99982c09c969d97ed3abeb4be..c8ed9dd504e73841d2ef3315743d8694ba58d2a5 100644 (file)
@@ -119,6 +119,10 @@ extern struct cleanup *make_cleanup_ui_out_tuple_begin_end (struct ui_out *uiout
 extern void ui_out_field_int (struct ui_out *uiout, const char *fldname,
                              int value);
 
+extern void ui_out_field_fmt_int (struct ui_out *uiout, int width,
+                                 enum ui_align align, const char *fldname, 
+                                 int value);
+
 extern void ui_out_field_core_addr (struct ui_out *uiout, const char *fldname,
                                    CORE_ADDR address);
 
index 9aab625f63cf51fb20ab30e016a4001bec57a06b..d1b4c994570486f92b5d59aeb009bf3674189168 100644 (file)
@@ -2649,6 +2649,8 @@ string_to_core_addr (const char *my_string)
            internal_error (__FILE__, __LINE__, "invalid decimal");
        }
     }
+  if (INTEGER_TO_ADDRESS_P ())
+    addr = INTEGER_TO_ADDRESS (builtin_type_void_data_ptr, &addr); 
   return addr;
 }
 
index 1aec483bb90e5479cdaa66db51dc826ce04ed801..958eac331b85f13734109cbc5c99b13b0927edd5 100644 (file)
@@ -50,12 +50,6 @@ struct MessageIO
 /* Prototypes for functions located in other files */
 extern void break_command (char *, int);
 
-extern void stepi_command (char *, int);
-
-extern void nexti_command (char *, int);
-
-extern void continue_command (char *, int);
-
 extern int (*ui_loop_hook) (int);
 
 /* Prototypes for local functions */
index 6d40e8b1d0f4377948198e7dcec5a3a0fd66595e..ccef576c9dee27af8c7d6d3eeef48b82efc9a2ba 100644 (file)
@@ -1 +1 @@
-2002-09-27-cvs
+2002-10-11-cvs
index 389569eab5d2123f4e2baa528783e6c240d30bc3..65f3160af383322147d2f00748a04c26fda58b00 100644 (file)
@@ -1,3 +1,15 @@
+2002-10-11  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
+
+       * sh.h: Add SH TLS relocs.
+
+2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
+            Ken Raeburn  <raeburn@cygnus.com>
+            Aldy Hernandez  <aldyh@redhat.com>
+            Eric Christopher  <echristo@redhat.com>
+            Richard Sandiford  <rsandifo@redhat.com>
+
+       * mips.h (E_MIPS_MACH_4120, E_MIPS_MACH_5400, E_MIPS_MACH_5500): New.
+
 2002-09-12  Roland McGrath  <roland@redhat.com>
 
        * dwarf2.h: Updates from GCC version of thie file:
index 3b6fe99eccf5480c493943188a8b1821f5f95ddd..81451ab55cd1ee02755ec2892c1ccbe68ee4f675 100644 (file)
@@ -175,8 +175,11 @@ END_RELOC_NUMBERS (R_MIPS_maxext)
 #define E_MIPS_MACH_4010       0x00820000
 #define E_MIPS_MACH_4100       0x00830000
 #define E_MIPS_MACH_4650       0x00850000
+#define E_MIPS_MACH_4120       0x00870000
 #define E_MIPS_MACH_4111       0x00880000
 #define E_MIPS_MACH_SB1         0x008a0000
+#define E_MIPS_MACH_5400       0x00910000
+#define E_MIPS_MACH_5500       0x00980000
 \f
 /* Processor specific section indices.  These sections do not actually
    exist.  Symbols with a st_shndx field corresponding to one of these
index af78c9bb04e76ff2308d55e577482579824d7037..ef964d685e8e6786337381581002637b6d6df5b3 100644 (file)
@@ -167,7 +167,17 @@ START_RELOC_NUMBERS (elf_sh_reloc_type)
   RELOC_NUMBER (R_SH_DIR10SL, 50)
   RELOC_NUMBER (R_SH_DIR10SQ, 51)
   FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_3, 52)
-  FAKE_RELOC (R_SH_LAST_INVALID_RELOC_3, 159)
+  FAKE_RELOC (R_SH_LAST_INVALID_RELOC_3, 143)
+  RELOC_NUMBER (R_SH_TLS_GD_32, 144)
+  RELOC_NUMBER (R_SH_TLS_LD_32, 145)
+  RELOC_NUMBER (R_SH_TLS_LDO_32, 146)
+  RELOC_NUMBER (R_SH_TLS_IE_32, 147)
+  RELOC_NUMBER (R_SH_TLS_LE_32, 148)
+  RELOC_NUMBER (R_SH_TLS_DTPMOD32, 149)
+  RELOC_NUMBER (R_SH_TLS_DTPOFF32, 150)
+  RELOC_NUMBER (R_SH_TLS_TPOFF32, 151)
+  FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_4, 152)
+  FAKE_RELOC (R_SH_LAST_INVALID_RELOC_4, 159)
   RELOC_NUMBER (R_SH_GOT32, 160)
   RELOC_NUMBER (R_SH_PLT32, 161)
   RELOC_NUMBER (R_SH_COPY, 162)
@@ -205,8 +215,8 @@ START_RELOC_NUMBERS (elf_sh_reloc_type)
   RELOC_NUMBER (R_SH_GLOB_DAT64, 194)
   RELOC_NUMBER (R_SH_JMP_SLOT64, 195)
   RELOC_NUMBER (R_SH_RELATIVE64, 196)
-  FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_4, 197)
-  FAKE_RELOC (R_SH_LAST_INVALID_RELOC_4, 241)
+  FAKE_RELOC (R_SH_FIRST_INVALID_RELOC_5, 197)
+  FAKE_RELOC (R_SH_LAST_INVALID_RELOC_5, 241)
   RELOC_NUMBER (R_SH_SHMEDIA_CODE, 242)
   RELOC_NUMBER (R_SH_PT_16, 243)
   RELOC_NUMBER (R_SH_IMMS16, 244)
index b950eefc36829678f7ce28639e5f9a5e1f267ee5..ab908ec92c37607de9e6e9f50630c4cf93c667e5 100644 (file)
@@ -1,3 +1,17 @@
+2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
+            Ken Raeburn  <raeburn@cygnus.com>
+            Aldy Hernandez  <aldyh@redhat.com>
+            Eric Christopher  <echristo@redhat.com>
+            Richard Sandiford  <rsandifo@redhat.com>
+
+       * mips.h: Update comment for new opcodes.
+       (OP_MASK_VECBYTE, OP_SH_VECBYTE): New.
+       (OP_MASK_VECALIGN, OP_SH_VECALIGN): New.
+       (INSN_4111, INSN_4120, INSN_5400, INSN_5500): New.
+       (CPU_VR4120, CPU_VR5400, CPU_VR5500): New.
+       (OPCODE_IS_MEMBER): Handle the new CPU_* values and INSN_* flags.
+       Don't match CPU_R4111 with INSN_4100.
+
 2002-08-19  Elena Zannoni <ezannoni@redhat.com>
  
         From matthew green  <mrg@redhat.com>
index 1a39640ca829cf76464119bfd9436254719cc5f6..3849fdce68b9ca8389d4f0ebf7a27e4360dfa1ef 100644 (file)
@@ -137,6 +137,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  *
 #define OP_MASK_ALN            0x7
 #define OP_SH_VSEL             21
 #define OP_MASK_VSEL           0x1f
+#define OP_MASK_VECBYTE                0x7     /* Selector field is really 4 bits,
+                                          but 0x8-0xf don't select bytes.  */
+#define OP_SH_VECBYTE          22
+#define OP_MASK_VECALIGN       0x7     /* Vector byte-align (alni.ob) op.  */
+#define OP_SH_VECALIGN         21
 
 /* Values in the 'VSEL' field.  */
 #define MDMX_FMTSEL_IMM_QH     0x1d
@@ -189,6 +194,7 @@ struct mips_opcode
    "i" 16 bit unsigned immediate (OP_*_IMMEDIATE)
    "j" 16 bit signed immediate (OP_*_DELTA)
    "k" 5 bit cache opcode in target register position (OP_*_CACHE)
+       Also used for immediate operands in vr5400 vector insns.
    "o" 16 bit signed offset (OP_*_DELTA)
    "p" 16 bit PC relative branch target address (OP_*_DELTA)
    "q" 10 bit extra breakpoint code (OP_*_CODE2)
@@ -221,6 +227,9 @@ struct mips_opcode
    "G" 5 bit destination register (OP_*_RD)
    "H" 3 bit sel field for (d)mtc* and (d)mfc* (OP_*_SEL)
    "P" 5 bit performance-monitor register (OP_*_PERFREG)
+   "e" 5 bit vector register byte specifier (OP_*_VECBYTE)
+   "%" 3 bit immediate vr5400 vector alignment operand (OP_*_VECALIGN)
+   see also "k" above
 
    Macro instructions:
    "A" General 32 bit expression
@@ -241,11 +250,12 @@ struct mips_opcode
    Other:
    "()" parens surrounding optional value
    ","  separates operands
+   "[]" brackets around index for vector-op scalar operand specifier (vr5400)
 
    Characters used so far, for quick reference when adding more:
-   "<>(),"
+   "%[]<>(),"
    "ABCDEFGHIJLMNOPQRSTUVWXYZ"
-   "abcdfhijklopqrstuvwxz"
+   "abcdefhijklopqrstuvwxz"
 */
 
 /* These are the bits which may be set in the pinfo field of an
@@ -362,6 +372,14 @@ struct mips_opcode
 #define INSN_10000                0x00100000
 /* Broadcom SB-1 instruction.  */
 #define INSN_SB1                  0x00200000
+/* NEC VR4111/VR4181 instruction.  */
+#define INSN_4111                 0x00400000
+/* NEC VR4120 instruction.  */
+#define INSN_4120                 0x00800000
+/* NEC VR5400 instruction.  */
+#define INSN_5400                0x01000000
+/* NEC VR5500 instruction.  */
+#define INSN_5500                0x02000000
 
 /* MIPS ISA defines, use instead of hardcoding ISA level.  */
 
@@ -383,11 +401,14 @@ struct mips_opcode
 #define CPU_R4010      4010
 #define CPU_VR4100     4100
 #define CPU_R4111      4111
+#define CPU_VR4120     4120
 #define CPU_R4300      4300
 #define CPU_R4400      4400
 #define CPU_R4600      4600
 #define CPU_R4650      4650
 #define CPU_R5000      5000
+#define CPU_VR5400     5400
+#define CPU_VR5500     5500
 #define CPU_R6000      6000
 #define CPU_R8000      8000
 #define CPU_R10000     10000
@@ -407,12 +428,15 @@ struct mips_opcode
     (((insn)->membership & isa) != 0                                   \
      || (cpu == CPU_R4650 && ((insn)->membership & INSN_4650) != 0)    \
      || (cpu == CPU_R4010 && ((insn)->membership & INSN_4010) != 0)    \
-     || ((cpu == CPU_VR4100 || cpu == CPU_R4111)                       \
-        && ((insn)->membership & INSN_4100) != 0)                      \
+     || (cpu == CPU_VR4100 && ((insn)->membership & INSN_4100) != 0)   \
      || (cpu == CPU_R3900 && ((insn)->membership & INSN_3900) != 0)    \
      || ((cpu == CPU_R10000 || cpu == CPU_R12000)                      \
         && ((insn)->membership & INSN_10000) != 0)                     \
      || (cpu == CPU_SB1 && ((insn)->membership & INSN_SB1) != 0)       \
+     || (cpu == CPU_R4111 && ((insn)->membership & INSN_4111) != 0)    \
+     || (cpu == CPU_VR4120 && ((insn)->membership & INSN_4120) != 0)   \
+     || (cpu == CPU_VR5400 && ((insn)->membership & INSN_5400) != 0)   \
+     || (cpu == CPU_VR5500 && ((insn)->membership & INSN_5500) != 0)   \
      || 0)     /* Please keep this term for easier source merging.  */
 
 /* This is a list of macro expanded instructions.
index bde129cda841f85d5a76e1887dbb0d02dd072089..10e77404201e7239c2990e6999be124bddb2ae6f 100644 (file)
@@ -1,3 +1,9 @@
+2002-10-06  Andreas Jaeger  <aj@suse.de>
+
+       * libiberty/cplus-dem.c (ada_demangle): Get rid of unneeded
+       variable and of strict-aliasing warning.
+       (grow_vect): Use char as first parameter.
+
 2002-09-22  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * Makefile.in (all): Fix multilib parallel build.
index 4c4778375b0579b51b80971d43cc494ec743c94d..f42d6181d403b2e06a4d180d769a5a3003c9fc54 100644 (file)
@@ -514,7 +514,7 @@ recursively_demangle PARAMS ((struct work_stuff *, const char **, string *,
                              int));
 
 static void
-grow_vect PARAMS ((void **, size_t *, size_t, int));
+grow_vect PARAMS ((char **, size_t *, size_t, int));
 
 /* Translate count to integer, consuming tokens in the process.
    Conversion terminates on the first non-digit character.
@@ -936,7 +936,7 @@ cplus_demangle (mangled, options)
 
 static void
 grow_vect (old_vect, size, min_size, element_size)
-     void **old_vect;
+     char **old_vect;
      size_t *size;
      size_t min_size;
      int element_size;
@@ -969,8 +969,7 @@ ada_demangle (mangled, option)
   char *demangled = NULL;
   int at_start_name;
   int changed;
-  char *demangling_buffer = NULL;
-  size_t demangling_buffer_size = 0;
+  size_t demangled_size = 0;
   
   changed = 0;
 
@@ -998,10 +997,9 @@ ada_demangle (mangled, option)
     }
   
   /* Make demangled big enough for possible expansion by operator name.  */
-  grow_vect ((void **) &(demangling_buffer),
-            &demangling_buffer_size,  2 * len0 + 1,
+  grow_vect (&demangled,
+            &demangled_size,  2 * len0 + 1,
             sizeof (char));
-  demangled = demangling_buffer;
   
   if (ISDIGIT ((unsigned char) mangled[len0 - 1])) {
     for (i = len0 - 2; i >= 0 && ISDIGIT ((unsigned char) mangled[i]); i -= 1)
@@ -1051,10 +1049,10 @@ ada_demangle (mangled, option)
     return demangled;
   
  Suppress:
-  grow_vect ((void **) &(demangling_buffer),
-            &demangling_buffer_size,  strlen (mangled) + 3,
+  grow_vect (&demangled,
+            &demangled_size,  strlen (mangled) + 3,
             sizeof (char));
-  demangled = demangling_buffer;
+
   if (mangled[0] == '<')
      strcpy (demangled, mangled);
   else
index 487530a5bf85c9a8e69b68fab4596eca258645cc..6128a7d1cfa4b16a71693c89d45fca5670501d18 100644 (file)
@@ -1,3 +1,17 @@
+2002-09-30  Gavin Romig-Koch  <gavin@redhat.com>
+            Ken Raeburn  <raeburn@cygnus.com>
+            Aldy Hernandez  <aldyh@redhat.com>
+            Eric Christopher  <echristo@redhat.com>
+            Richard Sandiford  <rsandifo@redhat.com>
+
+       * mips-dis.c (print_insn_arg): Handle '[', ']', 'e' and '%'.
+       (mips_isa_type): Handle bfd_mach_mips4120, bfd_mach_mips5400
+       and bfd_mach_mips5500.
+       * mips-opc.c (V1): Include INSN_4111 and INSN_4120.
+       (N411, N412, N5, N54, N55): New convenience defines.
+       (mips_builtin_opcodes): Add vr4120, vr5400 and vr5500 opcodes.
+       Change dmadd16 and madd16 from V1 to N411.
+
 2002-09-26  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
 
        * mips-dis.c (print_insn_mips): Always allow disassembly of
index 4ffdf9990f432bdb4c398eef08c2f100e493fc11..0a4280108da449257a9d7caa092c1fae42ce734b 100644 (file)
@@ -110,6 +110,8 @@ print_insn_arg (d, l, pc, info)
     case ',':
     case '(':
     case ')':
+    case '[':
+    case ']':
       (*info->fprintf_func) (info->stream, "%c", *d);
       break;
 
@@ -279,6 +281,16 @@ print_insn_arg (d, l, pc, info)
                             (l >> OP_SH_PERFREG) & OP_MASK_PERFREG);
       break;
 
+    case 'e':
+      (*info->fprintf_func) (info->stream, "%d",
+                            (l >> OP_SH_VECBYTE) & OP_MASK_VECBYTE);
+      break;
+
+    case '%':
+      (*info->fprintf_func) (info->stream, "%d",
+                            (l >> OP_SH_VECALIGN) & OP_MASK_VECALIGN);
+      break;
+
     case 'H':
       (*info->fprintf_func) (info->stream, "%d",
                             (l >> OP_SH_SEL) & OP_MASK_SEL);
@@ -374,6 +386,10 @@ mips_isa_type (mach, isa, cputype)
       *cputype = CPU_R4111;
       *isa = ISA_MIPS3;
       break;
+    case bfd_mach_mips4120:
+      *cputype = CPU_VR4120;
+      *isa = ISA_MIPS3;
+      break;
     case bfd_mach_mips4300:
       *cputype = CPU_R4300;
       *isa = ISA_MIPS3;
@@ -394,6 +410,14 @@ mips_isa_type (mach, isa, cputype)
       *cputype = CPU_R5000;
       *isa = ISA_MIPS4;
       break;
+    case bfd_mach_mips5400:
+      *cputype = CPU_VR5400;
+      *isa = ISA_MIPS4;
+      break;
+    case bfd_mach_mips5500:
+      *cputype = CPU_VR5500;
+      *isa = ISA_MIPS4;
+      break;
     case bfd_mach_mips6000:
       *cputype = CPU_R6000;
       *isa = ISA_MIPS2;
index 6e8adc5d1923bf7b0e1d7fd971fe630a4d50b67f..7dae28a4f556af5c9a554b8f1059e2d84dbf8de0 100644 (file)
@@ -97,10 +97,15 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  *
 
 #define P3     INSN_4650
 #define L1     INSN_4010
-#define V1      INSN_4100
+#define V1     (INSN_4100 | INSN_4111 | INSN_4120)
 #define T3      INSN_3900
 #define M1     INSN_10000
 #define SB1     INSN_SB1
+#define N411   INSN_4111
+#define N412   INSN_4120
+#define N5     (INSN_5400 | INSN_5500)
+#define N54    INSN_5400
+#define N55    INSN_5500
 
 #define G1      (T3             \
                  )
@@ -133,7 +138,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"pref",    "k,o(b)",   0xcc000000, 0xfc000000, RD_b,                  I4|I32|G3       },
 {"prefx",   "h,t(b)",  0x4c00000f, 0xfc0007ff, RD_b|RD_t,              I4      },
 {"nop",     "",         0x00000000, 0xffffffff, 0,                     I1      },
-{"ssnop",   "",         0x00000040, 0xffffffff, 0,                     I32     },
+{"ssnop",   "",         0x00000040, 0xffffffff, 0,                     I32|N55 },
 {"li",      "t,j",      0x24000000, 0xffe00000, WR_t,                  I1      }, /* addiu */
 {"li",     "t,i",      0x34000000, 0xffe00000, WR_t,                   I1      }, /* ori */
 {"li",      "t,I",     0,    (int) M_LI,       INSN_MACRO,             I1      },
@@ -154,6 +159,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"add.s",   "D,V,T",   0x46000000, 0xffe0003f, WR_D|RD_S|RD_T|FP_S,    I1      },
 {"add.d",   "D,V,T",   0x46200000, 0xffe0003f, WR_D|RD_S|RD_T|FP_D,    I1      },
 {"add.ob",  "X,Y,Q",   0x7800000b, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"add.ob",  "D,S,T",   0x4ac0000b, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
+{"add.ob",  "D,S,T[e]",        0x4800000b, 0xfe20003f, WR_D|RD_S|RD_T,         N54     },
+{"add.ob",  "D,S,k",   0x4bc0000b, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"add.ps",  "D,V,T",   0x46c00000, 0xffe0003f, WR_D|RD_S|RD_T|FP_D,    I5      },
 {"add.qh",  "X,Y,Q",   0x7820000b, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 {"adda.ob", "Y,Q",     0x78000037, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1  },
@@ -166,6 +174,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"addu",    "d,v,t",   0x00000021, 0xfc0007ff, WR_d|RD_s|RD_t,         I1      },
 {"addu",    "t,r,I",   0,    (int) M_ADDU_I,   INSN_MACRO,             I1      },
 {"alni.ob", "X,Y,Z,O", 0x78000018, 0xff00003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"alni.ob", "D,S,T,%", 0x48000018, 0xff00003f, WR_D|RD_S|RD_T,         N54     },
 {"alni.qh", "X,Y,Z,O", 0x7800001a, 0xff00003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 {"alnv.ps", "D,V,T,s", 0x4c00001e, 0xfc00003f, WR_D|RD_S|RD_T|FP_D,    I5      },
 {"alnv.ob", "X,Y,Z,s", 0x78000019, 0xfc00003f, WR_D|RD_S|RD_T|RD_s|FP_D, MX|SB1        },
@@ -173,6 +182,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"and",     "d,v,t",   0x00000024, 0xfc0007ff, WR_d|RD_s|RD_t,         I1      },
 {"and",     "t,r,I",   0,    (int) M_AND_I,    INSN_MACRO,             I1      },
 {"and.ob",  "X,Y,Q",   0x7800000c, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"and.ob",  "D,S,T",   0x4ac0000c, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
+{"and.ob",  "D,S,T[e]",        0x4800000c, 0xfe20003f, WR_D|RD_S|RD_T,         N54     },
+{"and.ob",  "D,S,k",   0x4bc0000c, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"and.qh",  "X,Y,Q",   0x7820000c, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 {"andi",    "t,r,i",   0x30000000, 0xfc000000, WR_t|RD_s,              I1      },
 /* b is at the top of the table.  */
@@ -278,6 +290,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"c.eq.s",  "S,T",      0x46000032, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S,   I1      },
 {"c.eq.s",  "M,S,T",    0x46000032, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S,   I4|I32 },
 {"c.eq.ob", "Y,Q",     0x78000001, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D,   MX|SB1  },
+{"c.eq.ob", "S,T",     0x4ac00001, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
+{"c.eq.ob", "S,T[e]",  0x48000001, 0xfe2007ff, WR_CC|RD_S|RD_T,        N54     },
+{"c.eq.ob", "S,k",     0x4bc00001, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
 {"c.eq.ps", "S,T",     0x46c00032, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D,   I5      },
 {"c.eq.ps", "M,S,T",   0x46c00032, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D,   I5      },
 {"c.eq.qh", "Y,Q",     0x78200001, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D,   MX      },
@@ -340,6 +355,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"c.lt.s",  "S,T",     0x4600003c, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S,   I1      },
 {"c.lt.s",  "M,S,T",    0x4600003c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S,   I4|I32 },
 {"c.lt.ob", "Y,Q",     0x78000004, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D,   MX|SB1  },
+{"c.lt.ob", "S,T",     0x4ac00004, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
+{"c.lt.ob", "S,T[e]",  0x48000004, 0xfe2007ff, WR_CC|RD_S|RD_T,        N54     },
+{"c.lt.ob", "S,k",     0x4bc00004, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
 {"c.lt.ps", "S,T",     0x46c0003c, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D,   I5      },
 {"c.lt.ps", "M,S,T",   0x46c0003c, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D,   I5      },
 {"c.lt.qh", "Y,Q",     0x78200004, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D,   MX      },
@@ -354,6 +372,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"c.le.s",  "S,T",     0x4600003e, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S,   I1      },
 {"c.le.s",  "M,S,T",    0x4600003e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S,   I4|I32 },
 {"c.le.ob", "Y,Q",     0x78000005, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D,   MX|SB1  },
+{"c.le.ob", "S,T",     0x4ac00005, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
+{"c.le.ob", "S,T[e]",  0x48000005, 0xfe2007ff, WR_CC|RD_S|RD_T,        N54     },
+{"c.le.ob", "S,k",     0x4bc00005, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
 {"c.le.ps", "S,T",     0x46c0003e, 0xffe007ff, RD_S|RD_T|WR_CC|FP_D,   I5      },
 {"c.le.ps", "M,S,T",   0x46c0003e, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D,   I5      },
 {"c.le.qh", "Y,Q",     0x78200005, 0xfc2007ff, WR_CC|RD_S|RD_T|FP_D,   MX      },
@@ -421,8 +442,8 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"cfc1",    "t,S",     0x44400000, 0xffe007ff, LCD|WR_t|RD_C1|FP_S,    I1      },
 {"cfc2",    "t,G",     0x48400000, 0xffe007ff, LCD|WR_t|RD_C2,         I1      },
 {"cfc3",    "t,G",     0x4c400000, 0xffe007ff, LCD|WR_t|RD_C3,         I1      },
-{"clo",     "U,s",      0x70000021, 0xfc0007ff, WR_d|WR_t|RD_s,        I32     },
-{"clz",     "U,s",      0x70000020, 0xfc0007ff, WR_d|WR_t|RD_s,        I32     },
+{"clo",     "U,s",      0x70000021, 0xfc0007ff, WR_d|WR_t|RD_s,        I32|N55 },
+{"clz",     "U,s",      0x70000020, 0xfc0007ff, WR_d|WR_t|RD_s,        I32|N55 },
 {"ctc0",    "t,G",     0x40c00000, 0xffe007ff, COD|RD_t|WR_CC,         I1      },
 {"ctc1",    "t,G",     0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S,    I1      },
 {"ctc1",    "t,S",     0x44c00000, 0xffe007ff, COD|RD_t|WR_CC|FP_S,    I1      },
@@ -450,8 +471,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"daddiu",  "t,r,j",   0x64000000, 0xfc000000, WR_t|RD_s,              I3      },
 {"daddu",   "d,v,t",   0x0000002d, 0xfc0007ff, WR_d|RD_s|RD_t,         I3      },
 {"daddu",   "t,r,I",   0,    (int) M_DADDU_I,  INSN_MACRO,             I3      },
-{"dclo",    "U,s",      0x70000025, 0xfc0007ff, RD_s|WR_d|WR_t,        I64     },
-{"dclz",    "U,s",      0x70000024, 0xfc0007ff, RD_s|WR_d|WR_t,        I64     },
+{"dbreak",  "",                0x7000003f, 0xffffffff, 0,                      N5      },
+{"dclo",    "U,s",      0x70000025, 0xfc0007ff, RD_s|WR_d|WR_t,        I64|N55 },
+{"dclz",    "U,s",      0x70000024, 0xfc0007ff, RD_s|WR_d|WR_t,        I64|N55 },
 /* dctr and dctw are used on the r5000.  */
 {"dctr",    "o(b)",    0xbc050000, 0xfc1f0000, RD_b,                   I3      },
 {"dctw",    "o(b)",    0xbc090000, 0xfc1f0000, RD_b,                   I3      },
@@ -484,8 +506,15 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"dli",     "t,j",      0x24000000, 0xffe00000, WR_t,                  I3      }, /* addiu */
 {"dli",            "t,i",      0x34000000, 0xffe00000, WR_t,                   I3      }, /* ori */
 {"dli",     "t,I",     0,    (int) M_DLI,      INSN_MACRO,             I3      },
-
-{"dmadd16", "s,t",      0x00000029, 0xfc00ffff, RD_s|RD_t|MOD_LO,       V1      },
+{"dmacc",   "d,s,t",   0x00000029, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d,   N412    },
+{"dmacchi", "d,s,t",   0x00000229, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d,   N412    },
+{"dmacchis", "d,s,t",  0x00000629, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d,   N412    },
+{"dmacchiu", "d,s,t",  0x00000269, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d,   N412    },
+{"dmacchius", "d,s,t", 0x00000669, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d,   N412    },
+{"dmaccs",  "d,s,t",   0x00000429, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d,   N412    },
+{"dmaccu",  "d,s,t",   0x00000069, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d,   N412    },
+{"dmaccus", "d,s,t",   0x00000469, 0xfc0007ff, RD_s|RD_t|WR_LO|WR_d,   N412    },
+{"dmadd16", "s,t",      0x00000029, 0xfc00ffff, RD_s|RD_t|MOD_LO,       N411    },
 {"dmfc0",   "t,G",     0x40200000, 0xffe007ff, LCD|WR_t|RD_C0,         I3      },
 {"dmfc0",   "t,G,H",    0x40200000, 0xffe007f8, LCD|WR_t|RD_C0,        I64     },
 {"dmtc0",   "t,G",     0x40a00000, 0xffe007ff, COD|RD_t|WR_C0|WR_CC,   I3      },
@@ -518,8 +547,14 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"dremu",   "z,s,t",    0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO,      I3      },
 {"dremu",   "d,v,t",   3,    (int) M_DREMU_3,  INSN_MACRO,             I3      },
 {"dremu",   "d,v,I",   3,    (int) M_DREMU_3I, INSN_MACRO,             I3      },
+{"dret",    "",                0x7000003e, 0xffffffff, 0,                      N5      },
 {"drol",    "d,v,t",   0,    (int) M_DROL,     INSN_MACRO,             I3      },
 {"drol",    "d,v,I",   0,    (int) M_DROL_I,   INSN_MACRO,             I3      },
+{"drorv",   "d,t,s",   0x00000056, 0xfc0007ff, RD_t|RD_s|WR_d,         N5      },
+{"dror32",  "d,w,<",   0x0020003e, 0xffe0003f, WR_d|RD_t,              N5      },
+{"dror",    "d,w,s",   0x00000056, 0xfc0007ff, RD_t|RD_s|WR_d,         N5      }, /* drorv */
+{"dror",    "d,w,>",   0x0020003e, 0xffe0003f, WR_d|RD_t,              N5      },
+{"dror",    "d,w,<",   0x0020003a, 0xffe0003f, WR_d|RD_t,              N5      },
 {"dror",    "d,v,t",   0,    (int) M_DROR,     INSN_MACRO,             I3      },
 {"dror",    "d,v,I",   0,    (int) M_DROR_I,   INSN_MACRO,             I3      },
 {"dsllv",   "d,t,s",   0x00000014, 0xfc0007ff, WR_d|RD_t|RD_s,         I3      },
@@ -609,7 +644,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"lld",            "t,o(b)",   0xd0000000, 0xfc000000, LDD|RD_b|WR_t,          I3      },
 {"lld",     "t,A(b)",  0,    (int) M_LLD_AB,   INSN_MACRO,             I3      },
 {"lui",     "t,u",     0x3c000000, 0xffe00000, WR_t,                   I1      },
-{"luxc1",   "D,t(b)",  0x4c000005, 0xfc00f83f, LDD|WR_D|RD_t|RD_b,     I5      },
+{"luxc1",   "D,t(b)",  0x4c000005, 0xfc00f83f, LDD|WR_D|RD_t|RD_b,     I5|N55  },
 {"lw",      "t,o(b)",  0x8c000000, 0xfc000000, LDD|RD_b|WR_t,          I1      },
 {"lw",      "t,A(b)",  0,    (int) M_LW_AB,    INSN_MACRO,             I1      },
 {"lwc0",    "E,o(b)",  0xc0000000, 0xfc000000, CLD|RD_b|WR_CC,         I1      },
@@ -635,24 +670,39 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"lwu",     "t,o(b)",  0x9c000000, 0xfc000000, LDD|RD_b|WR_t,          I3      },
 {"lwu",     "t,A(b)",  0,    (int) M_LWU_AB,   INSN_MACRO,             I3      },
 {"lwxc1",   "D,t(b)",  0x4c000000, 0xfc00f83f, LDD|WR_D|RD_t|RD_b,     I4      },
+{"macc",    "d,s,t",   0x00000028, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412    },
+{"macc",    "d,s,t",   0x00000158, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
+{"maccs",   "d,s,t",   0x00000428, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412    },
+{"macchi",  "d,s,t",   0x00000228, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412    },
+{"macchi",  "d,s,t",   0x00000358, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
+{"macchis", "d,s,t",   0x00000628, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412    },
+{"macchiu", "d,s,t",   0x00000268, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412    },
+{"macchiu", "d,s,t",   0x00000359, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
+{"macchius","d,s,t",   0x00000668, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412    },
+{"maccu",   "d,s,t",   0x00000068, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412    },
+{"maccu",   "d,s,t",   0x00000159, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
+{"maccus",  "d,s,t",   0x00000468, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N412    },
 {"mad",     "s,t",      0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO,     P3      },
 {"madu",    "s,t",      0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO,     P3      },
 {"madd.d",  "D,R,S,T", 0x4c000021, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D,    I4 },
 {"madd.s",  "D,R,S,T", 0x4c000020, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S,    I4 },
 {"madd.ps", "D,R,S,T", 0x4c000026, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D,    I5 },
 {"madd",    "s,t",      0x0000001c, 0xfc00ffff, RD_s|RD_t|WR_HILO,           L1 },
-{"madd",    "s,t",      0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO,          I32},
+{"madd",    "s,t",      0x70000000, 0xfc00ffff, RD_s|RD_t|MOD_HILO,          I32|N55},
 {"madd",    "s,t",      0x70000000, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M,      G1 },
 {"madd",    "d,s,t",    0x70000000, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, G1 },
 {"maddu",   "s,t",      0x0000001d, 0xfc00ffff, RD_s|RD_t|WR_HILO,           L1 },
-{"maddu",   "s,t",      0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO,          I32},
+{"maddu",   "s,t",      0x70000001, 0xfc00ffff, RD_s|RD_t|MOD_HILO,          I32|N55},
 {"maddu",   "s,t",      0x70000001, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M,      G1        },
 {"maddu",   "d,s,t",    0x70000001, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, G1        },
-{"madd16",  "s,t",      0x00000028, 0xfc00ffff, RD_s|RD_t|MOD_HILO,          V1 },
+{"madd16",  "s,t",      0x00000028, 0xfc00ffff, RD_s|RD_t|MOD_HILO,    N411    },
 {"max.ob",  "X,Y,Q",   0x78000007, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"max.ob",  "D,S,T",   0x4ac00007, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
+{"max.ob",  "D,S,T[e]",        0x48000007, 0xfe20003f, WR_D|RD_S|RD_T,         N54     },
+{"max.ob",  "D,S,k",   0x4bc00007, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"max.qh",  "X,Y,Q",   0x78200007, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
-{"mfpc",    "t,P",     0x4000c801, 0xffe0ffc1, LCD|WR_t|RD_C0,         M1      },
-{"mfps",    "t,P",     0x4000c800, 0xffe0ffc1, LCD|WR_t|RD_C0,         M1      },
+{"mfpc",    "t,P",     0x4000c801, 0xffe0ffc1, LCD|WR_t|RD_C0,         M1|N5   },
+{"mfps",    "t,P",     0x4000c800, 0xffe0ffc1, LCD|WR_t|RD_C0,         M1|N5   },
 {"mfc0",    "t,G",     0x40000000, 0xffe007ff, LCD|WR_t|RD_C0,         I1      },
 {"mfc0",    "t,G,H",    0x40000000, 0xffe007f8, LCD|WR_t|RD_C0,        I32     },
 {"mfc1",    "t,S",     0x44000000, 0xffe007ff, LCD|WR_t|RD_S|FP_S,     I1      },
@@ -661,9 +711,13 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"mfc2",    "t,G,H",    0x48000000, 0xffe007f8, LCD|WR_t|RD_C2,        I32     },
 {"mfc3",    "t,G",     0x4c000000, 0xffe007ff, LCD|WR_t|RD_C3,         I1      },
 {"mfc3",    "t,G,H",    0x4c000000, 0xffe007f8, LCD|WR_t|RD_C3,        I32     },
+{"mfdr",    "t,G",     0x7000003d, 0xffe007ff, LCD|WR_t|RD_C0,         N5      },
 {"mfhi",    "d",       0x00000010, 0xffff07ff, WR_d|RD_HI,             I1      },
 {"mflo",    "d",       0x00000012, 0xffff07ff, WR_d|RD_LO,             I1      },
 {"min.ob",  "X,Y,Q",   0x78000006, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"min.ob",  "D,S,T",   0x4ac00006, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
+{"min.ob",  "D,S,T[e]",        0x48000006, 0xfe20003f, WR_D|RD_S|RD_T,         N54     },
+{"min.ob",  "D,S,k",   0x4bc00006, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"min.qh",  "X,Y,Q",   0x78200006, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 {"mov.d",   "D,S",     0x46200006, 0xffff003f, WR_D|RD_S|FP_D,         I1      },
 {"mov.s",   "D,S",     0x46000006, 0xffff003f, WR_D|RD_S|FP_S,         I1      },
@@ -694,17 +748,21 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"movz.l",  "X,Y,t",    0x46a00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D,    MX|SB1 },
 {"movz.s",  "D,S,t",    0x46000012, 0xffe0003f, WR_D|RD_S|RD_t|FP_S,    I4|I32 },
 {"movz.ps", "D,S,t",    0x46c00012, 0xffe0003f, WR_D|RD_S|RD_t|FP_D,    I5     },
+{"msac",    "d,s,t",   0x000001d8, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
+{"msacu",   "d,s,t",   0x000001d9, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
+{"msachi",  "d,s,t",   0x000003d8, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
+{"msachiu", "d,s,t",   0x000003d9, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
 /* move is at the top of the table.  */
 {"msgn.qh", "X,Y,Q",   0x78200000, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 {"msub.d",  "D,R,S,T", 0x4c000029, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, I4    },
 {"msub.s",  "D,R,S,T", 0x4c000028, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_S, I4    },
 {"msub.ps", "D,R,S,T", 0x4c00002e, 0xfc00003f, RD_R|RD_S|RD_T|WR_D|FP_D, I5    },
 {"msub",    "s,t",      0x0000001e, 0xfc00ffff, RD_s|RD_t|WR_HILO,     L1      },
-{"msub",    "s,t",      0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO,     I32     },
+{"msub",    "s,t",      0x70000004, 0xfc00ffff, RD_s|RD_t|MOD_HILO,     I32|N55 },
 {"msubu",   "s,t",      0x0000001f, 0xfc00ffff, RD_s|RD_t|WR_HILO,     L1      },
-{"msubu",   "s,t",      0x70000005, 0xfc00ffff, RD_s|RD_t|MOD_HILO,     I32     },
-{"mtpc",    "t,P",     0x4080c801, 0xffe0ffc1, COD|RD_t|WR_C0,         M1      },
-{"mtps",    "t,P",     0x4080c800, 0xffe0ffc1, COD|RD_t|WR_C0,         M1      },
+{"msubu",   "s,t",      0x70000005, 0xfc00ffff, RD_s|RD_t|MOD_HILO,     I32|N55        },
+{"mtpc",    "t,P",     0x4080c801, 0xffe0ffc1, COD|RD_t|WR_C0,         M1|N5   },
+{"mtps",    "t,P",     0x4080c800, 0xffe0ffc1, COD|RD_t|WR_C0,         M1|N5   },
 {"mtc0",    "t,G",     0x40800000, 0xffe007ff, COD|RD_t|WR_C0|WR_CC,   I1      },
 {"mtc0",    "t,G,H",    0x40800000, 0xffe007f8, COD|RD_t|WR_C0|WR_CC,   I32     },
 {"mtc1",    "t,S",     0x44800000, 0xffe007ff, COD|RD_t|WR_S|FP_S,     I1      },
@@ -713,33 +771,57 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"mtc2",    "t,G,H",    0x48800000, 0xffe007f8, COD|RD_t|WR_C2|WR_CC,   I32     },
 {"mtc3",    "t,G",     0x4c800000, 0xffe007ff, COD|RD_t|WR_C3|WR_CC,   I1      },
 {"mtc3",    "t,G,H",    0x4c800000, 0xffe007f8, COD|RD_t|WR_C3|WR_CC,   I32     },
+{"mtdr",    "t,G",     0x7080003d, 0xffe007ff, COD|RD_t|WR_C0,         N5      },
 {"mthi",    "s",       0x00000011, 0xfc1fffff, RD_s|WR_HI,             I1      },
 {"mtlo",    "s",       0x00000013, 0xfc1fffff, RD_s|WR_LO,             I1      },
 {"mul.d",   "D,V,T",   0x46200002, 0xffe0003f, WR_D|RD_S|RD_T|FP_D,    I1      },
 {"mul.s",   "D,V,T",   0x46000002, 0xffe0003f, WR_D|RD_S|RD_T|FP_S,    I1      },
 {"mul.ob",  "X,Y,Q",   0x78000030, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"mul.ob",  "D,S,T",   0x4ac00030, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
+{"mul.ob",  "D,S,T[e]",        0x48000030, 0xfe20003f, WR_D|RD_S|RD_T,         N54     },
+{"mul.ob",  "D,S,k",   0x4bc00030, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"mul.ps",  "D,V,T",   0x46c00002, 0xffe0003f, WR_D|RD_S|RD_T|FP_D,    I5      },
 {"mul.qh",  "X,Y,Q",   0x78200030, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
-{"mul",     "d,v,t",    0x70000002, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, I32|P3  },
+{"mul",     "d,v,t",    0x70000002, 0xfc0007ff, WR_d|RD_s|RD_t|WR_HILO, I32|P3|N55},
+{"mul",     "d,s,t",   0x00000058, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N54     },
 {"mul",     "d,v,t",   0,    (int) M_MUL,      INSN_MACRO,             I1      },
 {"mul",     "d,v,I",   0,    (int) M_MUL_I,    INSN_MACRO,             I1      },
 {"mula.ob", "Y,Q",     0x78000033, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1  },
+{"mula.ob", "S,T",     0x4ac00033, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
+{"mula.ob", "S,T[e]",  0x48000033, 0xfe2007ff, WR_CC|RD_S|RD_T,        N54     },
+{"mula.ob", "S,k",     0x4bc00033, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
 {"mula.qh", "Y,Q",     0x78200033, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX      },
+{"mulhi",   "d,s,t",   0x00000258, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
+{"mulhiu",  "d,s,t",   0x00000259, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
 {"mull.ob", "Y,Q",     0x78000433, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1  },
+{"mull.ob", "S,T",     0x4ac00433, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
+{"mull.ob", "S,T[e]",  0x48000433, 0xfe2007ff, WR_CC|RD_S|RD_T,        N54     },
+{"mull.ob", "S,k",     0x4bc00433, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
 {"mull.qh", "Y,Q",     0x78200433, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX      },
 {"mulo",    "d,v,t",   0,    (int) M_MULO,     INSN_MACRO,             I1      },
 {"mulo",    "d,v,I",   0,    (int) M_MULO_I,   INSN_MACRO,             I1      },
 {"mulou",   "d,v,t",   0,    (int) M_MULOU,    INSN_MACRO,             I1      },
 {"mulou",   "d,v,I",   0,    (int) M_MULOU_I,  INSN_MACRO,             I1      },
 {"mulr.ps", "D,S,T",   0x46c0001a, 0xffe0003f, WR_D|RD_S|RD_T|FP_D,    M3D     },
+{"muls",    "d,s,t",   0x000000d8, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
+{"mulsu",   "d,s,t",   0x000000d9, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
+{"mulshi",  "d,s,t",   0x000002d8, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
+{"mulshiu", "d,s,t",   0x000002d9, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
 {"muls.ob", "Y,Q",     0x78000032, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1  },
+{"muls.ob", "S,T",     0x4ac00032, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
+{"muls.ob", "S,T[e]",  0x48000032, 0xfe2007ff, WR_CC|RD_S|RD_T,        N54     },
+{"muls.ob", "S,k",     0x4bc00032, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
 {"muls.qh", "Y,Q",     0x78200032, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX      },
 {"mulsl.ob", "Y,Q",    0x78000432, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1  },
+{"mulsl.ob", "S,T",    0x4ac00432, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
+{"mulsl.ob", "S,T[e]", 0x48000432, 0xfe2007ff, WR_CC|RD_S|RD_T,        N54     },
+{"mulsl.ob", "S,k",    0x4bc00432, 0xffe007ff, WR_CC|RD_S|RD_T,        N54     },
 {"mulsl.qh", "Y,Q",    0x78200432, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX      },
 {"mult",    "s,t",      0x00000018, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, I1     },
 {"mult",    "d,s,t",    0x00000018, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, G1        },
 {"multu",   "s,t",      0x00000019, 0xfc00ffff, RD_s|RD_t|WR_HILO|IS_M, I1     },
 {"multu",   "d,s,t",    0x00000019, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d|IS_M, G1        },
+{"mulu",    "d,s,t",   0x00000059, 0xfc0007ff, RD_s|RD_t|WR_HILO|WR_d, N5      },
 {"neg",     "d,w",     0x00000022, 0xffe007ff, WR_d|RD_t,              I1      }, /* sub 0 */
 {"negu",    "d,w",     0x00000023, 0xffe007ff, WR_d|RD_t,              I1      }, /* subu 0 */
 {"neg.d",   "D,V",     0x46200007, 0xffff003f, WR_D|RD_S|FP_D,         I1      },
@@ -755,19 +837,31 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"nor",     "d,v,t",   0x00000027, 0xfc0007ff, WR_d|RD_s|RD_t,         I1      },
 {"nor",     "t,r,I",   0,    (int) M_NOR_I,    INSN_MACRO,             I1      },
 {"nor.ob",  "X,Y,Q",   0x7800000f, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"nor.ob",  "D,S,T",   0x4ac0000f, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
+{"nor.ob",  "D,S,T[e]",        0x4800000f, 0xfe20003f, WR_D|RD_S|RD_T,         N54     },
+{"nor.ob",  "D,S,k",   0x4bc0000f, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"nor.qh",  "X,Y,Q",   0x7820000f, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 {"not",     "d,v",     0x00000027, 0xfc1f07ff, WR_d|RD_s|RD_t,         I1      },/*nor d,s,0*/
 {"or",      "d,v,t",   0x00000025, 0xfc0007ff, WR_d|RD_s|RD_t,         I1      },
 {"or",      "t,r,I",   0,    (int) M_OR_I,     INSN_MACRO,             I1      },
 {"or.ob",   "X,Y,Q",   0x7800000e, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"or.ob",   "D,S,T",   0x4ac0000e, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
+{"or.ob",   "D,S,T[e]",        0x4800000e, 0xfe20003f, WR_D|RD_S|RD_T,         N54     },
+{"or.ob",   "D,S,k",   0x4bc0000e, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"or.qh",   "X,Y,Q",   0x7820000e, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 {"ori",     "t,r,i",   0x34000000, 0xfc000000, WR_t|RD_s,              I1      },
 {"pabsdiff.ob", "X,Y,Q",0x78000009, 0xfc20003f,        WR_D|RD_S|RD_T|FP_D,    SB1     },
 {"pabsdiffc.ob", "Y,Q",        0x78000035, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, SB1     },
 {"pavg.ob", "X,Y,Q",   0x78000008, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    SB1     },
 {"pickf.ob", "X,Y,Q",  0x78000002, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"pickf.ob", "D,S,T",  0x4ac00002, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
+{"pickf.ob", "D,S,T[e]",0x48000002, 0xfe20003f,        WR_D|RD_S|RD_T,         N54     },
+{"pickf.ob", "D,S,k",  0x4bc00002, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"pickf.qh", "X,Y,Q",  0x78200002, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 {"pickt.ob", "X,Y,Q",  0x78000003, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"pickt.ob", "D,S,T",  0x4ac00003, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
+{"pickt.ob", "D,S,T[e]",0x48000003, 0xfe20003f,        WR_D|RD_S|RD_T,         N54     },
+{"pickt.ob", "D,S,k",  0x4bc00003, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"pickt.qh", "X,Y,Q",  0x78200003, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 {"pll.ps",  "D,V,T",   0x46c0002c, 0xffe0003f, WR_D|RD_S|RD_T|FP_D,    I5      },
 {"plu.ps",  "D,V,T",   0x46c0002d, 0xffe0003f, WR_D|RD_S|RD_T|FP_D,    I5      },
@@ -775,10 +869,13 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"pul.ps",  "D,V,T",   0x46c0002e, 0xffe0003f, WR_D|RD_S|RD_T|FP_D,    I5      },
 {"puu.ps",  "D,V,T",   0x46c0002f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D,    I5      },
 {"rach.ob", "X",       0x7a00003f, 0xfffff83f, WR_D|RD_MACC|FP_D,      MX|SB1  },
+{"rach.ob", "D",       0x4a00003f, 0xfffff83f, WR_D,                   N54     },
 {"rach.qh", "X",       0x7a20003f, 0xfffff83f, WR_D|RD_MACC|FP_D,      MX      },
 {"racl.ob", "X",       0x7800003f, 0xfffff83f, WR_D|RD_MACC|FP_D,      MX|SB1  },
+{"racl.ob", "D",       0x4800003f, 0xfffff83f, WR_D,                   N54     },
 {"racl.qh", "X",       0x7820003f, 0xfffff83f, WR_D|RD_MACC|FP_D,      MX      },
 {"racm.ob", "X",       0x7900003f, 0xfffff83f, WR_D|RD_MACC|FP_D,      MX|SB1  },
+{"racm.ob", "D",       0x4900003f, 0xfffff83f, WR_D,                   N54     },
 {"racm.qh", "X",       0x7920003f, 0xfffff83f, WR_D|RD_MACC|FP_D,      MX      },
 {"recip.d", "D,S",     0x46200015, 0xffff003f, WR_D|RD_S|FP_D,         I4      },
 {"recip.ps","D,S",     0x46c00015, 0xffff003f, WR_D|RD_S|FP_D,         SB1     },
@@ -804,6 +901,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"rneu.qh", "X,Q",     0x78200022, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX      },
 {"rol",     "d,v,t",   0,    (int) M_ROL,      INSN_MACRO,             I1      },
 {"rol",     "d,v,I",   0,    (int) M_ROL_I,    INSN_MACRO,             I1      },
+{"rorv",    "d,t,s",   0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d,         N5      },
+{"ror",     "d,w,s",   0x00000046, 0xfc0007ff, RD_t|RD_s|WR_d,         N5      }, /* rorv */
+{"ror",            "d,w,<",    0x00200002, 0xffe0003f, WR_d|RD_t,              N5      },
 {"ror",     "d,v,t",   0,    (int) M_ROR,      INSN_MACRO,             I1      },
 {"ror",     "d,v,I",   0,    (int) M_ROR_I,    INSN_MACRO,             I1      },
 {"round.l.d", "D,S",   0x46200008, 0xffff003f, WR_D|RD_S|FP_D,         I3      },
@@ -821,6 +921,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"rsqrt2.s",  "D,S,T", 0x4600001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_S,    M3D     },
 {"rzs.qh",  "X,Q",     0x78200024, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX      },
 {"rzu.ob",  "X,Q",     0x78000020, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX|SB1  },
+{"rzu.ob",  "D,k",     0x4bc00020, 0xffe0f83f, WR_D|RD_S|RD_T,         N54     },
 {"rzu.qh",  "X,Q",     0x78200020, 0xfc20f83f, WR_D|RD_MACC|RD_T|FP_D, MX      },
 {"sb",      "t,o(b)",  0xa0000000, 0xfc000000, SM|RD_t|RD_b,           I1      },
 {"sb",      "t,A(b)",  0,    (int) M_SB_AB,    INSN_MACRO,             I1      },
@@ -868,11 +969,15 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"sh",      "t,A(b)",  0,    (int) M_SH_AB,    INSN_MACRO,             I1      },
 {"shfl.bfla.qh", "X,Y,Z", 0x7a20001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX      },
 {"shfl.mixh.ob", "X,Y,Z", 0x7980001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX|SB1  },
+{"shfl.mixh.ob", "D,S,T", 0x4980001f, 0xffe0003f, WR_D|RD_S|RD_T,      N54     },
 {"shfl.mixh.qh", "X,Y,Z", 0x7820001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX      },
 {"shfl.mixl.ob", "X,Y,Z", 0x79c0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX|SB1  },
+{"shfl.mixl.ob", "D,S,T", 0x49c0001f, 0xffe0003f, WR_D|RD_S|RD_T,      N54     },
 {"shfl.mixl.qh", "X,Y,Z", 0x78a0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX      },
 {"shfl.pach.ob", "X,Y,Z", 0x7900001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX|SB1  },
+{"shfl.pach.ob", "D,S,T", 0x4900001f, 0xffe0003f, WR_D|RD_S|RD_T,      N54     },
 {"shfl.pach.qh", "X,Y,Z", 0x7920001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX      },
+{"shfl.pacl.ob", "D,S,T", 0x4940001f, 0xffe0003f, WR_D|RD_S|RD_T,      N54     },
 {"shfl.repa.qh", "X,Y,Z", 0x7b20001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX      },
 {"shfl.repb.qh", "X,Y,Z", 0x7ba0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX      },
 {"shfl.upsl.ob", "X,Y,Z", 0x78c0001f, 0xffe0003f, WR_D|RD_S|RD_T|FP_D, MX|SB1  },
@@ -884,6 +989,8 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"sll",     "d,w,s",   0x00000004, 0xfc0007ff, WR_d|RD_t|RD_s,         I1      }, /* sllv */
 {"sll",     "d,w,<",   0x00000000, 0xffe0003f, WR_d|RD_t,              I1      },
 {"sll.ob",  "X,Y,Q",   0x78000010, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"sll.ob",  "D,S,T[e]",        0x48000010, 0xfe20003f, WR_D|RD_S|RD_T,         N54     },
+{"sll.ob",  "D,S,k",   0x4bc00010, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"sll.qh",  "X,Y,Q",   0x78200010, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 {"slt",     "d,v,t",   0x0000002a, 0xfc0007ff, WR_d|RD_s|RD_t,         I1      },
 {"slt",     "d,v,I",   0,    (int) M_SLT_I,    INSN_MACRO,             I1      },
@@ -904,6 +1011,8 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"srl",     "d,w,s",   0x00000006, 0xfc0007ff, WR_d|RD_t|RD_s,         I1      }, /* srlv */
 {"srl",     "d,w,<",   0x00000002, 0xffe0003f, WR_d|RD_t,              I1      },
 {"srl.ob",  "X,Y,Q",   0x78000012, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"srl.ob",  "D,S,T[e]",        0x48000012, 0xfe20003f, WR_D|RD_S|RD_T,         N54     },
+{"srl.ob",  "D,S,k",   0x4bc00012, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"srl.qh",  "X,Y,Q",   0x78200012, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 /* ssnop is at the start of the table.  */
 {"standby", "",         0x42000021, 0xffffffff,        0,                      V1      },
@@ -912,6 +1021,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"sub.d",   "D,V,T",   0x46200001, 0xffe0003f, WR_D|RD_S|RD_T|FP_D,    I1      },
 {"sub.s",   "D,V,T",   0x46000001, 0xffe0003f, WR_D|RD_S|RD_T|FP_S,    I1      },
 {"sub.ob",  "X,Y,Q",   0x7800000a, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"sub.ob",  "D,S,T",   0x4ac0000a, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
+{"sub.ob",  "D,S,T[e]",        0x4800000a, 0xfe20003f, WR_D|RD_S|RD_T,         N54     },
+{"sub.ob",  "D,S,k",   0x4bc0000a, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"sub.ps",  "D,V,T",   0x46c00001, 0xffe0003f, WR_D|RD_S|RD_T|FP_D,    I5      },
 {"sub.qh",  "X,Y,Q",   0x7820000a, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 {"suba.ob", "Y,Q",     0x78000036, 0xfc2007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1  },
@@ -921,7 +1033,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"subu",    "d,v,t",   0x00000023, 0xfc0007ff, WR_d|RD_s|RD_t,         I1      },
 {"subu",    "d,v,I",   0,    (int) M_SUBU_I,   INSN_MACRO,             I1      },
 {"suspend", "",         0x42000022, 0xffffffff,        0,                      V1      },
-{"suxc1",   "S,t(b)",   0x4c00000d, 0xfc0007ff, SM|RD_S|RD_t|RD_b,     I5      },
+{"suxc1",   "S,t(b)",   0x4c00000d, 0xfc0007ff, SM|RD_S|RD_t|RD_b,     I5|N55  },
 {"sw",      "t,o(b)",  0xac000000, 0xfc000000, SM|RD_t|RD_b,           I1      },
 {"sw",      "t,A(b)",  0,    (int) M_SW_AB,    INSN_MACRO,             I1      },
 {"swc0",    "E,o(b)",  0xe0000000, 0xfc000000, SM|RD_C0|RD_b,          I1      },
@@ -1007,16 +1119,21 @@ const struct mips_opcode mips_builtin_opcodes[] =
 {"usw",     "t,o(b)",  0,    (int) M_USW,      INSN_MACRO,             I1      },
 {"usw",     "t,A(b)",  0,    (int) M_USW_A,    INSN_MACRO,             I1      },
 {"wach.ob", "Y",       0x7a00003e, 0xffff07ff, WR_MACC|RD_S|FP_D,      MX|SB1  },
+{"wach.ob", "S",       0x4a00003e, 0xffff07ff, RD_S,                   N54     },
 {"wach.qh", "Y",       0x7a20003e, 0xffff07ff, WR_MACC|RD_S|FP_D,      MX      },
 {"wacl.ob", "Y,Z",     0x7800003e, 0xffe007ff, WR_MACC|RD_S|RD_T|FP_D, MX|SB1  },
+{"wacl.ob", "S,T",     0x4800003e, 0xffe007ff, RD_S|RD_T,              N54     },
 {"wacl.qh", "Y,Z",     0x7820003e, 0xffe007ff, WR_MACC|RD_S|RD_T|FP_D, MX      },
 {"wait",    "",         0x42000020, 0xffffffff, TRAP,                  I3|I32  },
-{"wait",    "J",        0x42000020, 0xfe00003f, TRAP,                  I32     },
+{"wait",    "J",        0x42000020, 0xfe00003f, TRAP,                  I32|N55 },
 {"waiti",   "",                0x42000020, 0xffffffff, TRAP,                   L1      },
 {"wb",             "o(b)",     0xbc040000, 0xfc1f0000, SM|RD_b,                L1      },
 {"xor",     "d,v,t",   0x00000026, 0xfc0007ff, WR_d|RD_s|RD_t,         I1      },
 {"xor",     "t,r,I",   0,    (int) M_XOR_I,    INSN_MACRO,             I1      },
 {"xor.ob",  "X,Y,Q",   0x7800000d, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX|SB1  },
+{"xor.ob",  "D,S,T",   0x4ac0000d, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
+{"xor.ob",  "D,S,T[e]",        0x4800000d, 0xfe20003f, WR_D|RD_S|RD_T,         N54     },
+{"xor.ob",  "D,S,k",   0x4bc0000d, 0xffe0003f, WR_D|RD_S|RD_T,         N54     },
 {"xor.qh",  "X,Y,Q",   0x7820000d, 0xfc20003f, WR_D|RD_S|RD_T|FP_D,    MX      },
 {"xori",    "t,r,i",   0x38000000, 0xfc000000, WR_t|RD_s,              I1      },
 
index 9ce404ed6bd36be2062b008d40321ca487882a68..a397330171576f595a62b164ee72ed46946bffa7 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-27  Andrew Cagney  <ac131313@redhat.com>
+
+       * wrapper.c (sim_open): Add support for -m<mem-size>.
+       (mem_size): Reduce to 2MB.
+       Fix PR gdb/433.
+
 2002-08-15  Nick Clifton  <nickc@redhat.com>
 
        * armos.c (ARMul_OSHandleSWI): Catch and ignore SWIs of -1, they
index c8361ba9faea2b6b770bd93c48affba2bd286607..262e2e7edeaae66615e2de56c897dbbeb4465c87 100644 (file)
@@ -49,7 +49,7 @@ static SIM_OPEN_KIND sim_kind;
 static char *myname;
 
 /* Memory size in bytes.  */
-static int mem_size = (1 << 23);
+static int mem_size = (1 << 21);
 
 /* Non-zero to display start up banner, and maybe other things.  */
 static int verbosity;
@@ -632,7 +632,7 @@ sim_open (kind, ptr, abfd, argv)
     {
       int i;
 
-      /* Scan for endian-ness switch.  */
+      /* Scan for endian-ness and memory-size switches.  */
       for (i = 0; (argv[i] != NULL) && (argv[i][0] != 0); i++)
        if (argv[i][0] == '-' && argv[i][1] == 'E')
          {
@@ -667,6 +667,23 @@ sim_open (kind, ptr, abfd, argv)
                break;
              }
          }
+       else if (argv[i][0] == '-' && argv[i][1] == 'm')
+         {
+           if (argv[i][2] != '\0')
+             sim_size (atoi (&argv[i][2]));
+           else if (argv[i + 1] != NULL)
+             {
+               sim_size (atoi (argv[i + 1]));
+               i++;
+             }
+           else
+             {
+               sim_callback->printf_filtered (sim_callback,
+                                              "Missing argument to -m option\n");
+               return NULL;
+             }
+             
+         }
     }
 
   return (SIM_DESC) 1;
index 4c2dfef81817ead4a9699737205b0f6452acdc2a..26d04311625a85a59cf46e67181234fe1d2b4f42 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-27  Andrew Cagney  <ac131313@redhat.com>
+
+       * hw_disk.c (hw_disk_init_address): Set device type to "block",
+       not "disk".
+
 2002-06-22  Andrew Cagney  <ac131313@redhat.com>
 
        * Makefile.in (INTL_SRC): Define.
index 84086ff1d4ae16e1717b0fa1d7ee9f5700328607..0e9573bda6eff94893b955d578d748b0dd9982fd 100644 (file)
@@ -233,7 +233,7 @@ hw_disk_init_address(device *me)
                        me);
 
   /* Tell the world we are a disk.  */
-  device_add_string_property(me, "device_type", "disk");
+  device_add_string_property(me, "device_type", "block");
 
   /* get the name of the file specifying the disk image */
   disk->name_index = 0;
index ec587595082e10490cd4c0139d6c2d09dd5d5bd3..60b41f7c55253049bcb5f694b21865f3488e2a73 100644 (file)
@@ -1,3 +1,11 @@
+Fri Oct 11 16:22:28 2002  J"orn Rennecke <joern.rennecke@superh.com>
+
+       * interp.c (trap): Return int.  Take extra parameter for address
+       of the trap instruction.  Changed all callers.
+       Add case 33 for profiling.
+       * gencode.c (trapa): Handle trap 33 using the trap function.
+       Add read of vector for generic traps.
+
 Wed Jul 17 19:36:38 2002  J"orn Rennecke <joern.rennecke@superh.com>
 
        * Makefile.in (interp.o): Depend on $(srcroot)/include/gdb/sim-sh.h.
index ba6ee4c1bc6ae1e8914db0235d4b7a82e229cf0e..8e2445a7e11409a5fe2b9e88ec7dab32d264521d 100644 (file)
@@ -577,7 +577,7 @@ op tab[] =
   },
 
   { "", "nm", "mac.l @<REG_M>+,@<REG_N>+", "0000nnnnmmmm1111",
-    "trap (255,R0,memory,maskl,maskw, endianw);",
+    "trap (255, R0, PC, memory, maskl, maskw, endianw);",
     "/* FIXME: mac.l support */",
   },
 
@@ -951,8 +951,7 @@ op tab[] =
   },
 
   { "", "", "sleep", "0000000000011011",
-    "nip = PC;",
-    "trap (0xc3, R0, memory, maskl, maskw, endianw);",
+    "nip += trap (0xc3, R0, PC, memory, maskl, maskw, endianw);",
   },
 
   { "n", "", "stc <CREG_M>,<REG_N>", "0000nnnnmmmm0010",
@@ -1029,37 +1028,25 @@ op tab[] =
   },
 
   { "0", "", "trapa #<imm>", "11000011i8*1....", 
-#if 0
-    /* SH-[12] */
     "long imm = 0xff & i;",
-    "if (i==0xc3)",
-    "  PC-=2;",
-    "if (i<20||i==34||i==0xc3)",
-    "  trap(i,R,memory,maskl,maskw,endianw);",
+    "if (i < 20 || i == 33 || i == 34 || i == 0xc3)",
+    "  nip += trap (i, R, PC, memory, maskl, maskw,endianw);",
+#if 0
     "else {",
+    /* SH-[12] */
     "  R[15]-=4;",
-    "  WLAT(R[15],GET_SR());",
+    "  WLAT (R[15], GET_SR());",
     "  R[15]-=4;",
-    "  WLAT(R[15],PC+2);",
-    "  PC=RLAT(VBR+(imm<<2))-2;",
-    "}",
+    "  WLAT (R[15], PH2T (PC + 2));",
 #else
-    "if (i == 0xc3)",
-    "  {",
-    "    nip = PC;",
-    "    trap (i, R, memory, maskl, maskw,endianw);",
-    "  }",
-    "else if (i < 20 || i==34 || i==0xc3)",
-    "  trap (i, R, memory, maskl, maskw,endianw);",
     "else if (!SR_BL) {",
-    "  /* FIXME: TRA = (imm << 2); */",
     "  SSR = GET_SR();",
     "  SPC = PH2T (PC + 2);",
     "  SET_SR (GET_SR() | SR_MASK_MD | SR_MASK_BL | SR_MASK_RB);",
     "  /* FIXME: EXPEVT = 0x00000160; */",
-    "  SET_NIP (PT2H (VBR + 0x00000100));",
-    "}",
 #endif
+    "  SET_NIP (PT2H (RLAT (VBR + (imm<<2))));",
+    "}",
   },
 
   { "", "mn", "tst <REG_M>,<REG_N>", "0010nnnnmmmm1000",
index 2f5d1d37d596556cd902cd8116686562e8815d3a..8c2f3598a5d5f949a5fdb9c25a7c7c079923d192 100644 (file)
@@ -954,12 +954,14 @@ strnswap (str, len)
   while (start < end);
 }
 
-/* Simulate a monitor trap, put the result into r0 and errno into r1 */
+/* Simulate a monitor trap, put the result into r0 and errno into r1
+   return offset by which to adjust pc.  */
 
-static void
-trap (i, regs, memory, maskl, maskw, endianw)
+static int
+trap (i, regs, insn_ptr, memory, maskl, maskw, endianw)
      int i;
      int *regs;
+     unsigned char *insn_ptr;
      unsigned char *memory;
 {
   switch (i)
@@ -971,6 +973,13 @@ trap (i, regs, memory, maskl, maskw, endianw)
       raise_exception (SIGQUIT);
       break;
     case 3:                    /* FIXME: for backwards compat, should be removed */
+    case 33:
+      {
+       unsigned int countp = * (unsigned int *) (insn_ptr + 4);
+
+       WLAT (countp, RLAT (countp) + 1);
+       return 6;
+      }
     case 34:
       {
        extern int errno;
@@ -1154,9 +1163,11 @@ trap (i, regs, memory, maskl, maskw, endianw)
     case 0xc3:
     case 255:
       raise_exception (SIGTRAP);
+      if (i == 0xc3)
+       return -2;
       break;
     }
-
+  return 0;
 }
 
 void
index 100ece186e5879c2db49184e8f7a6cd819524361..2053096ece54d9cf75960014cf399315c077d5a4 100644 (file)
@@ -1,3 +1,9 @@
+2002-09-27  Jim Wilson  <wilson@redhat.com>
+
+       * simops.c (OP_E6077E0): And op1 with 7 after reading register, not
+       before.
+       (BIT_CHANGE_OP): Likewise.
+
 2002-09-26  Jim Wilson  <wilson@redhat.com>
 
        * simops (OP_10007E0): Don't subtract 4 from PC.
index eba728fa287cdd88ee98d270ac62ae24aa8d8744..04045234629fe78e1b3fa436bfac03c7c3784a9c 100644 (file)
@@ -1897,7 +1897,7 @@ OP_E607E0 (void)
   temp = load_mem (State.regs[ OP[0] ], 1);
   
   PSW &= ~PSW_Z;
-  if ((temp & (1 << State.regs[ OP[1] & 0x7 ])) == 0)
+  if ((temp & (1 << (State.regs[ OP[1] ] & 0x7))) == 0)
     PSW |= PSW_Z;
   
   trace_output (OP_BIT);
@@ -1924,7 +1924,7 @@ OP_22207E0 (void)
                                                \
   trace_input (name, OP_BIT_CHANGE, 0);                \
                                                \
-  bit  = 1 << State.regs[ OP[1] & 0x7 ];       \
+  bit  = 1 << (State.regs[ OP[1] ] & 0x7);     \
   temp = load_mem (State.regs[ OP[0] ], 1);    \
                                                \
   PSW &= ~PSW_Z;                               \