]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2003-03-16 Mark Kettenis <kettenis@gnu.org>
authorMark Kettenis <kettenis@gnu.org>
Sun, 16 Mar 2003 14:01:56 +0000 (14:01 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sun, 16 Mar 2003 14:01:56 +0000 (14:01 +0000)
Merge with mainline.  Tag is kettenis-i386newframe-20030316-mergepoint.

113 files changed:
ChangeLog
Makefile.in
Makefile.tpl
bfd/ChangeLog
bfd/aout-cris.c
bfd/aout-encap.c
bfd/aout-ns32k.c
bfd/aout-tic30.c
bfd/bfd-in2.h
bfd/configure
bfd/configure.in
bfd/elf32-mips.c
bfd/elf32-ppc.c
bfd/elf64-mips.c
bfd/elf64-ppc.c
bfd/elfn32-mips.c
bfd/elfxx-mips.c
bfd/elfxx-target.h
bfd/hp300bsd.c
bfd/i386aout.c
bfd/i386dynix.c
bfd/i386linux.c
bfd/i386lynx.c
bfd/i386mach3.c
bfd/ieee.c
bfd/libbfd.h
bfd/m68k4knetbsd.c
bfd/m68klinux.c
bfd/m68klynx.c
bfd/m68knetbsd.c
bfd/m88kmach3.c
bfd/mipsbsd.c
bfd/newsos3.c
bfd/reloc.c
bfd/sparclinux.c
bfd/sparclynx.c
bfd/sparcnetbsd.c
bfd/vaxbsd.c
bfd/version.h
bfd/xsym.c
configure
configure.in
gdb/ChangeLog
gdb/MAINTAINERS
gdb/alpha-tdep.c
gdb/arch-utils.c
gdb/arm-tdep.c
gdb/avr-tdep.c
gdb/breakpoint.c
gdb/cli-out.c
gdb/config/m68k/tm-delta68.h
gdb/config/m68k/tm-linux.h
gdb/config/pa/tm-hppa.h
gdb/config/rs6000/tm-rs6000.h
gdb/config/sparc/tm-sparc.h
gdb/cris-tdep.c
gdb/d10v-tdep.c
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/doc/gdbint.texinfo
gdb/doublest.c
gdb/dummy-frame.c
gdb/eval.c
gdb/findvar.c
gdb/frame-unwind.h
gdb/frame.c
gdb/frame.h
gdb/frv-tdep.c
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/h8300-tdep.c
gdb/hppa-tdep.c
gdb/i386-interix-tdep.c
gdb/ia64-tdep.c
gdb/m68hc11-tdep.c
gdb/m68k-tdep.c
gdb/mcore-tdep.c
gdb/mi/ChangeLog
gdb/mi/mi-main.c
gdb/mi/mi-out.c
gdb/minsyms.c
gdb/mips-tdep.c
gdb/mn10300-tdep.c
gdb/ns32k-tdep.c
gdb/ns32knbsd-nat.c
gdb/ppc-linux-tdep.c
gdb/regcache.c
gdb/regcache.h
gdb/rs6000-tdep.c
gdb/s390-tdep.c
gdb/sentinel-frame.c
gdb/sh-tdep.c
gdb/sparc-tdep.c
gdb/stack.c
gdb/tui/ChangeLog
gdb/tui/tui-out.c
gdb/tui/tuiRegs.c
gdb/v850-tdep.c
gdb/valarith.c
gdb/valops.c
gdb/vax-tdep.c
gdb/version.in
gdb/x86-64-tdep.c
gdb/x86-64-tdep.h
gdb/xstormy16-tdep.c
libiberty/ChangeLog
libiberty/cplus-dem.c
libiberty/hashtab.c
opcodes/ChangeLog
opcodes/ppc-opc.c
sim/h8300/ChangeLog
sim/h8300/compile.c

index 174114cef330f94941d840652cb011c89815d8c2..326297949dfdd58b4e3a3a50cd80ae2cc6251fbd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2003-03-14  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+       * Makefile.tpl: Move .NOEXPORT, MAKEOVERRIDES back down.
+       * Makefile.in: Regenerate.
+
+2003-03-14  Michael Chastain  <mec@shout.net>
+
+       * Makefile.in: Regenerate with correct Makefile.def.
+
+2003-03-12  Nathanael Nerode  <neroden@gcc.gnu.org>
+
+       * Makefile.tpl: Move .NOEXPORT, MAKEOVERRIDES up.  Delete unused
+       Make macro.
+       * Makefile.in: Regenerate.
+       * configure.in: Clean up gxx_include_dir logic.
+       * configure: Regenerate.
+
+2003-03-09  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
+
+       * configure.in (gxx_include_dir): Fix typo.
+       * configure: Regenerated.
+
 2003-03-06  Andrew Cagney  <cagney@redhat.com>
 
        * texinfo/texinfo.tex: Import version 2003-02-03.16.
index 41b1b641bd0bf54d597c744a4e8d63e4a133e1b8..f70250dd8d7bfb1ca7179753c64cce224bb44306 100644 (file)
@@ -84,7 +84,6 @@ INSTALL_DATA = $(INSTALL) -m 644
 # -------------------------------------------------
 
 links=@configlinks@
-enable_version_specific_runtime_libs = @enable_version_specific_runtime_libs@
 # The file containing GCC's version number.
 gcc_version_trigger = @gcc_version_trigger@
 gcc_version = @gcc_version@
@@ -7525,10 +7524,10 @@ config.status: configure $(gcc_version_trigger)
 AUTOCONF = autoconf
 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4
        cd $(srcdir) && $(AUTOCONF)
-#
 
-.NOEXPORT:
-MAKEOVERRIDES=
+# ------------------------------
+# Special directives to GNU Make
+# ------------------------------
 
 # Tell GNU make 3.79 not to run the top level in parallel.  This 
 # prevents contention for $builddir/$target/config.cache, as well
@@ -7536,4 +7535,8 @@ MAKEOVERRIDES=
 NOTPARALLEL = .NOTPARALLEL
 $(NOTPARALLEL):
 
+# Don't pass command-line variables to submakes.
+.NOEXPORT:
+MAKEOVERRIDES=
+
 # end of Makefile.in
index 0b24dd083e2ed995ecd9b80b921d51c7368675e5..72e24983c5783f5c5bb72b8d59db4e0a66b505e3 100644 (file)
@@ -87,7 +87,6 @@ INSTALL_DATA = $(INSTALL) -m 644
 # -------------------------------------------------
 
 links=@configlinks@
-enable_version_specific_runtime_libs = @enable_version_specific_runtime_libs@
 # The file containing GCC's version number.
 gcc_version_trigger = @gcc_version_trigger@
 gcc_version = @gcc_version@
@@ -1450,10 +1449,10 @@ config.status: configure $(gcc_version_trigger)
 AUTOCONF = autoconf
 $(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4
        cd $(srcdir) && $(AUTOCONF)
-#
 
-.NOEXPORT:
-MAKEOVERRIDES=
+# ------------------------------
+# Special directives to GNU Make
+# ------------------------------
 
 # Tell GNU make 3.79 not to run the top level in parallel.  This 
 # prevents contention for $builddir/$target/config.cache, as well
@@ -1461,4 +1460,8 @@ MAKEOVERRIDES=
 NOTPARALLEL = .NOTPARALLEL
 $(NOTPARALLEL):
 
+# Don't pass command-line variables to submakes.
+.NOEXPORT:
+MAKEOVERRIDES=
+
 # end of Makefile.in
index aca51b8d96173297640d444121e72b70b10765ee..bc78750d5b8fbefdabc72378563939f44d673e15 100644 (file)
@@ -1,3 +1,73 @@
+2003-03-14  Gene Smith  <gene.smith@siemens.com>
+
+       * ieee.c (ieee_write_expression): Handle the case where symbol is
+       NULL.
+       General formatting improvements.
+
+2003-03-13  Nick Clifton  <nickc@redhat.com>
+
+       * configure.in (LINGUAS): Add zh_CN.
+       * configure: Regenerate.
+       * po/zh_CN.po: New file.
+
+2003-03-13  Elias Athanasopoulos  <elathan@phys.uoa.gr>
+
+       * aout-cris.c (BYTES_IN_WORD): Don't define.
+       aout-encap.c: Likewise.
+       aout-ns32k.c: Likewise.
+       aout-tic30.c: Likewise.
+       hp300bsd.c: Likewise.
+       i386aout.c: Likewise.
+       i386dynix.c: Likewise.
+       i386linux.c: Likewise.
+       i386lynx.c: Likewise.
+       i386mach3.c: Likewise.
+       m68k4knetbsd.c: Likewise.
+       m68klinux.c: Likewise.
+       m68klynx.c: Likewise.
+       m68knetbsd.c: Likewise.
+       m88kmach3.c: Likewise.
+       mipsbsd.c: Likewise.
+       newsos3.c: Likewise.
+       sparclinux.c: Likewise.
+       sparclynx.c: Likewise.
+       sparcnetbsd.c: Likewise.
+       vaxbsd.c: Likewise. Fix comment formatting.
+
+2003-03-12  Alexandre Oliva  <aoliva@redhat.com>
+
+       * Reverted 2003-03-02's patch.
+
+       * elfxx-target.h (bfd_elfNN_canonicalize_reloc): Make it
+       overridable.
+       * elf64-mips.c (mips_elf64_canonicalize_reloc,
+       mips_elf64_get_dynamic_reloc_upper_bound,
+       mips_elf64_canonicalize_dynamic_reloc): New, adapted from elf.c.
+       (bfd_elf64_get_canonicalize_reloc,
+       bfd_elf64_get_dynamic_reloc_upper_bound,
+       bfd_elf64_canonicalize_dynamic_reloc): Define.
+       (mips_elf64_slurp_reloc_table): Support dynamic.
+       (mips_elf64_slurp_one_reloc_table): Adjust.
+
+2003-03-12  Nick Clifton  <nickc@redhat.com>
+
+       * xsym.c (bfd_sym_fetch_type_information_table_entry): Change
+       'index' to 'offset' in test for zero value.
+
+2003-03-11  Alexandre Oliva  <aoliva@redhat.com>
+
+       * elfxx-mips.c (mips_elf_create_dynamic_relocation): Do not create
+       dynamic relocations pointing to local or section symbols, use the
+       NULL symbol instead.  Document the choice to not emit an
+       additional R_MIPS_64 relocation.
+
+2003-03-11  Alan Modra  <amodra@bigpond.net.au>
+
+       * elf32-ppc.c (ppc_elf_relocate_section): Subtract tls seg vma from
+       zero index dynamic tls relocs generated for the GOT.  Tidy code.
+       Set "relocation" to 1 on DTPMOD32 relocs.  Optimize HA adjustment.
+       * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
+
 2003-03-07  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-ppc.c (ppc_elf_relocate_section): Don't look for a nop after
index 7027b173ca0597da560ac0ce17c4f3061b2c9ca9..4d1e48d7bf42c80c0aaa0620e6513abe668dc395 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD backend for CRIS a.out binaries.
-   Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by Axis Communications AB.
    Written by Hans-Peter Nilsson.
 
@@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    functions.  Beware; some of the information there is outdated.  */
 
 #define N_HEADER_IN_TEXT(x) 0
-#define BYTES_IN_WORD 4
 #define N_TXTOFF(x) 32
 #define ENTRY_CAN_BE_ZERO
 #define TEXT_START_ADDR 0
index 1a794ec978b2779038b48deec7866cae2098ea2c..96c7082933325b2e4a4c8831b69cd9015e9deb7e 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for a.out files encapsulated with COFF headers.
-   Copyright 1990, 1991, 1994, 1995, 2000, 2001, 2002
+   Copyright 1990, 1991, 1994, 1995, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define        TARGET_PAGE_SIZE        4096
 #define        SEGMENT_SIZE    TARGET_PAGE_SIZE
 #define TEXT_START_ADDR 0
-#define BYTES_IN_WORD 4
 #endif
 
 #include "bfd.h"
index 4809ffb89b3c8abdd29c4bd168ae43a824daee9f..0972b5db187b294aa2841a81f800644aa7682bc6 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for ns32k a.out-ish binaries.
-   Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002
+   Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1998, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
    Contributed by Ian Dall (idall@eleceng.adelaide.edu.au).
 
@@ -19,8 +19,6 @@
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-#define BYTES_IN_WORD 4
-
 #include "bfd.h"
 #include "aout/aout64.h"
 #include "ns32k.h"
index 6d5f48ca42d88947415aef50231fe97f06ca65a4..6e65fcf40aec11c959d55ed3e63c6fd0b97d755d 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for TMS320C30 a.out binaries.
-   Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -21,7 +21,6 @@
 
 #define TARGET_IS_BIG_ENDIAN_P
 #define N_HEADER_IN_TEXT(x) 1
-#define BYTES_IN_WORD 4
 #define TEXT_START_ADDR 1024
 #define TARGET_PAGE_SIZE 128
 #define SEGMENT_SIZE TARGET_PAGE_SIZE
index 9540eeb26a285b607074c6e8039049bf97d5831d..2385c409a5cd38b16ba0e8bf0bde441c9e892d3f 100644 (file)
@@ -2331,9 +2331,6 @@ to compensate for the borrow when the low bits are added.  */
 /* Like BFD_RELOC_LO16, but PC relative.  */
   BFD_RELOC_PCREL_LO16,
 
-/* Like BFD_RELOC_16_PCREL_S2, but for MIPS Embedded PIC.  */
-  BFD_RELOC_MIPSEMB_16_PCREL_S2,
-
 /* Relocation against a MIPS literal section.  */
   BFD_RELOC_MIPS_LITERAL,
 
index f41ac1d3cfaad4ac299d9ca1cd4517ed56699147..6616dc01b363cc599bebd67506a730132874a194 100755 (executable)
@@ -37,7 +37,7 @@ ac_help="$ac_help
   --enable-maintainer-mode enable make rules and dependencies not useful
                           (and sometimes confusing) to the casual installer"
 ac_help="$ac_help
-  --install-libbfd controls installation of libbfd and related headers"
+  --enable-install-libbfd controls installation of libbfd and related headers"
 ac_help="$ac_help
   --disable-nls           do not use Native Language Support"
 ac_help="$ac_help
@@ -59,6 +59,7 @@ program_suffix=NONE
 program_transform_name=s,x,x,
 silent=
 site=
+sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -173,6 +174,7 @@ Configuration:
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
+  --site-file=FILE        use FILE as the site file
   --version               print the version of autoconf that created configure
 Directory and file names:
   --prefix=PREFIX         install architecture-independent files in PREFIX
@@ -343,6 +345,11 @@ EOF
   -site=* | --site=* | --sit=*)
     site="$ac_optarg" ;;
 
+  -site-file | --site-file | --site-fil | --site-fi | --site-f)
+    ac_prev=sitefile ;;
+  -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+    sitefile="$ac_optarg" ;;
+
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -508,12 +515,16 @@ fi
 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
 
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+  if test -z "$CONFIG_SITE"; then
+    if test "x$prefix" != xNONE; then
+      CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+    else
+      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+    fi
   fi
+else
+  CONFIG_SITE="$sitefile"
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
@@ -552,12 +563,12 @@ else
 fi
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:556: checking for Cygwin environment" >&5
+echo "configure:567: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 561 "configure"
+#line 572 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -568,7 +579,7 @@ int main() {
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -585,19 +596,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:589: checking for mingw32 environment" >&5
+echo "configure:600: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 594 "configure"
+#line 605 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -662,7 +673,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:666: checking host system type" >&5
+echo "configure:677: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -683,7 +694,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:687: checking target system type" >&5
+echo "configure:698: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -701,7 +712,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:705: checking build system type" >&5
+echo "configure:716: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -726,7 +737,7 @@ test "$host_alias" != "$target_alias" &&
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:730: checking for $ac_word" >&5
+echo "configure:741: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -756,7 +767,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:760: checking for $ac_word" >&5
+echo "configure:771: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -807,7 +818,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:811: checking for $ac_word" >&5
+echo "configure:822: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -839,7 +850,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:843: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:854: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -850,12 +861,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 854 "configure"
+#line 865 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -881,12 +892,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:885: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:896: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:890: checking whether we are using GNU C" >&5
+echo "configure:901: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -895,7 +906,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:899: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -914,7 +925,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:918: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:929: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -946,7 +957,7 @@ else
 fi
 
 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:950: checking for POSIXized ISC" >&5
+echo "configure:961: checking for POSIXized ISC" >&5
 if test -d /etc/conf/kconfig.d &&
   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
 then
@@ -979,7 +990,7 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:983: checking for a BSD compatible install" >&5
+echo "configure:994: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1032,7 +1043,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:1036: checking whether build environment is sane" >&5
+echo "configure:1047: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -1089,7 +1100,7 @@ test "$program_suffix" != NONE &&
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1093: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1104: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1135,7 +1146,7 @@ EOF
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1139: checking for working aclocal" >&5
+echo "configure:1150: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1148,7 +1159,7 @@ else
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1152: checking for working autoconf" >&5
+echo "configure:1163: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1161,7 +1172,7 @@ else
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1165: checking for working automake" >&5
+echo "configure:1176: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1174,7 +1185,7 @@ else
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1178: checking for working autoheader" >&5
+echo "configure:1189: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1187,7 +1198,7 @@ else
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1191: checking for working makeinfo" >&5
+echo "configure:1202: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1222,7 +1233,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1226: checking for $ac_word" >&5
+echo "configure:1237: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1254,7 +1265,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1258: checking for $ac_word" >&5
+echo "configure:1269: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1286,7 +1297,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1290: checking for $ac_word" >&5
+echo "configure:1301: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1401,7 +1412,7 @@ ac_prog=ld
 if test "$GCC" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1405: checking for ld used by GCC" >&5
+echo "configure:1416: checking for ld used by GCC" >&5
   case $host in
   *-*-mingw*)
     # gcc leaves a trailing carriage return which upsets mingw
@@ -1431,10 +1442,10 @@ echo "configure:1405: checking for ld used by GCC" >&5
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1435: checking for GNU ld" >&5
+echo "configure:1446: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1438: checking for non-GNU ld" >&5
+echo "configure:1449: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1469,7 +1480,7 @@ else
 fi
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1473: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1484: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1486,7 +1497,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
 echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
-echo "configure:1490: checking for $LD option to reload object files" >&5
+echo "configure:1501: checking for $LD option to reload object files" >&5
 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1498,7 +1509,7 @@ reload_flag=$lt_cv_ld_reload_flag
 test -n "$reload_flag" && reload_flag=" $reload_flag"
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1502: checking for BSD-compatible nm" >&5
+echo "configure:1513: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1536,7 +1547,7 @@ NM="$lt_cv_path_NM"
 echo "$ac_t""$NM" 1>&6
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1540: checking whether ln -s works" >&5
+echo "configure:1551: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1557,7 +1568,7 @@ else
 fi
 
 echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1561: checking how to recognise dependant libraries" >&5
+echo "configure:1572: checking how to recognise dependant libraries" >&5
 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1730,13 +1741,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd
 deplibs_check_method=$lt_cv_deplibs_check_method
 
 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1734: checking for object suffix" >&5
+echo "configure:1745: checking for object suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   rm -f conftest*
 echo 'int i = 1;' > conftest.$ac_ext
-if { (eval echo configure:1740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   for ac_file in conftest.*; do
     case $ac_file in
     *.c) ;;
@@ -1756,7 +1767,7 @@ ac_objext=$ac_cv_objext
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1760: checking for executable suffix" >&5
+echo "configure:1771: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1766,10 +1777,10 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:1770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:1781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
-      *.c | *.o | *.obj) ;;
+      *.c | *.o | *.obj | *.ilk | *.pdb) ;;
       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
       esac
     done
@@ -1793,7 +1804,7 @@ case $deplibs_check_method in
 file_magic*)
   if test "$file_magic_cmd" = '$MAGIC_CMD'; then
     echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:1797: checking for ${ac_tool_prefix}file" >&5
+echo "configure:1808: checking for ${ac_tool_prefix}file" >&5
 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1855,7 +1866,7 @@ fi
 if test -z "$lt_cv_path_MAGIC_CMD"; then
   if test -n "$ac_tool_prefix"; then
     echo $ac_n "checking for file""... $ac_c" 1>&6
-echo "configure:1859: checking for file" >&5
+echo "configure:1870: checking for file" >&5
 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1926,7 +1937,7 @@ esac
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1930: checking for $ac_word" >&5
+echo "configure:1941: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1958,7 +1969,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1962: checking for $ac_word" >&5
+echo "configure:1973: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1993,7 +2004,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1997: checking for $ac_word" >&5
+echo "configure:2008: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2025,7 +2036,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2029: checking for $ac_word" >&5
+echo "configure:2040: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2092,8 +2103,21 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
 case $host in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 2096 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:2097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 2107 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:2108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+   if test "$lt_cv_prog_gnu_ld" = yes; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -melf32bsmip"
+      ;;
+    *N32*)
+      LD="${LD-ld} -melf32bmipn32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -melf64bmip"
+      ;;
+    esac
+   else
     case `/usr/bin/file conftest.$ac_objext` in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -2105,6 +2129,7 @@ case $host in
       LD="${LD-ld} -64"
       ;;
     esac
+   fi
   fi
   rm -rf conftest*
   ;;
@@ -2112,7 +2137,7 @@ case $host in
 ia64-*-hpux*)
   # Find out which ABI we are using.
   echo 'int i;' > conftest.$ac_ext
-  if { (eval echo configure:2116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  if { (eval echo configure:2141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *ELF-32*)
       HPUX_IA64_MODE="32"
@@ -2130,7 +2155,7 @@ ia64-*-hpux*)
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2134: checking whether the C compiler needs -belf" >&5
+echo "configure:2159: checking whether the C compiler needs -belf" >&5
 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2143,14 +2168,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a
 cross_compiling=$ac_cv_prog_cc_cross
 
      cat > conftest.$ac_ext <<EOF
-#line 2147 "configure"
+#line 2172 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_needs_belf=yes
 else
@@ -2340,7 +2365,7 @@ if test -z "$target" ; then
 fi
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:2344: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2369: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -2363,7 +2388,7 @@ fi
   
 
 echo $ac_n "checking whether to install libbfd""... $ac_c" 1>&6
-echo "configure:2367: checking whether to install libbfd" >&5
+echo "configure:2392: checking whether to install libbfd" >&5
   # Check whether --enable-install-libbfd or --disable-install-libbfd was given.
 if test "${enable_install_libbfd+set}" = set; then
   enableval="$enable_install_libbfd"
@@ -2400,7 +2425,7 @@ fi
 
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2404: checking for executable suffix" >&5
+echo "configure:2429: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2410,10 +2435,10 @@ else
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:2414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:2439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
-      *.c | *.o | *.obj) ;;
+      *.c | *.o | *.obj | *.ilk | *.pdb) ;;
       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
       esac
     done
@@ -2440,7 +2465,7 @@ bfd_default_target_size=32
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2444: checking for $ac_word" >&5
+echo "configure:2469: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2470,7 +2495,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2474: checking for $ac_word" >&5
+echo "configure:2499: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2521,7 +2546,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2525: checking for $ac_word" >&5
+echo "configure:2550: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2553,7 +2578,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2557: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2582: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -2564,12 +2589,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 2568 "configure"
+#line 2593 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2598: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2595,12 +2620,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2599: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2624: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2604: checking whether we are using GNU C" >&5
+echo "configure:2629: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2609,7 +2634,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2613: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2628,7 +2653,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2632: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2657: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2660,9 +2685,9 @@ else
 fi
 
 
-ALL_LINGUAS="fr tr ja es sv da"
+ALL_LINGUAS="fr tr ja es sv da zh_CN"
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2666: checking how to run the C preprocessor" >&5
+echo "configure:2691: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2677,13 +2702,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2681 "configure"
+#line 2706 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2687: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2694,13 +2719,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2698 "configure"
+#line 2723 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2711,13 +2736,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2715 "configure"
+#line 2740 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2721: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2744,7 +2769,7 @@ echo "$ac_t""$CPP" 1>&6
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2748: checking for $ac_word" >&5
+echo "configure:2773: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2772,12 +2797,12 @@ else
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2776: checking for ANSI C header files" >&5
+echo "configure:2801: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2781 "configure"
+#line 2806 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2785,7 +2810,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2789: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2802,7 +2827,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2806 "configure"
+#line 2831 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2820,7 +2845,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2824 "configure"
+#line 2849 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2841,7 +2866,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2845 "configure"
+#line 2870 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2852,7 +2877,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:2856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2876,12 +2901,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:2880: checking for working const" >&5
+echo "configure:2905: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2885 "configure"
+#line 2910 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -2930,7 +2955,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:2934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2959: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -2951,21 +2976,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2955: checking for inline" >&5
+echo "configure:2980: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 2962 "configure"
+#line 2987 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:2969: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -2991,12 +3016,12 @@ EOF
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2995: checking for off_t" >&5
+echo "configure:3020: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3000 "configure"
+#line 3025 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3024,12 +3049,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3028: checking for size_t" >&5
+echo "configure:3053: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3033 "configure"
+#line 3058 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3059,19 +3084,19 @@ fi
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:3063: checking for working alloca.h" >&5
+echo "configure:3088: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3068 "configure"
+#line 3093 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:3075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -3092,12 +3117,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:3096: checking for alloca" >&5
+echo "configure:3121: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3101 "configure"
+#line 3126 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -3125,7 +3150,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:3129: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -3157,12 +3182,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3161: checking whether alloca needs Cray hooks" >&5
+echo "configure:3186: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3166 "configure"
+#line 3191 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -3187,12 +3212,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3191: checking for $ac_func" >&5
+echo "configure:3216: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3196 "configure"
+#line 3221 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3215,7 +3240,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3242,7 +3267,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3246: checking stack direction for C alloca" >&5
+echo "configure:3271: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3250,7 +3275,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 3254 "configure"
+#line 3279 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -3269,7 +3294,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:3273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -3290,21 +3315,21 @@ EOF
 
 fi
 
-for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3298: checking for $ac_hdr" >&5
+echo "configure:3323: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3303 "configure"
+#line 3328 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3308: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3333,12 +3358,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3337: checking for $ac_func" >&5
+echo "configure:3362: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3342 "configure"
+#line 3367 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3361,7 +3386,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3386,7 +3411,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3390: checking for working mmap" >&5
+echo "configure:3415: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3394,7 +3419,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3398 "configure"
+#line 3423 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3422,24 +3447,11 @@ else
 #include <fcntl.h>
 #include <sys/mman.h>
 
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
 /* This mess was copied from the GNU getpagesize.h.  */
 #ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+# endif
 
 /* Assume that all systems that can run configure have sys/param.h.  */
 # ifndef HAVE_SYS_PARAM_H
@@ -3547,7 +3559,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:3551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -3575,17 +3587,17 @@ unistd.h values.h sys/param.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3579: checking for $ac_hdr" >&5
+echo "configure:3591: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3584 "configure"
+#line 3596 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3615,12 +3627,12 @@ done
 __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3619: checking for $ac_func" >&5
+echo "configure:3631: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3624 "configure"
+#line 3636 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3643,7 +3655,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3672,12 +3684,12 @@ done
      for ac_func in stpcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3676: checking for $ac_func" >&5
+echo "configure:3688: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3681 "configure"
+#line 3693 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3700,7 +3712,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3704: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3734,19 +3746,19 @@ EOF
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:3738: checking for LC_MESSAGES" >&5
+echo "configure:3750: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3743 "configure"
+#line 3755 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:3750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_val_LC_MESSAGES=yes
 else
@@ -3767,7 +3779,7 @@ EOF
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:3771: checking whether NLS is requested" >&5
+echo "configure:3783: checking whether NLS is requested" >&5
         # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
@@ -3787,7 +3799,7 @@ fi
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:3791: checking whether included gettext is requested" >&5
+echo "configure:3803: checking whether included gettext is requested" >&5
       # Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
   withval="$with_included_gettext"
@@ -3806,17 +3818,17 @@ fi
 
        ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:3810: checking for libintl.h" >&5
+echo "configure:3822: checking for libintl.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3815 "configure"
+#line 3827 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3820: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3832: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3833,19 +3845,19 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:3837: checking for gettext in libc" >&5
+echo "configure:3849: checking for gettext in libc" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3842 "configure"
+#line 3854 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3849: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libc=yes
 else
@@ -3861,7 +3873,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
 
           if test "$gt_cv_func_gettext_libc" != "yes"; then
             echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:3865: checking for bindtextdomain in -lintl" >&5
+echo "configure:3877: checking for bindtextdomain in -lintl" >&5
 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3869,7 +3881,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3873 "configure"
+#line 3885 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3880,7 +3892,7 @@ int main() {
 bindtextdomain()
 ; return 0; }
 EOF
-if { (eval echo configure:3884: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3896,19 +3908,19 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:3900: checking for gettext in libintl" >&5
+echo "configure:3912: checking for gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3905 "configure"
+#line 3917 "configure"
 #include "confdefs.h"
 
 int main() {
 return (int) gettext ("")
 ; return 0; }
 EOF
-if { (eval echo configure:3912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gettext_libintl=yes
 else
@@ -3936,7 +3948,7 @@ EOF
              # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3940: checking for $ac_word" >&5
+echo "configure:3952: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3970,12 +3982,12 @@ fi
                for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3974: checking for $ac_func" >&5
+echo "configure:3986: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3979 "configure"
+#line 3991 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3998,7 +4010,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4025,7 +4037,7 @@ done
                # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4029: checking for $ac_word" >&5
+echo "configure:4041: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4061,7 +4073,7 @@ fi
                # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4065: checking for $ac_word" >&5
+echo "configure:4077: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4093,7 +4105,7 @@ else
 fi
 
                cat > conftest.$ac_ext <<EOF
-#line 4097 "configure"
+#line 4109 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4101,7 +4113,7 @@ extern int _nl_msg_cat_cntr;
                               return _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:4105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   CATOBJEXT=.gmo
                   DATADIRNAME=share
@@ -4133,7 +4145,7 @@ fi
         # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4137: checking for $ac_word" >&5
+echo "configure:4149: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4167,7 +4179,7 @@ fi
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4171: checking for $ac_word" >&5
+echo "configure:4183: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4203,7 +4215,7 @@ fi
         # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4207: checking for $ac_word" >&5
+echo "configure:4219: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4293,7 +4305,7 @@ fi
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:4297: checking for catalogs to be installed" >&5
+echo "configure:4309: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for lang in ${LINGUAS=$ALL_LINGUAS}; do
          case "$ALL_LINGUAS" in
@@ -4321,17 +4333,17 @@ echo "configure:4297: checking for catalogs to be installed" >&5
       if test "$CATOBJEXT" = ".cat"; then
         ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:4325: checking for linux/version.h" >&5
+echo "configure:4337: checking for linux/version.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4330 "configure"
+#line 4342 "configure"
 #include "confdefs.h"
 #include <linux/version.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4335: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4409,7 +4421,7 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:4413: checking for a BSD compatible install" >&5
+echo "configure:4425: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4492,7 +4504,7 @@ if test "x$cross_compiling" = "xno"; then
   EXEEXT_FOR_BUILD='$(EXEEXT)'
 else
   echo $ac_n "checking for build system executable suffix""... $ac_c" 1>&6
-echo "configure:4496: checking for build system executable suffix" >&5
+echo "configure:4508: checking for build system executable suffix" >&5
 if eval "test \"`echo '$''{'bfd_cv_build_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4520,17 +4532,17 @@ for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4524: checking for $ac_hdr" >&5
+echo "configure:4536: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4529 "configure"
+#line 4541 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4534: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4560,17 +4572,17 @@ for ac_hdr in fcntl.h sys/file.h sys/time.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4564: checking for $ac_hdr" >&5
+echo "configure:4576: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4569 "configure"
+#line 4581 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4597,12 +4609,12 @@ fi
 done
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:4601: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4613: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4606 "configure"
+#line 4618 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -4611,7 +4623,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:4615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -4636,12 +4648,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:4640: checking for $ac_hdr that defines DIR" >&5
+echo "configure:4652: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4645 "configure"
+#line 4657 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -4649,7 +4661,7 @@ int main() {
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -4674,7 +4686,7 @@ done
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:4678: checking for opendir in -ldir" >&5
+echo "configure:4690: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4682,7 +4694,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4686 "configure"
+#line 4698 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4693,7 +4705,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4715,7 +4727,7 @@ fi
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:4719: checking for opendir in -lx" >&5
+echo "configure:4731: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4723,7 +4735,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4727 "configure"
+#line 4739 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4734,7 +4746,7 @@ int main() {
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:4738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4750: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4759,12 +4771,12 @@ fi
 for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4763: checking for $ac_func" >&5
+echo "configure:4775: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4768 "configure"
+#line 4780 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4787,7 +4799,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4822,12 +4834,12 @@ EOF
 esac
 
 echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6
-echo "configure:4826: checking whether strstr must be declared" >&5
+echo "configure:4838: checking whether strstr must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_strstr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4831 "configure"
+#line 4843 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4848,7 +4860,7 @@ int main() {
 char *(*pfn) = (char *(*)) strstr
 ; return 0; }
 EOF
-if { (eval echo configure:4852: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_strstr=no
 else
@@ -4869,12 +4881,12 @@ EOF
 fi
 
 echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6
-echo "configure:4873: checking whether malloc must be declared" >&5
+echo "configure:4885: checking whether malloc must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4878 "configure"
+#line 4890 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4895,7 +4907,7 @@ int main() {
 char *(*pfn) = (char *(*)) malloc
 ; return 0; }
 EOF
-if { (eval echo configure:4899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4911: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_malloc=no
 else
@@ -4916,12 +4928,12 @@ EOF
 fi
 
 echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6
-echo "configure:4920: checking whether realloc must be declared" >&5
+echo "configure:4932: checking whether realloc must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4925 "configure"
+#line 4937 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4942,7 +4954,7 @@ int main() {
 char *(*pfn) = (char *(*)) realloc
 ; return 0; }
 EOF
-if { (eval echo configure:4946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_realloc=no
 else
@@ -4963,12 +4975,12 @@ EOF
 fi
 
 echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6
-echo "configure:4967: checking whether free must be declared" >&5
+echo "configure:4979: checking whether free must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4972 "configure"
+#line 4984 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -4989,7 +5001,7 @@ int main() {
 char *(*pfn) = (char *(*)) free
 ; return 0; }
 EOF
-if { (eval echo configure:4993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5005: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_free=no
 else
@@ -5010,12 +5022,12 @@ EOF
 fi
 
 echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6
-echo "configure:5014: checking whether getenv must be declared" >&5
+echo "configure:5026: checking whether getenv must be declared" >&5
 if eval "test \"`echo '$''{'bfd_cv_decl_needed_getenv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5019 "configure"
+#line 5031 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -5036,7 +5048,7 @@ int main() {
 char *(*pfn) = (char *(*)) getenv
 ; return 0; }
 EOF
-if { (eval echo configure:5040: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_decl_needed_getenv=no
 else
@@ -5223,16 +5235,16 @@ if test "${target}" = "${host}"; then
        # Not all versions of AIX with -DAIX_CORE_DUMPX_CORE
        # have c_impl as a member of struct core_dumpx
        echo $ac_n "checking for c_impl in struct core_dumpx""... $ac_c" 1>&6
-echo "configure:5227: checking for c_impl in struct core_dumpx" >&5
+echo "configure:5239: checking for c_impl in struct core_dumpx" >&5
        cat > conftest.$ac_ext <<EOF
-#line 5229 "configure"
+#line 5241 "configure"
 #include "confdefs.h"
 #include <core.h>
 int main() {
 struct core_dumpx c; c.c_impl = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:5236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5248: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_ST_C_IMPL 1
@@ -5300,17 +5312,17 @@ rm -f conftest*
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5304: checking for $ac_hdr" >&5
+echo "configure:5316: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5309 "configure"
+#line 5321 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5326: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5338,12 +5350,12 @@ done
 
   if test "$ac_cv_header_sys_procfs_h" = yes; then
     echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5342: checking for prstatus_t in sys/procfs.h" >&5
+echo "configure:5354: checking for prstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5347 "configure"
+#line 5359 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5352,7 +5364,7 @@ int main() {
 prstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prstatus_t=yes
 else
@@ -5374,12 +5386,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6
 
     echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5378: checking for prstatus32_t in sys/procfs.h" >&5
+echo "configure:5390: checking for prstatus32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5383 "configure"
+#line 5395 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5388,7 +5400,7 @@ int main() {
 prstatus32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prstatus32_t=yes
 else
@@ -5410,12 +5422,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6
 
     echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5414: checking for prstatus_t.pr_who in sys/procfs.h" >&5
+echo "configure:5426: checking for prstatus_t.pr_who in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5419 "configure"
+#line 5431 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5424,7 +5436,7 @@ int main() {
 prstatus_t avar; void* aref = (void*) &avar.pr_who
 ; return 0; }
 EOF
-if { (eval echo configure:5428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes
 else
@@ -5446,12 +5458,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6
 
     echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5450: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
+echo "configure:5462: checking for prstatus32_t.pr_who in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5455 "configure"
+#line 5467 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5460,7 +5472,7 @@ int main() {
 prstatus32_t avar; void* aref = (void*) &avar.pr_who
 ; return 0; }
 EOF
-if { (eval echo configure:5464: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes
 else
@@ -5482,12 +5494,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6
 
     echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5486: checking for pstatus_t in sys/procfs.h" >&5
+echo "configure:5498: checking for pstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5491 "configure"
+#line 5503 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5496,7 +5508,7 @@ int main() {
 pstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pstatus_t=yes
 else
@@ -5518,12 +5530,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6
 
     echo $ac_n "checking for pxstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5522: checking for pxstatus_t in sys/procfs.h" >&5
+echo "configure:5534: checking for pxstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5527 "configure"
+#line 5539 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5532,7 +5544,7 @@ int main() {
 pxstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pxstatus_t=yes
 else
@@ -5554,12 +5566,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pxstatus_t" 1>&6
 
     echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5558: checking for pstatus32_t in sys/procfs.h" >&5
+echo "configure:5570: checking for pstatus32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5563 "configure"
+#line 5575 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5568,7 +5580,7 @@ int main() {
 pstatus32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_pstatus32_t=yes
 else
@@ -5590,12 +5602,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6
 
     echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5594: checking for prpsinfo_t in sys/procfs.h" >&5
+echo "configure:5606: checking for prpsinfo_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5599 "configure"
+#line 5611 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5604,7 +5616,7 @@ int main() {
 prpsinfo_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5620: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prpsinfo_t=yes
 else
@@ -5626,12 +5638,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6
 
     echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5630: checking for prpsinfo32_t in sys/procfs.h" >&5
+echo "configure:5642: checking for prpsinfo32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5635 "configure"
+#line 5647 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5640,7 +5652,7 @@ int main() {
 prpsinfo32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5656: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes
 else
@@ -5662,12 +5674,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6
 
     echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5666: checking for psinfo_t in sys/procfs.h" >&5
+echo "configure:5678: checking for psinfo_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5671 "configure"
+#line 5683 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5676,7 +5688,7 @@ int main() {
 psinfo_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_psinfo_t=yes
 else
@@ -5698,12 +5710,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6
 
     echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5702: checking for psinfo32_t in sys/procfs.h" >&5
+echo "configure:5714: checking for psinfo32_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5707 "configure"
+#line 5719 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5712,7 +5724,7 @@ int main() {
 psinfo32_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5716: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_psinfo32_t=yes
 else
@@ -5734,12 +5746,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6
 
     echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5738: checking for lwpstatus_t in sys/procfs.h" >&5
+echo "configure:5750: checking for lwpstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5743 "configure"
+#line 5755 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5748,7 +5760,7 @@ int main() {
 lwpstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5752: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5764: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_lwpstatus_t=yes
 else
@@ -5770,12 +5782,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6
 
     echo $ac_n "checking for lwpxstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5774: checking for lwpxstatus_t in sys/procfs.h" >&5
+echo "configure:5786: checking for lwpxstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5779 "configure"
+#line 5791 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5784,7 +5796,7 @@ int main() {
 lwpxstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5788: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5800: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes
 else
@@ -5806,12 +5818,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpxstatus_t" 1>&6
 
     echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5810: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
+echo "configure:5822: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5815 "configure"
+#line 5827 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5820,7 +5832,7 @@ int main() {
 lwpstatus_t avar; void* aref = (void*) &avar.pr_context
 ; return 0; }
 EOF
-if { (eval echo configure:5824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes
 else
@@ -5842,12 +5854,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6
 
     echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5846: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
+echo "configure:5858: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5851 "configure"
+#line 5863 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5856,7 +5868,7 @@ int main() {
 lwpstatus_t avar; void* aref = (void*) &avar.pr_reg
 ; return 0; }
 EOF
-if { (eval echo configure:5860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes
 else
@@ -5878,12 +5890,12 @@ EOF
  echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6
 
     echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6
-echo "configure:5882: checking for win32_pstatus_t in sys/procfs.h" >&5
+echo "configure:5894: checking for win32_pstatus_t in sys/procfs.h" >&5
  if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5887 "configure"
+#line 5899 "configure"
 #include "confdefs.h"
 
 #define _SYSCALL32
@@ -5892,7 +5904,7 @@ int main() {
 win32_pstatus_t avar
 ; return 0; }
 EOF
-if { (eval echo configure:5896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes
 else
@@ -6360,10 +6372,10 @@ case ${host64}-${target64}-${want64} in
     if test -n "$GCC" ; then
        bad_64bit_gcc=no;
        echo $ac_n "checking for gcc version with buggy 64-bit support""... $ac_c" 1>&6
-echo "configure:6363: checking for gcc version with buggy 64-bit support" >&5
+echo "configure:6376: checking for gcc version with buggy 64-bit support" >&5
        # Add more tests for gcc versions with non-working 64-bit support here.
        cat > conftest.$ac_ext <<EOF
-#line 6366 "configure"
+#line 6379 "configure"
 #include "confdefs.h"
 :__GNUC__:__GNUC_MINOR__:__i386__:
 EOF
@@ -6405,21 +6417,21 @@ test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selar
 test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}"
 
 
-for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h
+for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6412: checking for $ac_hdr" >&5
+echo "configure:6425: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6417 "configure"
+#line 6430 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6448,12 +6460,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6451: checking for $ac_func" >&5
+echo "configure:6464: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 6456 "configure"
+#line 6469 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6476,7 +6488,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6501,7 +6513,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:6504: checking for working mmap" >&5
+echo "configure:6517: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6509,7 +6521,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 6512 "configure"
+#line 6525 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -6537,24 +6549,11 @@ else
 #include <fcntl.h>
 #include <sys/mman.h>
 
-#if HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
 /* This mess was copied from the GNU getpagesize.h.  */
 #ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+# endif
 
 /* Assume that all systems that can run configure have sys/param.h.  */
 # ifndef HAVE_SYS_PARAM_H
index 82dc090428f85681d278ec67340949330746447c..ddb5e8b287ab3530ff8c9fa061e652b16374d96d 100644 (file)
@@ -103,7 +103,7 @@ bfd_default_target_size=32
 
 AC_PROG_CC
 
-ALL_LINGUAS="fr tr ja es sv da"
+ALL_LINGUAS="fr tr ja es sv da zh_CN"
 CY_GNU_GETTEXT
 
 # Permit host specific settings.
index cf705d502f04db1ce490c568a78fb997e526d49a..1399f0031287e52d0d722c21b7b1af68be67b3f2 100644 (file)
@@ -261,11 +261,9 @@ static reloc_howto_type elf_mips_howto_table_rel[] =
         0x0000ffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 
-  /* 16 bit PC relative reference.  Note that the ABI document has a typo
-     and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
-     We do the right thing here.  */
+  /* 16 bit PC relative reference.  */
   HOWTO (R_MIPS_PC16,          /* type */
-        2,                     /* rightshift */
+        0,                     /* rightshift */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
         16,                    /* bitsize */
         TRUE,                  /* pc_relative */
@@ -1403,7 +1401,7 @@ static const struct elf_reloc_map mips_reloc_map[] =
   { BFD_RELOC_GPREL16, R_MIPS_GPREL16 },
   { BFD_RELOC_MIPS_LITERAL, R_MIPS_LITERAL },
   { BFD_RELOC_MIPS_GOT16, R_MIPS_GOT16 },
-  { BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 },
+  { BFD_RELOC_16_PCREL, R_MIPS_PC16 },
   { BFD_RELOC_MIPS_CALL16, R_MIPS_CALL16 },
   { BFD_RELOC_GPREL32, R_MIPS_GPREL32 },
   { BFD_RELOC_MIPS_GOT_HI16, R_MIPS_GOT_HI16 },
@@ -1460,7 +1458,7 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
       return &elf_mips_gnu_rel_hi16;
     case BFD_RELOC_PCREL_LO16:
       return &elf_mips_gnu_rel_lo16;
-    case BFD_RELOC_MIPSEMB_16_PCREL_S2:
+    case BFD_RELOC_16_PCREL_S2:
       return &elf_mips_gnu_rel16_s2;
     case BFD_RELOC_64_PCREL:
       return &elf_mips_gnu_pcrel64;
index b7b09dcea2d4d46c4c703b95446ee5983d2c8d67..6d544192987c587d60bd2bd525a5d86db633d042 100644 (file)
@@ -4779,10 +4779,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                        outrel.r_offset = (htab->got->output_section->vma
                                           + htab->got->output_offset
                                           + off);
+                       outrel.r_addend = 0;
                        if (tls_ty & (TLS_LD | TLS_GD))
                          {
                            outrel.r_info = ELF32_R_INFO (indx, R_PPC_DTPMOD32);
-                           outrel.r_addend = 0;
                            if (tls_ty == (TLS_TLS | TLS_GD))
                              {
                                loc = htab->relgot->contents;
@@ -4790,9 +4790,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                                        * sizeof (Elf32_External_Rela));
                                bfd_elf32_swap_reloca_out (output_bfd,
                                                           &outrel, loc);
+                               outrel.r_offset += 4;
                                outrel.r_info
                                  = ELF32_R_INFO (indx, R_PPC_DTPREL32);
-                               outrel.r_offset += 4;
                              }
                          }
                        else if (tls_ty == (TLS_TLS | TLS_DTPREL))
@@ -4803,9 +4803,12 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                          outrel.r_info = ELF32_R_INFO (indx, R_PPC_RELATIVE);
                        else
                          outrel.r_info = ELF32_R_INFO (indx, R_PPC_GLOB_DAT);
-                       outrel.r_addend = 0;
                        if (indx == 0)
-                         outrel.r_addend += relocation;
+                         {
+                           outrel.r_addend += relocation;
+                           if (tls_ty & (TLS_GD | TLS_DTPREL | TLS_TPREL))
+                             outrel.r_addend -= htab->tls_sec->vma;
+                         }
                        loc = htab->relgot->contents;
                        loc += (htab->relgot->reloc_count++
                                * sizeof (Elf32_External_Rela));
@@ -4933,6 +4936,11 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
          addend -= htab->tls_sec->vma + DTP_OFFSET;
          goto dodyn;
 
+       case R_PPC_DTPMOD32:
+         relocation = 1;
+         addend = 0;
+         goto dodyn;
+
        case R_PPC_REL24:
        case R_PPC_REL32:
        case R_PPC_REL14:
@@ -4959,7 +4967,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
        case R_PPC_ADDR14_BRNTAKEN:
        case R_PPC_UADDR32:
        case R_PPC_UADDR16:
-       case R_PPC_DTPMOD32:
          /* r_symndx will be zero only for relocs against symbols
             from removed linkonce sections, or sections discarded by
             a linker script.  */
@@ -5332,8 +5339,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
             'sec' would be NULL, and we should leave the symbol
             alone (it will be set to zero elsewhere in the link).  */
          if (sec != NULL)
-           /* Add 0x10000 if sign bit in 0:15 is set.  */
-           addend += ((relocation + addend) & 0x8000) << 1;
+           /* Add 0x10000 if sign bit in 0:15 is set.
+              Bits 0:15 are not used.  */
+           addend += 0x8000;
          break;
        }
 
index 807ddf5f22fd7997bb62f179fa4a7764c5d18ac1..46d9a92cb5b7cb5897a4b2320de27f98d8f41335 100644 (file)
@@ -91,8 +91,14 @@ static void mips_elf64_info_to_howto_rela
   PARAMS ((bfd *, arelent *, Elf_Internal_Rela *));
 static long mips_elf64_get_reloc_upper_bound
   PARAMS ((bfd *, asection *));
+static long mips_elf64_canonicalize_reloc
+  PARAMS ((bfd *, asection *, arelent **, asymbol **));
+static long mips_elf64_get_dynamic_reloc_upper_bound PARAMS ((bfd *));
+static long mips_elf64_canonicalize_dynamic_reloc
+  PARAMS ((bfd *, arelent **, asymbol **));
 static bfd_boolean mips_elf64_slurp_one_reloc_table
-  PARAMS ((bfd *, asection *, asymbol **, const Elf_Internal_Shdr *));
+  PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, bfd_size_type,
+          arelent *, asymbol **, bfd_boolean));
 static bfd_boolean mips_elf64_slurp_reloc_table
   PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
 static void mips_elf64_write_relocs
@@ -300,11 +306,9 @@ static reloc_howto_type mips_elf64_howto_table_rel[] =
         0x0000ffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 
-  /* 16 bit PC relative reference.  Note that the ABI document has a typo
-     and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
-     We do the right thing here.  */
+  /* 16 bit PC relative reference.  */
   HOWTO (R_MIPS_PC16,          /* type */
-        2,                     /* rightshift */
+        0,                     /* rightshift */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
         16,                    /* bitsize */
         TRUE,                  /* pc_relative */
@@ -797,11 +801,9 @@ static reloc_howto_type mips_elf64_howto_table_rela[] =
         0x0000ffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 
-  /* 16 bit PC relative reference.  Note that the ABI document has a typo
-     and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
-     We do the right thing here.  */
+  /* 16 bit PC relative reference.  */
   HOWTO (R_MIPS_PC16,          /* type */
-        2,                     /* rightshift */
+        0,                     /* rightshift */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
         16,                    /* bitsize */
         TRUE,                  /* pc_relative */
@@ -1898,7 +1900,7 @@ static const struct elf_reloc_map mips_reloc_map[] =
   /* There is no BFD reloc for R_MIPS_REL32.  */
   { BFD_RELOC_64, R_MIPS_64 },
   { BFD_RELOC_CTOR, R_MIPS_64 },
-  { BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 },
+  { BFD_RELOC_16_PCREL, R_MIPS_PC16 },
   { BFD_RELOC_HI16_S, R_MIPS_HI16 },
   { BFD_RELOC_LO16, R_MIPS_LO16 },
   { BFD_RELOC_GPREL16, R_MIPS_GPREL16 },
@@ -2022,20 +2024,104 @@ mips_elf64_get_reloc_upper_bound (abfd, sec)
   return (sec->reloc_count * 3 + 1) * sizeof (arelent *);
 }
 
-/* Read the relocations from one reloc section.  */
+static long
+mips_elf64_get_dynamic_reloc_upper_bound (abfd)
+     bfd *abfd;
+{
+  return _bfd_elf_get_dynamic_reloc_upper_bound (abfd) * 3;
+}
+
+/* We must also copy more relocations than the corresponding functions
+   in elf.c would, so the two following functions are slightly
+   modified from elf.c, that multiply the external relocation count by
+   3 to obtain the internal relocation count.  */
+
+static long
+mips_elf64_canonicalize_reloc (abfd, section, relptr, symbols)
+     bfd *abfd;
+     sec_ptr section;
+     arelent **relptr;
+     asymbol **symbols;
+{
+  arelent *tblptr;
+  unsigned int i;
+  struct elf_backend_data *bed = get_elf_backend_data (abfd);
+
+  if (! bed->s->slurp_reloc_table (abfd, section, symbols, FALSE))
+    return -1;
+
+  tblptr = section->relocation;
+  for (i = 0; i < section->reloc_count * 3; i++)
+    *relptr++ = tblptr++;
+
+  *relptr = NULL;
+
+  return section->reloc_count * 3;
+}
+
+static long
+mips_elf64_canonicalize_dynamic_reloc (abfd, storage, syms)
+     bfd *abfd;
+     arelent **storage;
+     asymbol **syms;
+{
+  bfd_boolean (*slurp_relocs)
+    PARAMS ((bfd *, asection *, asymbol **, bfd_boolean));
+  asection *s;
+  long ret;
+
+  if (elf_dynsymtab (abfd) == 0)
+    {
+      bfd_set_error (bfd_error_invalid_operation);
+      return -1;
+    }
+
+  slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table;
+  ret = 0;
+  for (s = abfd->sections; s != NULL; s = s->next)
+    {
+      if (elf_section_data (s)->this_hdr.sh_link == elf_dynsymtab (abfd)
+         && (elf_section_data (s)->this_hdr.sh_type == SHT_REL
+             || elf_section_data (s)->this_hdr.sh_type == SHT_RELA))
+       {
+         arelent *p;
+         long count, i;
+
+         if (! (*slurp_relocs) (abfd, s, syms, TRUE))
+           return -1;
+         count = s->_raw_size / elf_section_data (s)->this_hdr.sh_entsize * 3;
+         p = s->relocation;
+         for (i = 0; i < count; i++)
+           *storage++ = p++;
+         ret += count;
+       }
+    }
+
+  *storage = NULL;
+
+  return ret;
+}
+
+/* Read the relocations from one reloc section.  This is mostly copied
+   from elfcode.h, except for the changes to expand one external
+   relocation to 3 internal ones.  We must unfortunately set
+   reloc_count to the number of external relocations, because a lot of
+   generic code seems to depend on this.  */
 
 static bfd_boolean
-mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr)
+mips_elf64_slurp_one_reloc_table (abfd, asect, rel_hdr, reloc_count,
+                                 relents, symbols, dynamic)
      bfd *abfd;
      asection *asect;
+     Elf_Internal_Shdr *rel_hdr;
+     bfd_size_type reloc_count;
+     arelent *relents;
      asymbol **symbols;
-     const Elf_Internal_Shdr *rel_hdr;
+     bfd_boolean dynamic;
 {
   PTR allocated = NULL;
   bfd_byte *native_relocs;
-  arelent *relents;
   arelent *relent;
-  bfd_vma count;
   bfd_vma i;
   int entsize;
   reloc_howto_type *howto_table;
@@ -2045,26 +2131,24 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr)
     return FALSE;
 
   if (bfd_seek (abfd, rel_hdr->sh_offset, SEEK_SET) != 0
-      || (bfd_bread (allocated, rel_hdr->sh_size, abfd) != rel_hdr->sh_size))
+      || (bfd_bread (allocated, rel_hdr->sh_size, abfd)
+         != rel_hdr->sh_size))
     goto error_return;
 
   native_relocs = (bfd_byte *) allocated;
 
-  relents = asect->relocation + asect->reloc_count;
-
   entsize = rel_hdr->sh_entsize;
   BFD_ASSERT (entsize == sizeof (Elf64_Mips_External_Rel)
              || entsize == sizeof (Elf64_Mips_External_Rela));
 
-  count = rel_hdr->sh_size / entsize;
-
   if (entsize == sizeof (Elf64_Mips_External_Rel))
     howto_table = mips_elf64_howto_table_rel;
   else
     howto_table = mips_elf64_howto_table_rela;
 
-  relent = relents;
-  for (i = 0; i < count; i++, native_relocs += entsize)
+  for (i = 0, relent = relents;
+       i < reloc_count;
+       i++, native_relocs += entsize)
     {
       Elf64_Mips_Internal_Rela rela;
       bfd_boolean used_sym, used_ssym;
@@ -2166,7 +2250,7 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr)
             object file, and absolute for an executable file or
             shared library.  The address of a BFD reloc is always
             section relative.  */
-         if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0)
+         if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0 || dynamic)
            relent->address = rela.r_offset;
          else
            relent->address = rela.r_offset - asect->vma;
@@ -2193,7 +2277,10 @@ mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, rel_hdr)
 }
 
 /* Read the relocations.  On Irix 6, there can be two reloc sections
-   associated with a single data section.  */
+   associated with a single data section.  This is copied from
+   elfcode.h as well, with changes as small as accounting for 3
+   internal relocs per external reloc and resetting reloc_count to
+   zero before processing the relocs of a section.  */
 
 static bfd_boolean
 mips_elf64_slurp_reloc_table (abfd, asect, symbols, dynamic)
@@ -2202,39 +2289,72 @@ mips_elf64_slurp_reloc_table (abfd, asect, symbols, dynamic)
      asymbol **symbols;
      bfd_boolean dynamic;
 {
-  bfd_size_type amt;
   struct bfd_elf_section_data * const d = elf_section_data (asect);
+  Elf_Internal_Shdr *rel_hdr;
+  Elf_Internal_Shdr *rel_hdr2;
+  bfd_size_type reloc_count;
+  bfd_size_type reloc_count2;
+  arelent *relents;
+  bfd_size_type amt;
+
+  if (asect->relocation != NULL)
+    return TRUE;
 
-  if (dynamic)
+  if (dynamic)
     {
-      bfd_set_error (bfd_error_invalid_operation);
-      return FALSE;
-    }
+      if ((asect->flags & SEC_RELOC) == 0
+         || asect->reloc_count == 0)
+       return TRUE;
 
-  if (asect->relocation != NULL
-      || (asect->flags & SEC_RELOC) == 0
-      || asect->reloc_count == 0)
-    return TRUE;
+      rel_hdr = &d->rel_hdr;
+      reloc_count = NUM_SHDR_ENTRIES (rel_hdr);
+      rel_hdr2 = d->rel_hdr2;
+      reloc_count2 = (rel_hdr2 ? NUM_SHDR_ENTRIES (rel_hdr2) : 0);
+
+      BFD_ASSERT (asect->reloc_count == reloc_count + reloc_count2);
+      BFD_ASSERT (asect->rel_filepos == rel_hdr->sh_offset
+                 || (rel_hdr2 && asect->rel_filepos == rel_hdr2->sh_offset));
+
+    }
+  else
+    {
+      /* Note that ASECT->RELOC_COUNT tends not to be accurate in this
+        case because relocations against this section may use the
+        dynamic symbol table, and in that case bfd_section_from_shdr
+        in elf.c does not update the RELOC_COUNT.  */
+      if (asect->_raw_size == 0)
+       return TRUE;
+
+      rel_hdr = &d->this_hdr;
+      reloc_count = NUM_SHDR_ENTRIES (rel_hdr);
+      rel_hdr2 = NULL;
+      reloc_count2 = 0;
+    }
 
   /* Allocate space for 3 arelent structures for each Rel structure.  */
-  amt = asect->reloc_count;
-  amt *= 3 * sizeof (arelent);
-  asect->relocation = (arelent *) bfd_alloc (abfd, amt);
-  if (asect->relocation == NULL)
+  amt = (reloc_count + reloc_count2) * 3 * sizeof (arelent);
+  relents = (arelent *) bfd_alloc (abfd, amt);
+  if (relents == NULL)
     return FALSE;
 
   /* The slurp_one_reloc_table routine increments reloc_count.  */
   asect->reloc_count = 0;
 
-  if (! mips_elf64_slurp_one_reloc_table (abfd, asect, symbols, &d->rel_hdr))
+  if (! mips_elf64_slurp_one_reloc_table (abfd, asect,
+                                         rel_hdr, reloc_count,
+                                         relents,
+                                         symbols, dynamic))
     return FALSE;
   if (d->rel_hdr2 != NULL)
     {
-      if (! mips_elf64_slurp_one_reloc_table (abfd, asect, symbols,
-                                             d->rel_hdr2))
+      if (! mips_elf64_slurp_one_reloc_table (abfd, asect,
+                                             rel_hdr2, reloc_count2,
+                                             relents + reloc_count * 3,
+                                             symbols, dynamic))
        return FALSE;
     }
 
+  asect->relocation = relents;
   return TRUE;
 }
 
@@ -2764,6 +2884,9 @@ const struct elf_size_info mips_elf64_size_info =
                                _bfd_mips_elf_print_private_bfd_data
 
 #define bfd_elf64_get_reloc_upper_bound mips_elf64_get_reloc_upper_bound
+#define bfd_elf64_canonicalize_reloc mips_elf64_canonicalize_reloc
+#define bfd_elf64_get_dynamic_reloc_upper_bound mips_elf64_get_dynamic_reloc_upper_bound
+#define bfd_elf64_canonicalize_dynamic_reloc mips_elf64_canonicalize_dynamic_reloc
 
 /* MIPS ELF64 archive functions.  */
 #define bfd_elf64_archive_functions
index 1030e69b7ddaa106093db3b0c5b5af5a9198d4d1..29c90fe32e4aa2be5586dbae9d3173fede9f1cd6 100644 (file)
@@ -7638,8 +7638,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                                       + off);
                    if (tls_type & (TLS_LD | TLS_GD))
                      {
-                       outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPMOD64);
                        outrel.r_addend = 0;
+                       outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPMOD64);
                        if (tls_type == (TLS_TLS | TLS_GD))
                          {
                            loc = htab->srelgot->contents;
@@ -7647,9 +7647,9 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                                    * sizeof (Elf64_External_Rela));
                            bfd_elf64_swap_reloca_out (output_bfd,
                                                       &outrel, loc);
+                           outrel.r_offset += 8;
                            outrel.r_info
                              = ELF64_R_INFO (indx, R_PPC64_DTPREL64);
-                           outrel.r_offset += 8;
                          }
                      }
                    else if (tls_type == (TLS_TLS | TLS_DTPREL))
@@ -7662,7 +7662,11 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                      outrel.r_info = ELF64_R_INFO (indx, R_PPC64_GLOB_DAT);
                    outrel.r_addend = rel->r_addend;
                    if (indx == 0)
-                     outrel.r_addend += relocation;
+                     {
+                       outrel.r_addend += relocation;
+                       if (tls_type & (TLS_GD | TLS_DTPREL | TLS_TPREL))
+                         outrel.r_addend -= htab->tls_sec->vma;
+                     }
                    loc = htab->srelgot->contents;
                    loc += (htab->srelgot->reloc_count++
                            * sizeof (Elf64_External_Rela));
@@ -7798,6 +7802,11 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
          addend -= htab->tls_sec->vma + DTP_OFFSET;
          break;
 
+       case R_PPC64_DTPMOD64:
+         relocation = 1;
+         addend = 0;
+         goto dodyn;
+
        case R_PPC64_TPREL64:
          addend -= htab->tls_sec->vma + TP_OFFSET;
          goto dodyn;
@@ -7808,7 +7817,6 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
 
          /* Relocations that may need to be propagated if this is a
             dynamic object.  */
-       case R_PPC64_DTPMOD64:
        case R_PPC64_REL30:
        case R_PPC64_REL32:
        case R_PPC64_REL64:
@@ -8028,8 +8036,9 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
             'sec' would be NULL, and we should leave the symbol
             alone (it will be set to zero elsewhere in the link).  */
          if (sec != NULL)
-           /* Add 0x10000 if sign bit in 0:15 is set.  */
-           addend += ((relocation + addend) & 0x8000) << 1;
+           /* Add 0x10000 if sign bit in 0:15 is set.
+              Bits 0:15 are not used.  */
+           addend += 0x8000;
          break;
 
        case R_PPC64_ADDR16_DS:
index b2d745bdfbc308b01a956636a28793ce74f57449..00a0e88c1cead9bb0cee73fa7296cec326019a0c 100644 (file)
@@ -275,11 +275,9 @@ static reloc_howto_type elf_mips_howto_table_rel[] =
         0x0000ffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 
-  /* 16 bit PC relative reference.  Note that the ABI document has a typo
-     and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
-     We do the right thing here.  */
+  /* 16 bit PC relative reference.  */
   HOWTO (R_MIPS_PC16,          /* type */
-        2,                     /* rightshift */
+        0,                     /* rightshift */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
         16,                    /* bitsize */
         TRUE,                  /* pc_relative */
@@ -774,11 +772,9 @@ static reloc_howto_type elf_mips_howto_table_rela[] =
         0x0000ffff,            /* dst_mask */
         FALSE),                /* pcrel_offset */
 
-  /* 16 bit PC relative reference.  Note that the ABI document has a typo
-     and claims R_MIPS_PC16 to be not rightshifted, rendering it useless.
-     We do the right thing here.  */
+  /* 16 bit PC relative reference.  */
   HOWTO (R_MIPS_PC16,          /* type */
-        2,                     /* rightshift */
+        0,                     /* rightshift */
         2,                     /* size (0 = byte, 1 = short, 2 = long) */
         16,                    /* bitsize */
         TRUE,                  /* pc_relative */
@@ -1841,7 +1837,7 @@ static const struct elf_reloc_map mips_reloc_map[] =
   /* There is no BFD reloc for R_MIPS_REL32.  */
   { BFD_RELOC_CTOR, R_MIPS_32 },
   { BFD_RELOC_64, R_MIPS_64 },
-  { BFD_RELOC_16_PCREL_S2, R_MIPS_PC16 },
+  { BFD_RELOC_16_PCREL, R_MIPS_PC16 },
   { BFD_RELOC_HI16_S, R_MIPS_HI16 },
   { BFD_RELOC_LO16, R_MIPS_LO16 },
   { BFD_RELOC_GPREL16, R_MIPS_GPREL16 },
index 6ca4f063af2bb28cce062e6669175be023ac439b..2b2f615934a10296367e37320a7153ec1d4b8961 100644 (file)
@@ -496,6 +496,7 @@ static struct mips_got_info *mips_elf_got_for_ibfd
 static bfd *reldyn_sorting_bfd;
 
 /* Nonzero if ABFD is using the N32 ABI.  */
+
 #define ABI_N32_P(abfd) \
   ((elf_elfheader (abfd)->e_flags & EF_MIPS_ABI2) != 0)
 
@@ -2129,7 +2130,7 @@ mips_elf_bfd2got_entry_eq (entry1, entry2)
   return e1->bfd == e2->bfd;
 }
 
-/* In a multi-got link, determine the GOT to be used for IBFD.  G must
+/* In a multi-got link, determine the GOT to be used for IBDF.  G must
    be the master GOT data.  */
 
 static struct mips_got_info *
@@ -3315,6 +3316,12 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
       value &= howto->dst_mask;
       break;
 
+    case R_MIPS_GNU_REL16_S2:
+      value = symbol + mips_elf_sign_extend (addend << 2, 18) - p;
+      overflowed_p = mips_elf_overflow_p (value, 18);
+      value = (value >> 2) & howto->dst_mask;
+      break;
+
     case R_MIPS_GNU_REL_HI16:
       /* Instead of subtracting 'p' here, we should be subtracting the
         equivalent value for the LO part of the reloc, since the value
@@ -3443,10 +3450,8 @@ mips_elf_calculate_relocation (abfd, input_bfd, input_section, info,
       break;
 
     case R_MIPS_PC16:
-    case R_MIPS_GNU_REL16_S2:
-      value = mips_elf_sign_extend (addend << 2, 18) + symbol - p;
-      overflowed_p = mips_elf_overflow_p (value, 18);
-      value = (value >> 2) & howto->dst_mask;
+      value = mips_elf_sign_extend (addend, 16) + symbol - p;
+      overflowed_p = mips_elf_overflow_p (value, 16);
       break;
 
     case R_MIPS_GOT_HI16:
@@ -3832,7 +3837,6 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec,
   else
     {
       long indx;
-      bfd_vma section_offset;
 
       /* We must now calculate the dynamic symbol table index to use
         in the relocation.  */
@@ -3862,15 +3866,18 @@ mips_elf_create_dynamic_relocation (output_bfd, info, rel, h, sec,
                abort ();
            }
 
-         /* Figure out how far the target of the relocation is from
-            the beginning of its section.  */
-         section_offset = symbol - sec->output_section->vma;
-         /* The relocation we're building is section-relative.
-            Therefore, the original addend must be adjusted by the
-            section offset.  */
-         *addendp += section_offset;
-         /* Now, the relocation is just against the section.  */
-         symbol = sec->output_section->vma;
+         /* Instead of generating a relocation using the section
+            symbol, we may as well make it a fully relative
+            relocation.  We want to avoid generating relocations to
+            local symbols because we used to generate them
+            incorrectly, without adding the original symbol value,
+            which is mandated by the ABI for section symbols.  In
+            order to give dynamic loaders and applications time to
+            phase out the incorrect use, we refrain from emitting
+            section-relative relocations.  It's not like they're
+            useful, after all.  This should be a bit more efficient
+            as well.  */
+         indx = 0;
        }
 
       /* If the relocation was previously an absolute relocation and
@@ -3884,6 +3891,18 @@ 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);
+      /* For strict adherence to the ABI specification, we should
+        generate a R_MIPS_64 relocation record by itself before the
+        _REL32/_64 record as well, such that the addend is read in as
+        a 64-bit value (REL32 is a 32-bit relocation, after all).
+        However, since none of the existing ELF64 MIPS dynamic
+        loaders seems to care, we don't waste space with these
+        artificial relocations.  If this turns out to not be true,
+        mips_elf_allocate_dynamic_relocation() should be tweaked so
+        as to make room for a pair of dynamic relocations per
+        invocation if ABI_64_P, and here we should generate an
+        additional relocation record with R_MIPS_64 by itself for a
+        NULL symbol before this relocation record.  */
       outrel[1].r_info = ELF_R_INFO (output_bfd, (unsigned long) 0,
                                     ABI_64_P (output_bfd)
                                     ? R_MIPS_64
index 69e3782b1bc0257ca5dc79ea0580bba85cf331a6..734d78bb75e8a29b056d20326fd618837219d9ea 100644 (file)
@@ -33,7 +33,9 @@
 #endif
 
 #define bfd_elfNN_canonicalize_dynamic_symtab _bfd_elf_canonicalize_dynamic_symtab
+#ifndef bfd_elfNN_canonicalize_reloc
 #define bfd_elfNN_canonicalize_reloc   _bfd_elf_canonicalize_reloc
+#endif
 #ifndef bfd_elfNN_find_nearest_line
 #define bfd_elfNN_find_nearest_line    _bfd_elf_find_nearest_line
 #endif
index c0e3f958df8d04fe477a9492b06a0abf047e0517..4d005ce9acafb89db61e17155b55e06af7c61db0 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for HP 9000/300 (68000-based) machines running BSD Unix.
-   Copyright 1992, 1994, 1995, 2001 Free Software Foundation, Inc.
+   Copyright 1992, 1994, 1995, 2001, 2003 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -19,7 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define TARGET_IS_BIG_ENDIAN_P
 #define N_HEADER_IN_TEXT(x) 0
-#define BYTES_IN_WORD 4
 #define ENTRY_CAN_BE_ZERO
 #define N_SHARED_LIB(x) 0 /* Avoids warning */
 #define TEXT_START_ADDR 0
index b2d106f623115dda8b1d8508b1cdf9d3c353ce0b..6b2948ef4cc807f36eb84ed0f21b2800f914e26a 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for i386 a.out binaries.
-   Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001, 2002
+   Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
    system, and I'll stick it in for the next release.  */
 
 #define N_HEADER_IN_TEXT(x) 0
-#define BYTES_IN_WORD 4
 
 #define N_TXTOFF(x) 0x20
 #define N_TXTADDR(x) (N_MAGIC(x)==ZMAGIC ? 0x1020 : 0)
index 51f0844d196dc9910e5cff653c79b8ae251deca6..17871962c1f4345ec18fe2382fb0af2df8d87662 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for i386 a.out binaries under dynix.
-   Copyright 1994, 1995, 2001 Free Software Foundation, Inc.
+   Copyright 1994, 1995, 2001, 2003 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -20,8 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 /* This BFD is currently only tested with gdb, writing object files
    may not work.  */
 
-#define BYTES_IN_WORD  4
-
 #define TEXT_START_ADDR 4096
 #define TARGET_PAGE_SIZE       4096
 #define SEGMENT_SIZE   TARGET_PAGE_SIZE
index 5a2d382b9408f097576e947a9c71ce4dadf8c4c9..6403e1c608bf3407c25973066a52fd6074c9a1dd 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for linux flavored i386 a.out binaries.
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2002
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define        SEGMENT_SIZE TARGET_PAGE_SIZE
 #define TEXT_START_ADDR        0x0
 #define N_SHARED_LIB(x) 0
-#define BYTES_IN_WORD 4
 
 #define MACHTYPE_OK(mtype) ((mtype) == M_386 || (mtype) == M_UNKNOWN)
 
index 6bf6e727b21f6bd1ea7c1f1c80a0aacf9e1f5206..32274ea6c7f7831332f4e17bd95fd9b20e11a42a 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for i386 a.out binaries under LynxOS.
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2001, 2002
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-#define BYTES_IN_WORD 4
 #define N_SHARED_LIB(x) 0
 
 #define TEXT_START_ADDR 0
index 0e4c4e752e3bedfc204f87c2237dbc3662140f96..215f814a1ca0142c229154953e742c77dbad12c4 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for i386 a.out binaries.
-   Copyright 1990, 1991, 1993, 1994, 1995, 1997, 2001, 2002
+   Copyright 1990, 1991, 1993, 1994, 1995, 1997, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define        SEGMENT_SIZE    0x1000
 #define TEXT_START_ADDR        0x10000
 #define ARCH 32
-#define BYTES_IN_WORD 4
 /* This macro is only relevant when N_MAGIC(x) == ZMAGIC.  */
 #define N_HEADER_IN_TEXT(x)    1
 
index 08119528c4e89e0de8cc0be532e2a61e739c431b..59d57430d8960b1cddf427320d33c243e413f3bb 100644 (file)
@@ -225,8 +225,8 @@ ieee_write_int (abfd, value)
     {
       unsigned int length;
 
-      /* How many significant bytes ? */
-      /* FIXME FOR LONGER INTS */
+      /* How many significant bytes ?  */
+      /* FIXME FOR LONGER INTS */
       if (value & 0xff000000)
        length = 4;
       else if (value & 0x00ff0000)
@@ -301,10 +301,8 @@ ieee_write_id (abfd, id)
   return TRUE;
 }
 \f
-/***************************************************************************
-Functions for reading from ieee files in the strange way that the
-standard requires:
-*/
+/* Functions for reading from ieee files in the strange way that the
+   standard requires.  */
 
 #define this_byte(ieee) *((ieee)->input_p)
 #define next_byte(ieee) ((ieee)->input_p++)
@@ -316,6 +314,7 @@ read_2bytes (ieee)
 {
   unsigned char c1 = this_byte_and_next (ieee);
   unsigned char c2 = this_byte_and_next (ieee);
+
   return (c1 << 8) | c2;
 }
 
@@ -326,10 +325,9 @@ bfd_get_string (ieee, string, length)
      size_t length;
 {
   size_t i;
+
   for (i = 0; i < length; i++)
-    {
-      string[i] = this_byte_and_next (ieee);
-    }
+    string[i] = this_byte_and_next (ieee);
 }
 
 static char *
@@ -338,23 +336,25 @@ read_id (ieee)
 {
   size_t length;
   char *string;
+
   length = this_byte_and_next (ieee);
   if (length <= 0x7f)
     {
-      /* Simple string of length 0 to 127 */
+      /* Simple string of length 0 to 127 */
     }
   else if (length == 0xde)
     {
-      /* Length is next byte, allowing 0..255 */
+      /* Length is next byte, allowing 0..255 */
       length = this_byte_and_next (ieee);
     }
   else if (length == 0xdf)
     {
-      /* Length is next two bytes, allowing 0..65535 */
+      /* Length is next two bytes, allowing 0..65535 */
       length = this_byte_and_next (ieee);
       length = (length * 256) + this_byte_and_next (ieee);
     }
-  /* Buy memory and read string */
+
+  /* Buy memory and read string.  */
   string = bfd_alloc (ieee->abfd, (bfd_size_type) length + 1);
   if (!string)
     return NULL;
@@ -380,57 +380,63 @@ ieee_write_expression (abfd, value, symbol, pcrel, index)
       term_count++;
     }
 
-  if (bfd_is_com_section (symbol->section)
-      || bfd_is_und_section (symbol->section))
-    {
-      /* Def of a common symbol */
-      if (! ieee_write_byte (abfd, ieee_variable_X_enum)
-         || ! ieee_write_int (abfd, symbol->value))
-       return FALSE;
-      term_count++;
-    }
-  else if (! bfd_is_abs_section (symbol->section))
+  /* Badly formatted binaries can have a missing symbol,
+     so test here to prevent a seg fault.  */
+  if (symbol != NULL)
     {
-      /* Ref to defined symbol - */
-
-      if (symbol->flags & BSF_GLOBAL)
+      if (bfd_is_com_section (symbol->section)
+         || bfd_is_und_section (symbol->section))
        {
-         if (! ieee_write_byte (abfd, ieee_variable_I_enum)
+         /* Def of a common symbol.  */
+         if (! ieee_write_byte (abfd, ieee_variable_X_enum)
              || ! ieee_write_int (abfd, symbol->value))
            return FALSE;
-         term_count++;
+         term_count ++;
        }
-      else if (symbol->flags & (BSF_LOCAL | BSF_SECTION_SYM))
+      else if (! bfd_is_abs_section (symbol->section))
        {
-         /* This is a reference to a defined local symbol.  We can
-            easily do a local as a section+offset.  */
-         if (! ieee_write_byte (abfd, ieee_variable_R_enum)
-             || ! ieee_write_byte (abfd,
-                                   (bfd_byte) (symbol->section->index
-                                               + IEEE_SECTION_NUMBER_BASE)))
-           return FALSE;
-         term_count++;
-         if (symbol->value != 0)
+         /* Ref to defined symbol -  */
+
+         if (symbol->flags & BSF_GLOBAL)
            {
-             if (! ieee_write_int (abfd, symbol->value))
+             if (! ieee_write_byte (abfd, ieee_variable_I_enum)
+                 || ! ieee_write_int (abfd, symbol->value))
                return FALSE;
              term_count++;
            }
-       }
-      else
-       {
-         (*_bfd_error_handler)
-           (_("%s: unrecognized symbol `%s' flags 0x%x"),
-            bfd_get_filename (abfd), bfd_asymbol_name (symbol),
-            symbol->flags);
-         bfd_set_error (bfd_error_invalid_operation);
-         return FALSE;
+         else if (symbol->flags & (BSF_LOCAL | BSF_SECTION_SYM))
+           {
+             /* This is a reference to a defined local symbol.  We can
+                easily do a local as a section+offset.  */
+             if (! ieee_write_byte (abfd, ieee_variable_R_enum)
+                 || ! ieee_write_byte (abfd,
+                                       (bfd_byte) (symbol->section->index
+                                                   + IEEE_SECTION_NUMBER_BASE)))
+               return FALSE;
+
+             term_count++;
+             if (symbol->value != 0)
+               {
+                 if (! ieee_write_int (abfd, symbol->value))
+                   return FALSE;
+                 term_count++;
+               }
+           }
+         else
+           {
+             (*_bfd_error_handler)
+               (_("%s: unrecognized symbol `%s' flags 0x%x"),
+                bfd_get_filename (abfd), bfd_asymbol_name (symbol),
+                symbol->flags);
+             bfd_set_error (bfd_error_invalid_operation);
+             return FALSE;
+           }
        }
     }
 
   if (pcrel)
     {
-      /* subtract the pc from here by asking for PC of this section*/
+      /* Subtract the pc from here by asking for PC of this section.  */
       if (! ieee_write_byte (abfd, ieee_variable_P_enum)
          || ! ieee_write_byte (abfd,
                                (bfd_byte) (index + IEEE_SECTION_NUMBER_BASE))
@@ -440,10 +446,8 @@ ieee_write_expression (abfd, value, symbol, pcrel, index)
 
   /* Handle the degenerate case of a 0 address.  */
   if (term_count == 0)
-    {
-      if (! ieee_write_int (abfd, (bfd_vma) 0))
-       return FALSE;
-    }
+    if (! ieee_write_int (abfd, (bfd_vma) 0))
+      return FALSE;
 
   while (term_count > 1)
     {
@@ -455,11 +459,8 @@ ieee_write_expression (abfd, value, symbol, pcrel, index)
   return TRUE;
 }
 \f
-/*****************************************************************************/
+/* Writes any integer into the buffer supplied and always takes 5 bytes.  */
 
-/*
-writes any integer into the buffer supplied and always takes 5 bytes
-*/
 static void
 ieee_write_int5 (buffer, value)
      bfd_byte *buffer;
@@ -492,6 +493,7 @@ parse_int (ieee, value_ptr)
 {
   int value = this_byte (ieee);
   int result;
+
   if (value >= 0 && value <= 127)
     {
       *value_ptr = value;
@@ -501,6 +503,7 @@ parse_int (ieee, value_ptr)
   else if (value >= 0x80 && value <= 0x88)
     {
       unsigned int count = value & 0xf;
+
       result = 0;
       next_byte (ieee);
       while (count)
@@ -664,7 +667,7 @@ parse_expression (ieee, value, symbol, pcrel, extra, section)
   bfd_boolean loop = TRUE;
   ieee_value_type stack[10];
 
-  /* The stack pointer always points to the next unused location */
+  /* The stack pointer always points to the next unused location */
 #define PUSH(x,y,z) TOS.symbol=x;TOS.section=y;TOS.value=z;INC;
 #define POP(x,y,z) DEC;x=TOS.symbol;y=TOS.section;z=TOS.value;
   ieee_value_type *sp = stack;
@@ -675,9 +678,10 @@ parse_expression (ieee, value, symbol, pcrel, extra, section)
       switch (this_byte (&(ieee->h)))
        {
        case ieee_variable_P_enum:
-         /* P variable, current program counter for section n */
+         /* P variable, current program counter for section n */
          {
            int section_n;
+
            next_byte (&(ieee->h));
            *pcrel = TRUE;
            section_n = must_parse_int (&(ieee->h));
@@ -685,25 +689,25 @@ parse_expression (ieee, value, symbol, pcrel, extra, section)
            break;
          }
        case ieee_variable_L_enum:
-         /* L variable  address of section N */
+         /* L variable  address of section N */
          next_byte (&(ieee->h));
          PUSH (NOSYMBOL, ieee->section_table[must_parse_int (&(ieee->h))], 0);
          break;
        case ieee_variable_R_enum:
-         /* R variable, logical address of section module */
-         /* FIXME, this should be different to L */
+         /* R variable, logical address of section module */
+         /* FIXME, this should be different to L */
          next_byte (&(ieee->h));
          PUSH (NOSYMBOL, ieee->section_table[must_parse_int (&(ieee->h))], 0);
          break;
        case ieee_variable_S_enum:
-         /* S variable, size in MAUS of section module */
+         /* S variable, size in MAUS of section module */
          next_byte (&(ieee->h));
          PUSH (NOSYMBOL,
                0,
                ieee->section_table[must_parse_int (&(ieee->h))]->_raw_size);
          break;
        case ieee_variable_I_enum:
-         /* Push the address of variable n */
+         /* Push the address of variable n */
          {
            ieee_symbol_index_type sy;
            next_byte (&(ieee->h));
@@ -714,7 +718,7 @@ parse_expression (ieee, value, symbol, pcrel, extra, section)
          }
          break;
        case ieee_variable_X_enum:
-         /* Push the address of external variable n */
+         /* Push the address of external variable n */
          {
            ieee_symbol_index_type sy;
            next_byte (&(ieee->h));
@@ -776,7 +780,6 @@ parse_expression (ieee, value, symbol, pcrel, extra, section)
      terms.  We can tell if that's the case by ensuring that
      sp == stack here.  If not, then we've pushed something too far,
      so we keep adding.  */
-
   while (sp != stack + 1)
     {
       asection *section1;
@@ -822,7 +825,7 @@ ieee_part_after (ieee, here)
 }
 
 static unsigned int last_index;
-static char last_type;         /* is the index for an X or a D */
+static char last_type;         /* Is the index for an X or a D.  */
 
 static ieee_symbol_type *
 get_symbol (abfd, ieee, last_symbol, symbol_count, pptr, max_index, this_type)
@@ -834,8 +837,9 @@ get_symbol (abfd, ieee, last_symbol, symbol_count, pptr, max_index, this_type)
      unsigned int *max_index;
      int this_type;
 {
-  /* Need a new symbol */
+  /* Need a new symbol */
   unsigned int new_index = must_parse_int (&(ieee->h));
+
   if (new_index != last_index || this_type != last_type)
     {
       ieee_symbol_type *new_symbol;
@@ -851,9 +855,8 @@ get_symbol (abfd, ieee, last_symbol, symbol_count, pptr, max_index, this_type)
       **pptr = new_symbol;
       *pptr = &new_symbol->next;
       if (new_index > *max_index)
-       {
-         *max_index = new_index;
-       }
+       *max_index = new_index;
+
       last_type = this_type;
       new_symbol->symbol.section = bfd_abs_section_ptr;
       return new_symbol;
@@ -941,7 +944,7 @@ ieee_slurp_external_symbols (abfd)
                  }
                break;
              case ieee_external_reference_info_record_enum:
-               /* Skip over ATX record. */
+               /* Skip over ATX record.  */
                parse_int (&(ieee->h), &value);
                parse_int (&(ieee->h), &value);
                parse_int (&(ieee->h), &value);
@@ -950,7 +953,7 @@ ieee_slurp_external_symbols (abfd)
              case ieee_atn_record_enum:
                /* We may get call optimization information here,
                   which we just ignore.  The format is
-                  {$F1}${CE}{index}{$00}{$3F}{$3F}{#_of_ASNs} */
+                  {$F1}${CE}{index}{$00}{$3F}{$3F}{#_of_ASNs} */
                parse_int (&ieee->h, &value);
                parse_int (&ieee->h, &value);
                parse_int (&ieee->h, &value);
@@ -1036,16 +1039,16 @@ ieee_slurp_external_symbols (abfd)
            bfd_vma size;
            bfd_vma value;
            next_byte (&(ieee->h));
-           /* Throw away the external reference index */
+           /* Throw away the external reference index */
            (void) must_parse_int (&(ieee->h));
-           /* Fetch the default size if not resolved */
+           /* Fetch the default size if not resolved */
            size = must_parse_int (&(ieee->h));
-           /* Fetch the defautlt value if available */
+           /* Fetch the defautlt value if available */
            if (! parse_int (&(ieee->h), &value))
              {
                value = 0;
              }
-           /* This turns into a common */
+           /* This turns into a common */
            symbol->symbol.section = bfd_com_section_ptr;
            symbol->symbol.value = size;
          }
@@ -1136,10 +1139,8 @@ ieee_get_symtab_upper_bound (abfd)
     (abfd->symcount + 1) * (sizeof (ieee_symbol_type *)) : 0;
 }
 
-/*
-Move from our internal lists to the canon table, and insert in
-symbol index order
-*/
+/* Move from our internal lists to the canon table, and insert in
+   symbol index order.  */
 
 extern const bfd_target ieee_vec;
 
@@ -1172,41 +1173,35 @@ ieee_get_symtab (abfd, location)
 
       if (! ieee->symbol_table_full)
        {
-         /* Arrgh - there are gaps in the table, run through and fill them */
-         /* up with pointers to a null place */
+         /* Arrgh - there are gaps in the table, run through and fill them
+            up with pointers to a null place.  */
          unsigned int i;
+
          for (i = 0; i < abfd->symcount; i++)
-           {
-             location[i] = &empty_symbol;
-           }
+           location[i] = &empty_symbol;
        }
 
       ieee->external_symbol_base_offset = -ieee->external_symbol_min_index;
       for (symp = IEEE_DATA (abfd)->external_symbols;
           symp != (ieee_symbol_type *) NULL;
           symp = symp->next)
-       {
-         /* Place into table at correct index locations */
-         location[symp->index + ieee->external_symbol_base_offset] = &symp->symbol;
-       }
+       /* Place into table at correct index locations.  */
+       location[symp->index + ieee->external_symbol_base_offset] = &symp->symbol;
 
-      /* The external refs are indexed in a bit */
+      /* The external refs are indexed in a bit */
       ieee->external_reference_base_offset =
        -ieee->external_reference_min_index + ieee->external_symbol_count;
 
       for (symp = IEEE_DATA (abfd)->external_reference;
           symp != (ieee_symbol_type *) NULL;
           symp = symp->next)
-       {
-         location[symp->index + ieee->external_reference_base_offset] =
-           &symp->symbol;
-
-       }
+       location[symp->index + ieee->external_reference_base_offset] =
+         &symp->symbol;
     }
+
   if (abfd->symcount)
-    {
-      location[abfd->symcount] = (asymbol *) NULL;
-    }
+    location[abfd->symcount] = (asymbol *) NULL;
+
   return abfd->symcount;
 }
 
@@ -1286,34 +1281,33 @@ ieee_slurp_sections (abfd)
                section_type[0] = this_byte_and_next (&(ieee->h));
 
                /* Set minimal section attributes. Attributes are
-                  extended later, based on section contents. */
-
+                  extended later, based on section contents.  */
                switch (section_type[0])
                  {
                  case 0xC1:
-                   /* Normal attributes for absolute sections  */
+                   /* Normal attributes for absolute sections.  */
                    section_type[1] = this_byte (&(ieee->h));
                    section->flags = SEC_ALLOC;
                    switch (section_type[1])
                      {
-                     case 0xD3:        /* AS Absolute section attributes */
+                     case 0xD3:        /* AS Absolute section attributes */
                        next_byte (&(ieee->h));
                        section_type[2] = this_byte (&(ieee->h));
                        switch (section_type[2])
                          {
                          case 0xD0:
-                           /* Normal code */
+                           /* Normal code */
                            next_byte (&(ieee->h));
                            section->flags |= SEC_CODE;
                            break;
                          case 0xC4:
-                           /* Normal data */
+                           /* Normal data */
                            next_byte (&(ieee->h));
                            section->flags |= SEC_DATA;
                            break;
                          case 0xD2:
                            next_byte (&(ieee->h));
-                           /* Normal rom data */
+                           /* Normal rom data */
                            section->flags |= SEC_ROM | SEC_DATA;
                            break;
                          default:
@@ -1321,20 +1315,20 @@ ieee_slurp_sections (abfd)
                          }
                      }
                    break;
-                 case 0xC3:    /* Named relocatable sections (type C) */
+                 case 0xC3:    /* Named relocatable sections (type C) */
                    section_type[1] = this_byte (&(ieee->h));
                    section->flags = SEC_ALLOC;
                    switch (section_type[1])
                      {
-                     case 0xD0:        /* Normal code (CP) */
+                     case 0xD0:        /* Normal code (CP) */
                        next_byte (&(ieee->h));
                        section->flags |= SEC_CODE;
                        break;
-                     case 0xC4:        /* Normal data (CD) */
+                     case 0xC4:        /* Normal data (CD) */
                        next_byte (&(ieee->h));
                        section->flags |= SEC_DATA;
                        break;
-                     case 0xD2:        /* Normal rom data (CR) */
+                     case 0xD2:        /* Normal rom data (CR) */
                        next_byte (&(ieee->h));
                        section->flags |= SEC_ROM | SEC_DATA;
                        break;
@@ -1343,12 +1337,12 @@ ieee_slurp_sections (abfd)
                      }
                  }
 
-               /* Read section name, use it if non empty. */
+               /* Read section name, use it if non empty.  */
                name = read_id (&ieee->h);
                if (name[0])
                  section->name = name;
 
-               /* Skip these fields, which we don't care about */
+               /* Skip these fields, which we don't care about */
                {
                  bfd_vma parent, brother, context;
                  parse_int (&(ieee->h), &parent);
@@ -1452,9 +1446,7 @@ ieee_slurp_debug (abfd)
   return TRUE;
 }
 \f
-/***********************************************************************
-*  archive stuff
-*/
+/* Archive stuff.  */
 
 const bfd_target *
 ieee_archive_p (abfd)
@@ -1640,11 +1632,9 @@ ieee_object_p (abfd)
     goto got_wrong_format;
   ieee->mb.module_name = read_id (&(ieee->h));
   if (abfd->filename == (const char *) NULL)
-    {
-      abfd->filename = ieee->mb.module_name;
-    }
-  /* Determine the architecture and machine type of the object file.
-     */
+    abfd->filename = ieee->mb.module_name;
+
+  /* Determine the architecture and machine type of the object file.  */
   {
     const bfd_arch_info_type *arch;
     char family[10];
@@ -1685,7 +1675,7 @@ ieee_object_p (abfd)
          }
        else if (TOUPPER (processor[3]) == 'F')  /* 68F333 */
          strcpy (family, "68332");                /* CPU32 */
-       else if ((TOUPPER (processor[3]) == 'C') /* Embedded controllers */
+       else if ((TOUPPER (processor[3]) == 'C') /* Embedded controllers */
                 && ((TOUPPER (processor[2]) == 'E')
                     || (TOUPPER (processor[2]) == 'H')
                     || (TOUPPER (processor[2]) == 'L')))
@@ -1694,7 +1684,7 @@ ieee_object_p (abfd)
            strncat (family, processor + 4, 7);
            family[9] = '\0';
          }
-       else                             /* "Regular" processors */
+       else                             /* "Regular" processors */
          {
            strncpy (family, processor, 9);
            family[9] = '\0';
@@ -1716,43 +1706,34 @@ ieee_object_p (abfd)
   }
 
   if (this_byte (&(ieee->h)) != (int) ieee_address_descriptor_enum)
-    {
-      goto fail;
-    }
+    goto fail;
+
   next_byte (&(ieee->h));
 
   if (! parse_int (&(ieee->h), &ieee->ad.number_of_bits_mau))
-    {
-      goto fail;
-    }
+    goto fail;
+
   if (! parse_int (&(ieee->h), &ieee->ad.number_of_maus_in_address))
-    {
-      goto fail;
-    }
+    goto fail;
 
-  /* If there is a byte order info, take it */
-  if (this_byte (&(ieee->h)) == (int) ieee_variable_L_enum ||
-      this_byte (&(ieee->h)) == (int) ieee_variable_M_enum)
+  /* If there is a byte order info, take it */
+  if (this_byte (&(ieee->h)) == (int) ieee_variable_L_enum
+      || this_byte (&(ieee->h)) == (int) ieee_variable_M_enum)
     next_byte (&(ieee->h));
 
   for (part = 0; part < N_W_VARIABLES; part++)
     {
       bfd_boolean ok;
+
       if (read_2bytes (&(ieee->h)) != (int) ieee_assign_value_to_variable_enum)
-       {
-         goto fail;
-       }
+       goto fail;
+
       if (this_byte_and_next (&(ieee->h)) != part)
-       {
-         goto fail;
-       }
+       goto fail;
 
       ieee->w.offset[part] = parse_i (&(ieee->h), &ok);
       if (! ok)
-       {
-         goto fail;
-       }
-
+       goto fail;
     }
 
   if (ieee->w.r.external_part != 0)
@@ -1761,7 +1742,7 @@ ieee_object_p (abfd)
   /* By now we know that this is a real IEEE file, we're going to read
      the whole thing into memory so that we can run up and down it
      quickly.  We can work out how big the file is from the trailer
-     record */
+     record */
 
   amt = ieee->w.r.me_record + 1;
   IEEE_DATA (abfd)->h.first_byte =
@@ -1782,7 +1763,6 @@ ieee_object_p (abfd)
 
   /* Parse section data to activate file and section flags implied by
      section contents. */
-
   if (! ieee_slurp_section_data (abfd))
     goto fail;
 
@@ -1835,6 +1815,7 @@ ieee_print_symbol (abfd, afile, symbol, how)
          (symbol->section == (asection *) NULL
           ? "*abs"
           : symbol->section->name);
+
        if (symbol->name[0] == ' ')
          {
            fprintf (file, "* empty table entry ");
@@ -1868,6 +1849,7 @@ do_one (ieee, current_map, location_ptr, s, iterations)
       {
        unsigned int number_of_maus;
        unsigned int i;
+
        next_byte (&(ieee->h));
        number_of_maus = must_parse_int (&(ieee->h));
 
@@ -1882,6 +1864,7 @@ do_one (ieee, current_map, location_ptr, s, iterations)
     case ieee_load_with_relocation_enum:
       {
        bfd_boolean loop = TRUE;
+
        next_byte (&(ieee->h));
        while (loop)
          {
@@ -1923,7 +1906,7 @@ do_one (ieee, current_map, location_ptr, s, iterations)
                  if (this_byte (&(ieee->h)) == (int) ieee_comma)
                    {
                      next_byte (&(ieee->h));
-                     /* Fetch number of bytes to pad */
+                     /* Fetch number of bytes to pad */
                      extra = must_parse_int (&(ieee->h));
                    };
 
@@ -1941,7 +1924,7 @@ do_one (ieee, current_map, location_ptr, s, iterations)
                    default:
                      break;
                    }
-                 /* Build a relocation entry for this type */
+                 /* Build a relocation entry for this type */
                  /* If pc rel then stick -ve pc into instruction
                     and take out of reloc ..
 
@@ -2053,7 +2036,8 @@ do_one (ieee, current_map, location_ptr, s, iterations)
   return TRUE;
 }
 
-/* Read in all the section data and relocation stuff too */
+/* Read in all the section data and relocation stuff too.  */
+
 static bfd_boolean
 ieee_slurp_section_data (abfd)
      bfd *abfd;
@@ -2064,14 +2048,13 @@ ieee_slurp_section_data (abfd)
 
   ieee_per_section_type *current_map = (ieee_per_section_type *) NULL;
   asection *s;
-  /* Seek to the start of the data area */
+  /* Seek to the start of the data area */
   if (ieee->read_data)
     return TRUE;
   ieee->read_data = TRUE;
   ieee_seek (ieee, ieee->w.r.data_part);
 
-  /* Allocate enough space for all the section contents */
-
+  /* Allocate enough space for all the section contents.  */
   for (s = abfd->sections; s != (asection *) NULL; s = s->next)
     {
       ieee_per_section_type *per = ieee_per_section (s);
@@ -2080,7 +2063,6 @@ ieee_slurp_section_data (abfd)
       per->data = (bfd_byte *) bfd_alloc (ieee->h.abfd, s->_raw_size);
       if (!per->data)
        return FALSE;
-      /*SUPPRESS 68*/
       per->reloc_tail_ptr =
        (ieee_reloc_type **) & (s->relocation);
     }
@@ -2089,7 +2071,7 @@ ieee_slurp_section_data (abfd)
     {
       switch (this_byte (&(ieee->h)))
        {
-         /* IF we see anything strange then quit */
+         /* IF we see anything strange then quit */
        default:
          return TRUE;
 
@@ -2100,9 +2082,9 @@ ieee_slurp_section_data (abfd)
          s->flags |= SEC_LOAD | SEC_HAS_CONTENTS;
          current_map = ieee_per_section (s);
          location_ptr = current_map->data - s->vma;
-         /* The document I have says that Microtec's compilers reset */
-         /* this after a sec section, even though the standard says not */
-         /* to. SO .. */
+         /* The document I have says that Microtec's compilers reset
+            this after a sec section, even though the standard says not
+            to, SO...  */
          current_map->pc = s->vma;
          break;
 
@@ -2116,8 +2098,9 @@ ieee_slurp_section_data (abfd)
                ieee_symbol_index_type symbol;
                unsigned int extra;
                bfd_boolean pcrel;
+
                next_byte (&(ieee->h));
-               must_parse_int (&(ieee->h));    /* Throw away section #*/
+               must_parse_int (&(ieee->h));    /* Throw away section #.  */
                parse_expression (ieee, &value,
                                  &symbol,
                                  &pcrel, &extra,
@@ -2132,7 +2115,7 @@ ieee_slurp_section_data (abfd)
              if (this_byte (&(ieee->h)) == ieee_function_either_open_b_enum)
                next_byte (&(ieee->h));
              abfd->start_address = must_parse_int (&(ieee->h));
-             /* We've got to the end of the data now - */
+             /* We've got to the end of the data now -  */
              return TRUE;
            default:
              BFD_FAIL ();
@@ -2142,18 +2125,17 @@ ieee_slurp_section_data (abfd)
        case ieee_repeat_data_enum:
          {
            /* Repeat the following LD or LR n times - we do this by
-                remembering the stream pointer before running it and
-                resetting it and running it n times. We special case
-                the repetition of a repeat_data/load_constant
-                */
-
+              remembering the stream pointer before running it and
+              resetting it and running it n times. We special case
+              the repetition of a repeat_data/load_constant.  */
            unsigned int iterations;
            unsigned char *start;
+
            next_byte (&(ieee->h));
            iterations = must_parse_int (&(ieee->h));
            start = ieee->h.input_p;
-           if (start[0] == (int) ieee_load_constant_bytes_enum &&
-               start[1] == 1)
+           if (start[0] == (int) ieee_load_constant_bytes_enum
+               && start[1] == 1)
              {
                while (iterations != 0)
                  {
@@ -2179,10 +2161,8 @@ ieee_slurp_section_data (abfd)
          break;
        case ieee_load_constant_bytes_enum:
        case ieee_load_with_relocation_enum:
-         {
-           if (!do_one (ieee, current_map, location_ptr, s, 1))
-             return FALSE;
-         }
+         if (!do_one (ieee, current_map, location_ptr, s, 1))
+           return FALSE;
        }
     }
 }
@@ -2245,7 +2225,7 @@ ieee_canonicalize_reloc (abfd, section, relptr, symbols)
 
   while (src != (ieee_reloc_type *) NULL)
     {
-      /* Work out which symbol to attach it this reloc to */
+      /* Work out which symbol to attach it this reloc to */
       switch (src->symbol.letter)
        {
        case 'I':
@@ -2304,7 +2284,7 @@ ieee_write_section_part (abfd)
 
          if (abfd->flags & EXEC_P)
            {
-             /* This image is executable, so output absolute sections */
+             /* This image is executable, so output absolute sections */
              if (! ieee_write_byte (abfd, ieee_variable_A_enum)
                  || ! ieee_write_byte (abfd, ieee_variable_S_enum))
                return FALSE;
@@ -2343,7 +2323,7 @@ ieee_write_section_part (abfd)
          ieee_write_int (abfd, 0);     /* Brother */
          ieee_write_int (abfd, 0);     /* Context */
 #endif
-         /* Alignment */
+         /* Alignment */
          if (! ieee_write_byte (abfd, ieee_section_alignment_enum)
              || ! ieee_write_byte (abfd,
                                    (bfd_byte) (s->index
@@ -2351,7 +2331,7 @@ ieee_write_section_part (abfd)
              || ! ieee_write_int (abfd, (bfd_vma) 1 << s->alignment_power))
            return FALSE;
 
-         /* Size */
+         /* Size */
          if (! ieee_write_2bytes (abfd, ieee_section_size_enum)
              || ! ieee_write_byte (abfd,
                                    (bfd_byte) (s->index
@@ -2360,8 +2340,8 @@ ieee_write_section_part (abfd)
            return FALSE;
          if (abfd->flags & EXEC_P)
            {
-             /* Relocateable sections don't have asl records */
-             /* Vma */
+             /* Relocateable sections don't have asl records */
+             /* Vma */
              if (! ieee_write_2bytes (abfd, ieee_section_base_address_enum)
                  || ! ieee_write_byte (abfd,
                                        ((bfd_byte)
@@ -2394,7 +2374,7 @@ do_with_relocs (abfd, s)
         sizeof (arelent **),
         comp);
 
-  /* Output the section preheader */
+  /* Output the section preheader */
   if (! ieee_write_byte (abfd, ieee_set_current_section_enum)
       || ! ieee_write_byte (abfd,
                            (bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE))
@@ -2417,23 +2397,21 @@ do_with_relocs (abfd, s)
   if (relocs_to_go == 0)
     {
       /* If there aren't any relocations then output the load constant
-        byte opcode rather than the load with relocation opcode */
-
+        byte opcode rather than the load with relocation opcode.  */
       while (current_byte_index < s->_raw_size)
        {
          bfd_size_type run;
          unsigned int MAXRUN = 127;
+
          run = MAXRUN;
          if (run > s->_raw_size - current_byte_index)
-           {
-             run = s->_raw_size - current_byte_index;
-           }
+           run = s->_raw_size - current_byte_index;
 
          if (run != 0)
            {
              if (! ieee_write_byte (abfd, ieee_load_constant_bytes_enum))
                return FALSE;
-             /* Output a stream of bytes */
+             /* Output a stream of bytes */
              if (! ieee_write_int (abfd, run))
                return FALSE;
              if (bfd_bwrite ((PTR) (stream + current_byte_index), run, abfd)
@@ -2454,7 +2432,7 @@ do_with_relocs (abfd, s)
 
       if ((PTR) stream == (PTR) NULL)
        {
-         /* Outputting a section without data, fill it up */
+         /* Outputting a section without data, fill it up */
          stream = (unsigned char *) bfd_zalloc (abfd, s->_raw_size);
          if (!stream)
            return FALSE;
@@ -2463,6 +2441,7 @@ do_with_relocs (abfd, s)
        {
          bfd_size_type run;
          unsigned int MAXRUN = 127;
+
          if (relocs_to_go)
            {
              run = (*p)->address - current_byte_index;
@@ -2470,17 +2449,14 @@ do_with_relocs (abfd, s)
                run = MAXRUN;
            }
          else
-           {
-             run = MAXRUN;
-           }
+           run = MAXRUN;
+
          if (run > s->_raw_size - current_byte_index)
-           {
-             run = s->_raw_size - current_byte_index;
-           }
+           run = s->_raw_size - current_byte_index;
 
          if (run != 0)
            {
-             /* Output a stream of bytes */
+             /* Output a stream of bytes */
              if (! ieee_write_int (abfd, run))
                return FALSE;
              if (bfd_bwrite ((PTR) (stream + current_byte_index), run, abfd)
@@ -2488,7 +2464,8 @@ do_with_relocs (abfd, s)
                return FALSE;
              current_byte_index += run;
            }
-         /* Output any relocations here */
+
+         /* Output any relocations here.  */
          if (relocs_to_go && (*p) && (*p)->address == current_byte_index)
            {
              while (relocs_to_go
@@ -2496,14 +2473,10 @@ do_with_relocs (abfd, s)
                {
                  arelent *r = *p;
                  bfd_signed_vma ov;
-
 #if 0
                  if (r->howto->pc_relative)
-                   {
-                     r->addend += current_byte_index;
-                   }
+                   r->addend += current_byte_index;
 #endif
-
                  switch (r->howto->size)
                    {
                    case 2:
@@ -2638,6 +2611,7 @@ do_without_relocs (abfd, s)
   else
     {
       unsigned int i;
+
       for (i = 0; i < s->_raw_size; i++)
        {
          if (stream[i] != 0)
@@ -2699,6 +2673,7 @@ static void
 flush ()
 {
   bfd_size_type amt = output_ptr - output_ptr_start;
+
   if (bfd_bwrite ((PTR) (output_ptr_start), amt, output_bfd) != amt)
     abort ();
   output_ptr = output_ptr_start;
@@ -2720,20 +2695,14 @@ write_int (value)
   else
     {
       unsigned int length;
-      /* How many significant bytes ? */
-      /* FIXME FOR LONGER INTS */
+      /* How many significant bytes ?  */
+      /* FIXME FOR LONGER INTS */
       if (value & 0xff000000)
-       {
-         length = 4;
-       }
+       length = 4;
       else if (value & 0x00ff0000)
-       {
-         length = 3;
-       }
+       length = 3;
       else if (value & 0x0000ff00)
-       {
-         length = 2;
-       }
+       length = 2;
       else
        length = 1;
 
@@ -2749,7 +2718,6 @@ write_int (value)
        case 1:
          OUT (value);
        }
-
     }
 }
 
@@ -2758,6 +2726,7 @@ copy_id ()
 {
   int length = THIS ();
   char ch;
+
   OUT (length);
   NEXT ();
   while (length--)
@@ -2775,6 +2744,7 @@ copy_expression ()
   int stack[10];
   int *tos = stack;
   int value;
+
   while (1)
     {
       switch (THIS ())
@@ -2822,7 +2792,7 @@ copy_expression ()
        default:
          if (THIS () > 0x84)
            {
-             /* Not a number, just bug out with the answer */
+             /* Not a number, just bug out with the answer */
              write_int (*(--tos));
              return;
            }
@@ -2830,7 +2800,7 @@ copy_expression ()
          NEXT ();
          break;
        case 0xa5:
-         /* PLUS anything */
+         /* PLUS anything */
          value = *(--tos);
          value += *(--tos);
          *tos++ = value;
@@ -2841,6 +2811,7 @@ copy_expression ()
            int section_number;
            ieee_data_type *ieee;
            asection *s;
+
            NEXT ();
            section_number = THIS ();
 
@@ -2874,7 +2845,7 @@ fill_int (buf)
 {
   if (buf->buffer == output_buffer)
     {
-      /* Still a chance to output the size */
+      /* Still a chance to output the size */
       int value = output_ptr - buf->ptrp + 3;
       buf->ptrp[0] = value >> 24;
       buf->ptrp[1] = value >> 16;
@@ -2889,6 +2860,7 @@ drop_int (buf)
 {
   int type = THIS ();
   int ch;
+
   if (type <= 0x84)
     {
       NEXT ();
@@ -2962,7 +2934,8 @@ static void
 f1_record ()
 {
   int ch;
-  /* ATN record */
+
+  /* ATN record.  */
   NEXT ();
   ch = THIS ();
   switch (ch)
@@ -3002,7 +2975,7 @@ f1_record ()
        }
       break;
     case 0xd8:
-      /* EXternal ref */
+      /* EXternal ref */
       NEXT ();
       OUT (0xf1);
       OUT (0xd8);
@@ -3056,13 +3029,12 @@ f1_record ()
          break;
        }
     }
-
 }
 
 static void
 f0_record ()
 {
-  /* Attribute record */
+  /* Attribute record */
   NEXT ();
   OUT (0xf0);
   INTn (Symbol name);
@@ -3073,6 +3045,7 @@ static void
 copy_till_end ()
 {
   int ch = THIS ();
+
   while (1)
     {
       while (ch <= 0x80)
@@ -3131,11 +3104,12 @@ f8_record ()
     case 0x01:
     case 0x02:
     case 0x03:
-      /* Unique typedefs for module */
-      /* GLobal typedefs  */
-      /* High level module scope beginning */
+      /* Unique typedefs for module */
+      /* GLobal typedefs  */
+      /* High level module scope beginning */
       {
        struct output_buffer_struct ob;
+
        NEXT ();
        OUT (0xf8);
        OUT (ch);
@@ -3150,9 +3124,10 @@ f8_record ()
       }
       break;
     case 0x04:
-      /* Global function */
+      /* Global function */
       {
        struct output_buffer_struct ob;
+
        NEXT ();
        OUT (0xf8);
        OUT (0x04);
@@ -3172,9 +3147,10 @@ f8_record ()
       break;
 
     case 0x05:
-      /* File name for source line numbers */
+      /* File name for source line numbers */
       {
        struct output_buffer_struct ob;
+
        NEXT ();
        OUT (0xf8);
        OUT (0x05);
@@ -3194,9 +3170,10 @@ f8_record ()
       break;
 
     case 0x06:
-      /* Local function */
+      /* Local function */
       {
        struct output_buffer_struct ob;
+
        NEXT ();
        OUT (0xf8);
        OUT (0x06);
@@ -3214,7 +3191,7 @@ f8_record ()
       break;
 
     case 0x0a:
-      /* Assembler module scope beginning -*/
+      /* Assembler module scope beginning -  */
       {
        struct output_buffer_struct ob;
 
@@ -3243,6 +3220,7 @@ f8_record ()
     case 0x0b:
       {
        struct output_buffer_struct ob;
+
        NEXT ();
        OUT (0xf8);
        OUT (0x0b);
@@ -3279,6 +3257,7 @@ static void
 block ()
 {
   int ch;
+
   while (1)
     {
       ch = THIS ();
@@ -3310,11 +3289,8 @@ block ()
 }
 
 
-
-/* relocate_debug,
-   moves all the debug information from the source bfd to the output
-   bfd, and relocates any expressions it finds
-*/
+/* Moves all the debug information from the source bfd to the output
+   bfd, and relocates any expressions it finds.  */
 
 static void
 relocate_debug (output, input)
@@ -3375,6 +3351,7 @@ ieee_write_debug_part (abfd)
        {
          bfd *entry = chain->this;
          ieee_data_type *entry_ieee = IEEE_DATA (entry);
+
          if (entry_ieee->w.r.debug_information_part)
            {
              if (bfd_seek (entry, entry_ieee->w.r.debug_information_part,
@@ -3385,14 +3362,11 @@ ieee_write_debug_part (abfd)
 
          chain = chain->next;
        }
+
       if (some_debug)
-       {
-         ieee->w.r.debug_information_part = here;
-       }
+       ieee->w.r.debug_information_part = here;
       else
-       {
-         ieee->w.r.debug_information_part = 0;
-       }
+       ieee->w.r.debug_information_part = 0;
 
       flush ();
     }
@@ -3407,8 +3381,10 @@ ieee_write_data_part (abfd)
      bfd *abfd;
 {
   asection *s;
+
   ieee_data_type *ieee = IEEE_DATA (abfd);
   ieee->w.r.data_part = bfd_tell (abfd);
+
   for (s = abfd->sections; s != (asection *) NULL; s = s->next)
     {
       /* Skip sections that have no loadable contents (.bss,
@@ -3439,6 +3415,7 @@ init_for_output (abfd)
      bfd *abfd;
 {
   asection *s;
+
   for (s = abfd->sections; s != (asection *) NULL; s = s->next)
     {
       if ((s->flags & SEC_DEBUGGING) != 0)
@@ -3454,11 +3431,11 @@ init_for_output (abfd)
   return TRUE;
 }
 \f
-/** exec and core file sections */
+/* Exec and core file sections.  */
+
+/* Set section contents is complicated with IEEE since the format is
+   not a byte image, but a record stream.  */
 
-/* set section contents is complicated with IEEE since the format is
-* not a byte image, but a record stream.
-*/
 static bfd_boolean
 ieee_set_section_contents (abfd, section, location, offset, count)
      bfd *abfd;
@@ -3504,20 +3481,21 @@ ieee_write_external_part (abfd)
 {
   asymbol **q;
   ieee_data_type *ieee = IEEE_DATA (abfd);
-
   unsigned int reference_index = IEEE_REFERENCE_BASE;
   unsigned int public_index = IEEE_PUBLIC_BASE + 2;
   file_ptr here = bfd_tell (abfd);
   bfd_boolean hadone = FALSE;
+
   if (abfd->outsymbols != (asymbol **) NULL)
     {
 
       for (q = abfd->outsymbols; *q != (asymbol *) NULL; q++)
        {
          asymbol *p = *q;
+
          if (bfd_is_und_section (p->section))
            {
-             /* This must be a symbol reference .. */
+             /* This must be a symbol reference */
              if (! ieee_write_byte (abfd, ieee_external_reference_enum)
                  || ! ieee_write_int (abfd, (bfd_vma) reference_index)
                  || ! ieee_write_id (abfd, p->name))
@@ -3528,7 +3506,7 @@ ieee_write_external_part (abfd)
            }
          else if (bfd_is_com_section (p->section))
            {
-             /* This is a weak reference */
+             /* This is a weak reference */
              if (! ieee_write_byte (abfd, ieee_external_reference_enum)
                  || ! ieee_write_int (abfd, (bfd_vma) reference_index)
                  || ! ieee_write_id (abfd, p->name)
@@ -3543,8 +3521,7 @@ ieee_write_external_part (abfd)
            }
          else if (p->flags & BSF_GLOBAL)
            {
-             /* This must be a symbol definition */
-
+             /* This must be a symbol definition.  */
              if (! ieee_write_byte (abfd, ieee_external_symbol_enum)
                  || ! ieee_write_int (abfd, (bfd_vma) public_index)
                  || ! ieee_write_id (abfd, p->name)
@@ -3555,7 +3532,7 @@ ieee_write_external_part (abfd)
                  || ! ieee_write_byte (abfd, 1)) /* one of them */
                return FALSE;
 
-             /* Write out the value */
+             /* Write out the value */
              if (! ieee_write_2bytes (abfd, ieee_value_record_enum)
                  || ! ieee_write_int (abfd, (bfd_vma) public_index))
                return FALSE;
@@ -3564,7 +3541,7 @@ ieee_write_external_part (abfd)
                  if (abfd->flags & EXEC_P)
                    {
                      /* If fully linked, then output all symbols
-                        relocated */
+                        relocated */
                      if (! (ieee_write_int
                             (abfd,
                              (p->value
@@ -3596,8 +3573,8 @@ ieee_write_external_part (abfd)
            }
          else
            {
-             /* This can happen - when there are gaps in the symbols read */
-             /* from an input ieee file */
+             /* This can happen - when there are gaps in the symbols read
+                from an input ieee file.  */
            }
        }
     }
@@ -3611,9 +3588,9 @@ ieee_write_external_part (abfd)
 static const unsigned char exten[] =
 {
   0xf0, 0x20, 0x00,
-  0xf1, 0xce, 0x20, 0x00, 37, 3, 3,    /* Set version 3 rev 3          */
-  0xf1, 0xce, 0x20, 0x00, 39, 2,/* keep symbol in  original case */
-  0xf1, 0xce, 0x20, 0x00, 38   /* set object type relocateable to x */
+  0xf1, 0xce, 0x20, 0x00, 37, 3, 3,    /* Set version 3 rev 3.  */
+  0xf1, 0xce, 0x20, 0x00, 39, 2,       /* Keep symbol in  original case.  */
+  0xf1, 0xce, 0x20, 0x00, 38           /* Set object type relocateable to x.  */
 };
 
 static const unsigned char envi[] =
@@ -3746,7 +3723,7 @@ ieee_write_object_contents (abfd)
   unsigned int i;
   file_ptr old;
 
-  /* Fast forward over the header area */
+  /* Fast forward over the header area */
   if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
     return FALSE;
 
@@ -3755,14 +3732,14 @@ ieee_write_object_contents (abfd)
       || ! ieee_write_id (abfd, abfd->filename))
     return FALSE;
 
-  /* Fast forward over the variable bits */
+  /* Fast forward over the variable bits */
   if (! ieee_write_byte (abfd, ieee_address_descriptor_enum))
     return FALSE;
 
-  /* Bits per MAU */
+  /* Bits per MAU */
   if (! ieee_write_byte (abfd, (bfd_byte) (bfd_arch_bits_per_byte (abfd))))
     return FALSE;
-  /* MAU's per address */
+  /* MAU's per address */
   if (! ieee_write_byte (abfd,
                         (bfd_byte) (bfd_arch_bits_per_address (abfd)
                                     / bfd_arch_bits_per_byte (abfd))))
@@ -3823,11 +3800,6 @@ ieee_write_object_contents (abfd)
   if (! ieee_write_external_part (abfd))
     return FALSE;
 
-  /*  ieee_write_byte(abfd, ieee_record_seperator_enum);*/
-
-  /*  ieee_write_byte(abfd, ieee_record_seperator_enum);*/
-
-
   /* Write any debugs we have been told about.  */
   if (! ieee_write_debug_part (abfd))
     return FALSE;
@@ -3842,7 +3814,7 @@ ieee_write_object_contents (abfd)
   if (! ieee_write_me_part (abfd))
     return FALSE;
 
-  /* Generate the header */
+  /* Generate the header */
   if (bfd_seek (abfd, old, SEEK_SET) != 0)
     return FALSE;
 
@@ -3861,7 +3833,7 @@ ieee_write_object_contents (abfd)
 
 /* We read the symbols into a buffer, which is discarded when this
    function exits.  We read the strings into a buffer large enough to
-   hold them all plus all the cached symbol entries. */
+   hold them all plus all the cached symbol entries.  */
 
 static asymbol *
 ieee_make_empty_symbol (abfd)
@@ -3869,6 +3841,7 @@ ieee_make_empty_symbol (abfd)
 {
   bfd_size_type amt = sizeof (ieee_symbol_type);
   ieee_symbol_type *new = (ieee_symbol_type *) bfd_zalloc (abfd, amt);
+
   if (!new)
     return NULL;
   new->symbol.the_bfd = abfd;
@@ -3881,15 +3854,16 @@ ieee_openr_next_archived_file (arch, prev)
      bfd *prev;
 {
   ieee_ar_data_type *ar = IEEE_AR_DATA (arch);
-  /* take the next one from the arch state, or reset */
+
+  /* Take the next one from the arch state, or reset.  */
   if (prev == (bfd *) NULL)
-    {
-      /* Reset the index - the first two entries are bogus*/
-      ar->element_index = 2;
-    }
+    /* Reset the index - the first two entries are bogus.  */
+    ar->element_index = 2;
+
   while (TRUE)
     {
       ieee_ar_obstack_type *p = ar->elements + ar->element_index;
+
       ar->element_index++;
       if (ar->element_index <= ar->element_count)
        {
@@ -3908,7 +3882,6 @@ ieee_openr_next_archived_file (arch, prev)
          bfd_set_error (bfd_error_no_more_archived_files);
          return (bfd *) NULL;
        }
-
     }
 }
 
@@ -3986,8 +3959,7 @@ ieee_bfd_debug_info_end (abfd)
 
 
 /* Add this section to the list of sections we have debug info for, to
-   be ready to output it at close time
-   */
+   be ready to output it at close time.  */
 static void
 ieee_bfd_debug_info_accumulate (abfd, section)
      bfd *abfd;
@@ -3995,37 +3967,34 @@ ieee_bfd_debug_info_accumulate (abfd, section)
 {
   ieee_data_type *ieee = IEEE_DATA (section->owner);
   ieee_data_type *output_ieee = IEEE_DATA (abfd);
-  /* can only accumulate data from other ieee bfds */
+
+  /* Can only accumulate data from other ieee bfds.  */
   if (section->owner->xvec != abfd->xvec)
     return;
-  /* Only bother once per bfd */
+  /* Only bother once per bfd */
   if (ieee->done_debug)
     return;
   ieee->done_debug = TRUE;
 
-  /* Don't bother if there is no debug info */
+  /* Don't bother if there is no debug info */
   if (ieee->w.r.debug_information_part == 0)
     return;
 
-
-  /* Add to chain */
+  /* Add to chain.  */
   {
     bfd_size_type amt = sizeof (bfd_chain_type);
     bfd_chain_type *n = (bfd_chain_type *) bfd_alloc (abfd, amt);
+
     if (!n)
       abort ();                /* FIXME */
     n->this = section->owner;
     n->next = (bfd_chain_type *) NULL;
 
     if (output_ieee->chain_head)
-      {
-       output_ieee->chain_head->next = n;
-      }
+      output_ieee->chain_head->next = n;
     else
-      {
-       output_ieee->chain_root = n;
+      output_ieee->chain_root = n;
 
-      }
     output_ieee->chain_head = n;
   }
 }
@@ -4075,7 +4044,6 @@ ieee_bfd_debug_info_accumulate (abfd, section)
 #define ieee_bfd_final_link _bfd_generic_final_link
 #define ieee_bfd_link_split_section  _bfd_generic_link_split_section
 
-/*SUPPRESS 460 */
 const bfd_target ieee_vec =
 {
   "ieee",                      /* name */
index 14978ba862fe4e1f08ed65ca4e54c2fefbecf53f..222b23dcb5dfe15bc974ca6cba5496de2e1ab331 100644 (file)
@@ -850,7 +850,6 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
   "BFD_RELOC_LO16",
   "BFD_RELOC_PCREL_HI16_S",
   "BFD_RELOC_PCREL_LO16",
-  "BFD_RELOC_MIPSEMB_16_PCREL_S2",
   "BFD_RELOC_MIPS_LITERAL",
   "BFD_RELOC_MIPS_GOT16",
   "BFD_RELOC_MIPS_CALL16",
index 13e0a6d398110ebf5680b8f419c75af2422388f1..1ca4a626999e6970f6a9a5d3899356a564b68eec 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for NetBSD/m68k a.out-ish binaries.
-   Copyright 1990, 1991, 1992, 1995, 1998, 2001
+   Copyright 1990, 1991, 1992, 1995, 1998, 2001, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-#define BYTES_IN_WORD  4
 #define TARGET_IS_BIG_ENDIAN_P
 
 #define TARGET_PAGE_SIZE       0x1000
index a526998c51ad98a6aac15d43019455c5e19a41a2..1a829806975c56a2f7bc59cf58477e3edb3646ea 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for linux flavored m68k a.out binaries.
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define        SEGMENT_SIZE TARGET_PAGE_SIZE
 #define TEXT_START_ADDR        0x0
 #define N_SHARED_LIB(x) 0
-#define BYTES_IN_WORD 4
 
 #define MACHTYPE_OK(mtype) ((mtype) == M_68020 || (mtype) == M_UNKNOWN)
 
index 00571ca71f624f499fe076e24e9d9136838a09c1..46fa0763dae9298bfaea0dd0afff155630431c81 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for m68k binaries under LynxOS.
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001, 2002
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-#define BYTES_IN_WORD 4
 #define N_SHARED_LIB(x) 0
 
 #define TEXT_START_ADDR 0
index 521d6468f9d9c47b3898aeb283956d944acf049e..2a748891b99a35f8e09fc60d425ce36c0517beee 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for NetBSD/m68k a.out-ish binaries.
-   Copyright 1990, 1991, 1992, 1994, 1995, 1997, 1998, 2000, 2001
+   Copyright 1990, 1991, 1992, 1994, 1995, 1997, 1998, 2000, 2001, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-#define BYTES_IN_WORD  4
 #define TARGET_IS_BIG_ENDIAN_P
 
 /* Our m68k ports use either 4K or 8K pages, but object files always
index 8305401463dc8bcba15ff0202b5a1b3733c631de..79e3bb8312b37de5ee79b0c0f3c67d9db688e17a 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for Motorola m88k a.out (Mach 3) binaries.
-   Copyright 1990, 1991, 1993, 1994, 1995, 2001
+   Copyright 1990, 1991, 1993, 1994, 1995, 2001, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define        TARGET_PAGE_SIZE        (4096*2)
 #define SEGMENT_SIZE   0x20000
 #define TEXT_START_ADDR        0
-#define BYTES_IN_WORD  4
 #define N_HEADER_IN_TEXT(x)    1               /* (N_MAGIG(x) == ZMAGIC) */
 #define N_SHARED_LIB(x) 0
 
index 581ace299ecd49006849f20f6a062a1e374ed36c..af1ba55aeca8bfca35b21f571b14d73eebcd407d 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD backend for MIPS BSD (a.out) binaries.
-   Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002
+   Copyright 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
    Written by Ralph Campbell.
 
@@ -19,7 +19,6 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-#define BYTES_IN_WORD 4
 /* #define ENTRY_CAN_BE_ZERO */
 #define N_HEADER_IN_TEXT(x) 1
 #define N_SHARED_LIB(x) 0
index 34c4216e6d683ad7d662dc319dfcf9128ba8c7dd..d0a5c54817ed23281b6e93392e4d48aa8e00a4b3 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for NewsOS3 (Sony, 68k) binaries.
-   Copyright 1990, 1991, 1994, 1995, 2000, 2001
+   Copyright 1990, 1991, 1994, 1995, 2000, 2001, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define        TARGET_PAGE_SIZE        4096
 #define        SEGMENT_SIZE    TARGET_PAGE_SIZE
 #define TEXT_START_ADDR 0
-#define BYTES_IN_WORD 4
 
 /* Do not "beautify" the CONCAT* macro args.  Traditional C will not
    remove whitespace added here, and thus will fail to concatenate
index 45660c8387e425667e8b80605ef203632e33508a..9f8a952c591f1f2d2dfbea13bb3c2b70e16a967e 100644 (file)
@@ -2080,10 +2080,7 @@ ENUM
   BFD_RELOC_PCREL_LO16
 ENUMDOC
   Like BFD_RELOC_LO16, but PC relative.
-ENUM
-  BFD_RELOC_MIPSEMB_16_PCREL_S2
-ENUMDOC
-  Like BFD_RELOC_16_PCREL_S2, but for MIPS Embedded PIC.
+
 ENUM
   BFD_RELOC_MIPS_LITERAL
 ENUMDOC
@@ -2153,6 +2150,7 @@ ENUMX
 ENUMDOC
   Fujitsu Frv Relocations.
 COMMENT
+COMMENT
 ENUMDOC
   MIPS ELF relocations.
 
index 4352727a20637edb5045bf9efe61e15cd9859f06..40e49c85e3eb1ca2e5ad69aff54104accaa1b3ef 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for linux flavored sparc a.out binaries.
-   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002
+   Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -24,7 +24,6 @@ USA.  */
 #define SEGMENT_SIZE           TARGET_PAGE_SIZE
 #define TEXT_START_ADDR                0x0
 #define N_SHARED_LIB(x)                0
-#define BYTES_IN_WORD          4
 
 #define MACHTYPE_OK(mtype) ((mtype) == M_SPARC || (mtype) == M_UNKNOWN)
 
index 84d9d4a9d0aa1b499eca1b2ee431b654598cf8db..6be9a4446b1df67d9edea00bb89bb23a9b695984 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD support for Sparc binaries under LynxOS.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000,
-   2001, 2002 Free Software Foundation, Inc.
+   2001, 2002, 2003 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -19,7 +19,6 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #if 0
-#define BYTES_IN_WORD 4
 #define N_SHARED_LIB(x) 0
 
 #define TEXT_START_ADDR 0
index 64d0eb10e84a48dbc07c83a39cd0af90533faa4a..be8e53634905eb8b40149b69018acf620ad41338 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for NetBSD/sparc a.out-ish binaries.
-   Copyright 1990, 1991, 1992, 1994, 1995, 1997, 1998, 2000, 2001
+   Copyright 1990, 1991, 1992, 1994, 1995, 1997, 1998, 2000, 2001, 2003
    Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
@@ -18,7 +18,6 @@ You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-#define BYTES_IN_WORD  4
 #define TARGET_IS_BIG_ENDIAN_P
 
 /* SPARC chips use either 4K or 8K pages, but object files always
index 5faedbee4c2c422d2fc8a50867d6344e33091d58..a97408fa0685d40ecda674f13dc92cf3b8428d31 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for BSD and Ultrix/VAX (1K page size) a.out-ish binaries.
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2003 Free Software Foundation, Inc.
 
 This file is part of BFD, the Binary File Descriptor library.
 
@@ -18,7 +18,6 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #define N_HEADER_IN_TEXT(x) 0
-#define BYTES_IN_WORD 4
 #define ENTRY_CAN_BE_ZERO
 #define N_SHARED_LIB(x) 0 /* Avoids warning */
 #define TEXT_START_ADDR 0
@@ -26,7 +25,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #define SEGMENT_SIZE TARGET_PAGE_SIZE
 #define DEFAULT_ARCH bfd_arch_vax
 
-/* Do not "beautify" the CONCAT* macro args.  Traditional C will not   remove whitespace added here, and thus will fail to concatenate   the tokens.  */
+/* Do not "beautify" the CONCAT* macro args.  Traditional C will not   
+   remove whitespace added here, and thus will fail to concatenate the 
+   tokens.  */
 #define MY(OP) CONCAT2 (vaxbsd_,OP)
 
 #define TARGETNAME "a.out-vax-bsd"
index 1aaeb257746a044cf774cf924f033e922ea8ff33..d4e94301e3bdfc28e8992df706b5ed1740610b27 100644 (file)
@@ -1,3 +1,3 @@
-#define BFD_VERSION_DATE 20030308
+#define BFD_VERSION_DATE 20030316
 #define BFD_VERSION @bfd_version@
 #define BFD_VERSION_STRING @bfd_version_string@
index 65475742f13c64a7b829b7aad92f6f18d9ea5176..d73c05d871f38938dc03461505eb303d1ddc3a0a 100644 (file)
@@ -1,5 +1,5 @@
 /* xSYM symbol-file support for BFD.
-   Copyright 1999, 2000, 2001, 2002
+   Copyright 1999, 2000, 2001, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -1131,7 +1131,7 @@ bfd_sym_fetch_type_information_table_entry (abfd, entry, offset)
   BFD_ASSERT (bfd_sym_valid (abfd));
   sdata = abfd->tdata.sym_data;
 
-  if (index == 0)
+  if (offset == 0)
     return -1;
 
   if (bfd_seek (abfd, offset, SEEK_SET) < 0)
index 7cf1f55446b05451bcd977796ac3a9a7040c873f..3fc3a7278466ecf22fee5eb81e4bbe2817d3c48e 100755 (executable)
--- a/configure
+++ b/configure
@@ -2201,12 +2201,6 @@ EOF
   esac
 fi
 
-# record if we want runtime library stuff installed in libsubdir.
-# Blank means no.
-if test -z "${enable_version_specific_runtime_libs}"; then
-  enable_version_specific_runtime_libs=no
-fi
-
 # Make sure that the compiler is able to generate an executable.  If it
 # can't, we are probably in trouble.  We don't care whether we can run the
 # executable--we might be using a cross compiler--we only care whether it
@@ -2477,30 +2471,19 @@ target_configargs="--cache-file=../config.cache --host=${target_alias} --build=$
 # Note, if you change the default, make sure to fix both here and in
 # the gcc and libstdc++-v3 subdirectories.
 # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
-gxx_include_dir=
-if test -n "${with_gxx_include_dir}"; then
-  case "${with_gxx_include_dir}" in
-    yes )
-      echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
-      exit 1
-      ;;
-    no )
-      ;;
-    * )
-      gxx_include_dir=${with_gxx_include_dir}
-      ;;
-  esac
-fi
-if test x${gxx_include_dir} = x; then
-  if test x${enable_version_specific_runtime_libs} = xyes; then
-    gxx_include_dir='${libsubdir}/include/c++'
-  else
-    . ${srcdir}/config.if
-    gxx_include_dir='${prefix}/include/${libstdcxx_incdir}'
-  fi
-else
-  gxx_include_dir=${gxx_include_dir}
-fi
+case "${with_gxx_include_dir}" in
+  yes)
+    { echo "configure: error: --with-gxx-include-dir=[dir] requires a directory" 1>&2; exit 1; }
+    ;;
+  no | "")
+    case "${enable_version_specific_runtime_libs}" in
+      yes) gxx_include_dir='${libsubdir}/include/c++' ;;
+      *)
+        . ${srcdir}/config.if
+        gxx_include_dir='${prefix}/include/'${libstdcxx_incdir} ;;
+    esac ;;
+  *) gxx_include_dir=${with_gxx_include_dir} ;;
+esac
 
 FLAGS_FOR_TARGET=
 case " $target_configdirs " in
@@ -2658,7 +2641,6 @@ ospace_frag=${srcdir}/${ospace_frag}
 
 
 
-
 # Build module lists & subconfigure args.
 
 
@@ -2701,7 +2683,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
   # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2705: checking for $ac_word" >&5
+echo "configure:2687: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2734,7 +2716,7 @@ if test -z "$ac_cv_prog_AR" ; then
     # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2738: checking for $ac_word" >&5
+echo "configure:2720: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2773,7 +2755,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2777: checking for $ac_word" >&5
+echo "configure:2759: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2806,7 +2788,7 @@ if test -z "$ac_cv_prog_AS" ; then
     # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2810: checking for $ac_word" >&5
+echo "configure:2792: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2845,7 +2827,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2849: checking for $ac_word" >&5
+echo "configure:2831: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2878,7 +2860,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then
     # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2882: checking for $ac_word" >&5
+echo "configure:2864: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2917,7 +2899,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2921: checking for $ac_word" >&5
+echo "configure:2903: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2950,7 +2932,7 @@ if test -z "$ac_cv_prog_LD" ; then
     # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2954: checking for $ac_word" >&5
+echo "configure:2936: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2989,7 +2971,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2993: checking for $ac_word" >&5
+echo "configure:2975: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3022,7 +3004,7 @@ if test -z "$ac_cv_prog_NM" ; then
     # Extract the first word of "nm", so it can be a program name with args.
 set dummy nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3026: checking for $ac_word" >&5
+echo "configure:3008: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3061,7 +3043,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3065: checking for $ac_word" >&5
+echo "configure:3047: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3094,7 +3076,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then
     # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3098: checking for $ac_word" >&5
+echo "configure:3080: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3133,7 +3115,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3137: checking for $ac_word" >&5
+echo "configure:3119: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3166,7 +3148,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then
     # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3170: checking for $ac_word" >&5
+echo "configure:3152: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3205,7 +3187,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}objcopy; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3209: checking for $ac_word" >&5
+echo "configure:3191: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3238,7 +3220,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then
     # Extract the first word of "objcopy", so it can be a program name with args.
 set dummy objcopy; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3242: checking for $ac_word" >&5
+echo "configure:3224: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3277,7 +3259,7 @@ fi
   # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args.
 set dummy ${ncn_tool_prefix}objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3281: checking for $ac_word" >&5
+echo "configure:3263: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3310,7 +3292,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then
     # Extract the first word of "objdump", so it can be a program name with args.
 set dummy objdump; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3314: checking for $ac_word" >&5
+echo "configure:3296: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3358,7 +3340,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3362: checking for $ac_word" >&5
+echo "configure:3344: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3391,7 +3373,7 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then
     # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3395: checking for $ac_word" >&5
+echo "configure:3377: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3430,7 +3412,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3434: checking for $ac_word" >&5
+echo "configure:3416: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3463,7 +3445,7 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then
     # Extract the first word of "as", so it can be a program name with args.
 set dummy as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3467: checking for $ac_word" >&5
+echo "configure:3449: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3502,7 +3484,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3506: checking for $ac_word" >&5
+echo "configure:3488: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3535,7 +3517,7 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then
     # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3539: checking for $ac_word" >&5
+echo "configure:3521: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3574,7 +3556,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3578: checking for $ac_word" >&5
+echo "configure:3560: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3607,7 +3589,7 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then
     # Extract the first word of "ld", so it can be a program name with args.
 set dummy ld; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3611: checking for $ac_word" >&5
+echo "configure:3593: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3646,7 +3628,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3650: checking for $ac_word" >&5
+echo "configure:3632: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3679,7 +3661,7 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then
     # Extract the first word of "nm", so it can be a program name with args.
 set dummy nm; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3683: checking for $ac_word" >&5
+echo "configure:3665: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3718,7 +3700,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3722: checking for $ac_word" >&5
+echo "configure:3704: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3751,7 +3733,7 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then
     # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3755: checking for $ac_word" >&5
+echo "configure:3737: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3790,7 +3772,7 @@ fi
   # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args.
 set dummy ${ncn_target_tool_prefix}windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3794: checking for $ac_word" >&5
+echo "configure:3776: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3823,7 +3805,7 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then
     # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3827: checking for $ac_word" >&5
+echo "configure:3809: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3890,7 +3872,7 @@ RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
 NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:3894: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:3876: checking whether to enable maintainer-specific portions of Makefiles" >&5
 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -4088,7 +4070,6 @@ s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g
 s%@BUILD_PREFIX@%$BUILD_PREFIX%g
 s%@BUILD_PREFIX_1@%$BUILD_PREFIX_1%g
 s%@configlinks@%$configlinks%g
-s%@enable_version_specific_runtime_libs@%$enable_version_specific_runtime_libs%g
 s%@gcc_version_trigger@%$gcc_version_trigger%g
 s%@gcc_version@%$gcc_version%g
 s%@tooldir@%$tooldir%g
index eb473b8a5c136d56e5721759892a73a5267a83ac..45239e2fa8f3c433478b616e23fa218f242919cf 100644 (file)
@@ -1541,12 +1541,6 @@ EOF
   esac
 fi
 
-# record if we want runtime library stuff installed in libsubdir.
-# Blank means no.
-if test -z "${enable_version_specific_runtime_libs}"; then
-  enable_version_specific_runtime_libs=no
-fi
-
 # Make sure that the compiler is able to generate an executable.  If it
 # can't, we are probably in trouble.  We don't care whether we can run the
 # executable--we might be using a cross compiler--we only care whether it
@@ -1816,30 +1810,19 @@ target_configargs="--cache-file=../config.cache --host=${target_alias} --build=$
 # Note, if you change the default, make sure to fix both here and in
 # the gcc and libstdc++-v3 subdirectories.
 # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
-gxx_include_dir=
-if test -n "${with_gxx_include_dir}"; then
-  case "${with_gxx_include_dir}" in
-    yes )
-      echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
-      exit 1
-      ;;
-    no )
-      ;;
-    * )
-      gxx_include_dir=${with_gxx_include_dir}
-      ;;
-  esac
-fi
-if test x${gxx_include_dir} = x; then
-  if test x${enable_version_specific_runtime_libs} = xyes; then
-    gxx_include_dir='${libsubdir}/include/c++'
-  else
-    . ${srcdir}/config.if
-    gxx_include_dir='${prefix}/include/${libstdcxx_incdir}'
-  fi
-else
-  gxx_include_dir=${gxx_include_dir}
-fi
+case "${with_gxx_include_dir}" in
+  yes)
+    AC_MSG_ERROR([--with-gxx-include-dir=[[dir]] requires a directory])
+    ;;
+  no | "")
+    case "${enable_version_specific_runtime_libs}" in
+      yes) gxx_include_dir='${libsubdir}/include/c++' ;;
+      *)
+        . ${srcdir}/config.if
+        gxx_include_dir='${prefix}/include/'${libstdcxx_incdir} ;;
+    esac ;;
+  *) gxx_include_dir=${with_gxx_include_dir} ;;
+esac
 
 FLAGS_FOR_TARGET=
 case " $target_configdirs " in
@@ -1989,7 +1972,6 @@ AC_SUBST(RPATH_ENVVAR)
 AC_SUBST(BUILD_PREFIX)
 AC_SUBST(BUILD_PREFIX_1)
 AC_SUBST(configlinks)
-AC_SUBST(enable_version_specific_runtime_libs)
 AC_SUBST(gcc_version_trigger)
 AC_SUBST(gcc_version)
 AC_SUBST(tooldir)
index 03c8bb2ed6de54f9bed52bab7ae8d9aeaf307a9e..17fe75158e5ee7d53cae57a3046cf40c63494837 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-16  Mark Kettenis  <kettenis@gnu.org>
+
+       Merge with mainline.  Tag is kettenis-i386newframe-20030316-mergepoint.
+
 2003-03-08  Mark Kettenis  <kettenis@gnu.org>
 
        * i386-tdep.c (i386_frameless_signal_p): Removed.
index 631588852ae242a7e4807b1dd7850eec944e64e9..00ac4c07268d9ad843246e33dbd7687d3db26757 100644 (file)
@@ -386,6 +386,7 @@ Petr Sorfa                                  petrs@caldera.com
 Gary Thomas                                    gthomas@redhat.com
 Jason Thorpe                                   thorpej@wasabisystems.com
 Tom Tromey                                     tromey@redhat.com
+D Venkatasubramanian                           dvenkat@noida.hcltech.com
 Corinna Vinschen                               vinschen@redhat.com
 Keith Walker                                   keith.walker@arm.com
 Kris Warkentin                                 kewarken@qnx.com
index 3d1d96ea4bf011ff3983964cf1d5a5a4b5d85fc4..57cd8936e99ff52e378b79edce7eaf4c5abc4b7d 100644 (file)
@@ -68,10 +68,8 @@ static gdbarch_frame_locals_address_ftype alpha_frame_locals_address;
 static gdbarch_skip_prologue_ftype alpha_skip_prologue;
 static gdbarch_saved_pc_after_call_ftype alpha_saved_pc_after_call;
 static gdbarch_frame_chain_ftype alpha_frame_chain;
-static gdbarch_frame_saved_pc_ftype alpha_frame_saved_pc;
 
 static gdbarch_push_arguments_ftype alpha_push_arguments;
-static gdbarch_pop_frame_ftype alpha_pop_frame;
 static gdbarch_fix_call_dummy_ftype alpha_fix_call_dummy;
 
 static gdbarch_get_longjmp_target_ftype alpha_get_longjmp_target;
@@ -459,7 +457,7 @@ static CORE_ADDR
 alpha_init_frame_pc_first (int fromleaf, struct frame_info *prev)
 {
   return (fromleaf ? SAVED_PC_AFTER_CALL (get_next_frame (prev)) 
-         : get_next_frame (prev) ? FRAME_SAVED_PC (get_next_frame (prev))
+         : get_next_frame (prev) ? DEPRECATED_FRAME_SAVED_PC (get_next_frame (prev))
          : read_pc ());
 }
 
@@ -932,7 +930,7 @@ static CORE_ADDR
 alpha_frame_chain (struct frame_info *frame)
 {
   alpha_extra_func_info_t proc_desc;
-  CORE_ADDR saved_pc = FRAME_SAVED_PC (frame);
+  CORE_ADDR saved_pc = DEPRECATED_FRAME_SAVED_PC (frame);
 
   if (saved_pc == 0 || inside_entry_file (saved_pc))
     return 0;
@@ -1303,7 +1301,7 @@ alpha_pop_frame (void)
      frame->proc_desc?  If we do, who will free it?
      For now, we don't save a copy... */
 
-  write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
+  write_register (PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame));
   if (get_frame_saved_regs (frame) == NULL)
     alpha_find_saved_regs (frame);
   if (proc_desc)
@@ -1842,7 +1840,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_saved_pc_after_call (gdbarch, alpha_saved_pc_after_call);
 
   set_gdbarch_frame_chain (gdbarch, alpha_frame_chain);
-  set_gdbarch_frame_saved_pc (gdbarch, alpha_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, alpha_frame_saved_pc);
 
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, alpha_frame_init_saved_regs);
 
@@ -1858,7 +1856,7 @@ alpha_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_use_generic_dummy_frames (gdbarch, 0);
   set_gdbarch_call_dummy_length (gdbarch, 0);
   set_gdbarch_push_arguments (gdbarch, alpha_push_arguments);
-  set_gdbarch_pop_frame (gdbarch, alpha_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, alpha_pop_frame);
 
   /* On the Alpha, the call dummy code is never copied to user space,
      stopping the user call is achieved via a bp_call_dummy breakpoint.
index 1016ba104a5541134c8bdf1281e3d241df888d64..712b03ebcc96c406f863a129a471a46e86f86b9a 100644 (file)
@@ -386,7 +386,7 @@ init_frame_pc_default (int fromleaf, struct frame_info *prev)
   if (fromleaf)
     return SAVED_PC_AFTER_CALL (get_next_frame (prev));
   else if (get_next_frame (prev) != NULL)
-    return FRAME_SAVED_PC (get_next_frame (prev));
+    return DEPRECATED_FRAME_SAVED_PC (get_next_frame (prev));
   else
     return read_pc ();
 }
index 11b23507f5f0235f311a6a5bf8a811fda9678677..e1d19c89c68790113ae9335f4d386e1404ec7f4b 100644 (file)
@@ -159,7 +159,7 @@ struct frame_extra_info
 static int
 arm_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
 {
-  return (FRAME_SAVED_PC (thisframe) >= LOWEST_PC);
+  return (DEPRECATED_FRAME_SAVED_PC (thisframe) >= LOWEST_PC);
 }
 
 /* Set to true if the 32-bit mode is in use.  */
@@ -1032,7 +1032,7 @@ arm_frame_chain (struct frame_info *fi)
     return 0;
 
   /* If the caller is the startup code, we're at the end of the chain.  */
-  caller_pc = FRAME_SAVED_PC (fi);
+  caller_pc = DEPRECATED_FRAME_SAVED_PC (fi);
 
   /* If the caller is Thumb and the caller is ARM, or vice versa,
      the frame register of the caller is different from ours.
@@ -1090,7 +1090,7 @@ arm_init_extra_frame_info (int fromleaf, struct frame_info *fi)
   get_frame_extra_info (fi)->framereg = 0;
 
   if (get_next_frame (fi))
-    deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
+    deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
 
   memset (get_frame_saved_regs (fi), '\000', sizeof get_frame_saved_regs (fi));
 
@@ -1535,7 +1535,7 @@ arm_pop_frame (void)
                  read_memory_integer (get_frame_saved_regs (frame)[regnum],
                                       REGISTER_RAW_SIZE (regnum)));
 
-  write_register (ARM_PC_REGNUM, FRAME_SAVED_PC (frame));
+  write_register (ARM_PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame));
   write_register (ARM_SP_REGNUM, old_SP);
 
   flush_cached_frames ();
@@ -2909,13 +2909,13 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_frame_chain (gdbarch, arm_frame_chain);
   set_gdbarch_frameless_function_invocation
     (gdbarch, arm_frameless_function_invocation);
-  set_gdbarch_frame_saved_pc (gdbarch, arm_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, arm_frame_saved_pc);
   set_gdbarch_frame_args_address (gdbarch, arm_frame_args_address);
   set_gdbarch_frame_locals_address (gdbarch, arm_frame_locals_address);
   set_gdbarch_frame_num_args (gdbarch, arm_frame_num_args);
   set_gdbarch_frame_args_skip (gdbarch, 0);
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, arm_frame_init_saved_regs);
-  set_gdbarch_pop_frame (gdbarch, arm_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, arm_pop_frame);
 
   /* Address manipulation.  */
   set_gdbarch_smash_text_address (gdbarch, arm_smash_text_address);
index 975132abd987627bff73791534484a396d884bb0..75707fef9f5d613742e8f3a3637edc2f34582e01 100644 (file)
@@ -736,7 +736,7 @@ avr_init_extra_frame_info (int fromleaf, struct frame_info *fi)
   int reg;
 
   if (get_next_frame (fi))
-    deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
+    deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
 
   frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
   frame_saved_regs_zalloc (fi);
@@ -1183,7 +1183,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_pointer_to_address (gdbarch, avr_pointer_to_address);
   set_gdbarch_push_arguments (gdbarch, avr_push_arguments);
   set_gdbarch_push_return_address (gdbarch, avr_push_return_address);
-  set_gdbarch_pop_frame (gdbarch, avr_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, avr_pop_frame);
 
   set_gdbarch_use_struct_convention (gdbarch, generic_use_struct_convention);
   set_gdbarch_store_struct_return (gdbarch, avr_store_struct_return);
@@ -1201,7 +1201,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_frame_args_skip (gdbarch, 0);
   set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue);    /* ??? */
   set_gdbarch_frame_chain (gdbarch, avr_frame_chain);
-  set_gdbarch_frame_saved_pc (gdbarch, avr_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, avr_frame_saved_pc);
   set_gdbarch_frame_args_address (gdbarch, avr_frame_address);
   set_gdbarch_frame_locals_address (gdbarch, avr_frame_address);
   set_gdbarch_saved_pc_after_call (gdbarch, avr_saved_pc_after_call);
index f27f3fc556e4edfb2482ae486e76dbc7a8f2ad89..491766d67eadc59d25c85e952213785cfae6db4b 100644 (file)
@@ -1679,7 +1679,7 @@ breakpoint_inserted_here_p (CORE_ADDR pc)
 
 /* Return nonzero if FRAME is a dummy frame.  We can't use
    DEPRECATED_PC_IN_CALL_DUMMY because figuring out the saved SP would
-   take too much time, at least using get_saved_register on the 68k.
+   take too much time, at least using frame_register() on the 68k.
    This means that for this function to work right a port must use the
    bp_call_dummy breakpoint.  */
 
@@ -1816,6 +1816,11 @@ bpstat_copy (bpstat bs)
     {
       tmp = (bpstat) xmalloc (sizeof (*tmp));
       memcpy (tmp, bs, sizeof (*tmp));
+      if (bs->commands != NULL)
+       tmp->commands = copy_command_lines (bs->commands);
+      if (bs->old_val != NULL)
+       tmp->old_val = value_copy (bs->old_val);
+
       if (p == NULL)
        /* This is the first thing in the chain.  */
        retval = tmp;
@@ -2758,9 +2763,9 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
            /* We will stop here */
            if (b->disposition == disp_disable)
              b->enable_state = bp_disabled;
-           bs->commands = copy_command_lines (b->commands);
            if (b->silent)
              bs->print = 0;
+           bs->commands = b->commands;
            if (bs->commands &&
                (STREQ ("silent", bs->commands->line) ||
                 (xdb_commands && STREQ ("Q", bs->commands->line))))
@@ -2768,6 +2773,7 @@ bpstat_stop_status (CORE_ADDR *pc, int not_a_sw_breakpoint)
                bs->commands = bs->commands->next;
                bs->print = 0;
              }
+           bs->commands = copy_command_lines (bs->commands);
          }
       }
     /* Print nothing for this entry if we dont stop or if we dont print.  */
index e3b45cdd5389a320346d08db65b0d5a240e3ed8e..38bf36ffaf21858662899051e8e5ed5746d349af 100644 (file)
@@ -1,6 +1,6 @@
 /* Output generating routines for GDB CLI.
 
-   Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions.
    Written by Fernando Nasser for Cygnus.
@@ -33,6 +33,7 @@ struct ui_out_data
     struct ui_file *stream;
     int suppress_output;
   };
+typedef struct ui_out_data cli_out_data;
 
 /* These are the CLI output functions */
 
@@ -110,7 +111,7 @@ cli_table_begin (struct ui_out *uiout, int nbrofcols,
                 int nr_rows,
                 const char *tblid)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (nr_rows == 0)
     data->suppress_output = 1;
   else
@@ -124,7 +125,7 @@ cli_table_begin (struct ui_out *uiout, int nbrofcols,
 void
 cli_table_body (struct ui_out *uiout)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   /* first, close the table header line */
@@ -136,7 +137,7 @@ cli_table_body (struct ui_out *uiout)
 void
 cli_table_end (struct ui_out *uiout)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   data->suppress_output = 0;
 }
 
@@ -147,7 +148,7 @@ cli_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
                  const char *col_name,
                  const char *colhdr)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   cli_field_string (uiout, 0, width, alignment, 0, colhdr);
@@ -161,7 +162,7 @@ cli_begin (struct ui_out *uiout,
           int level,
           const char *id)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
 }
@@ -173,7 +174,7 @@ cli_end (struct ui_out *uiout,
         enum ui_out_type type,
         int level)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
 }
@@ -187,7 +188,7 @@ cli_field_int (struct ui_out *uiout, int fldno, int width,
 {
   char buffer[20];             /* FIXME: how many chars long a %d can become? */
 
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   sprintf (buffer, "%d", value);
@@ -201,7 +202,7 @@ cli_field_skip (struct ui_out *uiout, int fldno, int width,
                enum ui_align alignment,
                const char *fldname)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   cli_field_string (uiout, fldno, width, alignment, fldname, "");
@@ -221,7 +222,7 @@ cli_field_string (struct ui_out *uiout,
   int before = 0;
   int after = 0;
 
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
 
@@ -268,7 +269,7 @@ cli_field_fmt (struct ui_out *uiout, int fldno,
               const char *format,
               va_list args)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
 
@@ -281,7 +282,7 @@ cli_field_fmt (struct ui_out *uiout, int fldno,
 void
 cli_spaces (struct ui_out *uiout, int numspaces)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   print_spaces_filtered (numspaces, data->stream);
@@ -290,7 +291,7 @@ cli_spaces (struct ui_out *uiout, int numspaces)
 void
 cli_text (struct ui_out *uiout, const char *string)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   fputs_filtered (string, data->stream);
@@ -300,7 +301,7 @@ void
 cli_message (struct ui_out *uiout, int verbosity,
             const char *format, va_list args)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   if (ui_out_get_verblvl (uiout) >= verbosity)
@@ -310,7 +311,7 @@ cli_message (struct ui_out *uiout, int verbosity,
 void
 cli_wrap_hint (struct ui_out *uiout, char *identstring)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   wrap_here (identstring);
@@ -319,7 +320,7 @@ cli_wrap_hint (struct ui_out *uiout, char *identstring)
 void
 cli_flush (struct ui_out *uiout)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   gdb_flush (data->stream);
 }
 
@@ -334,7 +335,7 @@ out_field_fmt (struct ui_out *uiout, int fldno,
               const char *fldname,
               const char *format,...)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   va_list args;
 
   va_start (args, format);
@@ -348,7 +349,7 @@ out_field_fmt (struct ui_out *uiout, int fldno,
 static void
 field_separator (void)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   fputc_filtered (' ', data->stream);
 }
 
@@ -359,7 +360,7 @@ cli_out_new (struct ui_file *stream)
 {
   int flags = ui_source_list;
 
-  struct ui_out_data *data = XMALLOC (struct ui_out_data);
+  cli_out_data *data = XMALLOC (cli_out_data);
   data->stream = stream;
   data->suppress_output = 0;
   return ui_out_new (&cli_ui_out_impl, data, flags);
@@ -368,7 +369,7 @@ cli_out_new (struct ui_file *stream)
 struct ui_file *
 cli_out_set_stream (struct ui_out *uiout, struct ui_file *stream)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  cli_out_data *data = ui_out_data (uiout);
   struct ui_file *old = data->stream;
   data->stream = stream;
   return old;
index a1abc0e8d3f66a68e6c0662185539353504183f0..c54f9a7dd9e533e38706adfcdd90f32d7f8bef1b 100644 (file)
@@ -99,8 +99,8 @@ extern int delta68_in_sigtramp (CORE_ADDR pc, char *name);
 #define IN_SIGTRAMP(pc,name) delta68_in_sigtramp (pc, name)
 
 extern CORE_ADDR delta68_frame_saved_pc (struct frame_info *fi);
-#undef FRAME_SAVED_PC
-#define FRAME_SAVED_PC(fi) delta68_frame_saved_pc (fi)
+#undef DEPRECATED_FRAME_SAVED_PC
+#define DEPRECATED_FRAME_SAVED_PC(fi) delta68_frame_saved_pc (fi)
 
 extern CORE_ADDR delta68_frame_args_address (struct frame_info *fi);
 #undef FRAME_ARGS_ADDRESS
index 4990bb0dabc330afc94ac2e4853506aab9193710..cc20c62a4b0ba6944325b918f4869b68034953a1 100644 (file)
 
 #define GET_LONGJMP_TARGET(ADDR) m68k_get_longjmp_target(ADDR)
 
-#undef FRAME_SAVED_PC
-#define FRAME_SAVED_PC(frame) m68k_linux_frame_saved_pc (frame)
+#undef DEPRECATED_FRAME_SAVED_PC
+#define DEPRECATED_FRAME_SAVED_PC(frame) m68k_linux_frame_saved_pc (frame)
 extern CORE_ADDR m68k_linux_frame_saved_pc (struct frame_info *);
 
 #define IN_SIGTRAMP(pc,name) m68k_linux_in_sigtramp (pc)
index dc23a631b35178f0608daa86364263f928955fb5..4b196dcd19aad25f23d7eac17d0db28651ac532b 100644 (file)
@@ -420,7 +420,7 @@ extern int hppa_frameless_function_invocation (struct frame_info *);
 
 #if !GDB_MULTI_ARCH
 extern CORE_ADDR hppa_frame_saved_pc (struct frame_info *frame);
-#define FRAME_SAVED_PC(FRAME) hppa_frame_saved_pc (FRAME)
+#define DEPRECATED_FRAME_SAVED_PC(FRAME) hppa_frame_saved_pc (FRAME)
 #endif
 
 #if !GDB_MULTI_ARCH
@@ -463,7 +463,7 @@ extern void hppa_push_dummy_frame (struct inferior_status *);
 /* Discard from the stack the innermost frame, 
    restoring all saved registers.  */
 #if !GDB_MULTI_ARCH
-#define POP_FRAME  hppa_pop_frame ()
+#define DEPRECATED_POP_FRAME  hppa_pop_frame ()
 extern void hppa_pop_frame (void);
 #endif
 
index 1bdd9ebd526c7b65f589edda1f52e324d3132b36..08f069bdcd90caff067caa712318f3260ee05c22 100644 (file)
@@ -80,7 +80,7 @@ extern void aix_process_linenos (void);
 
 #define DEPRECATED_INIT_FRAME_PC_FIRST(fromleaf, prev) \
   (fromleaf ? SAVED_PC_AFTER_CALL (prev->next) : \
-             prev->next ? FRAME_SAVED_PC (prev->next) : read_pc ())
+             prev->next ? DEPRECATED_FRAME_SAVED_PC (prev->next) : read_pc ())
 /* NOTE: cagney/2002-12-08: Add local declaration of
    init_frame_pc_noop() because it isn't possible to include
    "arch-utils.h" here.  Not too bad as this entire file is going away
index 20d5b37692998286fe557463098025d92d326e1d..8ab7401bd822db46024536859a267ca46700e1a8 100644 (file)
@@ -199,10 +199,10 @@ extern int sparc_intreg_size (void);
    stack rather than with the other registers, and this causes hair
    and confusion in places like pop_frame.  It might be better to
    remove the ins and locals from `registers', make sure that
-   get_saved_register can get them from the stack (even in the
-   innermost frame), and make this the way to access them.  For the
-   frame pointer we would do that via TARGET_READ_FP.  On the other
-   hand, that is likely to be confusing or worse for flat frames.  */
+   frame_register() can get them from the stack (even in the innermost
+   frame), and make this the way to access them.  For the frame
+   pointer we would do that via TARGET_READ_FP.  On the other hand,
+   that is likely to be confusing or worse for flat frames.  */
 
 #define REGISTER_BYTES (32*4+32*4+8*4)
 
@@ -453,8 +453,8 @@ extern CORE_ADDR sparc_pc_adjust (CORE_ADDR);
   /* time of the register saves.  */ \
   int sp_offset;
 
-/* We need to override GET_SAVED_REGISTER so that we can deal with the
-   way outs change into ins in different frames.  */
+/* We need to override DEPRECATED_GET_SAVED_REGISTER so that we can
+   deal with the way outs change into ins in different frames.  */
 
 void sparc_get_saved_register (char *raw_buffer,
                               int *optimized,
@@ -462,7 +462,7 @@ void sparc_get_saved_register (char *raw_buffer,
                               struct frame_info *frame,
                               int regnum, enum lval_type *lvalp);
 
-#define GET_SAVED_REGISTER(RAW_BUFFER, OPTIMIZED, ADDRP, FRAME, REGNUM, LVAL) \
+#define DEPRECATED_GET_SAVED_REGISTER(RAW_BUFFER, OPTIMIZED, ADDRP, FRAME, REGNUM, LVAL) \
      sparc_get_saved_register (RAW_BUFFER, OPTIMIZED, ADDRP, \
                               FRAME, REGNUM, LVAL)
 
@@ -484,7 +484,7 @@ extern CORE_ADDR sparc_frame_chain (struct frame_info *);
 
 /* Where is the PC for a specific frame */
 
-#define FRAME_SAVED_PC(FRAME) sparc_frame_saved_pc (FRAME)
+#define DEPRECATED_FRAME_SAVED_PC(FRAME) sparc_frame_saved_pc (FRAME)
 extern CORE_ADDR sparc_frame_saved_pc (struct frame_info *);
 
 /* If the argument is on the stack, it will be here.  */
@@ -519,7 +519,7 @@ extern CORE_ADDR init_frame_pc_noop (int fromleaf, struct frame_info *prev);
 #define        DEPRECATED_INIT_FRAME_PC(FROMLEAF, PREV)        (init_frame_pc_noop (FROMLEAF, PREV))
 #define DEPRECATED_INIT_FRAME_PC_FIRST(FROMLEAF, PREV) \
   ((FROMLEAF) ? SAVED_PC_AFTER_CALL ((PREV)->next) : \
-             (PREV)->next ? FRAME_SAVED_PC ((PREV)->next) : read_pc ())
+             (PREV)->next ? DEPRECATED_FRAME_SAVED_PC ((PREV)->next) : read_pc ())
 
 /* Define other aspects of the stack frame.  */
 
@@ -683,7 +683,7 @@ void sparc_fix_call_dummy (char *dummy, CORE_ADDR pc, CORE_ADDR fun,
 /* Push an empty stack frame, to record the current PC, etc.  */
 
 #define DEPRECATED_PUSH_DUMMY_FRAME    sparc_push_dummy_frame ()
-#define POP_FRAME              sparc_pop_frame ()
+#define DEPRECATED_POP_FRAME           sparc_pop_frame ()
 
 void sparc_push_dummy_frame (void);
 void sparc_pop_frame (void);
index a51f98ce43de64ee00bfbb0bfe616d386bf0019b..c71c12f17f3afd0f89ccff81b0e4cc637477d869 100644 (file)
@@ -1204,7 +1204,7 @@ cris_init_extra_frame_info (int fromleaf, struct frame_info *fi)
   if (get_next_frame (fi))
     {
       /* Called from get_prev_frame.  */
-      deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
+      deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
     }
  
   frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
@@ -4279,13 +4279,13 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
   set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
 
-  set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
+  set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
   
   /* No register requires conversion from raw format to virtual format.  */
   set_gdbarch_register_convertible (gdbarch, generic_register_convertible_not);
 
   set_gdbarch_push_return_address (gdbarch, cris_push_return_address);
-  set_gdbarch_pop_frame (gdbarch, cris_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, cris_pop_frame);
 
   set_gdbarch_store_struct_return (gdbarch, cris_store_struct_return);
   set_gdbarch_deprecated_extract_struct_value_address
@@ -4316,7 +4316,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
     (gdbarch, cris_frameless_function_invocation);
   set_gdbarch_frame_chain (gdbarch, cris_frame_chain);
 
-  set_gdbarch_frame_saved_pc (gdbarch, cris_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, cris_frame_saved_pc);
   set_gdbarch_saved_pc_after_call (gdbarch, cris_saved_pc_after_call);
 
   set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
index 5f334e6a7ab53754bd3ecfbbfeb8a5ec6104540b..b60ce7fad3a2ea5f96bb506e38f5718c5d0ab79f 100644 (file)
@@ -1445,13 +1445,12 @@ display_trace (int low, int high)
     }
 }
 
-
 static CORE_ADDR
-d10v_frame_pc_unwind (struct frame_info *frame,
-                     void **cache)
+d10v_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
 {
-  struct d10v_unwind_cache *info = d10v_frame_unwind_cache (frame, cache);
-  return info->return_pc;
+  ULONGEST pc;
+  frame_unwind_unsigned_register (next_frame, PC_REGNUM, &pc);
+  return d10v_make_iaddr (pc);
 }
 
 /* Given a GDB frame, determine the address of the calling function's
@@ -1557,51 +1556,23 @@ d10v_frame_register_unwind (struct frame_info *frame,
                            int *realnump, void *bufferp)
 {
   struct d10v_unwind_cache *info = d10v_frame_unwind_cache (frame, cache);
-  saved_regs_unwinder (frame, info->saved_regs, regnum, optimizedp,
-                      lvalp, addrp, realnump, bufferp);
-}
-
-
-static void
-d10v_frame_pop (struct frame_info *fi, void **unwind_cache,
-               struct regcache *regcache)
-{
-  struct d10v_unwind_cache *info = d10v_frame_unwind_cache (fi, unwind_cache);
-  CORE_ADDR fp;
-  int regnum;
-  char raw_buffer[8];
-
-  fp = get_frame_base (fi);
-
-  /* now update the current registers with the old values */
-  for (regnum = A0_REGNUM; regnum < A0_REGNUM + NR_A_REGS; regnum++)
+  if (regnum == PC_REGNUM)
     {
-      frame_unwind_register (fi, regnum, raw_buffer);
-      regcache_cooked_write (regcache, regnum, raw_buffer);
+      /* The call instruction saves the caller's PC in LR.  The
+        function prologue of the callee may then save the LR on the
+        stack.  Find that possibly saved LR value and return it.  */
+      saved_regs_unwinder (frame, info->saved_regs, LR_REGNUM, optimizedp,
+                          lvalp, addrp, realnump, bufferp);
     }
-  for (regnum = 0; regnum < SP_REGNUM; regnum++)
+  else
     {
-      frame_unwind_register (fi, regnum, raw_buffer);
-      regcache_cooked_write (regcache, regnum, raw_buffer);
+      saved_regs_unwinder (frame, info->saved_regs, regnum, optimizedp,
+                          lvalp, addrp, realnump, bufferp);
     }
-  frame_unwind_register (fi, PSW_REGNUM, raw_buffer);
-  regcache_cooked_write (regcache, PSW_REGNUM, raw_buffer);
-
-  frame_unwind_register (fi, LR_REGNUM, raw_buffer);
-  regcache_cooked_write (regcache, PC_REGNUM, raw_buffer);
-
-  store_unsigned_integer (raw_buffer,
-                         register_size (current_gdbarch, SP_REGNUM),
-                         fp + info->size);
-  regcache_cooked_write (regcache, SP_REGNUM, raw_buffer);
-
-  target_store_registers (-1);
-  flush_cached_frames ();
 }
 
+
 static struct frame_unwind d10v_frame_unwind = {
-  d10v_frame_pop,
-  d10v_frame_pc_unwind,
   d10v_frame_id_unwind,
   d10v_frame_register_unwind
 };
@@ -1769,6 +1740,9 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_unwind_dummy_id (gdbarch, d10v_unwind_dummy_id);
   set_gdbarch_save_dummy_frame_tos (gdbarch, generic_save_dummy_frame_tos);
 
+  /* Return the unwound PC value.  */
+  set_gdbarch_unwind_pc (gdbarch, d10v_unwind_pc);
+
   return gdbarch;
 }
 
index 4971d3268fac6c72eb75177e8e1864e8c0395316..982322d4bb1aa165affd8e6bd8bb97c24bc07ddd 100644 (file)
@@ -1,3 +1,28 @@
+2003-03-12  Andrew Cagney  <cagney@redhat.com>
+
+       * gdbint.texinfo (Target Architecture Definition): Delete
+       references to get_saved_register.  Rename GET_SAVED_REGISTER to
+       DEPRECATED_GET_SAVED_REGISTER.
+
+2003-03-13  Andrew Cagney  <cagney@redhat.com>
+
+       * gdbint.texinfo (Target Architecture Definition): Replace
+       POP_FRAME with DEPRECATED_POP_FRAME.  Update description.
+
+2003-03-12  Andrew Cagney  <cagney@redhat.com>
+
+       * gdbint.texinfo (Target Architecture Definition): Rename
+       FRAME_SAVED_PC to DEPRECATED_FRAME_SAVED_PC.
+       
+2003-03-10  Corinna Vinschen  <vinschen@redhat.com>
+
+       * gdb.texinfo: Add File-I/O documentation.
+
+2003-03-10  Andrew Cagney  <cagney@redhat.com>
+
+       * gdbint.texinfo (Target Architecture Definition): Cross reference
+       FRAME_SAVED_PC to unwind_pc.  Document unwind_pc.
+
 2003-03-07  Andrew Cagney  <cagney@redhat.com>
 
        * gdb.texinfo (Debugging Output): Mention the "set/show debug
index b0ba376fab4eb28d2391e2ab46299754b25bae67..99de23b6a44e3dcd447ea347258decc29922c848 100644 (file)
@@ -14801,6 +14801,7 @@ compiled with the @samp{-pg} compiler option.
 * General Query Packets::
 * Register Packet Format::
 * Examples::
+* File-I/O remote protocol extension::
 @end menu
 
 @node Overview
@@ -15025,9 +15026,12 @@ Reserved for future use.
 
 Reserved for future use.
 
-@item @code{F} --- reserved
+@item @code{F}@var{RC}@code{,}@var{EE}@code{,}@var{CF}@code{;}@var{XX} --- Reply to target's F packet.
+@cindex @code{F} packet
 
-Reserved for future use.
+This packet is send by @value{GDBN} as reply to a @code{F} request packet
+sent by the target.  This is part of the File-I/O protocol extension.
+@xref{File-I/O remote protocol extension}, for the specification.
 
 @item @code{g} --- read registers
 @anchor{read registers packet}
@@ -15526,6 +15530,24 @@ is a query initiated by the host debugger.}
 any time while the program is running and the debugger should continue
 to wait for @samp{W}, @samp{T}, etc.
 
+@item F@var{call-id}@code{,}@var{parameter@dots{}}
+
+@var{call-id} is the identifier which says which host system call should
+be called.  This is just the name of the function.  Translation into the
+correct system call is only applicable as it's defined in @value{GDBN}.
+@xref{File-I/O remote protocol extension}, for a list of implemented
+system calls.
+
+@var{parameter@dots{}} is a list of parameters as defined for this very
+system call.
+
+The target replies with this packet when it expects @value{GDBN} to call
+a host system call on behalf of the target.  @value{GDBN} replies with
+an appropriate @code{F} packet and keeps up waiting for the next reply
+packet from the target.  The latest @samp{C}, @samp{c}, @samp{S} or
+@samp{s} action is expected to be continued.
+@xref{File-I/O remote protocol extension}, for more details.
+
 @end table
 
 @node General Query Packets
@@ -15768,6 +15790,1149 @@ Example sequence of a target being stepped by a single instruction:
 -> @code{+}
 @end smallexample
 
+@node File-I/O remote protocol extension
+@section File-I/O remote protocol extension
+@cindex File-I/O remote protocol extension
+
+@menu
+* File-I/O Overview::
+* Protocol basics::
+* The `F' request packet::
+* The `F' reply packet::
+* Memory transfer::
+* The Ctrl-C message::
+* Console I/O::
+* The isatty call::
+* The system call::
+* List of supported calls::
+* Protocol specific representation of datatypes::
+* Constants::
+* File-I/O Examples::
+@end menu
+
+@node File-I/O Overview
+@subsection File-I/O Overview
+@cindex file-i/o overview
+
+The File I/O remote protocol extension (short: File-I/O) allows the
+target to use the hosts file system and console I/O when calling various
+system calls.  System calls on the target system are translated into a
+remote protocol packet to the host system which then performs the needed
+actions and returns with an adequate response packet to the target system.
+This simulates file system operations even on targets that lack file systems.
+
+The protocol is defined host- and target-system independent.  It uses
+it's own independent representation of datatypes and values.  Both,
+@value{GDBN} and the target's @value{GDBN} stub are responsible for
+translating the system dependent values into the unified protocol values
+when data is transmitted.
+
+The communication is synchronous.  A system call is possible only
+when GDB is waiting for the @samp{C}, @samp{c}, @samp{S} or @samp{s}
+packets.  While @value{GDBN} handles the request for a system call,
+the target is stopped to allow deterministic access to the target's
+memory.  Therefore File-I/O is not interuptible by target signals.  It
+is possible to interrupt File-I/O by a user interrupt (Ctrl-C), though.
+
+The target's request to perform a host system call does not finish
+the latest @samp{C}, @samp{c}, @samp{S} or @samp{s} action.  That means,
+after finishing the system call, the target returns to continuing the
+previous activity (continue, step).  No additional continue or step
+request from @value{GDBN} is required.
+
+@smallexample
+(gdb) continue
+  <- target requests 'system call X'
+  target is stopped, @value{GDBN} executes system call
+  -> GDB returns result
+  ... target continues, GDB returns to wait for the target
+  <- target hits breakpoint and sends a Txx packet
+@end smallexample
+
+The protocol is only used for files on the host file system and
+for I/O on the console.  Character or block special devices, pipes,
+named pipes or sockets or any other communication method on the host
+system are not supported by this protocol.
+
+@node Protocol basics
+@subsection Protocol basics
+@cindex protocol basics, file-i/o
+
+The File-I/O protocol uses the @code{F} packet, as request as well
+as as reply packet.  Since a File-I/O system call can only occur when
+@value{GDBN} is waiting for the continuing or stepping target, the 
+File-I/O request is a reply that @value{GDBN} has to expect as a result
+of a former @samp{C}, @samp{c}, @samp{S} or @samp{s} packet.
+This @code{F} packet contains all information needed to allow @value{GDBN}
+to call the appropriate host system call:
+
+@itemize @bullet
+@item 
+A unique identifier for the requested system call.
+
+@item
+All parameters to the system call.  Pointers are given as addresses
+in the target memory address space.  Pointers to strings are given as
+pointer/length pair.  Numerical values are given as they are. 
+Numerical control values are given in a protocol specific representation.
+
+@end itemize
+
+At that point @value{GDBN} has to perform the following actions.
+
+@itemize @bullet
+@item 
+If parameter pointer values are given, which point to data needed as input
+to a system call, @value{GDBN} requests this data from the target with a
+standard @code{m} packet request.  This additional communication has to be
+expected by the target implementation and is handled as any other @code{m}
+packet.
+
+@item
+@value{GDBN} translates all value from protocol representation to host
+representation as needed.  Datatypes are coerced into the host types.
+
+@item
+@value{GDBN} calls the system call
+
+@item
+It then coerces datatypes back to protocol representation.
+
+@item
+If pointer parameters in the request packet point to buffer space in which
+a system call is expected to copy data to, the data is transmitted to the
+target using a @code{M} or @code{X} packet.  This packet has to be expected
+by the target implementation and is handled as any other @code{M} or @code{X}
+packet.
+
+@end itemize
+
+Eventually @value{GDBN} replies with another @code{F} packet which contains all
+necessary information for the target to continue.  This at least contains
+
+@itemize @bullet
+@item
+Return value.
+
+@item
+@code{errno}, if has been changed by the system call.
+
+@item
+``Ctrl-C'' flag.
+
+@end itemize
+
+After having done the needed type and value coercion, the target continues
+the latest continue or step action.
+
+@node The `F' request packet
+@subsection The @code{F} request packet
+@cindex file-i/o request packet
+@cindex @code{F} request packet
+
+The @code{F} request packet has the following format:
+
+@table @samp
+
+@smallexample
+@code{F}@var{call-id}@code{,}@var{parameter@dots{}}
+@end smallexample
+
+@var{call-id} is the identifier to indicate the host system call to be called.
+This is just the name of the function.
+
+@var{parameter@dots{}} are the parameters to the system call.
+
+@end table 
+
+Parameters are hexadecimal integer values, either the real values in case
+of scalar datatypes, as pointers to target buffer space in case of compound
+datatypes and unspecified memory areas or as pointer/length pairs in case
+of string parameters.  These are appended to the call-id, each separated
+from its predecessor by a comma.  All values are transmitted in ASCII
+string representation, pointer/length pairs separated by a slash.
+
+@node The `F' reply packet
+@subsection The @code{F} reply packet
+@cindex file-i/o reply packet
+@cindex @code{F} reply packet
+
+The @code{F} reply packet has the following format:
+
+@table @samp
+
+@smallexample
+@code{F}@var{retcode}@code{,}@var{errno}@code{,}@var{Ctrl-C flag}@code{;}@var{call specific attachment}
+@end smallexample
+
+@var{retcode} is the return code of the system call as hexadecimal value.
+
+@var{errno} is the errno set by the call, in protocol specific representation.
+This parameter can be omitted if the call was successful.
+
+@var{Ctrl-C flag} is only send if the user requested a break.  In this
+case, @var{errno} must be send as well, even if the call was successful.
+The @var{Ctrl-C flag} itself consists of the character 'C':
+
+@smallexample
+F0,0,C
+@end smallexample
+
+@noindent
+or, if the call was interupted before the host call has been performed:
+
+@smallexample
+F-1,4,C
+@end smallexample
+
+@noindent
+assuming 4 is the protocol specific representation of @code{EINTR}.
+
+@end table
+
+@node Memory transfer
+@subsection Memory transfer
+@cindex memory transfer, in file-i/o protocol
+
+Structured data which is transferred using a memory read or write as e.g.@:
+a @code{struct stat} is expected to be in a protocol specific format with
+all scalar multibyte datatypes being big endian.  This should be done by
+the target before the @code{F} packet is sent resp.@: by @value{GDBN} before
+it transfers memory to the target.  Transferred pointers to structured
+data should point to the already coerced data at any time.
+
+@node The Ctrl-C message
+@subsection The Ctrl-C message
+@cindex ctrl-c message, in file-i/o protocol
+
+A special case is, if the @var{Ctrl-C flag} is set in the @value{GDBN}
+reply packet.  In this case the target should behave, as if it had
+gotten a break message.  The meaning for the target is ``system call
+interupted by @code{SIGINT}''.  Consequentially, the target should actually stop
+(as with a break message) and return to @value{GDBN} with a @code{T02}
+packet.  In this case, it's important for the target to know, in which 
+state the system call was interrupted.  Since this action is by design
+not an atomic operation, we have to differ between two cases:
+
+@itemize @bullet
+@item
+The system call hasn't been performed on the host yet.
+
+@item
+The system call on the host has been finished.
+
+@end itemize
+
+These two states can be distinguished by the target by the value of the
+returned @code{errno}.  If it's the protocol representation of @code{EINTR}, the system
+call hasn't been performed.  This is equivalent to the @code{EINTR} handling
+on POSIX systems.  In any other case, the target may presume that the
+system call has been finished --- successful or not --- and should behave
+as if the break message arrived right after the system call.
+
+@value{GDBN} must behave reliable.  If the system call has not been called
+yet, @value{GDBN} may send the @code{F} reply immediately, setting @code{EINTR} as
+@code{errno} in the packet.  If the system call on the host has been finished
+before the user requests a break, the full action must be finshed by
+@value{GDBN}.  This requires sending @code{M} or @code{X} packets as they fit.
+The @code{F} packet may only be send when either nothing has happened
+or the full action has been completed.
+
+@node Console I/O
+@subsection Console I/O
+@cindex console i/o as part of file-i/o
+
+By default and if not explicitely closed by the target system, the file
+descriptors 0, 1 and 2 are connected to the @value{GDBN} console.  Output
+on the @value{GDBN} console is handled as any other file output operation
+(@code{write(1, @dots{})} or @code{write(2, @dots{})}).  Console input is handled
+by @value{GDBN} so that after the target read request from file descriptor
+0 all following typing is buffered until either one of the following
+conditions is met:
+
+@itemize @bullet
+@item
+The user presses @kbd{Ctrl-C}.  The behaviour is as explained above, the
+@code{read}
+system call is treated as finished.
+
+@item
+The user presses @kbd{Enter}.  This is treated as end of input with a trailing
+line feed.
+
+@item
+The user presses @kbd{Ctrl-D}.  This is treated as end of input.  No trailing
+character, especially no Ctrl-D is appended to the input.
+
+@end itemize
+
+If the user has typed more characters as fit in the buffer given to
+the read call, the trailing characters are buffered in @value{GDBN} until
+either another @code{read(0, @dots{})} is requested by the target or debugging
+is stopped on users request.
+
+@node The isatty call
+@subsection The isatty(3) call
+@cindex isatty call, file-i/o protocol
+
+A special case in this protocol is the library call @code{isatty} which
+is implemented as it's own call inside of this protocol.  It returns
+1 to the target if the file descriptor given as parameter is attached
+to the @value{GDBN} console, 0 otherwise.  Implementing through system calls
+would require implementing @code{ioctl} and would be more complex than
+needed.
+
+@node The system call
+@subsection The system(3) call
+@cindex system call, file-i/o protocol
+
+The other special case in this protocol is the @code{system} call which
+is implemented as it's own call, too.  @value{GDBN} is taking over the full
+task of calling the necessary host calls to perform the @code{system}
+call.  The return value of @code{system} is simplified before it's returned
+to the target.  Basically, the only signal transmitted back is @code{EINTR}
+in case the user pressed @kbd{Ctrl-C}.  Otherwise the return value consists
+entirely of the exit status of the called command.
+
+Due to security concerns, the @code{system} call is refused to be called
+by @value{GDBN} by default.  The user has to allow this call explicitly by 
+entering
+
+@table @samp
+@kindex set remote system-call-allowed 1
+@item @code{set remote system-call-allowed 1}
+@end table
+
+Disabling the @code{system} call is done by
+
+@table @samp
+@kindex set remote system-call-allowed 0
+@item @code{set remote system-call-allowed 0}
+@end table
+
+The current setting is shown by typing
+
+@table @samp
+@kindex show remote system-call-allowed
+@item @code{show remote system-call-allowed}
+@end table
+
+@node List of supported calls
+@subsection List of supported calls
+@cindex list of supported file-i/o calls
+
+@menu
+* open::
+* close::
+* read::
+* write::
+* lseek::
+* rename::
+* unlink::
+* stat/fstat::
+* gettimeofday::
+* isatty::
+* system::
+@end menu
+
+@node open
+@unnumberedsubsubsec open
+@cindex open, file-i/o system call
+
+@smallexample
+@exdent Synopsis:
+int open(const char *pathname, int flags);
+int open(const char *pathname, int flags, mode_t mode);
+
+@exdent Request:     
+Fopen,pathptr/len,flags,mode
+@end smallexample
+
+@noindent
+@code{flags} is the bitwise or of the following values:
+
+@table @code
+@item O_CREAT    
+If the file does not exist it will be created.  The host
+rules apply as far as file ownership and time stamps
+are concerned.
+
+@item O_EXCL     
+When used with O_CREAT, if the file already exists it is
+an error and open() fails.
+
+@item O_TRUNC    
+If the file already exists and the open mode allows
+writing (O_RDWR or O_WRONLY is given) it will be
+truncated to length 0.
+
+@item O_APPEND   
+The file is opened in append mode.
+
+@item O_RDONLY   
+The file is opened for reading only.
+
+@item O_WRONLY   
+The file is opened for writing only.
+
+@item O_RDWR     
+The file is opened for reading and writing.
+
+@noindent
+Each other bit is silently ignored.
+
+@end table
+
+@noindent
+@code{mode} is the bitwise or of the following values:
+
+@table @code
+@item S_IRUSR    
+User has read permission.
+
+@item S_IWUSR    
+User has write permission.
+
+@item S_IRGRP    
+Group has read permission.
+
+@item S_IWGRP    
+Group has write permission.
+
+@item S_IROTH    
+Others have read permission.
+
+@item S_IWOTH    
+Others have write permission.
+
+@noindent
+Each other bit is silently ignored.
+
+@end table
+
+@smallexample
+@exdent Return value:
+open returns the new file descriptor or -1 if an error
+occured.
+
+@exdent Errors:
+@end smallexample
+
+@table @code
+@item EEXIST     
+pathname already exists and O_CREAT and O_EXCL were used.
+
+@item EISDIR     
+pathname refers to a directory.
+
+@item EACCES     
+The requested access is not allowed.
+
+@item ENAMETOOLONG
+pathname was too long.
+
+@item ENOENT     
+A directory component in pathname does not exist.
+
+@item ENODEV     
+pathname refers to a device, pipe, named pipe or socket.
+
+@item EROFS      
+pathname refers to a file on a read-only filesystem and
+write access was requested.
+
+@item EFAULT     
+pathname is an invalid pointer value.
+
+@item ENOSPC     
+No space on device to create the file.
+
+@item EMFILE     
+The process already has the maximum number of files open.
+
+@item ENFILE     
+The limit on the total number of files open on the system
+has been reached.
+
+@item EINTR      
+The call was interrupted by the user.
+@end table
+
+@node close
+@unnumberedsubsubsec close
+@cindex close, file-i/o system call
+
+@smallexample
+@exdent Synopsis:    
+int close(int fd);
+
+@exdent Request:     
+Fclose,fd
+
+@exdent Return value:
+close returns zero on success, or -1 if an error occurred.
+
+@exdent Errors:
+@end smallexample
+
+@table @code
+@item EBADF      
+fd isn't a valid open file descriptor.
+
+@item EINTR      
+The call was interrupted by the user.
+@end table
+
+@node read
+@unnumberedsubsubsec read
+@cindex read, file-i/o system call
+
+@smallexample
+@exdent Synopsis:    
+int read(int fd, void *buf, unsigned int count);
+
+@exdent Request:     
+Fread,fd,bufptr,count
+
+@exdent Return value:
+On success, the number of bytes read is returned.
+Zero indicates end of file.  If count is zero, read
+returns zero as well.  On error, -1 is returned. 
+
+@exdent Errors:
+@end smallexample
+
+@table @code
+@item EBADF      
+fd is not a valid file descriptor or is not open for
+reading.
+
+@item EFAULT     
+buf is an invalid pointer value.
+
+@item EINTR      
+The call was interrupted by the user.
+@end table
+
+@node write
+@unnumberedsubsubsec write
+@cindex write, file-i/o system call
+
+@smallexample
+@exdent Synopsis:    
+int write(int fd, const void *buf, unsigned int count);
+
+@exdent Request:     
+Fwrite,fd,bufptr,count
+
+@exdent Return value:
+On success, the number of bytes written are returned.
+Zero indicates nothing was written.  On error, -1
+is returned.
+
+@exdent Errors:
+@end smallexample
+
+@table @code
+@item EBADF      
+fd is not a valid file descriptor or is not open for
+writing.
+
+@item EFAULT     
+buf is an invalid pointer value.
+
+@item EFBIG      
+An attempt was made to write a file that exceeds the
+host specific maximum file size allowed.
+
+@item ENOSPC     
+No space on device to write the data.
+
+@item EINTR      
+The call was interrupted by the user.
+@end table
+
+@node lseek
+@unnumberedsubsubsec lseek
+@cindex lseek, file-i/o system call
+
+@smallexample
+@exdent Synopsis:    
+long lseek (int fd, long offset, int flag);
+
+@exdent Request:     
+Flseek,fd,offset,flag
+@end smallexample
+
+@code{flag} is one of:
+
+@table @code
+@item SEEK_SET   
+The offset is set to offset bytes.
+
+@item SEEK_CUR   
+The offset is set to its current location plus offset
+bytes.
+
+@item SEEK_END   
+The offset is set to the size of the file plus offset
+bytes.
+@end table
+
+@smallexample
+@exdent Return value:
+On success, the resulting unsigned offset in bytes from
+the beginning of the file is returned.  Otherwise, a
+value of -1 is returned.
+
+@exdent Errors:
+@end smallexample
+
+@table @code
+@item EBADF      
+fd is not a valid open file descriptor.
+
+@item ESPIPE     
+fd is associated with the @value{GDBN} console.
+
+@item EINVAL     
+flag is not a proper value.
+
+@item EINTR      
+The call was interrupted by the user.
+@end table
+
+@node rename
+@unnumberedsubsubsec rename
+@cindex rename, file-i/o system call
+
+@smallexample
+@exdent Synopsis:    
+int rename(const char *oldpath, const char *newpath);
+
+@exdent Request:     
+Frename,oldpathptr/len,newpathptr/len
+
+@exdent Return value:
+On success, zero is returned.  On error, -1 is returned.
+
+@exdent Errors:
+@end smallexample
+
+@table @code
+@item EISDIR     
+newpath is an existing directory, but oldpath is not a
+directory.
+
+@item EEXIST     
+newpath is a non-empty directory.
+
+@item EBUSY      
+oldpath or newpath is a directory that is in use by some
+process.
+
+@item EINVAL     
+An attempt was made to make a directory a subdirectory
+of itself.
+
+@item ENOTDIR    
+A  component used as a directory in oldpath or new
+path is not a directory.  Or oldpath is a directory
+and newpath exists but is not a directory.
+
+@item EFAULT     
+oldpathptr or newpathptr are invalid pointer values.
+
+@item EACCES     
+No access to the file or the path of the file.
+
+@item ENAMETOOLONG
+             
+oldpath or newpath was too long.
+
+@item ENOENT     
+A directory component in oldpath or newpath does not exist.
+
+@item EROFS      
+The file is on a read-only filesystem.
+
+@item ENOSPC     
+The device containing the file has no room for the new
+directory entry.
+
+@item EINTR      
+The call was interrupted by the user.
+@end table
+
+@node unlink
+@unnumberedsubsubsec unlink
+@cindex unlink, file-i/o system call
+
+@smallexample
+@exdent Synopsis:    
+int unlink(const char *pathname);
+
+@exdent Request:     
+Funlink,pathnameptr/len
+
+@exdent Return value:
+On success, zero is returned.  On error, -1 is returned.
+
+@exdent Errors:
+@end smallexample
+
+@table @code
+@item EACCES     
+No access to the file or the path of the file.
+
+@item EPERM      
+The system does not allow unlinking of directories.
+
+@item EBUSY      
+The file pathname cannot be unlinked because it's
+being used by another process.
+
+@item EFAULT     
+pathnameptr is an invalid pointer value.
+
+@item ENAMETOOLONG
+pathname was too long.
+
+@item ENOENT     
+A directory component in pathname does not exist.
+
+@item ENOTDIR    
+A component of the path is not a directory.
+
+@item EROFS      
+The file is on a read-only filesystem.
+
+@item EINTR      
+The call was interrupted by the user.
+@end table
+
+@node stat/fstat
+@unnumberedsubsubsec stat/fstat
+@cindex fstat, file-i/o system call
+@cindex stat, file-i/o system call
+
+@smallexample
+@exdent Synopsis:    
+int stat(const char *pathname, struct stat *buf);
+int fstat(int fd, struct stat *buf);
+
+@exdent Request:     
+Fstat,pathnameptr/len,bufptr
+Ffstat,fd,bufptr
+
+@exdent Return value:
+On success, zero is returned.  On error, -1 is returned.
+
+@exdent Errors:
+@end smallexample
+
+@table @code
+@item EBADF      
+fd is not a valid open file.
+
+@item ENOENT     
+A directory component in pathname does not exist or the
+path is an empty string.
+
+@item ENOTDIR    
+A component of the path is not a directory.
+
+@item EFAULT     
+pathnameptr is an invalid pointer value.
+
+@item EACCES     
+No access to the file or the path of the file.
+
+@item ENAMETOOLONG
+pathname was too long.
+
+@item EINTR      
+The call was interrupted by the user.
+@end table
+
+@node gettimeofday
+@unnumberedsubsubsec gettimeofday
+@cindex gettimeofday, file-i/o system call
+
+@smallexample
+@exdent Synopsis:    
+int gettimeofday(struct timeval *tv, void *tz);
+
+@exdent Request:     
+Fgettimeofday,tvptr,tzptr
+
+@exdent Return value:
+On success, 0 is returned, -1 otherwise.
+
+@exdent Errors:
+@end smallexample
+
+@table @code
+@item EINVAL     
+tz is a non-NULL pointer.
+
+@item EFAULT     
+tvptr and/or tzptr is an invalid pointer value.
+@end table
+
+@node isatty
+@unnumberedsubsubsec isatty
+@cindex isatty, file-i/o system call
+
+@smallexample
+@exdent Synopsis:    
+int isatty(int fd);
+
+@exdent Request:     
+Fisatty,fd
+
+@exdent Return value:
+Returns 1 if fd refers to the @value{GDBN} console, 0 otherwise.
+
+@exdent Errors:
+@end smallexample
+
+@table @code
+@item EINTR      
+The call was interrupted by the user.
+@end table
+
+@node system
+@unnumberedsubsubsec system
+@cindex system, file-i/o system call
+
+@smallexample
+@exdent Synopsis:    
+int system(const char *command);
+
+@exdent Request:     
+Fsystem,commandptr/len
+
+@exdent Return value:
+The value returned is -1 on error and the return status
+of the command otherwise.  Only the exit status of the
+command is returned, which is extracted from the hosts
+system return value by calling WEXITSTATUS(retval).
+In case /bin/sh could not be executed, 127 is returned.
+
+@exdent Errors:
+@end smallexample
+
+@table @code
+@item EINTR      
+The call was interrupted by the user.
+@end table
+
+@node Protocol specific representation of datatypes
+@subsection Protocol specific representation of datatypes
+@cindex protocol specific representation of datatypes, in file-i/o protocol
+
+@menu
+* Integral datatypes::
+* Pointer values::
+* struct stat::
+* struct timeval::
+@end menu
+
+@node Integral datatypes
+@unnumberedsubsubsec Integral datatypes
+@cindex integral datatypes, in file-i/o protocol
+
+The integral datatypes used in the system calls are
+
+@smallexample
+int@r{,} unsigned int@r{,} long@r{,} unsigned long@r{,} mode_t @r{and} time_t
+@end smallexample
+
+@code{Int}, @code{unsigned int}, @code{mode_t} and @code{time_t} are
+implemented as 32 bit values in this protocol.
+
+@code{Long} and @code{unsigned long} are implemented as 64 bit types. 
+    
+@xref{Limits}, for corresponding MIN and MAX values (similar to those
+in @file{limits.h}) to allow range checking on host and target.
+
+@code{time_t} datatypes are defined as seconds since the Epoch.
+
+All integral datatypes transferred as part of a memory read or write of a
+structured datatype e.g.@: a @code{struct stat} have to be given in big endian
+byte order.
+
+@node Pointer values
+@unnumberedsubsubsec Pointer values
+@cindex pointer values, in file-i/o protocol
+
+Pointers to target data are transmitted as they are.  An exception
+is made for pointers to buffers for which the length isn't
+transmitted as part of the function call, namely strings.  Strings
+are transmitted as a pointer/length pair, both as hex values, e.g.@:
+
+@smallexample
+@code{1aaf/12}
+@end smallexample
+
+@noindent
+which is a pointer to data of length 18 bytes at position 0x1aaf.
+The length is defined as the full string length in bytes, including
+the trailing null byte.  Example:
+
+@smallexample
+``hello, world'' at address 0x123456
+@end smallexample
+
+@noindent
+is transmitted as
+
+@smallexample
+@code{123456/d}
+@end smallexample
+
+@node struct stat
+@unnumberedsubsubsec struct stat
+@cindex struct stat, in file-i/o protocol
+
+The buffer of type struct stat used by the target and @value{GDBN} is defined
+as follows:
+
+@smallexample
+struct stat @{
+    unsigned int  st_dev;      /* device */
+    unsigned int  st_ino;      /* inode */
+    mode_t        st_mode;     /* protection */
+    unsigned int  st_nlink;    /* number of hard links */
+    unsigned int  st_uid;      /* user ID of owner */
+    unsigned int  st_gid;      /* group ID of owner */
+    unsigned int  st_rdev;     /* device type (if inode device) */
+    unsigned long st_size;     /* total size, in bytes */
+    unsigned long st_blksize;  /* blocksize for filesystem I/O */
+    unsigned long st_blocks;   /* number of blocks allocated */
+    time_t        st_atime;    /* time of last access */
+    time_t        st_mtime;    /* time of last modification */
+    time_t        st_ctime;    /* time of last change */
+@};
+@end smallexample
+
+The integral datatypes are conforming to the definitions given in the
+approriate section (see @ref{Integral datatypes}, for details) so this
+structure is of size 64 bytes.
+
+The values of several fields have a restricted meaning and/or
+range of values.
+
+@smallexample
+st_dev:     0       file
+            1       console
+
+st_ino:     No valid meaning for the target.  Transmitted unchanged.
+
+st_mode:    Valid mode bits are described in Appendix C.  Any other
+            bits have currently no meaning for the target.
+
+st_uid:     No valid meaning for the target.  Transmitted unchanged.
+
+st_gid:     No valid meaning for the target.  Transmitted unchanged.
+
+st_rdev:    No valid meaning for the target.  Transmitted unchanged.
+
+st_atime, st_mtime, st_ctime:
+            These values have a host and file system dependent
+            accuracy.  Especially on Windows hosts the file systems
+            don't support exact timing values.
+@end smallexample
+
+The target gets a struct stat of the above representation and is
+responsible to coerce it to the target representation before
+continuing.
+
+Note that due to size differences between the host and target
+representation of stat members, these members could eventually
+get truncated on the target.
+
+@node struct timeval
+@unnumberedsubsubsec struct timeval
+@cindex struct timeval, in file-i/o protocol
+
+The buffer of type struct timeval used by the target and @value{GDBN}
+is defined as follows:
+
+@smallexample
+struct timeval @{ 
+    time_t tv_sec;  /* second */
+    long   tv_usec; /* microsecond */
+@};
+@end smallexample
+
+The integral datatypes are conforming to the definitions given in the
+approriate section (see @ref{Integral datatypes}, for details) so this
+structure is of size 8 bytes.
+
+@node Constants
+@subsection Constants
+@cindex constants, in file-i/o protocol
+
+The following values are used for the constants inside of the
+protocol.  @value{GDBN} and target are resposible to translate these
+values before and after the call as needed.
+
+@menu
+* Open flags::
+* mode_t values::
+* Errno values::
+* Lseek flags::
+* Limits::
+@end menu
+
+@node Open flags
+@unnumberedsubsubsec Open flags
+@cindex open flags, in file-i/o protocol
+
+All values are given in hexadecimal representation.
+
+@smallexample
+  O_RDONLY        0x0
+  O_WRONLY        0x1
+  O_RDWR          0x2
+  O_APPEND        0x8
+  O_CREAT       0x200
+  O_TRUNC       0x400
+  O_EXCL        0x800
+@end smallexample
+
+@node mode_t values
+@unnumberedsubsubsec mode_t values
+@cindex mode_t values, in file-i/o protocol
+
+All values are given in octal representation.
+
+@smallexample
+  S_IFREG       0100000
+  S_IFDIR        040000
+  S_IRUSR          0400
+  S_IWUSR          0200
+  S_IXUSR          0100
+  S_IRGRP           040
+  S_IWGRP           020
+  S_IXGRP           010
+  S_IROTH            04
+  S_IWOTH            02
+  S_IXOTH            01
+@end smallexample
+
+@node Errno values
+@unnumberedsubsubsec Errno values
+@cindex errno values, in file-i/o protocol
+
+All values are given in decimal representation.
+
+@smallexample
+  EPERM           1
+  ENOENT          2
+  EINTR           4
+  EBADF           9
+  EACCES         13
+  EFAULT         14
+  EBUSY          16
+  EEXIST         17
+  ENODEV         19
+  ENOTDIR        20
+  EISDIR         21
+  EINVAL         22
+  ENFILE         23
+  EMFILE         24
+  EFBIG          27
+  ENOSPC         28
+  ESPIPE         29
+  EROFS          30
+  ENAMETOOLONG   91
+  EUNKNOWN       9999
+@end smallexample
+
+  EUNKNOWN is used as a fallback error value if a host system returns
+  any error value not in the list of supported error numbers.
+
+@node Lseek flags
+@unnumberedsubsubsec Lseek flags
+@cindex lseek flags, in file-i/o protocol
+
+@smallexample
+  SEEK_SET      0
+  SEEK_CUR      1
+  SEEK_END      2
+@end smallexample
+
+@node Limits
+@unnumberedsubsubsec Limits
+@cindex limits, in file-i/o protocol
+
+All values are given in decimal representation.
+
+@smallexample
+  INT_MIN       -2147483648
+  INT_MAX        2147483647
+  UINT_MAX       4294967295
+  LONG_MIN      -9223372036854775808
+  LONG_MAX       9223372036854775807
+  ULONG_MAX      18446744073709551615
+@end smallexample
+
+@node File-I/O Examples
+@subsection File-I/O Examples
+@cindex file-i/o examples
+
+Example sequence of a write call, file descriptor 3, buffer is at target
+address 0x1234, 6 bytes should be written:
+
+@smallexample
+<- @code{Fwrite,3,1234,6}
+@emph{request memory read from target}
+-> @code{m1234,6}
+<- XXXXXX
+@emph{return "6 bytes written"}
+-> @code{F6}
+@end smallexample
+
+Example sequence of a read call, file descriptor 3, buffer is at target
+address 0x1234, 6 bytes should be read:
+
+@smallexample
+<- @code{Fread,3,1234,6}
+@emph{request memory write to target}
+-> @code{X1234,6:XXXXXX}
+@emph{return "6 bytes read"}
+-> @code{F6}
+@end smallexample
+
+Example sequence of a read call, call fails on the host due to invalid
+file descriptor (EBADF):
+
+@smallexample
+<- @code{Fread,3,1234,6}
+-> @code{F-1,9}
+@end smallexample
+
+Example sequence of a read call, user presses Ctrl-C before syscall on
+host is called:
+
+@smallexample
+<- @code{Fread,3,1234,6}
+-> @code{F-1,4,C}
+<- @code{T02}
+@end smallexample
+
+Example sequence of a read call, user presses Ctrl-C after syscall on
+host is called:
+
+@smallexample
+<- @code{Fread,3,1234,6}
+-> @code{X1234,6:XXXXXX}
+<- @code{T02}
+@end smallexample
+
 @include gpl.texi
 
 @include fdl.texi
index 7deabfc6d3723e957e63a926fdeab7eaa4d4f843..186d9e7308c886c5aaa95129f5c78111f367a85e 100644 (file)
@@ -3268,10 +3268,30 @@ For the frame described by @var{fi} return the number of arguments that
 are being passed.  If the number of arguments is not known, return
 @code{-1}.
 
-@item FRAME_SAVED_PC(@var{frame})
-@findex FRAME_SAVED_PC
-Given @var{frame}, return the pc saved there.  This is the return
-address.
+@item DEPRECATED_FRAME_SAVED_PC(@var{frame})
+@findex DEPRECATED_FRAME_SAVED_PC
+@anchor{DEPRECATED_FRAME_SAVED_PC} Given @var{frame}, return the pc
+saved there.  This is the return address.
+
+This method is deprecated. @xref{unwind_pc}.
+
+@item CORE_ADDR unwind_pc (struct frame_info *@var{this_frame})
+@findex unwind_pc
+@anchor{unwind_pc} Return the instruction address, in @var{this_frame}'s
+caller, at which execution will resume after @var{this_frame} returns.
+This is commonly refered to as the return address.
+
+The implementation, which must be frame agnostic (work with any frame),
+is typically no more than:
+
+@smallexample
+ULONGEST pc;
+frame_unwind_unsigned_register (this_frame, D10V_PC_REGNUM, &pc);
+return d10v_make_iaddr (pc);
+@end smallexample
+
+@noindent
+@xref{DEPRECATED_FRAME_SAVED_PC}, which this method replaces.
 
 @item FUNCTION_EPILOGUE_SIZE
 @findex FUNCTION_EPILOGUE_SIZE
@@ -3332,11 +3352,10 @@ assuming that we have just stopped at a @code{longjmp} breakpoint.  It takes a
 @code{CORE_ADDR *} as argument, and stores the target PC value through this
 pointer.  It examines the current state of the machine as needed.
 
-@item GET_SAVED_REGISTER
-@findex GET_SAVED_REGISTER
-@findex get_saved_register
+@item DEPRECATED_GET_SAVED_REGISTER
+@findex DEPRECATED_GET_SAVED_REGISTER
 Define this if you need to supply your own definition for the function
-@code{get_saved_register}.
+@code{DEPRECATED_GET_SAVED_REGISTER}.
 
 @item IBM6000_TARGET
 @findex IBM6000_TARGET
@@ -3660,12 +3679,11 @@ A hook defined for XCOFF reading.
 If defined, this is the number of the processor status register.  (This
 definition is only used in generic code when parsing "$ps".)
 
-@item POP_FRAME
-@findex POP_FRAME
-@findex call_function_by_hand
-@findex return_command
-Used in @samp{call_function_by_hand} to remove an artificial stack
-frame and in @samp{return_command} to remove a real stack frame.
+@item DEPRECATED_POP_FRAME
+@findex DEPRECATED_POP_FRAME
+@findex frame_pop
+If defined, used by @code{frame_pop} to remove a stack frame.  This
+method has been superseeded by generic code.
 
 @item PUSH_ARGUMENTS (@var{nargs}, @var{args}, @var{sp}, @var{struct_return}, @var{struct_addr})
 @findex PUSH_ARGUMENTS
index e601a4dc405abd08c67c2a74983a791d849c23d1..3f68273877c66f605144cda998a487e21e21f5d5 100644 (file)
@@ -633,6 +633,14 @@ floatformat_from_length (int len)
     return TARGET_DOUBLE_FORMAT;
   else if (len * TARGET_CHAR_BIT == TARGET_LONG_DOUBLE_BIT)
     return TARGET_LONG_DOUBLE_FORMAT;
+  /* On i386 the 'long double' type takes 96 bits,
+     while the real number of used bits is only 80,
+     both in processor and in memory.  
+     The code below accepts the real bit size.  */ 
+  else if ((TARGET_LONG_DOUBLE_FORMAT != NULL) 
+          && (len * TARGET_CHAR_BIT ==
+               TARGET_LONG_DOUBLE_FORMAT->totalsize))
+    return TARGET_LONG_DOUBLE_FORMAT;
 
   return NULL;
 }
index 5b638306fd3956ed7733e96f0308e92d7e3fecc8..bf4a31c1ef426e3abcefd810e50622fcd0fb8f4f 100644 (file)
@@ -282,37 +282,6 @@ discard_innermost_dummy (struct dummy_frame **stack)
   xfree (tbd);
 }
 
-/* Function: dummy_frame_pop.  Restore the machine state from a saved
-   dummy stack frame. */
-
-static void
-dummy_frame_pop (struct frame_info *fi, void **cache,
-                struct regcache *regcache)
-{
-  struct dummy_frame *dummy = cached_find_dummy_frame (fi, cache);
-
-  /* If it isn't, what are we even doing here?  */
-  gdb_assert (get_frame_type (fi) == DUMMY_FRAME);
-
-  if (dummy == NULL)
-    error ("Can't pop dummy frame!");
-
-  /* Discard all dummy frames up-to but not including this one.  */
-  while (dummy_frame_stack != dummy)
-    discard_innermost_dummy (&dummy_frame_stack);
-
-  /* Restore this one.  */
-  regcache_cpy (regcache, dummy->regcache);
-  flush_cached_frames ();
-
-  /* Now discard it.  */
-  discard_innermost_dummy (&dummy_frame_stack);
-
-  /* Note: target changed would be better.  Registers, memory and
-     frame are all invalid.  */
-  flush_cached_frames ();
-}
-
 void
 generic_pop_dummy_frame (void)
 {
@@ -370,23 +339,6 @@ dummy_frame_register_unwind (struct frame_info *frame, void **cache,
     }
 }
 
-/* Assuming that FRAME is a dummy, return the resume address for the
-   previous frame.  */
-
-static CORE_ADDR
-dummy_frame_pc_unwind (struct frame_info *frame,
-                      void **cache)
-{
-  struct dummy_frame *dummy = cached_find_dummy_frame (frame, cache);
-  /* Oops!  In a dummy-frame but can't find the stack dummy.  Pretend
-     that the frame doesn't unwind.  Should this function instead
-     return a has-no-caller indication?  */
-  if (dummy == NULL)
-    return 0;
-  return dummy->pc;
-}
-
-
 /* Assuming that FRAME is a dummy, return the ID of the calling frame
    (the frame that the dummy has the saved state of).  */
 
@@ -407,8 +359,6 @@ dummy_frame_id_unwind (struct frame_info *frame,
 
 static struct frame_unwind dummy_frame_unwind =
 {
-  dummy_frame_pop,
-  dummy_frame_pc_unwind,
   dummy_frame_id_unwind,
   dummy_frame_register_unwind
 };
index a456e9cb74c312c22df5c8b7d0801c4abdc544f7..d5d08927893ac5a587be9aa9507867e039acae13 100644 (file)
@@ -447,7 +447,7 @@ evaluate_subexp_standard (struct type *expect_type,
     case OP_REGISTER:
       {
        int regno = longest_to_int (exp->elts[pc + 1].longconst);
-       struct value *val = value_of_register (regno, deprecated_selected_frame);
+       struct value *val = value_of_register (regno, get_selected_frame ());
        (*pos) += 2;
        if (val == NULL)
          error ("Value of register %s not available.",
index 3147126a75bd0587b43b9b9a8ae5c9d4c50f2699..93c4d8a6e8305a36436b0af037d632cb9c005cf7 100644 (file)
@@ -299,16 +299,16 @@ value_of_register (int regnum, struct frame_info *frame)
   CORE_ADDR addr;
   int optim;
   struct value *reg_val;
+  int realnum;
   char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
   enum lval_type lval;
 
   /* Builtin registers lie completly outside of the range of normal
      registers.  Catch them early so that the target never sees them.  */
   if (regnum >= NUM_REGS + NUM_PSEUDO_REGS)
-    return value_of_builtin_reg (regnum, deprecated_selected_frame);
+    return value_of_builtin_reg (regnum, frame);
 
-  get_saved_register (raw_buffer, &optim, &addr,
-                     frame, regnum, &lval);
+  frame_register (frame, regnum, &optim, &lval, &addr, &realnum, raw_buffer);
 
   /* FIXME: cagney/2002-05-15: This test is just bogus.
 
@@ -780,12 +780,9 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
             (value_bytes_copied += REGISTER_RAW_SIZE (local_regnum),
              ++local_regnum))
          {
-           get_saved_register (value_bytes + value_bytes_copied,
-                               &optim,
-                               &addr,
-                               frame,
-                               local_regnum,
-                               &lval);
+           int realnum;
+           frame_register (frame, local_regnum, &optim, &lval, &addr,
+                           &realnum, value_bytes + value_bytes_copied);
 
            if (register_cached (local_regnum) == -1)
              return NULL;      /* register value not available */
@@ -851,7 +848,10 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
      register's contents in a real register or in core;
      read the data in raw format.  */
 
-  get_saved_register (raw_buffer, &optim, &addr, frame, regnum, &lval);
+  {
+    int realnum;
+    frame_register (frame, regnum, &optim, &lval, &addr, &realnum, raw_buffer);
+  }
 
   if (register_cached (regnum) == -1)
     return NULL;               /* register value not available */
index 2c67c969fb1a8177de6aadebb56026bf605a3a38..5d85efe9c09dd33a96ebd5cbd314dd915d7ac64b 100644 (file)
@@ -69,12 +69,6 @@ typedef void (frame_unwind_reg_ftype) (struct frame_info * frame,
                                       CORE_ADDR *addrp,
                                       int *realnump, void *valuep);
 
-/* Same as for registers above, but return the address at which the
-   calling frame would resume.  */
-
-typedef CORE_ADDR (frame_unwind_pc_ftype) (struct frame_info * frame,
-                                          void **unwind_cache);
-
 /* Same as for registers above, but return the ID of the frame that
    called this one.  */
 
@@ -82,28 +76,11 @@ typedef void (frame_unwind_id_ftype) (struct frame_info * frame,
                                      void **unwind_cache,
                                      struct frame_id * id);
 
-/* Discard the frame by restoring the registers (in regcache) back to
-   that of the caller.  */
-/* NOTE: cagney/2003-01-19: While at present the callers all pop each
-   frame in turn, the implementor should try to code things so that
-   any frame can be popped directly.  */
-/* FIXME: cagney/2003-01-19: Since both FRAME and REGCACHE refer to a
-   common register cache, care must be taken when restoring the
-   registers.  The `correct fix' is to first first save the registers
-   in a scratch cache, and second write that scratch cache back to to
-   the real register cache.  */
-
-typedef void (frame_unwind_pop_ftype) (struct frame_info *frame,
-                                      void **unwind_cache,
-                                      struct regcache *regcache);
-
 struct frame_unwind
 {
   /* Should the frame's type go here? */
   /* Should an attribute indicating the frame's address-in-block go
      here?  */
-  frame_unwind_pop_ftype *pop;
-  frame_unwind_pc_ftype *pc;
   frame_unwind_id_ftype *id;
   frame_unwind_reg_ftype *reg;
 };
index bf860fe2ccd03414341a8fbf8b0aaf34653097ac..cf9349d658c24f46fdbb831cb8f8a308f2e3662f 100644 (file)
@@ -135,26 +135,94 @@ frame_find_by_id (struct frame_id id)
 }
 
 CORE_ADDR
-frame_pc_unwind (struct frame_info *frame)
+frame_pc_unwind (struct frame_info *this_frame)
 {
-  if (!frame->pc_unwind_cache_p)
+  if (!this_frame->pc_unwind_cache_p)
     {
-      frame->pc_unwind_cache = frame->unwind->pc (frame, &frame->unwind_cache);
-      frame->pc_unwind_cache_p = 1;
+      CORE_ADDR pc;
+      if (gdbarch_unwind_pc_p (current_gdbarch))
+       {
+         /* The right way.  The `pure' way.  The one true way.  This
+            method depends solely on the register-unwind code to
+            determine the value of registers in THIS frame, and hence
+            the value of this frame's PC (resume address).  A typical
+            implementation is no more than:
+          
+            frame_unwind_register (this_frame, ISA_PC_REGNUM, buf);
+            return extract_address (buf, size of ISA_PC_REGNUM);
+
+            Note: this method is very heavily dependent on a correct
+            register-unwind implementation, it pays to fix that
+            method first; this method is frame type agnostic, since
+            it only deals with register values, it works with any
+            frame.  This is all in stark contrast to the old
+            FRAME_SAVED_PC which would try to directly handle all the
+            different ways that a PC could be unwound.  */
+         pc = gdbarch_unwind_pc (current_gdbarch, this_frame);
+       }
+      else if (this_frame->level < 0)
+       {
+         /* FIXME: cagney/2003-03-06: Old code and and a sentinel
+             frame.  Do like was always done.  Fetch the PC's value
+             direct from the global registers array (via read_pc).
+             This assumes that this frame belongs to the current
+             global register cache.  The assumption is dangerous.  */
+         pc = read_pc ();
+       }
+      else if (DEPRECATED_FRAME_SAVED_PC_P ())
+       {
+         /* FIXME: cagney/2003-03-06: Old code, but not a sentinel
+             frame.  Do like was always done.  Note that this method,
+             unlike unwind_pc(), tries to handle all the different
+             frame cases directly.  It fails.  */
+         pc = DEPRECATED_FRAME_SAVED_PC (this_frame);
+       }
+      else
+       internal_error (__FILE__, __LINE__, "No gdbarch_unwind_pc method");
+      this_frame->pc_unwind_cache = pc;
+      this_frame->pc_unwind_cache_p = 1;
     }
-  return frame->pc_unwind_cache;
+  return this_frame->pc_unwind_cache;
+}
+
+static int
+do_frame_unwind_register (void *src, int regnum, void *buf)
+{
+  frame_unwind_register (src, regnum, buf);
+  return 1;
 }
 
 void
-frame_pop (struct frame_info *frame)
+frame_pop (struct frame_info *this_frame)
 {
-  /* FIXME: cagney/2003-01-18: There is probably a chicken-egg problem
-     with passing in current_regcache.  The pop function needs to be
-     written carefully so as to not overwrite registers whose [old]
-     values are needed to restore other registers.  Instead, this code
-     should pass in a scratch cache and, as a second step, restore the
-     registers using that.  */
-  frame->unwind->pop (frame, &frame->unwind_cache, current_regcache);
+  struct regcache *scratch_regcache;
+  struct cleanup *cleanups;
+
+  if (DEPRECATED_POP_FRAME_P ())
+    {
+      /* A legacy architecture that has implemented a custom pop
+        function.  All new architectures should instead be using the
+        generic code below.  */
+      DEPRECATED_POP_FRAME;
+    }
+  else
+    {
+      /* Make a copy of all the register values unwound from this
+        frame.  Save them in a scratch buffer so that there isn't a
+        race betweening trying to extract the old values from the
+        current_regcache while, at the same time writing new values
+        into that same cache.  */
+      struct regcache *scratch = regcache_xmalloc (current_gdbarch);
+      struct cleanup *cleanups = make_cleanup_regcache_xfree (scratch);
+      regcache_save (scratch, do_frame_unwind_register, this_frame);
+      /* Now copy those saved registers into the current regcache.
+         Here, regcache_cpy() calls regcache_restore().  */
+      regcache_cpy (current_regcache, scratch);
+      do_cleanups (cleanups);
+    }
+  /* We've made right mess of GDB's local state, just discard
+     everything.  */
+  target_store_registers (-1);
   flush_cached_frames ();
 }
 
@@ -200,9 +268,10 @@ frame_register (struct frame_info *frame, int regnum,
   /* Ulgh!  Old code that, for lval_register, sets ADDRP to the offset
      of the register in the register cache.  It should instead return
      the REGNUM corresponding to that register.  Translate the .  */
-  if (GET_SAVED_REGISTER_P ())
+  if (DEPRECATED_GET_SAVED_REGISTER_P ())
     {
-      GET_SAVED_REGISTER (bufferp, optimizedp, addrp, frame, regnum, lvalp);
+      DEPRECATED_GET_SAVED_REGISTER (bufferp, optimizedp, addrp, frame,
+                                    regnum, lvalp);
       /* Compute the REALNUM if the caller wants it.  */
       if (*lvalp == lval_register)
        {
@@ -330,23 +399,6 @@ generic_unwind_get_saved_register (char *raw_buffer,
                         &realnumx, raw_buffer);
 }
 
-void
-get_saved_register (char *raw_buffer,
-                   int *optimized,
-                   CORE_ADDR *addrp,
-                   struct frame_info *frame,
-                   int regnum,
-                   enum lval_type *lval)
-{
-  if (GET_SAVED_REGISTER_P ())
-    {
-      GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval);
-      return;
-    }
-  generic_unwind_get_saved_register (raw_buffer, optimized, addrp, frame,
-                                    regnum, lval);
-}
-
 /* frame_register_read ()
 
    Find and return the value of REGNUM for the specified stack frame.
@@ -498,10 +550,15 @@ unwind_to_current_frame (struct ui_out *ui_out, void *args)
 struct frame_info *
 get_current_frame (void)
 {
-  if (!target_has_stack)
-    error ("No stack.");
+  /* First check, and report, the lack of registers.  Having GDB
+     report "No stack!" or "No memory" when the target doesn't even
+     have registers is very confusing.  Besides, "printcmd.exp"
+     explicitly checks that ``print $pc'' with no registers prints "No
+     registers".  */
   if (!target_has_registers)
     error ("No registers.");
+  if (!target_has_stack)
+    error ("No stack.");
   if (!target_has_memory)
     error ("No memory.");
   if (current_frame == NULL)
@@ -667,13 +724,6 @@ frame_saved_regs_register_unwind (struct frame_info *frame, void **cache,
                  bufferp);
 }
 
-static CORE_ADDR
-frame_saved_regs_pc_unwind (struct frame_info *frame, void **cache)
-{
-  gdb_assert (FRAME_SAVED_PC_P ());
-  return FRAME_SAVED_PC (frame);
-}
-       
 static void
 frame_saved_regs_id_unwind (struct frame_info *next_frame, void **cache,
                            struct frame_id *id)
@@ -735,26 +785,17 @@ frame_saved_regs_id_unwind (struct frame_info *next_frame, void **cache,
   id->base = base;
 }
        
-static void
-frame_saved_regs_pop (struct frame_info *fi, void **cache,
-                     struct regcache *regcache)
-{
-  gdb_assert (POP_FRAME_P ());
-  POP_FRAME;
-}
-
 const struct frame_unwind trad_frame_unwinder = {
-  frame_saved_regs_pop,
-  frame_saved_regs_pc_unwind,
   frame_saved_regs_id_unwind,
   frame_saved_regs_register_unwind
 };
 const struct frame_unwind *trad_frame_unwind = &trad_frame_unwinder;
 
 
-/* Function: get_saved_register
+/* Function: deprecated_generic_get_saved_register
+
    Find register number REGNUM relative to FRAME and put its (raw,
-   target format) contents in *RAW_BUFFER.  
+   target format) contents in *RAW_BUFFER.
 
    Set *OPTIMIZED if the variable was optimized out (and thus can't be
    fetched).  Note that this is never set to anything other than zero
@@ -770,10 +811,6 @@ const struct frame_unwind *trad_frame_unwind = &trad_frame_unwinder;
    offset into the registers array.  If the value is stored in a dummy
    frame, set *ADDRP to zero.
 
-   To use this implementation, define a function called
-   "get_saved_register" in your target code, which simply passes all
-   of its arguments to this function.
-
    The argument RAW_BUFFER must point to aligned memory.  */
 
 void
@@ -904,15 +941,15 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
   return fi;
 }
 
-/* Return the frame that FRAME calls (NULL if FRAME is the innermost
-   frame).  Be careful to not fall off the bottom of the frame chain
-   and onto the sentinel frame.  */
+/* Return the frame that THIS_FRAME calls (NULL if THIS_FRAME is the
+   innermost frame).  Be careful to not fall off the bottom of the
+   frame chain and onto the sentinel frame.  */
 
 struct frame_info *
-get_next_frame (struct frame_info *frame)
+get_next_frame (struct frame_info *this_frame)
 {
-  if (frame->level > 0)
-    return frame->next;
+  if (this_frame->level > 0)
+    return this_frame->next;
   else
     return NULL;
 }
@@ -949,15 +986,151 @@ reinit_frame_cache (void)
    INIT_EXTRA_INFO, INIT_FRAME_PC and INIT_FRAME_PC_FIRST.  */
 
 static struct frame_info *
-legacy_get_prev_frame (struct frame_info *next_frame)
+legacy_get_prev_frame (struct frame_info *this_frame)
 {
   CORE_ADDR address = 0;
   struct frame_info *prev;
   int fromleaf;
 
+  /* Allocate the new frame but do not wire it in to the frame chain.
+     Some (bad) code in INIT_FRAME_EXTRA_INFO tries to look along
+     frame->next to pull some fancy tricks (of course such code is, by
+     definition, recursive).  Try to prevent it.
+
+     There is no reason to worry about memory leaks, should the
+     remainder of the function fail.  The allocated memory will be
+     quickly reclaimed when the frame cache is flushed, and the `we've
+     been here before' check, in get_prev_frame will stop repeated
+     memory allocation calls.  */
+  prev = FRAME_OBSTACK_ZALLOC (struct frame_info);
+  prev->level = this_frame->level + 1;
+
+  /* NOTE: cagney/2002-11-18: Should have been correctly setting the
+     frame's type here, before anything else, and not last, at the
+     bottom of this function.  The various
+     DEPRECATED_INIT_EXTRA_FRAME_INFO, DEPRECATED_INIT_FRAME_PC,
+     DEPRECATED_INIT_FRAME_PC_FIRST and
+     DEPRECATED_FRAME_INIT_SAVED_REGS methods are full of work-arounds
+     that handle the frame not being correctly set from the start.
+     Unfortunatly those same work-arounds rely on the type defaulting
+     to NORMAL_FRAME.  Ulgh!  The new frame code does not have this
+     problem.  */
+  prev->type = NORMAL_FRAME;
+
+  /* Handle sentinel frame unwind as a special case.  */
+  if (this_frame->level < 0)
+    {
+      /* Try to unwind the PC.  If that doesn't work, assume we've reached
+        the oldest frame and simply return.  Is there a better sentinal
+        value?  The unwound PC value is then used to initialize the new
+        previous frame's type.
+
+        Note that the pc-unwind is intentionally performed before the
+        frame chain.  This is ok since, for old targets, both
+        frame_pc_unwind (nee, FRAME_SAVED_PC) and FRAME_CHAIN()) assume
+        THIS_FRAME's data structures have already been initialized (using
+        DEPRECATED_INIT_EXTRA_FRAME_INFO) and hence the call order
+        doesn't matter.
+        
+        By unwinding the PC first, it becomes possible to, in the case of
+        a dummy frame, avoid also unwinding the frame ID.  This is
+        because (well ignoring the PPC) a dummy frame can be located
+        using THIS_FRAME's frame ID.  */
+      
+      prev->pc = frame_pc_unwind (this_frame);
+      if (prev->pc == 0)
+       {
+         /* The allocated PREV_FRAME will be reclaimed when the frame
+            obstack is next purged.  */
+         if (frame_debug)
+           fprintf_unfiltered (gdb_stdlog,
+                               "Outermost frame - unwound PC zero\n");
+         return NULL;
+       }
+      prev->type = frame_type_from_pc (prev->pc);
+
+      /* Set the unwind functions based on that identified PC.  */
+      prev->unwind = frame_unwind_find_by_pc (current_gdbarch, prev->pc);
+
+      /* Find the prev's frame's ID.  */
+      if (prev->type == DUMMY_FRAME
+         && gdbarch_unwind_dummy_id_p (current_gdbarch))
+       {
+         /* When unwinding a normal frame, the stack structure is
+            determined by analyzing the frame's function's code (be
+            it using brute force prologue analysis, or the dwarf2
+            CFI).  In the case of a dummy frame, that simply isn't
+            possible.  The The PC is either the program entry point,
+            or some random address on the stack.  Trying to use that
+            PC to apply standard frame ID unwind techniques is just
+            asking for trouble.  */
+         /* Assume hand_function_call(), via SAVE_DUMMY_FRAME_TOS,
+            previously saved the dummy frame's ID.  Things only work
+            if the two return the same value.  */
+         gdb_assert (SAVE_DUMMY_FRAME_TOS_P ());
+         /* Use an architecture specific method to extract the prev's
+            dummy ID from the next frame.  Note that this method uses
+            frame_register_unwind to obtain the register values
+            needed to determine the dummy frame's ID.  */
+         prev->id = gdbarch_unwind_dummy_id (current_gdbarch, this_frame);
+       }
+      else
+       {
+         /* We're unwinding a sentinel frame, the PC of which is
+            pointing at a stack dummy.  Fake up the dummy frame's ID
+            using the same sequence as is found a traditional
+            unwinder.  Once all architectures supply the
+            unwind_dummy_id method, this code can go away.  */
+         prev->id.base = read_fp ();
+         prev->id.pc = read_pc ();
+       }
+
+      /* Check that the unwound ID is valid.  */
+      if (!frame_id_p (prev->id))
+       {
+         if (frame_debug)
+           fprintf_unfiltered (gdb_stdlog,
+                               "Outermost legacy sentinel frame - unwound frame ID invalid\n");
+         return NULL;
+       }
+
+      /* Check that the new frame isn't inner to (younger, below,
+        next) the old frame.  If that happens the frame unwind is
+        going backwards.  */
+      /* FIXME: cagney/2003-02-25: Ignore the sentinel frame since
+        that doesn't have a valid frame ID.  Should instead set the
+        sentinel frame's frame ID to a `sentinel'.  Leave it until
+        after the switch to storing the frame ID, instead of the
+        frame base, in the frame object.  */
+
+      /* FIXME: cagney/2002-12-18: Instead of this hack, should only
+        store the frame ID in PREV_FRAME.  Unfortunatly, some
+        architectures (HP/UX) still reply on EXTRA_FRAME_INFO and,
+        hence, still poke at the "struct frame_info" object directly.  */
+      prev->frame = prev->id.base;
+
+      /* Link it in.  */
+      this_frame->prev = prev;
+      prev->next = this_frame;
+
+      /* FIXME: cagney/2002-01-19: This call will go away.  Instead of
+        initializing extra info, all frames will use the frame_cache
+        (passed to the unwind functions) to store additional frame
+        info.  Unfortunatly legacy targets can't use
+        legacy_get_prev_frame() to unwind the sentinel frame and,
+        consequently, are forced to take this code path and rely on
+        the below call to DEPRECATED_INIT_EXTRA_FRAME_INFO to
+        initialize the inner-most frame.  */
+      if (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ())
+       {
+         DEPRECATED_INIT_EXTRA_FRAME_INFO (0, prev);
+       }
+      return prev;
+    }
+
   /* This code only works on normal frames.  A sentinel frame, where
      the level is -1, should never reach this code.  */
-  gdb_assert (next_frame->level >= 0);
+  gdb_assert (this_frame->level >= 0);
 
   /* On some machines it is possible to call a function without
      setting up a stack frame for it.  On these machines, we
@@ -966,14 +1139,14 @@ legacy_get_prev_frame (struct frame_info *next_frame)
      or isn't leafless.  */
 
   /* Still don't want to worry about this except on the innermost
-     frame.  This macro will set FROMLEAF if NEXT_FRAME is a frameless
+     frame.  This macro will set FROMLEAF if THIS_FRAME is a frameless
      function invocation.  */
-  if (next_frame->level == 0)
+  if (this_frame->level == 0)
     /* FIXME: 2002-11-09: Frameless functions can occure anywhere in
        the frame chain, not just the inner most frame!  The generic,
        per-architecture, frame code should handle this and the below
        should simply be removed.  */
-    fromleaf = FRAMELESS_FUNCTION_INVOCATION (next_frame);
+    fromleaf = FRAMELESS_FUNCTION_INVOCATION (this_frame);
   else
     fromleaf = 0;
 
@@ -984,7 +1157,7 @@ legacy_get_prev_frame (struct frame_info *next_frame)
     /* FIXME: 2002-11-09: There isn't any reason to special case this
        edge condition.  Instead the per-architecture code should hande
        it locally.  */
-    address = get_frame_base (next_frame);
+    address = get_frame_base (this_frame);
   else
     {
       /* Two macros defined in tm.h specify the machine-dependent
@@ -1003,27 +1176,18 @@ legacy_get_prev_frame (struct frame_info *next_frame)
          start go curfluy than have an abort called from main not show
          main.  */
       gdb_assert (FRAME_CHAIN_P ());
-      address = FRAME_CHAIN (next_frame);
+      address = FRAME_CHAIN (this_frame);
 
-      if (!frame_chain_valid (address, next_frame))
+      if (!frame_chain_valid (address, this_frame))
        return 0;
     }
   if (address == 0)
     return 0;
 
-  /* Create an initially zero previous frame.  */
-  prev = frame_obstack_zalloc (sizeof (struct frame_info));
-
-  /* Link it in.  */
-  next_frame->prev = prev;
-  prev->next = next_frame;
+  /* Link in the already allocated prev frame.  */
+  this_frame->prev = prev;
+  prev->next = this_frame;
   prev->frame = address;
-  prev->level = next_frame->level + 1;
-  /* FIXME: cagney/2002-11-18: Should be setting the frame's type
-     here, before anything else, and not last.  Various INIT functions
-     are full of work-arounds for the frames type not being set
-     correctly from the word go.  Ulgh!  */
-  prev->type = NORMAL_FRAME;
 
   /* This change should not be needed, FIXME!  We should determine
      whether any targets *need* DEPRECATED_INIT_FRAME_PC to happen
@@ -1083,7 +1247,7 @@ legacy_get_prev_frame (struct frame_info *next_frame)
      inner most and any other case.
 
      Since there is always a frame to unwind from, there is always
-     somewhere (NEXT_FRAME) to store all the info needed to construct
+     somewhere (THIS_FRAME) to store all the info needed to construct
      a new (previous) frame without having to first create it.  This
      means that the convolution below - needing to carefully order a
      frame's initialization - isn't needed.
@@ -1112,10 +1276,10 @@ legacy_get_prev_frame (struct frame_info *next_frame)
      getting ourselves into an infinite backtrace.  Some architectures
      check this in FRAME_CHAIN or thereabouts, but it seems like there
      is no reason this can't be an architecture-independent check.  */
-  if (prev->frame == next_frame->frame
-      && prev->pc == next_frame->pc)
+  if (prev->frame == this_frame->frame
+      && prev->pc == this_frame->pc)
     {
-      next_frame->prev = NULL;
+      this_frame->prev = NULL;
       obstack_free (&frame_cache_obstack, prev);
       return NULL;
     }
@@ -1163,11 +1327,11 @@ legacy_get_prev_frame (struct frame_info *next_frame)
 }
 
 /* Return a structure containing various interesting information
-   about the frame that called NEXT_FRAME.  Returns NULL
+   about the frame that called THIS_FRAME.  Returns NULL
    if there is no such frame.  */
 
 struct frame_info *
-get_prev_frame (struct frame_info *next_frame)
+get_prev_frame (struct frame_info *this_frame)
 {
   struct frame_info *prev_frame;
 
@@ -1189,7 +1353,7 @@ get_prev_frame (struct frame_info *next_frame)
      that a frame isn't possible, rather than checking that the target
      has state and then calling get_current_frame() and
      get_prev_frame().  This is a guess mind.  */
-  if (next_frame == NULL)
+  if (this_frame == NULL)
     {
       /* NOTE: cagney/2002-11-09: There was a code segment here that
         would error out when CURRENT_FRAME was NULL.  The comment
@@ -1202,18 +1366,18 @@ get_prev_frame (struct frame_info *next_frame)
         thing to do.''
 
          Per the above, this code shouldn't even be called with a NULL
-         NEXT_FRAME.  */
+         THIS_FRAME.  */
       return current_frame;
     }
 
   /* There is always a frame.  If this assertion fails, suspect that
      something should be calling get_selected_frame() or
      get_current_frame().  */
-  gdb_assert (next_frame != NULL);
+  gdb_assert (this_frame != NULL);
 
-  if (next_frame->level >= 0
+  if (this_frame->level >= 0
       && !backtrace_below_main
-      && inside_main_func (get_frame_pc (next_frame)))
+      && inside_main_func (get_frame_pc (this_frame)))
     /* Don't unwind past main(), bug always unwind the sentinel frame.
        Note, this is done _before_ the frame has been marked as
        previously unwound.  That way if the user later decides to
@@ -1226,9 +1390,9 @@ get_prev_frame (struct frame_info *next_frame)
     }
 
   /* Only try to do the unwind once.  */
-  if (next_frame->prev_p)
-    return next_frame->prev;
-  next_frame->prev_p = 1;
+  if (this_frame->prev_p)
+    return this_frame->prev;
+  this_frame->prev_p = 1;
 
   /* If we're inside the entry file, it isn't valid.  Don't apply this
      test to a dummy frame - dummy frame PC's typically land in the
@@ -1241,8 +1405,8 @@ get_prev_frame (struct frame_info *next_frame)
   /* NOTE: cagney/2003-01-10: If there is a way of disabling this test
      then it should probably be moved to before the ->prev_p test,
      above.  */
-  if (next_frame->type != DUMMY_FRAME && next_frame->level >= 0
-      && inside_entry_file (get_frame_pc (next_frame)))
+  if (this_frame->type != DUMMY_FRAME && this_frame->level >= 0
+      && inside_entry_file (get_frame_pc (this_frame)))
     {
       if (frame_debug)
        fprintf_unfiltered (gdb_stdlog,
@@ -1258,8 +1422,8 @@ get_prev_frame (struct frame_info *next_frame)
   /* NOTE: cagney/2003-02-25: Don't enable until someone has found
      hard evidence that this is needed.  */
   if (0
-      && next_frame->type != DUMMY_FRAME && next_frame->level >= 0
-      && inside_entry_func (get_frame_pc (next_frame)))
+      && this_frame->type != DUMMY_FRAME && this_frame->level >= 0
+      && inside_entry_func (get_frame_pc (this_frame)))
     {
       if (frame_debug)
        fprintf_unfiltered (gdb_stdlog,
@@ -1268,16 +1432,10 @@ get_prev_frame (struct frame_info *next_frame)
     }
 
   /* If any of the old frame initialization methods are around, use
-     the legacy get_prev_frame method.  Just don't try to unwind a
-     sentinel frame using that method - it doesn't work.  All sentinal
-     frames use the new unwind code.  */
-  if ((DEPRECATED_INIT_FRAME_PC_P ()
-       || DEPRECATED_INIT_FRAME_PC_FIRST_P ()
-       || DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()
-       || FRAME_CHAIN_P ())
-      && next_frame->level >= 0)
+     the legacy get_prev_frame method.  */
+  if (legacy_frame_p (current_gdbarch))
     {
-      prev_frame = legacy_get_prev_frame (next_frame);
+      prev_frame = legacy_get_prev_frame (this_frame);
       if (frame_debug && prev_frame == NULL)
        fprintf_unfiltered (gdb_stdlog,
                            "Outermost frame - legacy_get_prev_frame NULL.\n");
@@ -1295,7 +1453,7 @@ get_prev_frame (struct frame_info *next_frame)
      been here before' check above will stop repeated memory
      allocation calls.  */
   prev_frame = FRAME_OBSTACK_ZALLOC (struct frame_info);
-  prev_frame->level = next_frame->level + 1;
+  prev_frame->level = this_frame->level + 1;
 
   /* Try to unwind the PC.  If that doesn't work, assume we've reached
      the oldest frame and simply return.  Is there a better sentinal
@@ -1305,16 +1463,16 @@ get_prev_frame (struct frame_info *next_frame)
      Note that the pc-unwind is intentionally performed before the
      frame chain.  This is ok since, for old targets, both
      frame_pc_unwind (nee, FRAME_SAVED_PC) and FRAME_CHAIN()) assume
-     NEXT_FRAME's data structures have already been initialized (using
+     THIS_FRAME's data structures have already been initialized (using
      DEPRECATED_INIT_EXTRA_FRAME_INFO) and hence the call order
      doesn't matter.
 
      By unwinding the PC first, it becomes possible to, in the case of
      a dummy frame, avoid also unwinding the frame ID.  This is
      because (well ignoring the PPC) a dummy frame can be located
-     using NEXT_FRAME's frame ID.  */
+     using THIS_FRAME's frame ID.  */
 
-  prev_frame->pc = frame_pc_unwind (next_frame);
+  prev_frame->pc = frame_pc_unwind (this_frame);
   if (prev_frame->pc == 0)
     {
       /* The allocated PREV_FRAME will be reclaimed when the frame
@@ -1342,47 +1500,24 @@ get_prev_frame (struct frame_info *next_frame)
         address on the stack.  Trying to use that PC to apply
         standard frame ID unwind techniques is just asking for
         trouble.  */
-      if (gdbarch_unwind_dummy_id_p (current_gdbarch))
-       {
-         /* Assume hand_function_call(), via SAVE_DUMMY_FRAME_TOS,
-            previously saved the dummy frame's ID.  Things only work
-            if the two return the same value.  */
-         gdb_assert (SAVE_DUMMY_FRAME_TOS_P ());
-         /* Use an architecture specific method to extract the prev's
-            dummy ID from the next frame.  Note that this method uses
-            frame_register_unwind to obtain the register values
-            needed to determine the dummy frame's ID.  */
-         prev_frame->id = gdbarch_unwind_dummy_id (current_gdbarch,
-                                                   next_frame);
-       }
-      else if (next_frame->level < 0)
-       {
-         /* We're unwinding a sentinel frame, the PC of which is
-            pointing at a stack dummy.  Fake up the dummy frame's ID
-            using the same sequence as is found a traditional
-            unwinder.  Once all architectures supply the
-            unwind_dummy_id method, this code can go away.  */
-         prev_frame->id.base = read_fp ();
-         prev_frame->id.pc = read_pc ();
-       }
-      else
-       {
-         /* Outch!  We're not on the innermost frame yet we're trying
-            to unwind to a dummy.  The architecture must provide the
-            unwind_dummy_id() method.  Abandon the unwind process but
-            only after first warning the user.  */
-         internal_warning (__FILE__, __LINE__,
-                           "Missing unwind_dummy_id architecture method");
-         return NULL;
-       }
+      gdb_assert (gdbarch_unwind_dummy_id_p (current_gdbarch));
+       /* Assume hand_function_call(), via SAVE_DUMMY_FRAME_TOS,
+          previously saved the dummy frame's ID.  Things only work if
+          the two return the same value.  */
+      gdb_assert (SAVE_DUMMY_FRAME_TOS_P ());
+      /* Use an architecture specific method to extract the prev's
+        dummy ID from the next frame.  Note that this method uses
+        frame_register_unwind to obtain the register values needed to
+        determine the dummy frame's ID.  */
+      prev_frame->id = gdbarch_unwind_dummy_id (current_gdbarch, this_frame);
       break;
     case NORMAL_FRAME:
     case SIGTRAMP_FRAME:
       /* FIXME: cagney/2003-03-04: The below call isn't right.  It
         should instead be doing something like "prev_frame -> unwind
-        -> id (next_frame, & prev_frame -> unwind_cache, & prev_frame
+        -> id (this_frame, & prev_frame -> unwind_cache, & prev_frame
         -> id)" but that requires more extensive (pending) changes.  */
-      next_frame->unwind->id (next_frame, &next_frame->unwind_cache,
+      this_frame->unwind->id (this_frame, &this_frame->unwind_cache,
                              &prev_frame->id);
       /* Check that the unwound ID is valid.  */
       if (!frame_id_p (prev_frame->id))
@@ -1400,8 +1535,8 @@ get_prev_frame (struct frame_info *next_frame)
         sentinel frame's frame ID to a `sentinel'.  Leave it until
         after the switch to storing the frame ID, instead of the
         frame base, in the frame object.  */
-      if (next_frame->level >= 0
-         && frame_id_inner (prev_frame->id, get_frame_id (next_frame)))
+      if (this_frame->level >= 0
+         && frame_id_inner (prev_frame->id, get_frame_id (this_frame)))
        error ("Unwound frame inner-to selected frame (corrupt stack?)");
       /* Note that, due to frameless functions, the stronger test of
         the new frame being outer to the old frame can't be used -
@@ -1418,22 +1553,8 @@ get_prev_frame (struct frame_info *next_frame)
   prev_frame->frame = prev_frame->id.base;
 
   /* Link it in.  */
-  next_frame->prev = prev_frame;
-  prev_frame->next = next_frame;
-
-  /* FIXME: cagney/2002-01-19: This call will go away.  Instead of
-     initializing extra info, all frames will use the frame_cache
-     (passed to the unwind functions) to store additional frame info.
-     Unfortunatly legacy targets can't use legacy_get_prev_frame() to
-     unwind the sentinel frame and, consequently, are forced to take
-     this code path and rely on the below call to
-     DEPRECATED_INIT_EXTRA_FRAME_INFO to initialize the inner-most
-     frame.  */
-  if (DEPRECATED_INIT_EXTRA_FRAME_INFO_P ())
-    {
-      gdb_assert (prev_frame->level == 0);
-      DEPRECATED_INIT_EXTRA_FRAME_INFO (0, prev_frame);
-    }
+  this_frame->prev = prev_frame;
+  prev_frame->next = this_frame;
 
   return prev_frame;
 }
@@ -1551,12 +1672,18 @@ deprecated_update_frame_pc_hack (struct frame_info *frame, CORE_ADDR pc)
 {
   /* See comment in "frame.h".  */
   frame->pc = pc;
-  /* While we're at it, update this frame's cached PC value, found in
-     the next frame.  Oh, for the day when "struct frame_info" is
-     opaque and this hack on hack can go.  */
-  gdb_assert (frame->next != NULL);
-  frame->next->pc_unwind_cache = pc;
-  frame->next->pc_unwind_cache_p = 1;
+  /* NOTE: cagney/2003-03-11: Some architectures (e.g., Arm) are
+     maintaining a locally allocated frame object.  Since such frame's
+     are not in the frame chain, it isn't possible to assume that the
+     frame has a next.  Sigh.  */
+  if (frame->next != NULL)
+    {
+      /* While we're at it, update this frame's cached PC value, found
+        in the next frame.  Oh for the day when "struct frame_info"
+        is opaque and this hack on hack can just go away.  */
+      frame->next->pc_unwind_cache = pc;
+      frame->next->pc_unwind_cache_p = 1;
+    }
 }
 
 void
@@ -1634,6 +1761,17 @@ deprecated_frame_xmalloc_with_cleanup (long sizeof_saved_regs,
   return frame;
 }
 
+int
+legacy_frame_p (struct gdbarch *current_gdbarch)
+{
+  return (DEPRECATED_INIT_FRAME_PC_P ()
+         || DEPRECATED_INIT_FRAME_PC_FIRST_P ()
+         || DEPRECATED_INIT_EXTRA_FRAME_INFO_P ()
+         || FRAME_CHAIN_P ()
+         || !gdbarch_unwind_dummy_id_p (current_gdbarch)
+         || !SAVE_DUMMY_FRAME_TOS_P ());
+}
+
 void
 _initialize_frame (void)
 {
index 18c4df4397fb26a616cca0867432267e6e618ccb..c4905dd2e135764f3fd7ca53b672be6794e7f1f1 100644 (file)
@@ -538,7 +538,7 @@ extern int generic_pc_in_call_dummy (CORE_ADDR pc,
 /* NOTE: cagney/2002-06-26: Targets should no longer use this
    function.  Instead, the contents of a dummy frames registers can be
    obtained by applying: frame_register_unwind to the dummy frame; or
-   get_saved_register to the next outer frame.  */
+   frame_register_unwind() to the next outer frame.  */
 
 extern char *deprecated_generic_find_dummy_frame (CORE_ADDR pc, CORE_ADDR fp);
 
@@ -554,21 +554,17 @@ void generic_unwind_get_saved_register (char *raw_buffer,
                                        enum lval_type *lvalp);
 
 /* The function generic_get_saved_register() has been made obsolete.
-   GET_SAVED_REGISTER now defaults to the recursive equivalent -
-   generic_unwind_get_saved_register() - so there is no need to even
-   set GET_SAVED_REGISTER.  Architectures that need to override the
-   register unwind mechanism should modify frame->unwind().  */
+   DEPRECATED_GET_SAVED_REGISTER now defaults to the recursive
+   equivalent - generic_unwind_get_saved_register() - so there is no
+   need to even set DEPRECATED_GET_SAVED_REGISTER.  Architectures that
+   need to override the register unwind mechanism should modify
+   frame->unwind().  */
 extern void deprecated_generic_get_saved_register (char *, int *, CORE_ADDR *,
                                                   struct frame_info *, int,
                                                   enum lval_type *);
 
 extern void generic_save_call_dummy_addr (CORE_ADDR lo, CORE_ADDR hi);
 
-extern void get_saved_register (char *raw_buffer, int *optimized,
-                               CORE_ADDR * addrp,
-                               struct frame_info *frame,
-                               int regnum, enum lval_type *lval);
-
 /* FIXME: cagney/2003-02-02: Should be deprecated or replaced with a
    function called frame_read_register_p().  This slightly weird (and
    older) variant of frame_read_register() returns zero (indicating
@@ -701,4 +697,8 @@ extern struct context *deprecated_get_frame_context (struct frame_info *fi);
 extern void deprecated_set_frame_context (struct frame_info *fi,
                                          struct context *context);
 
+/* Return non-zero if the architecture is relying on legacy frame
+   code.  */
+extern int legacy_frame_p (struct gdbarch *gdbarch);
+
 #endif /* !defined (FRAME_H)  */
index d27970724bf134b11737c6b115d6a55a964d0b66..2753283d6956c473b029ddf65dcd90432dd89f5b 100644 (file)
@@ -36,7 +36,6 @@ static gdbarch_register_virtual_type_ftype frv_register_virtual_type;
 static gdbarch_register_byte_ftype frv_register_byte;
 static gdbarch_breakpoint_from_pc_ftype frv_breakpoint_from_pc;
 static gdbarch_frame_chain_ftype frv_frame_chain;
-static gdbarch_frame_saved_pc_ftype frv_frame_saved_pc;
 static gdbarch_skip_prologue_ftype frv_skip_prologue;
 static gdbarch_deprecated_extract_return_value_ftype frv_extract_return_value;
 static gdbarch_deprecated_extract_struct_value_address_ftype frv_extract_struct_value_address;
@@ -46,7 +45,6 @@ static gdbarch_init_extra_frame_info_ftype stupid_useless_init_extra_frame_info;
 static gdbarch_store_struct_return_ftype frv_store_struct_return;
 static gdbarch_push_arguments_ftype frv_push_arguments;
 static gdbarch_push_return_address_ftype frv_push_return_address;
-static gdbarch_pop_frame_ftype frv_pop_frame;
 static gdbarch_saved_pc_after_call_ftype frv_saved_pc_after_call;
 
 static void frv_pop_frame_regular (struct frame_info *frame);
@@ -1081,7 +1079,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_saved_pc_after_call (gdbarch, frv_saved_pc_after_call);
 
   set_gdbarch_frame_chain (gdbarch, frv_frame_chain);
-  set_gdbarch_frame_saved_pc (gdbarch, frv_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, frv_frame_saved_pc);
 
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, frv_frame_init_saved_regs);
 
@@ -1096,7 +1094,7 @@ frv_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_call_dummy_length (gdbarch, 0);
   set_gdbarch_push_arguments (gdbarch, frv_push_arguments);
   set_gdbarch_push_return_address (gdbarch, frv_push_return_address);
-  set_gdbarch_pop_frame (gdbarch, frv_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, frv_pop_frame);
 
   set_gdbarch_call_dummy_p (gdbarch, 1);
   set_gdbarch_call_dummy_words (gdbarch, frv_call_dummy_words);
index 636349c7be2aa3cc0c57e148b58950750f14e18a..94e89f3a33b4a9a9b7086cb440e83bd26ecae074 100644 (file)
@@ -202,7 +202,7 @@ struct gdbarch
   gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc;
   int believe_pcc_promotion;
   int believe_pcc_promotion_type;
-  gdbarch_get_saved_register_ftype *get_saved_register;
+  gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register;
   gdbarch_register_convertible_ftype *register_convertible;
   gdbarch_register_convert_to_virtual_ftype *register_convert_to_virtual;
   gdbarch_register_convert_to_raw_ftype *register_convert_to_raw;
@@ -216,7 +216,7 @@ struct gdbarch
   gdbarch_push_arguments_ftype *push_arguments;
   gdbarch_deprecated_push_dummy_frame_ftype *deprecated_push_dummy_frame;
   gdbarch_push_return_address_ftype *push_return_address;
-  gdbarch_pop_frame_ftype *pop_frame;
+  gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame;
   gdbarch_store_struct_return_ftype *store_struct_return;
   gdbarch_extract_return_value_ftype *extract_return_value;
   gdbarch_store_return_value_ftype *store_return_value;
@@ -241,7 +241,8 @@ struct gdbarch
   gdbarch_frameless_function_invocation_ftype *frameless_function_invocation;
   gdbarch_frame_chain_ftype *frame_chain;
   gdbarch_frame_chain_valid_ftype *frame_chain_valid;
-  gdbarch_frame_saved_pc_ftype *frame_saved_pc;
+  gdbarch_deprecated_frame_saved_pc_ftype *deprecated_frame_saved_pc;
+  gdbarch_unwind_pc_ftype *unwind_pc;
   gdbarch_frame_args_address_ftype *frame_args_address;
   gdbarch_frame_locals_address_ftype *frame_locals_address;
   gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
@@ -433,6 +434,7 @@ struct gdbarch startup_gdbarch =
   0,
   0,
   0,
+  0,
   generic_in_function_epilogue_p,
   construct_inferior_arguments,
   0,
@@ -709,7 +711,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
     fprintf_unfiltered (log, "\n\tfix_call_dummy");
   /* Skip verify of deprecated_init_frame_pc_first, has predicate */
   /* Skip verify of deprecated_init_frame_pc, has predicate */
-  /* Skip verify of get_saved_register, has predicate */
+  /* Skip verify of deprecated_get_saved_register, has predicate */
   /* Skip verify of register_convertible, invalid_p == 0 */
   /* Skip verify of register_convert_to_virtual, invalid_p == 0 */
   /* Skip verify of register_convert_to_raw, invalid_p == 0 */
@@ -723,7 +725,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of push_arguments, invalid_p == 0 */
   /* Skip verify of deprecated_push_dummy_frame, has predicate */
   /* Skip verify of push_return_address, has predicate */
-  /* Skip verify of pop_frame, has predicate */
+  /* Skip verify of deprecated_pop_frame, has predicate */
   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
       && (gdbarch->store_struct_return == 0))
     fprintf_unfiltered (log, "\n\tstore_struct_return");
@@ -758,7 +760,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of frameless_function_invocation, invalid_p == 0 */
   /* Skip verify of frame_chain, has predicate */
   /* Skip verify of frame_chain_valid, has predicate */
-  /* Skip verify of frame_saved_pc, has predicate */
+  /* Skip verify of deprecated_frame_saved_pc, has predicate */
+  /* Skip verify of unwind_pc, has predicate */
   /* Skip verify of frame_args_address, invalid_p == 0 */
   /* Skip verify of frame_locals_address, invalid_p == 0 */
   if ((GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL)
@@ -1190,6 +1193,49 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->deprecated_frame_init_saved_regs
                         /*DEPRECATED_FRAME_INIT_SAVED_REGS ()*/);
 #endif
+#ifdef DEPRECATED_FRAME_SAVED_PC_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_FRAME_SAVED_PC_P()",
+                      XSTRING (DEPRECATED_FRAME_SAVED_PC_P ()));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: DEPRECATED_FRAME_SAVED_PC_P() = %d\n",
+                      DEPRECATED_FRAME_SAVED_PC_P ());
+#endif
+#ifdef DEPRECATED_FRAME_SAVED_PC
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_FRAME_SAVED_PC(fi)",
+                      XSTRING (DEPRECATED_FRAME_SAVED_PC (fi)));
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: DEPRECATED_FRAME_SAVED_PC = <0x%08lx>\n",
+                        (long) current_gdbarch->deprecated_frame_saved_pc
+                        /*DEPRECATED_FRAME_SAVED_PC ()*/);
+#endif
+#ifdef DEPRECATED_GET_SAVED_REGISTER_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_GET_SAVED_REGISTER_P()",
+                      XSTRING (DEPRECATED_GET_SAVED_REGISTER_P ()));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER_P() = %d\n",
+                      DEPRECATED_GET_SAVED_REGISTER_P ());
+#endif
+#ifdef DEPRECATED_GET_SAVED_REGISTER
+#if GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
+                      XSTRING (DEPRECATED_GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
+#endif
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: DEPRECATED_GET_SAVED_REGISTER = <0x%08lx>\n",
+                        (long) current_gdbarch->deprecated_get_saved_register
+                        /*DEPRECATED_GET_SAVED_REGISTER ()*/);
+#endif
 #ifdef DEPRECATED_INIT_EXTRA_FRAME_INFO_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
@@ -1307,6 +1353,29 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->deprecated_pc_in_call_dummy
                         /*DEPRECATED_PC_IN_CALL_DUMMY ()*/);
 #endif
+#ifdef DEPRECATED_POP_FRAME_P
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_POP_FRAME_P()",
+                      XSTRING (DEPRECATED_POP_FRAME_P ()));
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: DEPRECATED_POP_FRAME_P() = %d\n",
+                      DEPRECATED_POP_FRAME_P ());
+#endif
+#ifdef DEPRECATED_POP_FRAME
+#if GDB_MULTI_ARCH
+  /* Macro might contain `[{}]' when not multi-arch */
+  fprintf_unfiltered (file,
+                      "gdbarch_dump: %s # %s\n",
+                      "DEPRECATED_POP_FRAME(-)",
+                      XSTRING (DEPRECATED_POP_FRAME (-)));
+#endif
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: DEPRECATED_POP_FRAME = <0x%08lx>\n",
+                        (long) current_gdbarch->deprecated_pop_frame
+                        /*DEPRECATED_POP_FRAME ()*/);
+#endif
 #ifdef DEPRECATED_PUSH_DUMMY_FRAME_P
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
@@ -1586,26 +1655,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->frame_num_args
                         /*FRAME_NUM_ARGS ()*/);
 #endif
-#ifdef FRAME_SAVED_PC_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "FRAME_SAVED_PC_P()",
-                      XSTRING (FRAME_SAVED_PC_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: FRAME_SAVED_PC_P() = %d\n",
-                      FRAME_SAVED_PC_P ());
-#endif
-#ifdef FRAME_SAVED_PC
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "FRAME_SAVED_PC(fi)",
-                      XSTRING (FRAME_SAVED_PC (fi)));
-  if (GDB_MULTI_ARCH)
-    fprintf_unfiltered (file,
-                        "gdbarch_dump: FRAME_SAVED_PC = <0x%08lx>\n",
-                        (long) current_gdbarch->frame_saved_pc
-                        /*FRAME_SAVED_PC ()*/);
-#endif
 #ifdef FUNCTION_START_OFFSET
   fprintf_unfiltered (file,
                       "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
@@ -1634,29 +1683,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->get_longjmp_target
                         /*GET_LONGJMP_TARGET ()*/);
 #endif
-#ifdef GET_SAVED_REGISTER_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "GET_SAVED_REGISTER_P()",
-                      XSTRING (GET_SAVED_REGISTER_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: GET_SAVED_REGISTER_P() = %d\n",
-                      GET_SAVED_REGISTER_P ());
-#endif
-#ifdef GET_SAVED_REGISTER
-#if GDB_MULTI_ARCH
-  /* Macro might contain `[{}]' when not multi-arch */
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval)",
-                      XSTRING (GET_SAVED_REGISTER (raw_buffer, optimized, addrp, frame, regnum, lval)));
-#endif
-  if (GDB_MULTI_ARCH)
-    fprintf_unfiltered (file,
-                        "gdbarch_dump: GET_SAVED_REGISTER = <0x%08lx>\n",
-                        (long) current_gdbarch->get_saved_register
-                        /*GET_SAVED_REGISTER ()*/);
-#endif
 #ifdef HAVE_NONSTEPPABLE_WATCHPOINT
   fprintf_unfiltered (file,
                       "gdbarch_dump: HAVE_NONSTEPPABLE_WATCHPOINT # %s\n",
@@ -1810,29 +1836,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
                         (long) current_gdbarch->pointer_to_address
                         /*POINTER_TO_ADDRESS ()*/);
 #endif
-#ifdef POP_FRAME_P
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "POP_FRAME_P()",
-                      XSTRING (POP_FRAME_P ()));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: POP_FRAME_P() = %d\n",
-                      POP_FRAME_P ());
-#endif
-#ifdef POP_FRAME
-#if GDB_MULTI_ARCH
-  /* Macro might contain `[{}]' when not multi-arch */
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: %s # %s\n",
-                      "POP_FRAME(-)",
-                      XSTRING (POP_FRAME (-)));
-#endif
-  if (GDB_MULTI_ARCH)
-    fprintf_unfiltered (file,
-                        "gdbarch_dump: POP_FRAME = <0x%08lx>\n",
-                        (long) current_gdbarch->pop_frame
-                        /*POP_FRAME ()*/);
-#endif
 #ifdef PREPARE_TO_PROCEED
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
@@ -2578,6 +2581,14 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
     fprintf_unfiltered (file,
                         "gdbarch_dump: unwind_dummy_id = 0x%08lx\n",
                         (long) current_gdbarch->unwind_dummy_id);
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: gdbarch_unwind_pc_p() = %d\n",
+                        gdbarch_unwind_pc_p (current_gdbarch));
+  if (GDB_MULTI_ARCH)
+    fprintf_unfiltered (file,
+                        "gdbarch_dump: unwind_pc = 0x%08lx\n",
+                        (long) current_gdbarch->unwind_pc);
 #ifdef USE_STRUCT_CONVENTION
   fprintf_unfiltered (file,
                       "gdbarch_dump: %s # %s\n",
@@ -4002,29 +4013,29 @@ set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch,
 }
 
 int
-gdbarch_get_saved_register_p (struct gdbarch *gdbarch)
+gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
-  return gdbarch->get_saved_register != 0;
+  return gdbarch->deprecated_get_saved_register != 0;
 }
 
 void
-gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
+gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval)
 {
   gdb_assert (gdbarch != NULL);
-  if (gdbarch->get_saved_register == 0)
+  if (gdbarch->deprecated_get_saved_register == 0)
     internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_get_saved_register invalid");
+                    "gdbarch: gdbarch_deprecated_get_saved_register invalid");
   if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n");
-  gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_get_saved_register called\n");
+  gdbarch->deprecated_get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval);
 }
 
 void
-set_gdbarch_get_saved_register (struct gdbarch *gdbarch,
-                                gdbarch_get_saved_register_ftype get_saved_register)
+set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch,
+                                           gdbarch_deprecated_get_saved_register_ftype deprecated_get_saved_register)
 {
-  gdbarch->get_saved_register = get_saved_register;
+  gdbarch->deprecated_get_saved_register = deprecated_get_saved_register;
 }
 
 int
@@ -4296,29 +4307,29 @@ set_gdbarch_push_return_address (struct gdbarch *gdbarch,
 }
 
 int
-gdbarch_pop_frame_p (struct gdbarch *gdbarch)
+gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
-  return gdbarch->pop_frame != 0;
+  return gdbarch->deprecated_pop_frame != 0;
 }
 
 void
-gdbarch_pop_frame (struct gdbarch *gdbarch)
+gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
-  if (gdbarch->pop_frame == 0)
+  if (gdbarch->deprecated_pop_frame == 0)
     internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_pop_frame invalid");
+                    "gdbarch: gdbarch_deprecated_pop_frame invalid");
   if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n");
-  gdbarch->pop_frame ();
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_pop_frame called\n");
+  gdbarch->deprecated_pop_frame ();
 }
 
 void
-set_gdbarch_pop_frame (struct gdbarch *gdbarch,
-                       gdbarch_pop_frame_ftype pop_frame)
+set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch,
+                                  gdbarch_deprecated_pop_frame_ftype deprecated_pop_frame)
 {
-  gdbarch->pop_frame = pop_frame;
+  gdbarch->deprecated_pop_frame = deprecated_pop_frame;
 }
 
 void
@@ -4820,29 +4831,55 @@ set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch,
 }
 
 int
-gdbarch_frame_saved_pc_p (struct gdbarch *gdbarch)
+gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch)
+{
+  gdb_assert (gdbarch != NULL);
+  return gdbarch->deprecated_frame_saved_pc != 0;
+}
+
+CORE_ADDR
+gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
+{
+  gdb_assert (gdbarch != NULL);
+  if (gdbarch->deprecated_frame_saved_pc == 0)
+    internal_error (__FILE__, __LINE__,
+                    "gdbarch: gdbarch_deprecated_frame_saved_pc invalid");
+  if (gdbarch_debug >= 2)
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_frame_saved_pc called\n");
+  return gdbarch->deprecated_frame_saved_pc (fi);
+}
+
+void
+set_gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch,
+                                       gdbarch_deprecated_frame_saved_pc_ftype deprecated_frame_saved_pc)
+{
+  gdbarch->deprecated_frame_saved_pc = deprecated_frame_saved_pc;
+}
+
+int
+gdbarch_unwind_pc_p (struct gdbarch *gdbarch)
 {
   gdb_assert (gdbarch != NULL);
-  return gdbarch->frame_saved_pc != 0;
+  return gdbarch->unwind_pc != 0;
 }
 
 CORE_ADDR
-gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi)
+gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
 {
   gdb_assert (gdbarch != NULL);
-  if (gdbarch->frame_saved_pc == 0)
+  if (gdbarch->unwind_pc == 0)
     internal_error (__FILE__, __LINE__,
-                    "gdbarch: gdbarch_frame_saved_pc invalid");
+                    "gdbarch: gdbarch_unwind_pc invalid");
   if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n");
-  return gdbarch->frame_saved_pc (fi);
+    fprintf_unfiltered (gdb_stdlog, "gdbarch_unwind_pc called\n");
+  return gdbarch->unwind_pc (gdbarch, next_frame);
 }
 
 void
-set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch,
-                            gdbarch_frame_saved_pc_ftype frame_saved_pc)
+set_gdbarch_unwind_pc (struct gdbarch *gdbarch,
+                       gdbarch_unwind_pc_ftype unwind_pc)
 {
-  gdbarch->frame_saved_pc = frame_saved_pc;
+  gdbarch->unwind_pc = unwind_pc;
 }
 
 CORE_ADDR
index 26424ef5a9949d8b2764c79614dc982166988a4c..eb36ebc1499a5c7389ba4752ca900b48c3548cc2 100644 (file)
@@ -1388,40 +1388,40 @@ extern void set_gdbarch_believe_pcc_promotion_type (struct gdbarch *gdbarch, int
 #define BELIEVE_PCC_PROMOTION_TYPE (gdbarch_believe_pcc_promotion_type (current_gdbarch))
 #endif
 
-#if defined (GET_SAVED_REGISTER)
-/* Legacy for systems yet to multi-arch GET_SAVED_REGISTER */
-#if !defined (GET_SAVED_REGISTER_P)
-#define GET_SAVED_REGISTER_P() (1)
+#if defined (DEPRECATED_GET_SAVED_REGISTER)
+/* Legacy for systems yet to multi-arch DEPRECATED_GET_SAVED_REGISTER */
+#if !defined (DEPRECATED_GET_SAVED_REGISTER_P)
+#define DEPRECATED_GET_SAVED_REGISTER_P() (1)
 #endif
 #endif
 
 /* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (GET_SAVED_REGISTER_P)
-#define GET_SAVED_REGISTER_P() (0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER_P)
+#define DEPRECATED_GET_SAVED_REGISTER_P() (0)
 #endif
 
-extern int gdbarch_get_saved_register_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER_P)
-#error "Non multi-arch definition of GET_SAVED_REGISTER"
+extern int gdbarch_deprecated_get_saved_register_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER_P)
+#error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER_P)
-#define GET_SAVED_REGISTER_P() (gdbarch_get_saved_register_p (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER_P)
+#define DEPRECATED_GET_SAVED_REGISTER_P() (gdbarch_deprecated_get_saved_register_p (current_gdbarch))
 #endif
 
 /* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (GET_SAVED_REGISTER)
-#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (internal_error (__FILE__, __LINE__, "GET_SAVED_REGISTER"), 0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_GET_SAVED_REGISTER)
+#define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (internal_error (__FILE__, __LINE__, "DEPRECATED_GET_SAVED_REGISTER"), 0)
 #endif
 
-typedef void (gdbarch_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
-extern void gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
-extern void set_gdbarch_get_saved_register (struct gdbarch *gdbarch, gdbarch_get_saved_register_ftype *get_saved_register);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (GET_SAVED_REGISTER)
-#error "Non multi-arch definition of GET_SAVED_REGISTER"
+typedef void (gdbarch_deprecated_get_saved_register_ftype) (char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
+extern void gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval);
+extern void set_gdbarch_deprecated_get_saved_register (struct gdbarch *gdbarch, gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_GET_SAVED_REGISTER)
+#error "Non multi-arch definition of DEPRECATED_GET_SAVED_REGISTER"
 #endif
 #if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (GET_SAVED_REGISTER)
-#define GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_GET_SAVED_REGISTER)
+#define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_deprecated_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
 #endif
 #endif
 
@@ -1706,40 +1706,40 @@ extern void set_gdbarch_push_return_address (struct gdbarch *gdbarch, gdbarch_pu
 #endif
 #endif
 
-#if defined (POP_FRAME)
-/* Legacy for systems yet to multi-arch POP_FRAME */
-#if !defined (POP_FRAME_P)
-#define POP_FRAME_P() (1)
+#if defined (DEPRECATED_POP_FRAME)
+/* Legacy for systems yet to multi-arch DEPRECATED_POP_FRAME */
+#if !defined (DEPRECATED_POP_FRAME_P)
+#define DEPRECATED_POP_FRAME_P() (1)
 #endif
 #endif
 
 /* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (POP_FRAME_P)
-#define POP_FRAME_P() (0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_POP_FRAME_P)
+#define DEPRECATED_POP_FRAME_P() (0)
 #endif
 
-extern int gdbarch_pop_frame_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POP_FRAME_P)
-#error "Non multi-arch definition of POP_FRAME"
+extern int gdbarch_deprecated_pop_frame_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME_P)
+#error "Non multi-arch definition of DEPRECATED_POP_FRAME"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME_P)
-#define POP_FRAME_P() (gdbarch_pop_frame_p (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_POP_FRAME_P)
+#define DEPRECATED_POP_FRAME_P() (gdbarch_deprecated_pop_frame_p (current_gdbarch))
 #endif
 
 /* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (POP_FRAME)
-#define POP_FRAME (internal_error (__FILE__, __LINE__, "POP_FRAME"), 0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_POP_FRAME)
+#define DEPRECATED_POP_FRAME (internal_error (__FILE__, __LINE__, "DEPRECATED_POP_FRAME"), 0)
 #endif
 
-typedef void (gdbarch_pop_frame_ftype) (void);
-extern void gdbarch_pop_frame (struct gdbarch *gdbarch);
-extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ftype *pop_frame);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (POP_FRAME)
-#error "Non multi-arch definition of POP_FRAME"
+typedef void (gdbarch_deprecated_pop_frame_ftype) (void);
+extern void gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_pop_frame (struct gdbarch *gdbarch, gdbarch_deprecated_pop_frame_ftype *deprecated_pop_frame);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_POP_FRAME)
+#error "Non multi-arch definition of DEPRECATED_POP_FRAME"
 #endif
 #if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (POP_FRAME)
-#define POP_FRAME (gdbarch_pop_frame (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_POP_FRAME)
+#define DEPRECATED_POP_FRAME (gdbarch_deprecated_pop_frame (current_gdbarch))
 #endif
 #endif
 
@@ -2228,43 +2228,53 @@ extern void set_gdbarch_frame_chain_valid (struct gdbarch *gdbarch, gdbarch_fram
 #endif
 #endif
 
-#if defined (FRAME_SAVED_PC)
-/* Legacy for systems yet to multi-arch FRAME_SAVED_PC */
-#if !defined (FRAME_SAVED_PC_P)
-#define FRAME_SAVED_PC_P() (1)
+/* DEPRECATED_FRAME_SAVED_PC has been replaced by UNWIND_PC.  Please
+   note, per UNWIND_PC's doco, that while the two have similar
+   interfaces they have very different underlying implementations. */
+
+#if defined (DEPRECATED_FRAME_SAVED_PC)
+/* Legacy for systems yet to multi-arch DEPRECATED_FRAME_SAVED_PC */
+#if !defined (DEPRECATED_FRAME_SAVED_PC_P)
+#define DEPRECATED_FRAME_SAVED_PC_P() (1)
 #endif
 #endif
 
 /* Default predicate for non- multi-arch targets. */
-#if (!GDB_MULTI_ARCH) && !defined (FRAME_SAVED_PC_P)
-#define FRAME_SAVED_PC_P() (0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_SAVED_PC_P)
+#define DEPRECATED_FRAME_SAVED_PC_P() (0)
 #endif
 
-extern int gdbarch_frame_saved_pc_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_SAVED_PC_P)
-#error "Non multi-arch definition of FRAME_SAVED_PC"
+extern int gdbarch_deprecated_frame_saved_pc_p (struct gdbarch *gdbarch);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC_P)
+#error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC"
 #endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_SAVED_PC_P)
-#define FRAME_SAVED_PC_P() (gdbarch_frame_saved_pc_p (current_gdbarch))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_SAVED_PC_P)
+#define DEPRECATED_FRAME_SAVED_PC_P() (gdbarch_deprecated_frame_saved_pc_p (current_gdbarch))
 #endif
 
 /* Default (function) for non- multi-arch platforms. */
-#if (!GDB_MULTI_ARCH) && !defined (FRAME_SAVED_PC)
-#define FRAME_SAVED_PC(fi) (internal_error (__FILE__, __LINE__, "FRAME_SAVED_PC"), 0)
+#if (!GDB_MULTI_ARCH) && !defined (DEPRECATED_FRAME_SAVED_PC)
+#define DEPRECATED_FRAME_SAVED_PC(fi) (internal_error (__FILE__, __LINE__, "DEPRECATED_FRAME_SAVED_PC"), 0)
 #endif
 
-typedef CORE_ADDR (gdbarch_frame_saved_pc_ftype) (struct frame_info *fi);
-extern CORE_ADDR gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi);
-extern void set_gdbarch_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_frame_saved_pc_ftype *frame_saved_pc);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FRAME_SAVED_PC)
-#error "Non multi-arch definition of FRAME_SAVED_PC"
+typedef CORE_ADDR (gdbarch_deprecated_frame_saved_pc_ftype) (struct frame_info *fi);
+extern CORE_ADDR gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi);
+extern void set_gdbarch_deprecated_frame_saved_pc (struct gdbarch *gdbarch, gdbarch_deprecated_frame_saved_pc_ftype *deprecated_frame_saved_pc);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FRAME_SAVED_PC)
+#error "Non multi-arch definition of DEPRECATED_FRAME_SAVED_PC"
 #endif
 #if GDB_MULTI_ARCH
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (FRAME_SAVED_PC)
-#define FRAME_SAVED_PC(fi) (gdbarch_frame_saved_pc (current_gdbarch, fi))
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_FRAME_SAVED_PC)
+#define DEPRECATED_FRAME_SAVED_PC(fi) (gdbarch_deprecated_frame_saved_pc (current_gdbarch, fi))
 #endif
 #endif
 
+extern int gdbarch_unwind_pc_p (struct gdbarch *gdbarch);
+
+typedef CORE_ADDR (gdbarch_unwind_pc_ftype) (struct gdbarch *gdbarch, struct frame_info *next_frame);
+extern CORE_ADDR gdbarch_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame);
+extern void set_gdbarch_unwind_pc (struct gdbarch *gdbarch, gdbarch_unwind_pc_ftype *unwind_pc);
+
 /* Default (function) for non- multi-arch platforms. */
 #if (!GDB_MULTI_ARCH) && !defined (FRAME_ARGS_ADDRESS)
 #define FRAME_ARGS_ADDRESS(fi) (get_frame_base (fi))
@@ -2419,6 +2429,9 @@ extern void set_gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, gdbarch_re
 #endif
 #endif
 
+/* FIXME: kettenis/2003-03-08: This should be replaced by a function
+   parametrized with (at least) the regcache. */
+
 #if defined (SAVE_DUMMY_FRAME_TOS)
 /* Legacy for systems yet to multi-arch SAVE_DUMMY_FRAME_TOS */
 #if !defined (SAVE_DUMMY_FRAME_TOS_P)
index ed8a9e74420e08e4f4522d313b01622d7cc35567..ff745ef472876aa7228bbe495cde9e78aea3e283 100755 (executable)
@@ -541,7 +541,7 @@ F:2:DEPRECATED_INIT_FRAME_PC:CORE_ADDR:deprecated_init_frame_pc:int fromleaf, st
 #
 v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
 v::BELIEVE_PCC_PROMOTION_TYPE:int:believe_pcc_promotion_type:::::::
-F:2:GET_SAVED_REGISTER:void:get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval
+F:2:DEPRECATED_GET_SAVED_REGISTER:void:deprecated_get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval
 #
 f:2:REGISTER_CONVERTIBLE:int:register_convertible:int nr:nr:::generic_register_convertible_not::0
 f:2:REGISTER_CONVERT_TO_VIRTUAL:void:register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0
@@ -559,7 +559,7 @@ f:2:RETURN_VALUE_ON_STACK:int:return_value_on_stack:struct type *type:type:::gen
 f:2:PUSH_ARGUMENTS:CORE_ADDR:push_arguments:int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:nargs, args, sp, struct_return, struct_addr:::default_push_arguments::0
 F:2:DEPRECATED_PUSH_DUMMY_FRAME:void:deprecated_push_dummy_frame:void:-:::0
 F:2:PUSH_RETURN_ADDRESS:CORE_ADDR:push_return_address:CORE_ADDR pc, CORE_ADDR sp:pc, sp:::0
-F:2:POP_FRAME:void:pop_frame:void:-:::0
+F:2:DEPRECATED_POP_FRAME:void:deprecated_pop_frame:void:-:::0
 #
 f:2:STORE_STRUCT_RETURN:void:store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp:::0
 #
@@ -591,7 +591,11 @@ v:2:FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:-1
 f:2:FRAMELESS_FUNCTION_INVOCATION:int:frameless_function_invocation:struct frame_info *fi:fi:::generic_frameless_function_invocation_not::0
 F:2:FRAME_CHAIN:CORE_ADDR:frame_chain:struct frame_info *frame:frame::0:0
 F:2:FRAME_CHAIN_VALID:int:frame_chain_valid:CORE_ADDR chain, struct frame_info *thisframe:chain, thisframe::0:0
-F:2:FRAME_SAVED_PC:CORE_ADDR:frame_saved_pc:struct frame_info *fi:fi::0:0
+# DEPRECATED_FRAME_SAVED_PC has been replaced by UNWIND_PC.  Please
+# note, per UNWIND_PC's doco, that while the two have similar
+# interfaces they have very different underlying implementations.
+F:2:DEPRECATED_FRAME_SAVED_PC:CORE_ADDR:deprecated_frame_saved_pc:struct frame_info *fi:fi::0:0
+M::UNWIND_PC:CORE_ADDR:unwind_pc:struct frame_info *next_frame:next_frame:
 f:2:FRAME_ARGS_ADDRESS:CORE_ADDR:frame_args_address:struct frame_info *fi:fi::0:get_frame_base::0
 f:2:FRAME_LOCALS_ADDRESS:CORE_ADDR:frame_locals_address:struct frame_info *fi:fi::0:get_frame_base::0
 f:2:SAVED_PC_AFTER_CALL:CORE_ADDR:saved_pc_after_call:struct frame_info *frame:frame::0:0
@@ -601,6 +605,8 @@ F:2:STACK_ALIGN:CORE_ADDR:stack_align:CORE_ADDR sp:sp::0:0
 M:::CORE_ADDR:frame_align:CORE_ADDR address:address
 v:2:EXTRA_STACK_ALIGNMENT_NEEDED:int:extra_stack_alignment_needed::::0:1::0:::
 F:2:REG_STRUCT_HAS_ADDR:int:reg_struct_has_addr:int gcc_p, struct type *type:gcc_p, type::0:0
+# FIXME: kettenis/2003-03-08: This should be replaced by a function
+# parametrized with (at least) the regcache.
 F:2:SAVE_DUMMY_FRAME_TOS:void:save_dummy_frame_tos:CORE_ADDR sp:sp::0:0
 M::UNWIND_DUMMY_ID:struct frame_id:unwind_dummy_id:struct frame_info *info:info::0:0
 v:2:PARM_BOUNDARY:int:parm_boundary
index b90f6ed3abe5cbc9130adb7c3cd02036614c2af9..415acf8c07047e9b49439be0c17c32ed68b24af4 100644 (file)
@@ -1122,7 +1122,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_init_extra_frame_info (gdbarch, h8300_init_extra_frame_info);
   set_gdbarch_frame_chain (gdbarch, h8300_frame_chain);
   set_gdbarch_saved_pc_after_call (gdbarch, h8300_saved_pc_after_call);
-  set_gdbarch_frame_saved_pc (gdbarch, h8300_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, h8300_frame_saved_pc);
   set_gdbarch_skip_prologue (gdbarch, h8300_skip_prologue);
   set_gdbarch_frame_args_address (gdbarch, h8300_frame_args_address);
   set_gdbarch_frame_locals_address (gdbarch, h8300_frame_locals_address);
@@ -1151,7 +1151,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_push_return_address (gdbarch, h8300_push_return_address);
   set_gdbarch_deprecated_extract_return_value (gdbarch, h8300_extract_return_value);
   set_gdbarch_push_arguments (gdbarch, h8300_push_arguments);
-  set_gdbarch_pop_frame (gdbarch, h8300_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, h8300_pop_frame);
   set_gdbarch_store_struct_return (gdbarch, h8300_store_struct_return);
   set_gdbarch_deprecated_store_return_value (gdbarch, h8300_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, h8300_extract_struct_value_address);
index 9ba5ef903dc58c687b4e567138ae189da4508d05..9fde53d4a6e08fb1cadc55282d0c1b95557d002e 100644 (file)
@@ -875,7 +875,7 @@ hppa_saved_pc_after_call (struct frame_info *frame)
      the stub will return to out of the stack.  */
   u = find_unwind_entry (pc);
   if (u && u->stub_unwind.stub_type != 0)
-    return FRAME_SAVED_PC (frame);
+    return DEPRECATED_FRAME_SAVED_PC (frame);
   else
     return pc;
 }
@@ -1075,7 +1075,7 @@ hppa_init_extra_frame_info (int fromleaf, struct frame_info *frame)
     {
       /* Find the framesize of *this* frame without peeking at the PC
          in the current frame structure (it isn't set yet).  */
-      framesize = find_proc_framesize (FRAME_SAVED_PC (get_next_frame (frame)));
+      framesize = find_proc_framesize (DEPRECATED_FRAME_SAVED_PC (get_next_frame (frame)));
 
       /* Now adjust our base frame accordingly.  If we have a frame pointer
          use it, else subtract the size of this frame from the current
@@ -1185,7 +1185,7 @@ hppa_frame_chain (struct frame_info *frame)
   /* Get frame sizes for the current frame and the frame of the 
      caller.  */
   my_framesize = find_proc_framesize (frame->pc);
-  caller_pc = FRAME_SAVED_PC (frame);
+  caller_pc = DEPRECATED_FRAME_SAVED_PC (frame);
 
   /* If we can't determine the caller's PC, then it's not likely we can
      really determine anything meaningful about its frame.  We'll consider
@@ -1193,7 +1193,7 @@ hppa_frame_chain (struct frame_info *frame)
   if (caller_pc == (CORE_ADDR) 0)
     return (CORE_ADDR) 0;
 
-  caller_framesize = find_proc_framesize (FRAME_SAVED_PC (frame));
+  caller_framesize = find_proc_framesize (DEPRECATED_FRAME_SAVED_PC (frame));
 
   /* If caller does not have a frame pointer, then its frame
      can be found at current_frame - caller_framesize.  */
@@ -1316,7 +1316,7 @@ hppa_frame_chain (struct frame_info *frame)
                  || (saved_regs.regs[FLAGS_REGNUM] == 0
                      && read_register (FLAGS_REGNUM) & 0x2)))
            {
-             u = find_unwind_entry (FRAME_SAVED_PC (frame));
+             u = find_unwind_entry (DEPRECATED_FRAME_SAVED_PC (frame));
              if (!u)
                {
                  return read_memory_integer (saved_regs.regs[FP_REGNUM],
@@ -1351,7 +1351,7 @@ hppa_frame_chain (struct frame_info *frame)
              || (saved_regs.regs[FLAGS_REGNUM] == 0
                  && read_register (FLAGS_REGNUM) & 0x2)))
        {
-         u = find_unwind_entry (FRAME_SAVED_PC (frame));
+         u = find_unwind_entry (DEPRECATED_FRAME_SAVED_PC (frame));
          if (!u)
            {
              return read_memory_integer (saved_regs.regs[FP_REGNUM],
@@ -1392,7 +1392,7 @@ hppa_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
      indistinguishable (as nearly as I can tell) from the symbol for a function
      which is (legitimately, since it is in the user's namespace)
      named Ltext_end, so we can't just ignore it.  */
-  msym_us = lookup_minimal_symbol_by_pc (FRAME_SAVED_PC (thisframe));
+  msym_us = lookup_minimal_symbol_by_pc (DEPRECATED_FRAME_SAVED_PC (thisframe));
   msym_start = lookup_minimal_symbol ("_start", NULL, NULL);
   if (msym_us
       && msym_start
@@ -5011,13 +5011,13 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_frame_chain_valid (gdbarch, hppa_frame_chain_valid);
   set_gdbarch_frameless_function_invocation
     (gdbarch, hppa_frameless_function_invocation);
-  set_gdbarch_frame_saved_pc (gdbarch, hppa_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, hppa_frame_saved_pc);
   set_gdbarch_frame_args_address (gdbarch, hppa_frame_args_address);
   set_gdbarch_frame_locals_address (gdbarch, hppa_frame_locals_address);
   set_gdbarch_frame_num_args (gdbarch, hppa_frame_num_args);
   set_gdbarch_frame_args_skip (gdbarch, 0);
   /* set_gdbarch_deprecated_push_dummy_frame (gdbarch, hppa_push_dummy_frame);  */
-  set_gdbarch_pop_frame (gdbarch, hppa_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, hppa_pop_frame);
   set_gdbarch_call_dummy_length (gdbarch, INSTRUCTION_SIZE * 28);
   set_gdbarch_call_dummy_start_offset (gdbarch, 0);
   /* set_gdbarch_fix_call_dummy (gdbarch, hppa_fix_call_dummy); */
index b9ad2ff33a3c411d5cbdbc3a6c637052bc89271f..e25242c325e73d18fc75fa69efa598fee733708a 100644 (file)
@@ -334,7 +334,7 @@ i386_interix_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_deprecated_init_extra_frame_info (gdbarch, i386_interix_back_one_frame);
   set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop);
   set_gdbarch_frame_chain_valid (gdbarch, i386_interix_frame_chain_valid);
-  set_gdbarch_frame_saved_pc (gdbarch, i386_interix_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, i386_interix_frame_saved_pc);
   set_gdbarch_name_of_malloc (gdbarch, "_malloc");
 }
 
index 36036f2238aa7de195fe881e8918ea3a870a31dc..069c2e6a0cca86aba3511b0e53ccd956c41fbbb4 100644 (file)
@@ -92,9 +92,7 @@ static gdbarch_register_virtual_type_ftype ia64_register_virtual_type;
 static gdbarch_register_byte_ftype ia64_register_byte;
 static gdbarch_breakpoint_from_pc_ftype ia64_breakpoint_from_pc;
 static gdbarch_frame_chain_ftype ia64_frame_chain;
-static gdbarch_frame_saved_pc_ftype ia64_frame_saved_pc;
 static gdbarch_skip_prologue_ftype ia64_skip_prologue;
-static gdbarch_get_saved_register_ftype ia64_get_saved_register;
 static gdbarch_deprecated_extract_return_value_ftype ia64_extract_return_value;
 static gdbarch_deprecated_extract_struct_value_address_ftype ia64_extract_struct_value_address;
 static gdbarch_use_struct_convention_ftype ia64_use_struct_convention;
@@ -102,7 +100,6 @@ static gdbarch_frameless_function_invocation_ftype ia64_frameless_function_invoc
 static gdbarch_store_struct_return_ftype ia64_store_struct_return;
 static gdbarch_push_arguments_ftype ia64_push_arguments;
 static gdbarch_push_return_address_ftype ia64_push_return_address;
-static gdbarch_pop_frame_ftype ia64_pop_frame;
 static gdbarch_saved_pc_after_call_ftype ia64_saved_pc_after_call;
 static void ia64_pop_frame_regular (struct frame_info *frame);
 static struct type *is_float_or_hfa_type (struct type *t);
@@ -2008,7 +2005,7 @@ ia64_pop_frame_regular (struct frame_info *frame)
     }
 
   write_register (sp_regnum, FRAME_CHAIN (frame));
-  write_pc (FRAME_SAVED_PC (frame));
+  write_pc (DEPRECATED_FRAME_SAVED_PC (frame));
 
   cfm = read_register (IA64_CFM_REGNUM);
 
@@ -2197,10 +2194,10 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_saved_pc_after_call (gdbarch, ia64_saved_pc_after_call);
 
   set_gdbarch_frame_chain (gdbarch, ia64_frame_chain);
-  set_gdbarch_frame_saved_pc (gdbarch, ia64_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, ia64_frame_saved_pc);
 
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, ia64_frame_init_saved_regs);
-  set_gdbarch_get_saved_register (gdbarch, ia64_get_saved_register);
+  set_gdbarch_deprecated_get_saved_register (gdbarch, ia64_get_saved_register);
 
   set_gdbarch_register_convertible (gdbarch, ia64_register_convertible);
   set_gdbarch_register_convert_to_virtual (gdbarch, ia64_register_convert_to_virtual);
@@ -2223,7 +2220,7 @@ ia64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_call_dummy_length (gdbarch, 0);
   set_gdbarch_push_arguments (gdbarch, ia64_push_arguments);
   set_gdbarch_push_return_address (gdbarch, ia64_push_return_address);
-  set_gdbarch_pop_frame (gdbarch, ia64_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, ia64_pop_frame);
 
   set_gdbarch_call_dummy_p (gdbarch, 1);
   set_gdbarch_call_dummy_words (gdbarch, ia64_call_dummy_words);
index 6af823e5bd91d2d54b5b2f970d1d8f0228b766e4..7d64860fb8be4e08dd0906e3c0a542bd67c82775 100644 (file)
@@ -895,7 +895,7 @@ m68hc11_init_extra_frame_info (int fromleaf, struct frame_info *fi)
   frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
   
   if (get_next_frame (fi))
-    deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
+    deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
   
   m68hc11_frame_init_saved_regs (fi);
 
@@ -1390,7 +1390,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
                                        sizeof (m68hc11_call_dummy_words));
   set_gdbarch_call_dummy_p (gdbarch, 1);
   set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
-  set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
+  set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
   set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
   set_gdbarch_deprecated_extract_return_value (gdbarch, m68hc11_extract_return_value);
   set_gdbarch_push_arguments (gdbarch, m68hc11_push_arguments);
@@ -1404,13 +1404,13 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
 
 
   set_gdbarch_frame_chain (gdbarch, m68hc11_frame_chain);
-  set_gdbarch_frame_saved_pc (gdbarch, m68hc11_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, m68hc11_frame_saved_pc);
   set_gdbarch_frame_args_address (gdbarch, m68hc11_frame_args_address);
   set_gdbarch_frame_locals_address (gdbarch, m68hc11_frame_locals_address);
   set_gdbarch_saved_pc_after_call (gdbarch, m68hc11_saved_pc_after_call);
   set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
 
-  set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
+  set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
 
   set_gdbarch_store_struct_return (gdbarch, m68hc11_store_struct_return);
   set_gdbarch_deprecated_store_return_value (gdbarch, m68hc11_store_return_value);
@@ -1418,7 +1418,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info,
     (gdbarch, m68hc11_extract_struct_value_address);
   set_gdbarch_use_struct_convention (gdbarch, m68hc11_use_struct_convention);
   set_gdbarch_deprecated_init_extra_frame_info (gdbarch, m68hc11_init_extra_frame_info);
-  set_gdbarch_pop_frame (gdbarch, m68hc11_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, m68hc11_pop_frame);
   set_gdbarch_skip_prologue (gdbarch, m68hc11_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_decr_pc_after_break (gdbarch, 0);
index 6008a62205c20d04a9b025f46995671d5fde2c41..b79c68a19dfb37cb6373116972329d11ba14db97 100644 (file)
@@ -359,7 +359,7 @@ int
 isi_frame_num_args (struct frame_info *fi)
 {
   int val;
-  CORE_ADDR pc = FRAME_SAVED_PC (fi);
+  CORE_ADDR pc = DEPRECATED_FRAME_SAVED_PC (fi);
   int insn = read_memory_unsigned_integer (pc, 2);
   val = 0;
   if (insn == 0047757 || insn == 0157374)      /* lea W(sp),sp or addaw #W,sp */
@@ -381,7 +381,7 @@ int
 delta68_frame_num_args (struct frame_info *fi)
 {
   int val;
-  CORE_ADDR pc = FRAME_SAVED_PC (fi);
+  CORE_ADDR pc = DEPRECATED_FRAME_SAVED_PC (fi);
   int insn = read_memory_unsigned_integer (pc, 2);
   val = 0;
   if (insn == 0047757 || insn == 0157374)      /* lea W(sp),sp or addaw #W,sp */
@@ -403,7 +403,7 @@ int
 news_frame_num_args (struct frame_info *fi)
 {
   int val;
-  CORE_ADDR pc = FRAME_SAVED_PC (fi);
+  CORE_ADDR pc = DEPRECATED_FRAME_SAVED_PC (fi);
   int insn = read_memory_unsigned_integer (pc, 2);
   val = 0;
   if (insn == 0047757 || insn == 0157374)      /* lea W(sp),sp or addaw #W,sp */
@@ -1011,7 +1011,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_store_return_value (gdbarch, m68k_store_return_value);
 
   set_gdbarch_frame_chain (gdbarch, m68k_frame_chain);
-  set_gdbarch_frame_saved_pc (gdbarch, m68k_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, m68k_frame_saved_pc);
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, m68k_frame_init_saved_regs);
   set_gdbarch_frameless_function_invocation (gdbarch,
                                             m68k_frameless_function_invocation);
@@ -1051,7 +1051,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
   set_gdbarch_fix_call_dummy (gdbarch, m68k_fix_call_dummy);
   set_gdbarch_deprecated_push_dummy_frame (gdbarch, m68k_push_dummy_frame);
-  set_gdbarch_pop_frame (gdbarch, m68k_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, m68k_pop_frame);
 
   return gdbarch;
 }
index e5b64344af35fcdc8372714c7cfeebf451ee1a42..36dbbdb48a4010331fdbb65adff49abb95d547b7 100644 (file)
@@ -671,7 +671,7 @@ mcore_frame_chain (struct frame_info * fi)
 
      If our caller does not have a frame pointer, then his frame base
      is <our base> + -<caller's frame size>. */
-  dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), get_frame_base (fi));
+  dummy = analyze_dummy_frame (DEPRECATED_FRAME_SAVED_PC (fi), get_frame_base (fi));
 
   if (get_frame_extra_info (dummy)->status & MY_FRAME_IN_FP)
     {
@@ -803,7 +803,7 @@ mcore_pop_frame (void)
   else
     {
       /* Write out the PC we saved. */
-      write_register (PC_REGNUM, FRAME_SAVED_PC (fi));
+      write_register (PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (fi));
 
       /* Restore any saved registers. */
       for (rn = 0; rn < NUM_REGS; rn++)
@@ -1047,7 +1047,7 @@ void
 mcore_init_extra_frame_info (int fromleaf, struct frame_info *fi)
 {
   if (fi && get_next_frame (fi))
-    deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
+    deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
 
   frame_saved_regs_zalloc (fi);
 
@@ -1139,7 +1139,7 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_init_extra_frame_info (gdbarch, mcore_init_extra_frame_info);
   set_gdbarch_frame_chain (gdbarch, mcore_frame_chain);
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mcore_frame_init_saved_regs);
-  set_gdbarch_frame_saved_pc (gdbarch, mcore_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, mcore_frame_saved_pc);
   set_gdbarch_deprecated_store_return_value (gdbarch, mcore_store_return_value);
   set_gdbarch_deprecated_extract_return_value (gdbarch, 
                                               mcore_extract_return_value);
@@ -1151,7 +1151,7 @@ mcore_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_frame_args_address (gdbarch, mcore_frame_args_address);
   set_gdbarch_frame_locals_address (gdbarch, mcore_frame_locals_address);
   set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
-  set_gdbarch_pop_frame (gdbarch, mcore_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, mcore_pop_frame);
   set_gdbarch_virtual_frame_pointer (gdbarch, mcore_virtual_frame_pointer);
 
   /* Misc.:  */
index a103802864e8a1e58f2244847d40ed6a04003c20..1785b9b881326f6aa0d252b4bd4f21b37b595a61 100644 (file)
@@ -1,3 +1,13 @@
+2003-03-12  Andrew Cagney  <cagney@redhat.com>
+
+       * mi-main.c (get_register): Use frame_register instead of
+       get_saved_register.
+
+2003-03-08  Andrew Cagney  <cagney@redhat.com>
+
+       * mi-out.c: Update copyright.
+       (mi_out_data): Define typedef.  Use instead of ui_out_data.
+
 2003-03-01  Andrew Cagney  <cagney@redhat.com>
 
        * mi-main.c (get_register): Use register_type instead of
index f08bd3f5b1c21a9588754991d142268126321ed1..6ba069821ea694536d519b9d0933bd9b93ea713f 100644 (file)
@@ -514,6 +514,9 @@ get_register (int regnum, int format)
   char *raw_buffer = alloca (MAX_REGISTER_RAW_SIZE);
   char *virtual_buffer = alloca (MAX_REGISTER_VIRTUAL_SIZE);
   int optim;
+  int realnum;
+  CORE_ADDR addr;
+  enum lval_type lval;
   static struct ui_stream *stb = NULL;
 
   stb = ui_out_stream_new (uiout);
@@ -521,9 +524,9 @@ get_register (int regnum, int format)
   if (format == 'N')
     format = 0;
 
-  get_saved_register (raw_buffer, &optim, (CORE_ADDR *) NULL,
-                     deprecated_selected_frame,
-                     regnum, (enum lval_type *) NULL);
+  frame_register (deprecated_selected_frame, regnum, &optim, &lval, &addr,
+                 &realnum, raw_buffer);
+
   if (optim)
     {
       xasprintf (&mi_error_message, "Optimized out");
index f7156ca9c59286f0eba5e6a78281d4d531275422..2aac5289829ae6ed05d6bab5e1b89fc67b104726 100644 (file)
@@ -1,6 +1,6 @@
 /* MI Command Set - output generating routines.
 
-   Copyright 2000, 2002 Free Software Foundation, Inc.
+   Copyright 2000, 2002, 2003 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions (a Red Hat company).
 
@@ -32,6 +32,7 @@ struct ui_out_data
     int mi_version;
     struct ui_file *buffer;
   };
+typedef struct ui_out_data mi_out_data;
 
 /* These are the MI output functions */
 
@@ -107,7 +108,7 @@ mi_table_begin (struct ui_out *uiout,
                int nr_rows,
                const char *tblid)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   mi_open (uiout, tblid, ui_out_type_tuple);
   mi_field_int (uiout, -1/*fldno*/, -1/*width*/, -1/*alin*/,
                "nr_rows", nr_rows);
@@ -121,7 +122,7 @@ mi_table_begin (struct ui_out *uiout,
 void
 mi_table_body (struct ui_out *uiout)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   /* close the table header line if there were any headers */
@@ -134,7 +135,7 @@ mi_table_body (struct ui_out *uiout)
 void
 mi_table_end (struct ui_out *uiout)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   data->suppress_output = 0;
   mi_close (uiout, ui_out_type_list); /* body */
   mi_close (uiout, ui_out_type_tuple);
@@ -147,7 +148,7 @@ mi_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
                 const char *col_name,
                 const char *colhdr)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   mi_open (uiout, NULL, ui_out_type_tuple);
@@ -166,7 +167,7 @@ mi_begin (struct ui_out *uiout,
          int level,
          const char *id)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   mi_open (uiout, id, type);
@@ -179,7 +180,7 @@ mi_end (struct ui_out *uiout,
        enum ui_out_type type,
        int level)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   mi_close (uiout, type);
@@ -192,7 +193,7 @@ mi_field_int (struct ui_out *uiout, int fldno, int width,
               enum ui_align alignment, const char *fldname, int value)
 {
   char buffer[20];             /* FIXME: how many chars long a %d can become? */
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
 
@@ -206,7 +207,7 @@ void
 mi_field_skip (struct ui_out *uiout, int fldno, int width,
                enum ui_align alignment, const char *fldname)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   mi_field_string (uiout, fldno, width, alignment, fldname, "");
@@ -223,7 +224,7 @@ mi_field_string (struct ui_out *uiout,
                 const char *fldname,
                 const char *string)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   field_separator (uiout);
@@ -244,7 +245,7 @@ mi_field_fmt (struct ui_out *uiout, int fldno,
              const char *format,
              va_list args)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   field_separator (uiout);
@@ -282,7 +283,7 @@ mi_wrap_hint (struct ui_out *uiout, char *identstring)
 void
 mi_flush (struct ui_out *uiout)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   gdb_flush (data->buffer);
 }
 
@@ -296,7 +297,7 @@ static void
 out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
               char *format,...)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   va_list args;
 
   field_separator (uiout);
@@ -318,7 +319,7 @@ out_field_fmt (struct ui_out *uiout, int fldno, char *fldname,
 static void
 field_separator (struct ui_out *uiout)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   if (data->suppress_field_separator)
     data->suppress_field_separator = 0;
   else
@@ -330,7 +331,7 @@ mi_open (struct ui_out *uiout,
         const char *name,
         enum ui_out_type type)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   field_separator (uiout);
   data->suppress_field_separator = 1;
   if (name)
@@ -352,7 +353,7 @@ static void
 mi_close (struct ui_out *uiout,
          enum ui_out_type type)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   switch (type)
     {
     case ui_out_type_tuple:
@@ -372,7 +373,7 @@ mi_close (struct ui_out *uiout,
 void
 mi_out_buffered (struct ui_out *uiout, char *string)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   fprintf_unfiltered (data->buffer, "%s", string);
 }
 
@@ -381,7 +382,7 @@ mi_out_buffered (struct ui_out *uiout, char *string)
 void
 mi_out_rewind (struct ui_out *uiout)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   ui_file_rewind (data->buffer);
 }
 
@@ -397,7 +398,7 @@ void
 mi_out_put (struct ui_out *uiout,
            struct ui_file *stream)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   ui_file_put (data->buffer, do_write, stream);
   ui_file_rewind (data->buffer);
 }
@@ -407,7 +408,7 @@ mi_out_put (struct ui_out *uiout,
 int
 mi_version (struct ui_out *uiout)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  mi_out_data *data = ui_out_data (uiout);
   return data->mi_version;
 }
 
@@ -417,7 +418,7 @@ struct ui_out *
 mi_out_new (int mi_version)
 {
   int flags = 0;
-  struct ui_out_data *data = XMALLOC (struct ui_out_data);
+  mi_out_data *data = XMALLOC (mi_out_data);
   data->suppress_field_separator = 0;
   data->suppress_output = 0;
   data->mi_version = mi_version;
index 5c2ca469739571d72f668f211e36281b4532a080..d8569ff2aff4c14136ec69fc44b9fbd386f32d98 100644 (file)
@@ -113,7 +113,8 @@ add_minsym_to_hash_table (struct minimal_symbol *sym,
 {
   if (sym->hash_next == NULL)
     {
-      unsigned int hash = msymbol_hash (DEPRECATED_SYMBOL_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE;
+      unsigned int hash
+       = msymbol_hash (SYMBOL_LINKAGE_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE;
       sym->hash_next = table[hash];
       table[hash] = sym;
     }
@@ -288,7 +289,7 @@ lookup_minimal_symbol_text (register const char *name, const char *sfile,
               msymbol != NULL && found_symbol == NULL;
               msymbol = msymbol->hash_next)
            {
-             if (DEPRECATED_SYMBOL_MATCHES_NAME (msymbol, name) &&
+             if (strcmp (SYMBOL_LINKAGE_NAME (msymbol), name) == 0 &&
                  (MSYMBOL_TYPE (msymbol) == mst_text ||
                   MSYMBOL_TYPE (msymbol) == mst_file_text))
                {
@@ -364,7 +365,7 @@ lookup_minimal_symbol_solib_trampoline (register const char *name,
               msymbol != NULL && found_symbol == NULL;
               msymbol = msymbol->hash_next)
            {
-             if (DEPRECATED_SYMBOL_MATCHES_NAME (msymbol, name) &&
+             if (strcmp (SYMBOL_LINKAGE_NAME (msymbol), name) == 0 &&
                  MSYMBOL_TYPE (msymbol) == mst_solib_trampoline)
                return msymbol;
            }
@@ -659,8 +660,8 @@ compare_minimal_symbols (const void *fn1p, const void *fn2p)
   else
     /* addrs are equal: sort by name */
     {
-      char *name1 = DEPRECATED_SYMBOL_NAME (fn1);
-      char *name2 = DEPRECATED_SYMBOL_NAME (fn2);
+      char *name1 = SYMBOL_LINKAGE_NAME (fn1);
+      char *name2 = SYMBOL_LINKAGE_NAME (fn2);
 
       if (name1 && name2)      /* both have names */
        return strcmp (name1, name2);
@@ -752,7 +753,8 @@ compact_minimal_symbols (struct minimal_symbol *msymbol, int mcount,
        {
          if (SYMBOL_VALUE_ADDRESS (copyfrom) ==
              SYMBOL_VALUE_ADDRESS ((copyfrom + 1)) &&
-             (STREQ (DEPRECATED_SYMBOL_NAME (copyfrom), DEPRECATED_SYMBOL_NAME ((copyfrom + 1)))))
+             (STREQ (SYMBOL_LINKAGE_NAME (copyfrom),
+                     SYMBOL_LINKAGE_NAME ((copyfrom + 1)))))
            {
              if (MSYMBOL_TYPE ((copyfrom + 1)) == mst_unknown)
                {
@@ -867,9 +869,9 @@ install_minimal_symbols (struct objfile *objfile)
          for (bindex = 0; bindex < msym_bunch_index; bindex++, mcount++)
            {
              msymbols[mcount] = bunch->contents[bindex];
-             if (DEPRECATED_SYMBOL_NAME (&msymbols[mcount])[0] == leading_char)
+             if (SYMBOL_LINKAGE_NAME (&msymbols[mcount])[0] == leading_char)
                {
-                 DEPRECATED_SYMBOL_NAME (&msymbols[mcount])++;
+                 SYMBOL_LINKAGE_NAME (&msymbols[mcount])++;
                }
            }
          msym_bunch_index = BUNCH_SIZE;
@@ -898,7 +900,7 @@ install_minimal_symbols (struct objfile *objfile)
          symbol count does *not* include this null symbol, which is why it
          is indexed by mcount and not mcount-1. */
 
-      DEPRECATED_SYMBOL_NAME (&msymbols[mcount]) = NULL;
+      SYMBOL_LINKAGE_NAME (&msymbols[mcount]) = NULL;
       SYMBOL_VALUE_ADDRESS (&msymbols[mcount]) = 0;
       MSYMBOL_INFO (&msymbols[mcount]) = NULL;
       MSYMBOL_TYPE (&msymbols[mcount]) = mst_unknown;
@@ -918,7 +920,7 @@ install_minimal_symbols (struct objfile *objfile)
 
        for (i = 0; i < mcount; i++)
          {
-           const char *name = DEPRECATED_SYMBOL_NAME (&objfile->msymbols[i]);
+           const char *name = SYMBOL_LINKAGE_NAME (&objfile->msymbols[i]);
            if (name[0] == '_' && name[1] == 'Z')
              {
                set_cp_abi_as_auto_default ("gnu-v3");
@@ -981,7 +983,8 @@ find_solib_trampoline_target (CORE_ADDR pc)
       ALL_MSYMBOLS (objfile, msymbol)
       {
        if (MSYMBOL_TYPE (msymbol) == mst_text
-           && STREQ (DEPRECATED_SYMBOL_NAME (msymbol), DEPRECATED_SYMBOL_NAME (tsymbol)))
+           && STREQ (SYMBOL_LINKAGE_NAME (msymbol),
+                     SYMBOL_LINKAGE_NAME (tsymbol)))
          return SYMBOL_VALUE_ADDRESS (msymbol);
       }
     }
index 7ade6a224cea439f95a92b906346da389735359c..506fd1fe7cf889b1fc7835f4e7fdf106d641daef 100644 (file)
@@ -1694,7 +1694,7 @@ mips_init_frame_pc_first (int fromleaf, struct frame_info *prev)
   pc = ((fromleaf)
        ? SAVED_PC_AFTER_CALL (get_next_frame (prev))
        : get_next_frame (prev)
-       ? FRAME_SAVED_PC (get_next_frame (prev))
+       ? DEPRECATED_FRAME_SAVED_PC (get_next_frame (prev))
        : read_pc ());
   tmp = SKIP_TRAMPOLINE_CODE (pc);
   return tmp ? tmp : pc;
@@ -2432,7 +2432,7 @@ mips_frame_chain (struct frame_info *frame)
 {
   mips_extra_func_info_t proc_desc;
   CORE_ADDR tmp;
-  CORE_ADDR saved_pc = FRAME_SAVED_PC (frame);
+  CORE_ADDR saved_pc = DEPRECATED_FRAME_SAVED_PC (frame);
 
   if (saved_pc == 0 || inside_entry_file (saved_pc))
     return 0;
@@ -3844,7 +3844,7 @@ mips_pop_frame (void)
       return;
     }
 
-  write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
+  write_register (PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame));
   if (get_frame_saved_regs (frame) == NULL)
     DEPRECATED_FRAME_INIT_SAVED_REGS (frame);
   for (regnum = 0; regnum < NUM_REGS; regnum++)
@@ -4150,7 +4150,7 @@ do_fp_register_row (int regnum)
     {
       /* Eight byte registers: print each one as float AND as double.  */
       mips_read_fp_register_single (regnum, raw_buffer);
-      flt1 = unpack_double (mips_double_register_type (), raw_buffer, &inv1);
+      flt1 = unpack_double (mips_float_register_type (), raw_buffer, &inv1);
 
       mips_read_fp_register_double (regnum, raw_buffer);
       doub = unpack_double (mips_double_register_type (), raw_buffer, &inv3);
@@ -5546,23 +5546,37 @@ mips_saved_pc_after_call (struct frame_info *frame)
 static int
 mips_stab_reg_to_regnum (int num)
 {
-  if (num < 32)
+  if (num >= 0 && num < 32)
     return num;
-  else
+  else if (num >= 38 && num < 70)
     return num + FP0_REGNUM - 38;
+  else
+    {
+      /* This will hopefully (eventually) provoke a warning.  Should
+         we be calling complaint() here?  */
+      return NUM_REGS + NUM_PSEUDO_REGS;
+    }
 }
 
-/* Convert a ecoff register number to a gdb REGNUM */
+
+/* Convert a dwarf, dwarf2, or ecoff register number to a gdb REGNUM */
 
 static int
-mips_ecoff_reg_to_regnum (int num)
+mips_dwarf_dwarf2_ecoff_reg_to_regnum (int num)
 {
-  if (num < 32)
+  if (num >= 0 && num < 32)
     return num;
-  else
+  else if (num >= 32 && num < 64)
     return num + FP0_REGNUM - 32;
+  else
+    {
+      /* This will hopefully (eventually) provoke a warning.  Should
+         we be calling complaint() here?  */
+      return NUM_REGS + NUM_PSEUDO_REGS;
+    }
 }
 
+
 /* Convert an integer into an address.  By first converting the value
    into a pointer and then extracting it signed, the address is
    guarenteed to be correctly sign extended.  */
@@ -5979,7 +5993,9 @@ mips_gdbarch_init (struct gdbarch_info info,
 
   /* Map debug register numbers onto internal register numbers.  */
   set_gdbarch_stab_reg_to_regnum (gdbarch, mips_stab_reg_to_regnum);
-  set_gdbarch_ecoff_reg_to_regnum (gdbarch, mips_ecoff_reg_to_regnum);
+  set_gdbarch_ecoff_reg_to_regnum (gdbarch, mips_dwarf_dwarf2_ecoff_reg_to_regnum);
+  set_gdbarch_dwarf_reg_to_regnum (gdbarch, mips_dwarf_dwarf2_ecoff_reg_to_regnum);
+  set_gdbarch_dwarf2_reg_to_regnum (gdbarch, mips_dwarf_dwarf2_ecoff_reg_to_regnum);
 
   /* Initialize a frame */
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mips_frame_init_saved_regs);
@@ -5991,7 +6007,7 @@ mips_gdbarch_init (struct gdbarch_info info,
   set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
   set_gdbarch_call_dummy_address (gdbarch, mips_call_dummy_address);
   set_gdbarch_push_return_address (gdbarch, mips_push_return_address);
-  set_gdbarch_pop_frame (gdbarch, mips_pop_frame);
+  set_gdbarch_deprecated_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);
@@ -6011,11 +6027,11 @@ mips_gdbarch_init (struct gdbarch_info info,
   set_gdbarch_frame_chain (gdbarch, mips_frame_chain);
   set_gdbarch_frameless_function_invocation (gdbarch, 
                                             generic_frameless_function_invocation_not);
-  set_gdbarch_frame_saved_pc (gdbarch, mips_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, mips_frame_saved_pc);
   set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
   set_gdbarch_frame_args_skip (gdbarch, 0);
 
-  set_gdbarch_get_saved_register (gdbarch, mips_get_saved_register);
+  set_gdbarch_deprecated_get_saved_register (gdbarch, mips_get_saved_register);
 
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_breakpoint_from_pc (gdbarch, mips_breakpoint_from_pc);
index bcd96adea5a664b08ee0729f988d416b971ed0fa..df6e0439a635b4e91929f1d317e422c605a83085 100644 (file)
@@ -688,7 +688,7 @@ mn10300_frame_chain (struct frame_info *fi)
   /* The easiest way to get that info is to analyze our caller's frame.
      So we set up a dummy frame and call mn10300_analyze_prologue to
      find stuff for us.  */
-  dummy = analyze_dummy_frame (FRAME_SAVED_PC (fi), get_frame_base (fi));
+  dummy = analyze_dummy_frame (DEPRECATED_FRAME_SAVED_PC (fi), get_frame_base (fi));
 
   if (get_frame_extra_info (dummy)->status & MY_FRAME_IN_FP)
     {
@@ -728,7 +728,7 @@ mn10300_pop_frame_regular (struct frame_info *frame)
 {
   int regnum;
 
-  write_register (PC_REGNUM, FRAME_SAVED_PC (frame));
+  write_register (PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame));
 
   /* Restore any saved registers.  */
   for (regnum = 0; regnum < NUM_REGS; regnum++)
@@ -900,7 +900,7 @@ static void
 mn10300_init_extra_frame_info (int fromleaf, struct frame_info *fi)
 {
   if (get_next_frame (fi))
-    deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
+    deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
 
   frame_saved_regs_zalloc (fi);
   frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
@@ -1171,13 +1171,13 @@ mn10300_gdbarch_init (struct gdbarch_info info,
   set_gdbarch_deprecated_init_frame_pc (gdbarch, init_frame_pc_noop);
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, mn10300_frame_init_saved_regs);
   set_gdbarch_frame_chain (gdbarch, mn10300_frame_chain);
-  set_gdbarch_frame_saved_pc (gdbarch, mn10300_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, mn10300_frame_saved_pc);
   set_gdbarch_deprecated_extract_return_value (gdbarch, mn10300_extract_return_value);
   set_gdbarch_deprecated_extract_struct_value_address
     (gdbarch, mn10300_extract_struct_value_address);
   set_gdbarch_deprecated_store_return_value (gdbarch, mn10300_store_return_value);
   set_gdbarch_store_struct_return (gdbarch, mn10300_store_struct_return);
-  set_gdbarch_pop_frame (gdbarch, mn10300_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, mn10300_pop_frame);
   set_gdbarch_skip_prologue (gdbarch, mn10300_skip_prologue);
   set_gdbarch_frame_args_skip (gdbarch, 0);
   set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
index 36ccadc55872a9455a8a64b87cea69eccb532239..9737120bbbd184b137b83d053bd34fec45e47aec 100644 (file)
@@ -191,7 +191,7 @@ umax_frame_num_args (struct frame_info *fi)
     {
       pc = ((enter_addr == 1)
            ? SAVED_PC_AFTER_CALL (fi)
-           : FRAME_SAVED_PC (fi));
+           : DEPRECATED_FRAME_SAVED_PC (fi));
       insn = read_memory_integer (pc, 2);
       addr_mode = (insn >> 11) & 0x1f;
       insn = insn & 0x7ff;
@@ -573,7 +573,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
                                    generic_frameless_function_invocation_not);
   
   set_gdbarch_frame_chain (gdbarch, ns32k_frame_chain);
-  set_gdbarch_frame_saved_pc (gdbarch, ns32k_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, ns32k_frame_saved_pc);
 
   set_gdbarch_frame_args_address (gdbarch, ns32k_frame_args_address);
   set_gdbarch_frame_locals_address (gdbarch, ns32k_frame_locals_address);
@@ -593,7 +593,7 @@ ns32k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* Call dummy info */
   set_gdbarch_deprecated_push_dummy_frame (gdbarch, ns32k_push_dummy_frame);
-  set_gdbarch_pop_frame (gdbarch, ns32k_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, ns32k_pop_frame);
   set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
   set_gdbarch_call_dummy_p (gdbarch, 1);
   set_gdbarch_call_dummy_words (gdbarch, ns32k_call_dummy_words);
index bf5250f4035122a178c36843961aa46adf0b8260..97971d2512349abfe9403825668838800ccc8528 100644 (file)
@@ -295,7 +295,7 @@ frame_num_args (struct frame_info *fi)
   enter_addr = ns32k_get_enter_addr (fi->pc);
   if (enter_addr = 0)
     return (-1);
-  argp = enter_addr == 1 ? SAVED_PC_AFTER_CALL (fi) : FRAME_SAVED_PC (fi);
+  argp = enter_addr == 1 ? SAVED_PC_AFTER_CALL (fi) : DEPRECATED_FRAME_SAVED_PC (fi);
   for (i = 0; i < 16; i++)
     {
       /*
index f02581b558369c4945581072baf2dca24824cf5a..3ba7c2e52fb45bc0e34df9fafa4664fa684bbce7 100644 (file)
@@ -730,7 +730,7 @@ ppc_linux_init_abi (struct gdbarch_info info,
       set_gdbarch_frameless_function_invocation (gdbarch,
         ppc_linux_frameless_function_invocation);
       set_gdbarch_frame_chain (gdbarch, ppc_linux_frame_chain);
-      set_gdbarch_frame_saved_pc (gdbarch, ppc_linux_frame_saved_pc);
+      set_gdbarch_deprecated_frame_saved_pc (gdbarch, ppc_linux_frame_saved_pc);
 
       set_gdbarch_deprecated_frame_init_saved_regs (gdbarch,
                                          ppc_linux_frame_init_saved_regs);
index 3f2be7bc060076cc2ad705e72dc854e36a46261c..c66901780aedc5ad54e7a5f13cd63307fe671ea6 100644 (file)
@@ -389,59 +389,79 @@ register_buffer (struct regcache *regcache, int regnum)
 }
 
 void
-regcache_save (struct regcache *dst, struct regcache *src)
+regcache_save (struct regcache *dst, regcache_cooked_read_ftype *cooked_read,
+              void *src)
 {
   struct gdbarch *gdbarch = dst->descr->gdbarch;
+  void *buf = alloca (max_register_size (gdbarch));
   int regnum;
-  /* The SRC and DST register caches had better belong to the same
-     architecture.  */
-  gdb_assert (src->descr->gdbarch == dst->descr->gdbarch);
   /* The DST should be `read-only', if it wasn't then the save would
-     end up trying to write the register values out through to the
+     end up trying to write the register values back out to the
      target.  */
-  gdb_assert (!src->readonly_p);
   gdb_assert (dst->readonly_p);
   /* Clear the dest.  */
   memset (dst->registers, 0, dst->descr->sizeof_cooked_registers);
   memset (dst->register_valid_p, 0, dst->descr->sizeof_cooked_register_valid_p);
   /* Copy over any registers (identified by their membership in the
-     save_reggroup) and mark them as valid.  The full [0
-     .. NUM_REGS+NUM_PSEUDO_REGS) range is checked since some
-     architectures need to save/restore `cooked' registers that live
-     in memory.  */
+     save_reggroup) and mark them as valid.  The full [0 .. NUM_REGS +
+     NUM_PSEUDO_REGS) range is checked since some architectures need
+     to save/restore `cooked' registers that live in memory.  */
   for (regnum = 0; regnum < dst->descr->nr_cooked_registers; regnum++)
     {
       if (gdbarch_register_reggroup_p (gdbarch, regnum, save_reggroup))
        {
-         regcache_cooked_read (src, regnum, register_buffer (dst, regnum));
-         dst->register_valid_p[regnum] = 1;
+         int valid = cooked_read (src, regnum, buf);
+         if (valid)
+           {
+             memcpy (register_buffer (dst, regnum), buf,
+                     register_size (gdbarch, regnum));
+             dst->register_valid_p[regnum] = 1;
+           }
        }
     }
 }
 
 void
-regcache_restore (struct regcache *dst, struct regcache *src)
+regcache_restore (struct regcache *dst,
+                 regcache_cooked_read_ftype *cooked_read,
+                 void *src)
 {
   struct gdbarch *gdbarch = dst->descr->gdbarch;
+  void *buf = alloca (max_register_size (gdbarch));
   int regnum;
-  gdb_assert (src->descr->gdbarch == dst->descr->gdbarch);
+  /* The dst had better not be read-only.  If it is, the `restore'
+     doesn't make much sense.  */
   gdb_assert (!dst->readonly_p);
-  gdb_assert (src->readonly_p);
   /* Copy over any registers, being careful to only restore those that
-     were both saved and need to be restored.  The full [0
-     .. NUM_REGS+NUM_PSEUDO_REGS) range is checked since some
-     architectures need to save/restore `cooked' registers that live
-     in memory.  */
-  for (regnum = 0; regnum < src->descr->nr_cooked_registers; regnum++)
+     were both saved and need to be restored.  The full [0 .. NUM_REGS
+     + NUM_PSEUDO_REGS) range is checked since some architectures need
+     to save/restore `cooked' registers that live in memory.  */
+  for (regnum = 0; regnum < dst->descr->nr_cooked_registers; regnum++)
     {
-      if (gdbarch_register_reggroup_p (gdbarch, regnum, restore_reggroup)
-         && src->register_valid_p[regnum])
+      if (gdbarch_register_reggroup_p (gdbarch, regnum, restore_reggroup))
        {
-         regcache_cooked_write (dst, regnum, register_buffer (src, regnum));
+         int valid = cooked_read (src, regnum, buf);
+         if (valid)
+           regcache_cooked_write (dst, regnum, buf);
        }
     }
 }
 
+static int
+do_cooked_read (void *src, int regnum, void *buf)
+{
+  struct regcache *regcache = src;
+  if (!regcache_valid_p (regcache, regnum)
+      && regcache->readonly_p)
+    /* Don't even think about fetching a register from a read-only
+       cache when the register isn't yet valid.  There isn't a target
+       from which the register value can be fetched.  */
+    return 0;
+  regcache_cooked_read (regcache, regnum, buf);
+  return 1;
+}
+
+
 void
 regcache_cpy (struct regcache *dst, struct regcache *src)
 {
@@ -452,9 +472,9 @@ regcache_cpy (struct regcache *dst, struct regcache *src)
   gdb_assert (src != dst);
   gdb_assert (src->readonly_p || dst->readonly_p);
   if (!src->readonly_p)
-    regcache_save (dst, src);
+    regcache_save (dst, do_cooked_read, src);
   else if (!dst->readonly_p)
-    regcache_restore (dst, src);
+    regcache_restore (dst, do_cooked_read, src);
   else
     regcache_cpy_no_passthrough (dst, src);
 }
@@ -864,7 +884,7 @@ regcache_cooked_read_signed (struct regcache *regcache, int regnum,
 {
   char *buf;
   gdb_assert (regcache != NULL);
-  gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+  gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_cooked_registers);
   buf = alloca (regcache->descr->sizeof_register[regnum]);
   regcache_cooked_read (regcache, regnum, buf);
   (*val) = extract_signed_integer (buf,
@@ -877,13 +897,37 @@ regcache_cooked_read_unsigned (struct regcache *regcache, int regnum,
 {
   char *buf;
   gdb_assert (regcache != NULL);
-  gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_raw_registers);
+  gdb_assert (regnum >= 0 && regnum < regcache->descr->nr_cooked_registers);
   buf = alloca (regcache->descr->sizeof_register[regnum]);
   regcache_cooked_read (regcache, regnum, buf);
   (*val) = extract_unsigned_integer (buf,
                                     regcache->descr->sizeof_register[regnum]);
 }
 
+void
+regcache_cooked_write_signed (struct regcache *regcache, int regnum,
+                             LONGEST val)
+{
+  void *buf;
+  gdb_assert (regcache != NULL);
+  gdb_assert (regnum >=0 && regnum < regcache->descr->nr_cooked_registers);
+  buf = alloca (regcache->descr->sizeof_register[regnum]);
+  store_signed_integer (buf, regcache->descr->sizeof_register[regnum], val);
+  regcache_cooked_write (regcache, regnum, buf);
+}
+
+void
+regcache_cooked_write_unsigned (struct regcache *regcache, int regnum,
+                               ULONGEST val)
+{
+  void *buf;
+  gdb_assert (regcache != NULL);
+  gdb_assert (regnum >=0 && regnum < regcache->descr->nr_cooked_registers);
+  buf = alloca (regcache->descr->sizeof_register[regnum]);
+  store_unsigned_integer (buf, regcache->descr->sizeof_register[regnum], val);
+  regcache_cooked_write (regcache, regnum, buf);
+}
+
 /* Write register REGNUM at MYADDR to the target.  MYADDR points at
    REGISTER_RAW_BYTES(REGNUM), which must be in target byte-order.  */
 
index ee1050536056de08f98bd908332c3aa7a3311f6d..3fb43c437a469c21207db8a8d4a0d9a1971f74bb 100644 (file)
@@ -75,6 +75,10 @@ extern void regcache_cooked_read_signed (struct regcache *regcache,
                                         int regnum, LONGEST *val);
 extern void regcache_cooked_read_unsigned (struct regcache *regcache,
                                           int regnum, ULONGEST *val);
+extern void regcache_cooked_write_signed (struct regcache *regcache,
+                                         int regnum, LONGEST val);
+extern void regcache_cooked_write_unsigned (struct regcache *regcache,
+                                           int regnum, ULONGEST val);
 
 /* Partial transfer of a cooked register.  These perform read, modify,
    write style operations.  */
@@ -94,7 +98,7 @@ extern void regcache_collect (int regnum, void *buf);
 
 /* The register's ``offset''.
 
-   FIXME: cagney/2002-11-07: The get_saved_register() function, when
+   FIXME: cagney/2002-11-07: The frame_register() function, when
    specifying the real location of a register, does so using that
    registers offset in the register cache.  That offset is then used
    by valops.c to determine the location of the register.  The code
@@ -155,15 +159,19 @@ extern int max_register_size (struct gdbarch *gdbarch);
 extern int register_size (struct gdbarch *gdbarch, int regnum);
 
 
-/* Save/restore a register cache.  The registers saved/restored is
-   determined by the save_reggroup and restore_reggroup (although you
-   can't restore a register that wasn't saved as well :-).  You can
-   only save to a read-only cache (default from regcache_xmalloc())
-   from a live cache and you can only restore from a read-only cache
-   to a live cache.  */
+/* Save/restore a register cache.  The set of registers saved /
+   restored into the DST regcache determined by the save_reggroup /
+   restore_reggroup respectively.  COOKED_READ returns zero iff the
+   register's value can't be returned.  */
 
-extern void regcache_save (struct regcache *dst, struct regcache *src);
-extern void regcache_restore (struct regcache *dst, struct regcache *src);
+typedef int (regcache_cooked_read_ftype) (void *src, int regnum, void *buf);
+
+extern void regcache_save (struct regcache *dst,
+                          regcache_cooked_read_ftype *cooked_read,
+                          void *src);
+extern void regcache_restore (struct regcache *dst,
+                             regcache_cooked_read_ftype *cooked_read,
+                             void *src);
 
 /* Copy/duplicate the contents of a register cache.  By default, the
    operation is pass-through.  Writes to DST and reads from SRC will
index ac335789465832f5bff942c2ac8964917355bc8d..46733a3ac572e47a5fffc3266410c6deb7f8a64f 100644 (file)
@@ -2917,7 +2917,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_store_struct_return (gdbarch, rs6000_store_struct_return);
   set_gdbarch_extract_struct_value_address (gdbarch, rs6000_extract_struct_value_address);
-  set_gdbarch_pop_frame (gdbarch, rs6000_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, rs6000_pop_frame);
 
   set_gdbarch_skip_prologue (gdbarch, rs6000_skip_prologue);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
@@ -2938,7 +2938,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_frameless_function_invocation (gdbarch,
                                          rs6000_frameless_function_invocation);
   set_gdbarch_frame_chain (gdbarch, rs6000_frame_chain);
-  set_gdbarch_frame_saved_pc (gdbarch, rs6000_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, rs6000_frame_saved_pc);
 
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, rs6000_frame_init_saved_regs);
   set_gdbarch_deprecated_init_extra_frame_info (gdbarch, rs6000_init_extra_frame_info);
index 9ad34c893e0a8772164dda9f580786a9a697e72a..138ef78be08a451da890c292f412b5d8e49c94d8 100644 (file)
@@ -1221,7 +1221,7 @@ s390_pop_frame_regular (struct frame_info *frame)
 {
   int regnum;
 
-  write_register (S390_PC_REGNUM, FRAME_SAVED_PC (frame));
+  write_register (S390_PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame));
 
   /* Restore any saved registers.  */
   if (get_frame_saved_regs (frame))
@@ -1820,7 +1820,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
      This is often the number of bytes in BREAKPOINT
      but not always.  */
   set_gdbarch_decr_pc_after_break (gdbarch, 2);
-  set_gdbarch_pop_frame (gdbarch, s390_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, s390_pop_frame);
   /* Stack grows downward.  */
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   /* Offset from address of function to start of its code.
@@ -1839,7 +1839,7 @@ s390_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_frameless_function_invocation (gdbarch,
                                             s390_frameless_function_invocation);
   /* Return saved PC from a frame */
-  set_gdbarch_frame_saved_pc (gdbarch, s390_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, s390_frame_saved_pc);
   /* FRAME_CHAIN takes a frame's nominal address
      and produces the frame's chain-pointer. */
   set_gdbarch_frame_chain (gdbarch, s390_frame_chain);
index fe11d8a6f43ac10c5f48001616b889ba9b507e79..961e0300ea61725da9f7a3b5932f01cd9803131a 100644 (file)
@@ -70,17 +70,6 @@ sentinel_frame_register_unwind (struct frame_info *frame,
     }
 }
 
-CORE_ADDR
-sentinel_frame_pc_unwind (struct frame_info *frame,
-                         void **cache)
-{
-  /* FIXME: cagney/2003-01-08: This should be using a per-architecture
-     method that doesn't suffer from DECR_PC_AFTER_BREAK problems.
-     Such a method would take unwind_cache, regcache and stop reason
-     parameters.  */
-  return read_pc ();
-}
-
 void
 sentinel_frame_id_unwind (struct frame_info *frame,
                          void **cache,
@@ -94,18 +83,8 @@ sentinel_frame_id_unwind (struct frame_info *frame,
   id->pc = read_pc ();
 }
 
-static void
-sentinel_frame_pop (struct frame_info *frame,
-                   void **cache,
-                   struct regcache *regcache)
-{
-  internal_error (__FILE__, __LINE__, "Function sentinal_frame_pop called");
-}
-
 const struct frame_unwind sentinel_frame_unwinder =
 {
-  sentinel_frame_pop,
-  sentinel_frame_pc_unwind,
   sentinel_frame_id_unwind,
   sentinel_frame_register_unwind
 };
index 91f3f62964ceb2f1fcd2439f2392918870684615..2a6449f305a6a47e0e9b1b807f9750ab85107090 100644 (file)
@@ -1758,7 +1758,7 @@ sh_init_extra_frame_info (int fromleaf, struct frame_info *fi)
   frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
 
   if (get_next_frame (fi))
-    deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
+    deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
 
   if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
                                   get_frame_base (fi)))
@@ -1790,7 +1790,7 @@ sh64_init_extra_frame_info (int fromleaf, struct frame_info *fi)
   frame_extra_info_zalloc (fi, sizeof (struct frame_extra_info));
 
   if (get_next_frame (fi)) 
-    deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
+    deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
 
   if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), get_frame_base (fi),
                                   get_frame_base (fi)))
@@ -4372,14 +4372,14 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_do_registers_info (gdbarch, sh_do_registers_info);
   set_gdbarch_breakpoint_from_pc (gdbarch, sh_breakpoint_from_pc);
   set_gdbarch_frame_chain (gdbarch, sh_frame_chain);
-  set_gdbarch_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
+  set_gdbarch_deprecated_get_saved_register (gdbarch, deprecated_generic_get_saved_register);
   set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh_init_extra_frame_info);
   set_gdbarch_deprecated_extract_return_value (gdbarch, sh_extract_return_value);
   set_gdbarch_push_arguments (gdbarch, sh_push_arguments);
   set_gdbarch_store_struct_return (gdbarch, sh_store_struct_return);
   set_gdbarch_use_struct_convention (gdbarch, sh_use_struct_convention);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh_extract_struct_value_address);
-  set_gdbarch_pop_frame (gdbarch, sh_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, sh_pop_frame);
   set_gdbarch_print_insn (gdbarch, gdb_print_insn_sh);
   set_gdbarch_register_sim_regno (gdbarch, legacy_register_sim_regno);
   skip_prologue_hard_way = sh_skip_prologue_hard_way;
@@ -4615,13 +4615,13 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       set_gdbarch_breakpoint_from_pc (gdbarch, sh_sh64_breakpoint_from_pc);
       set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sh64_init_extra_frame_info);
       set_gdbarch_frame_chain (gdbarch, sh64_frame_chain);
-      set_gdbarch_get_saved_register (gdbarch, sh64_get_saved_register);
+      set_gdbarch_deprecated_get_saved_register (gdbarch, sh64_get_saved_register);
       set_gdbarch_deprecated_extract_return_value (gdbarch, sh64_extract_return_value);
       set_gdbarch_push_arguments (gdbarch, sh64_push_arguments);
       /*set_gdbarch_store_struct_return (gdbarch, sh64_store_struct_return);*/
       set_gdbarch_deprecated_extract_struct_value_address (gdbarch, sh64_extract_struct_value_address);
       set_gdbarch_use_struct_convention (gdbarch, sh64_use_struct_convention);
-      set_gdbarch_pop_frame (gdbarch, sh64_pop_frame);
+      set_gdbarch_deprecated_pop_frame (gdbarch, sh64_pop_frame);
       set_gdbarch_elf_make_msymbol_special (gdbarch,
                                             sh64_elf_make_msymbol_special);
       break;
@@ -4674,7 +4674,7 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   set_gdbarch_frame_args_skip (gdbarch, 0);
   set_gdbarch_frameless_function_invocation (gdbarch, frameless_look_for_prologue);
-  set_gdbarch_frame_saved_pc (gdbarch, sh_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, sh_frame_saved_pc);
   set_gdbarch_saved_pc_after_call (gdbarch, sh_saved_pc_after_call);
   set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
   set_gdbarch_believe_pcc_promotion (gdbarch, 1);
index b22474aac93ec390599415fece1f71987b98df3d..6e1b211f6d5a043c4116fb70ed483f3890b8463d 100644 (file)
@@ -326,9 +326,9 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
       else
        {
          /* Should we adjust for stack bias here? */
-         get_saved_register (buf, 0, 0, fi, FP_REGNUM, 0);
-         deprecated_update_frame_base_hack (fi, extract_address (buf, REGISTER_RAW_SIZE (FP_REGNUM)));
-
+         ULONGEST tmp;
+         frame_read_unsigned_register (fi, FP_REGNUM, &tmp);
+         deprecated_update_frame_base_hack (fi, tmp);
          if (GDB_TARGET_IS_SPARC64 && (get_frame_base (fi) & 1))
            deprecated_update_frame_base_hack (fi, get_frame_base (fi) + 2047);
        }
@@ -367,8 +367,11 @@ sparc_init_extra_frame_info (int fromleaf, struct frame_info *fi)
              get_frame_extra_info (fi)->sp_offset = offset;
 
              /* Overwrite the frame's address with the value in %i7.  */
-             get_saved_register (buf, 0, 0, fi, I7_REGNUM, 0);
-             deprecated_update_frame_base_hack (fi, extract_address (buf, REGISTER_RAW_SIZE (I7_REGNUM)));
+             {
+               ULONGEST tmp;
+               frame_read_unsigned_register (fi, I7_REGNUM, &tmp);
+               deprecated_update_frame_base_hack (fi, tmp);
+             }
 
              if (GDB_TARGET_IS_SPARC64 && (get_frame_base (fi) & 1))
                deprecated_update_frame_base_hack (fi, get_frame_base (fi) + 2047);
@@ -487,9 +490,11 @@ sparc_frame_saved_pc (struct frame_info *frame)
        saved_pc_offset = 12;
 
       /* The sigcontext address is contained in register O2.  */
-      get_saved_register (buf, (int *) NULL, (CORE_ADDR *) NULL,
-                         frame, O0_REGNUM + 2, (enum lval_type *) NULL);
-      sigcontext_addr = extract_address (buf, REGISTER_RAW_SIZE (O0_REGNUM + 2));
+      {
+       ULONGEST tmp;
+       frame_read_unsigned_register (frame, O0_REGNUM + 2, &tmp);
+       sigcontext_addr = tmp;
+      }
 
       /* Don't cause a memory_error when accessing sigcontext in case the
          stack layout has changed or the stack is corrupt.  */
@@ -505,9 +510,9 @@ sparc_frame_saved_pc (struct frame_info *frame)
     {
       /* A frameless function interrupted by a signal did not save
          the PC, it is still in %o7.  */
-      get_saved_register (buf, (int *) NULL, (CORE_ADDR *) NULL,
-                         frame, O7_REGNUM, (enum lval_type *) NULL);
-      return PC_ADJUST (extract_address (buf, SPARC_INTREG_SIZE));
+      ULONGEST tmp;
+      frame_read_unsigned_register (frame, O7_REGNUM, &tmp);
+      return PC_ADJUST (tmp);
     }
   if (get_frame_extra_info (frame)->flat)
     addr = get_frame_extra_info (frame)->pc_addr;
@@ -547,7 +552,7 @@ setup_arbitrary_frame (int argc, CORE_ADDR *argv)
                    "create_new_frame returned invalid frame");
 
   get_frame_extra_info (frame)->bottom = argv[1];
-  deprecated_update_frame_pc_hack (frame, FRAME_SAVED_PC (frame));
+  deprecated_update_frame_pc_hack (frame, DEPRECATED_FRAME_SAVED_PC (frame));
   return frame;
 }
 
@@ -936,8 +941,9 @@ sparc_get_saved_register (char *raw_buffer, int *optimized, CORE_ADDR *addrp,
          else if (regnum >= O0_REGNUM && regnum < O0_REGNUM + 8)
            {
              /* Outs become ins.  */
-             get_saved_register (raw_buffer, optimized, addrp, frame1,
-                                 (regnum - O0_REGNUM + I0_REGNUM), lval);
+             int realnum;
+             frame_register (frame1, (regnum - O0_REGNUM + I0_REGNUM),
+                             optimized, lval, addrp, &realnum, raw_buffer);
              return;
            }
        }
@@ -1090,10 +1096,10 @@ sparc_push_dummy_frame (void)
    I think few ports of GDB get right--if you are popping a frame
    which does not save some register that *is* saved by a more inner
    frame (such a frame will never be a dummy frame because dummy
-   frames save all registers).  Rewriting pop_frame to use
-   get_saved_register would solve this problem and also get rid of the
-   ugly duplication between sparc_frame_find_saved_regs and
-   get_saved_register.
+   frames save all registers).
+
+   NOTE: cagney/2003-03-12: Since pop_frame has been rewritten to use
+   frame_unwind_register() the need for this function is questionable.
 
    Stores, into an array of CORE_ADDR, 
    the addresses of the saved registers of frame described by FRAME_INFO.
@@ -1369,12 +1375,9 @@ sparc_pop_frame (void)
          /* I think this happens only in the innermost frame, if so then
             it is a complicated way of saying
             "pc = read_register (O7_REGNUM);".  */
-         char *buf;
-
-         buf = alloca (MAX_REGISTER_RAW_SIZE);
-         get_saved_register (buf, 0, 0, frame, O7_REGNUM, 0);
-         pc = PC_ADJUST (extract_address
-                         (buf, REGISTER_RAW_SIZE (O7_REGNUM)));
+         ULONGEST tmp;
+         frame_read_unsigned_register (frame, O7_REGNUM, &tmp);
+         pc = PC_ADJUST (tmp);
        }
 
       write_register (PC_REGNUM, pc);
@@ -3147,10 +3150,10 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_frame_chain (gdbarch, sparc_frame_chain);
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch, sparc_frame_init_saved_regs);
   set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
-  set_gdbarch_frame_saved_pc (gdbarch, sparc_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, sparc_frame_saved_pc);
   set_gdbarch_frameless_function_invocation (gdbarch, 
                                             frameless_look_for_prologue);
-  set_gdbarch_get_saved_register (gdbarch, sparc_get_saved_register);
+  set_gdbarch_deprecated_get_saved_register (gdbarch, sparc_get_saved_register);
   set_gdbarch_deprecated_init_extra_frame_info (gdbarch, sparc_init_extra_frame_info);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
@@ -3158,7 +3161,7 @@ sparc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
   set_gdbarch_deprecated_max_register_raw_size (gdbarch, 8);
   set_gdbarch_deprecated_max_register_virtual_size (gdbarch, 8);
-  set_gdbarch_pop_frame (gdbarch, sparc_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, sparc_pop_frame);
   set_gdbarch_push_return_address (gdbarch, sparc_push_return_address);
   set_gdbarch_deprecated_push_dummy_frame (gdbarch, sparc_push_dummy_frame);
   set_gdbarch_read_pc (gdbarch, generic_target_read_pc);
index 3eab979f6ca538e9f302c2f10817be2938ab2ceb..98b8a0f88ce66fd607e8b0aaa2a75d8fe2be0f56 100644 (file)
@@ -1639,9 +1639,13 @@ return_command (char *retval_exp, int from_tty)
      that.  */
 
   /* Do the real work.  Pop until the specified frame is current.  We
-     use this method because the deprecated_selected_frame is not valid after
-     a POP_FRAME.  The pc comparison makes this work even if the
-     selected frame shares its fp with another frame.  */
+     use this method because the deprecated_selected_frame is not
+     valid after a frame_pop().  The pc comparison makes this work
+     even if the selected frame shares its fp with another frame.  */
+
+  /* FIXME: cagney/32003-03-12: This code should use frame_id_eq().
+     Unfortunatly, that function doesn't yet include the PC in any
+     frame ID comparison.  */
 
   while (selected_frame_addr != get_frame_base (frame = get_current_frame ())
         || selected_frame_pc != get_frame_pc (frame))
index c3e659db394e5b7e71eae7dc385ce7a5e0d22e63..7069f965796d0c24bc27f05e5a2358e59cfe8535 100644 (file)
@@ -1,3 +1,17 @@
+2003-03-14  Andrew Cagney  <cagney@redhat.com>
+
+       * tuiRegs.c (_tuiGetRegisterRawValue): Use frame_read_register,
+       instead of get_saved_register.
+
+2003-03-13  Stephane Carrez  <stcarrez@nerim.fr>
+
+       * tui-out.c (tui_out_data): Fix typedef.
+
+2003-03-08  Andrew Cagney  <cagney@redhat.com>
+
+       * tui-out.c: Update copyright.
+       (tui_out_data): Define typedef.  Use instead of ui_out_data.
+
 2003-02-14  Andrew Cagney  <ac131313@redhat.com>
 
        * tui.c (tui_enable, tui_disable): Don't modify tui_version.
index 71ce5e00aa487b386823d680fd771b6684df1a8c..94fda09b14c2baa9f2eb6d22f22f7b2e94f6c5b8 100644 (file)
@@ -1,6 +1,7 @@
 /* Output generating routines for GDB CLI.
 
-   Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright 1999, 2000, 2001, 2002, 2003 Free Software Foundation,
+   Inc.
 
    Contributed by Cygnus Solutions.
    Written by Fernando Nasser for Cygnus.
@@ -35,6 +36,7 @@ struct ui_out_data
     int line;
     int start_of_line;
   };
+typedef struct ui_out_data tui_out_data;
 
 /* These are the CLI output functions */
 
@@ -112,7 +114,7 @@ tui_table_begin (struct ui_out *uiout, int nbrofcols,
                 int nr_rows,
                 const char *tblid)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (nr_rows == 0)
     data->suppress_output = 1;
   else
@@ -126,7 +128,7 @@ tui_table_begin (struct ui_out *uiout, int nbrofcols,
 void
 tui_table_body (struct ui_out *uiout)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   /* first, close the table header line */
@@ -138,7 +140,7 @@ tui_table_body (struct ui_out *uiout)
 void
 tui_table_end (struct ui_out *uiout)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   data->suppress_output = 0;
 }
 
@@ -149,7 +151,7 @@ tui_table_header (struct ui_out *uiout, int width, enum ui_align alignment,
                  const char *col_name,
                  const char *colhdr)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   tui_field_string (uiout, 0, width, alignment, 0, colhdr);
@@ -163,7 +165,7 @@ tui_begin (struct ui_out *uiout,
           int level,
           const char *id)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
 }
@@ -175,7 +177,7 @@ tui_end (struct ui_out *uiout,
         enum ui_out_type type,
         int level)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
 }
@@ -189,7 +191,7 @@ tui_field_int (struct ui_out *uiout, int fldno, int width,
 {
   char buffer[20];             /* FIXME: how many chars long a %d can become? */
 
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
 
@@ -212,7 +214,7 @@ tui_field_skip (struct ui_out *uiout, int fldno, int width,
                enum ui_align alignment,
                const char *fldname)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   tui_field_string (uiout, fldno, width, alignment, fldname, "");
@@ -232,7 +234,7 @@ tui_field_string (struct ui_out *uiout,
   int before = 0;
   int after = 0;
 
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
 
@@ -290,7 +292,7 @@ tui_field_fmt (struct ui_out *uiout, int fldno,
               const char *format,
               va_list args)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
 
@@ -304,7 +306,7 @@ tui_field_fmt (struct ui_out *uiout, int fldno,
 void
 tui_spaces (struct ui_out *uiout, int numspaces)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   print_spaces_filtered (numspaces, data->stream);
@@ -313,7 +315,7 @@ tui_spaces (struct ui_out *uiout, int numspaces)
 void
 tui_text (struct ui_out *uiout, const char *string)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   data->start_of_line ++;
@@ -335,7 +337,7 @@ void
 tui_message (struct ui_out *uiout, int verbosity,
             const char *format, va_list args)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   if (ui_out_get_verblvl (uiout) >= verbosity)
@@ -345,7 +347,7 @@ tui_message (struct ui_out *uiout, int verbosity,
 void
 tui_wrap_hint (struct ui_out *uiout, char *identstring)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   if (data->suppress_output)
     return;
   wrap_here (identstring);
@@ -354,7 +356,7 @@ tui_wrap_hint (struct ui_out *uiout, char *identstring)
 void
 tui_flush (struct ui_out *uiout)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   gdb_flush (data->stream);
 }
 
@@ -369,7 +371,7 @@ out_field_fmt (struct ui_out *uiout, int fldno,
               const char *fldname,
               const char *format,...)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   va_list args;
 
   va_start (args, format);
@@ -383,7 +385,7 @@ out_field_fmt (struct ui_out *uiout, int fldno,
 static void
 field_separator (void)
 {
-  struct ui_out_data *data = ui_out_data (uiout);
+  tui_out_data *data = ui_out_data (uiout);
   fputc_filtered (' ', data->stream);
 }
 
@@ -394,7 +396,7 @@ tui_out_new (struct ui_file *stream)
 {
   int flags = 0;
 
-  struct ui_out_data *data = XMALLOC (struct ui_out_data);
+  tui_out_data *data = XMALLOC (tui_out_data);
   data->stream = stream;
   data->suppress_output = 0;
   data->line = -1;
index 6fc63d9454eddeae4bf54480b3c550bfe8275920..6920d80d97553c70f28473cce1a59aed4348f887 100644 (file)
@@ -799,10 +799,10 @@ _tuiGetRegisterRawValue (int regNum, char *regValue, struct frame_info *frame)
 
   if (target_has_registers)
     {
-      int opt;
-      
-      get_saved_register (regValue, &opt, (CORE_ADDR*) NULL, frame,
-                         regNum, (enum lval_type*) NULL);
+      frame_read_register (frame, regNum, regValue);
+      /* NOTE: cagney/2003-03-13: This is bogus.  It is refering to
+         the register cache and not the frame which could have pulled
+         the register value off the stack.  */
       if (register_cached (regNum) >= 0)
        ret = TUI_SUCCESS;
     }
index 0894a8f6b86c71f44af6a907d6a4728fb936ca63..f0c12a223bc0a0a40f2530ab1cd525c7dcb0b81d 100644 (file)
@@ -826,7 +826,7 @@ v850_frame_chain (struct frame_info *fi)
   CORE_ADDR callers_pc, fp;
 
   /* First, find out who called us */
-  callers_pc = FRAME_SAVED_PC (fi);
+  callers_pc = DEPRECATED_FRAME_SAVED_PC (fi);
   /* If caller is a call-dummy, then our FP bears no relation to his FP! */
   fp = v850_find_callers_reg (fi, E_FP_RAW_REGNUM);
   if (DEPRECATED_PC_IN_CALL_DUMMY (callers_pc, fp, fp))
@@ -892,7 +892,7 @@ v850_pop_frame (void)
     generic_pop_dummy_frame ();
   else
     {
-      write_register (E_PC_REGNUM, FRAME_SAVED_PC (frame));
+      write_register (E_PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (frame));
 
       for (regnum = 0; regnum < E_NUM_REGS; regnum++)
        if (get_frame_saved_regs (frame)[regnum] != 0)
@@ -1165,7 +1165,7 @@ v850_init_extra_frame_info (int fromleaf, struct frame_info *fi)
   struct prologue_info pi;
 
   if (get_next_frame (fi))
-    deprecated_update_frame_pc_hack (fi, FRAME_SAVED_PC (get_next_frame (fi)));
+    deprecated_update_frame_pc_hack (fi, DEPRECATED_FRAME_SAVED_PC (get_next_frame (fi)));
 
   v850_frame_init_saved_regs (fi);
 }
@@ -1246,7 +1246,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_init_extra_frame_info (gdbarch, v850_init_extra_frame_info);
   set_gdbarch_frame_chain (gdbarch, v850_frame_chain);
   set_gdbarch_saved_pc_after_call (gdbarch, v850_saved_pc_after_call);
-  set_gdbarch_frame_saved_pc (gdbarch, v850_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, v850_frame_saved_pc);
   set_gdbarch_skip_prologue (gdbarch, v850_skip_prologue);
 
   /* 
@@ -1271,7 +1271,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_push_return_address (gdbarch, v850_push_return_address);
   set_gdbarch_deprecated_extract_return_value (gdbarch, v850_extract_return_value);
   set_gdbarch_push_arguments (gdbarch, v850_push_arguments);
-  set_gdbarch_pop_frame (gdbarch, v850_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, v850_pop_frame);
   set_gdbarch_store_struct_return (gdbarch, v850_store_struct_return);
   set_gdbarch_deprecated_store_return_value (gdbarch, v850_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, v850_extract_struct_value_address);
index dcfd92c9de8ba9d59cd1fbfbee551d24525a545f..ed0fe05f35e64d8a1091f1f704eec98279b6484f 100644 (file)
@@ -276,6 +276,7 @@ value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound
   else
     VALUE_LVAL (v) = VALUE_LVAL (array);
   VALUE_ADDRESS (v) = VALUE_ADDRESS (array);
+  VALUE_REGNO (v) = VALUE_REGNO (array);
   VALUE_OFFSET (v) = VALUE_OFFSET (array) + elt_offs;
   return v;
 }
index 6dcc6f107c9af58c52f8c729645e1f4e146dfca1..f21b781b8cafb3a811b0eb02ca1d53d334b1f656 100644 (file)
@@ -1303,7 +1303,7 @@ hand_function_call (struct value *function, int nargs, struct value **args)
   if (DEPRECATED_PUSH_DUMMY_FRAME_P ())
     {
       /* DEPRECATED_PUSH_DUMMY_FRAME is responsible for saving the
-        inferior registers (and POP_FRAME for restoring them).  (At
+        inferior registers (and frame_pop() for restoring them).  (At
         least on most machines) they are saved on the stack in the
         inferior.  */
       DEPRECATED_PUSH_DUMMY_FRAME;
index ab968b69f1b26b884a7ed6d4f746994355fbf943..f5cd2676e85843b794bd4056acaa39618ae5f4e4 100644 (file)
@@ -43,7 +43,6 @@ static gdbarch_skip_prologue_ftype vax_skip_prologue;
 static gdbarch_saved_pc_after_call_ftype vax_saved_pc_after_call;
 static gdbarch_frame_num_args_ftype vax_frame_num_args;
 static gdbarch_frame_chain_ftype vax_frame_chain;
-static gdbarch_frame_saved_pc_ftype vax_frame_saved_pc;
 static gdbarch_frame_args_address_ftype vax_frame_args_address;
 static gdbarch_frame_locals_address_ftype vax_frame_locals_address;
 
@@ -53,7 +52,6 @@ static gdbarch_deprecated_extract_struct_value_address_ftype
     vax_extract_struct_value_address;
 
 static gdbarch_deprecated_push_dummy_frame_ftype vax_push_dummy_frame;
-static gdbarch_pop_frame_ftype vax_pop_frame;
 static gdbarch_fix_call_dummy_ftype vax_fix_call_dummy;
 
 /* Return 1 if P points to an invalid floating point value.
@@ -375,7 +373,7 @@ vax_skip_prologue (CORE_ADDR pc)
 static CORE_ADDR
 vax_saved_pc_after_call (struct frame_info *frame)
 {
-  return (FRAME_SAVED_PC(frame));
+  return (DEPRECATED_FRAME_SAVED_PC(frame));
 }
 \f
 /* Print the vax instruction at address MEMADDR in debugged memory,
@@ -650,7 +648,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
                                   generic_frameless_function_invocation_not);
 
   set_gdbarch_frame_chain (gdbarch, vax_frame_chain);
-  set_gdbarch_frame_saved_pc (gdbarch, vax_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, vax_frame_saved_pc);
 
   set_gdbarch_frame_args_address (gdbarch, vax_frame_args_address);
   set_gdbarch_frame_locals_address (gdbarch, vax_frame_locals_address);
@@ -669,7 +667,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* Call dummy info */
   set_gdbarch_deprecated_push_dummy_frame (gdbarch, vax_push_dummy_frame);
-  set_gdbarch_pop_frame (gdbarch, vax_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, vax_pop_frame);
   set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
   set_gdbarch_call_dummy_p (gdbarch, 1);
   set_gdbarch_call_dummy_words (gdbarch, vax_call_dummy_words);
index 099f77234abe5f5f4504ed7e3c6d76e32a0600dd..44cef3b7a064d4dd18819dec3a90e5e472b6a8f3 100644 (file)
@@ -1 +1 @@
-2003-03-08-cvs
+2003-03-16-cvs
index 5fece43a4db53a1d8f220a882f100fd41d9cb7f9..ced11dca01c657f8eab1373202cc0e3859cfdb22 100644 (file)
@@ -1006,7 +1006,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
                                       x86_64_register_convert_to_raw);
 
   /* Getting saved registers is handled by unwind information.  */
-  set_gdbarch_get_saved_register (gdbarch, cfi_get_saved_register);
+  set_gdbarch_deprecated_get_saved_register (gdbarch, cfi_get_saved_register);
 
   /* FIXME: kettenis/20021026: Should we set parm_boundary to 64 here?  */
   set_gdbarch_read_fp (gdbarch, cfi_read_fp);
@@ -1015,7 +1015,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   set_gdbarch_push_arguments (gdbarch, x86_64_push_arguments);
   set_gdbarch_push_return_address (gdbarch, x86_64_push_return_address);
-  set_gdbarch_pop_frame (gdbarch, x86_64_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, x86_64_pop_frame);
   set_gdbarch_store_struct_return (gdbarch, x86_64_store_struct_return);
   set_gdbarch_store_return_value (gdbarch, x86_64_store_return_value);
   /* Override, since this is handled by x86_64_extract_return_value.  */
@@ -1030,7 +1030,7 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
                                         x86_64_frameless_function_invocation);
   /* FIXME: kettenis/20021026: These two are GNU/Linux-specific and
      should be moved elsewhere.  */
-  set_gdbarch_frame_saved_pc (gdbarch, x86_64_linux_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, x86_64_linux_frame_saved_pc);
   set_gdbarch_saved_pc_after_call (gdbarch, x86_64_linux_saved_pc_after_call);
   set_gdbarch_frame_num_args (gdbarch, frame_num_args_unknown);
   /* FIXME: kettenis/20021026: This one is GNU/Linux-specific too.  */
index b0b819112a6c4927ce202431d373620a399b1290..f39ea0da6b5539ec8ecdeb3b371695f8390a1aa8 100644 (file)
@@ -31,7 +31,7 @@ extern int x86_64_num_gregs;
 int x86_64_register_number (const char *name);
 const char *x86_64_register_name (int reg_nr);
 
-gdbarch_frame_saved_pc_ftype x86_64_linux_frame_saved_pc;
+gdbarch_deprecated_frame_saved_pc_ftype x86_64_linux_frame_saved_pc;
 gdbarch_saved_pc_after_call_ftype x86_64_linux_saved_pc_after_call;
 gdbarch_pc_in_sigtramp_ftype x86_64_linux_in_sigtramp;
 CORE_ADDR x86_64_linux_frame_chain (struct frame_info *fi);
index 2bbd4022d1294c42af68708d9e65432e0fff5063..2ccbb1e60b5005ed2447237a45ed548159d6ca1b 100644 (file)
@@ -354,7 +354,7 @@ xstormy16_pop_frame (void)
                                                      xstormy16_reg_size));
          }
       /* Restore the PC */
-      write_register (PC_REGNUM, FRAME_SAVED_PC (fi));
+      write_register (PC_REGNUM, DEPRECATED_FRAME_SAVED_PC (fi));
       flush_cached_frames ();
     }
   return;
@@ -723,11 +723,10 @@ xstormy16_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
    actual value of the previous frame's stack register. 
 
    This function may be called in any context where the saved register
-   values may be needed (backtrace, frame_info, get_saved_register).
-   On many targets, it is called directly by init_extra_frame_info, 
-   in part because the information may be needed immediately by 
-   frame_chain.
-*/
+   values may be needed (backtrace, frame_info, frame_register).  On
+   many targets, it is called directly by init_extra_frame_info, in
+   part because the information may be needed immediately by
+   frame_chain.  */
 
 static void
 xstormy16_frame_init_saved_regs (struct frame_info *fi)
@@ -836,17 +835,16 @@ xstormy16_frame_chain (struct frame_info *fi)
 static int
 xstormy16_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
 {
-  return chain < 0x8000 && FRAME_SAVED_PC (thisframe) >= 0x8000 &&
+  return chain < 0x8000 && DEPRECATED_FRAME_SAVED_PC (thisframe) >= 0x8000 &&
     (get_frame_extra_info (thisframe)->frameless_p ||
      get_frame_base (thisframe) - get_frame_extra_info (thisframe)->framesize == chain);
 }
 
-/* Function: xstormy16_saved_pc_after_call
-   Returns the previous PC immediately after a function call.
-   This function is meant to bypass the regular get_saved_register
-   mechanism, ie. it is meant to work even if the frame isn't complete. 
-   Called by step_over_function, and sometimes by get_prev_frame.
-*/
+/* Function: xstormy16_saved_pc_after_call Returns the previous PC
+   immediately after a function call.  This function is meant to
+   bypass the regular frame_register() mechanism, ie. it is meant to
+   work even if the frame isn't complete.  Called by
+   step_over_function, and sometimes by get_prev_frame.  */
 
 static CORE_ADDR
 xstormy16_saved_pc_after_call (struct frame_info *ignore)
@@ -1058,9 +1056,9 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_deprecated_frame_init_saved_regs (gdbarch,
                                     xstormy16_frame_init_saved_regs);
   set_gdbarch_frame_chain (gdbarch, xstormy16_frame_chain);
-  set_gdbarch_get_saved_register (gdbarch, xstormy16_get_saved_register);
+  set_gdbarch_deprecated_get_saved_register (gdbarch, xstormy16_get_saved_register);
   set_gdbarch_saved_pc_after_call (gdbarch, xstormy16_saved_pc_after_call);
-  set_gdbarch_frame_saved_pc (gdbarch, xstormy16_frame_saved_pc);
+  set_gdbarch_deprecated_frame_saved_pc (gdbarch, xstormy16_frame_saved_pc);
   set_gdbarch_skip_prologue (gdbarch, xstormy16_skip_prologue);
   set_gdbarch_frame_chain_valid (gdbarch, xstormy16_frame_chain_valid);
 
@@ -1089,7 +1087,7 @@ xstormy16_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   set_gdbarch_push_return_address (gdbarch, xstormy16_push_return_address);
   set_gdbarch_deprecated_extract_return_value (gdbarch, xstormy16_extract_return_value);
   set_gdbarch_push_arguments (gdbarch, xstormy16_push_arguments);
-  set_gdbarch_pop_frame (gdbarch, xstormy16_pop_frame);
+  set_gdbarch_deprecated_pop_frame (gdbarch, xstormy16_pop_frame);
   set_gdbarch_store_struct_return (gdbarch, xstormy16_store_struct_return);
   set_gdbarch_deprecated_store_return_value (gdbarch, xstormy16_store_return_value);
   set_gdbarch_deprecated_extract_struct_value_address (gdbarch, xstormy16_extract_struct_value_address);
index b3e904f975e4eae7a9436afb9d956bd9f9292f97..a45e537f4e26c0ea77497b7e22422ada92ec1320 100644 (file)
@@ -1,3 +1,23 @@
+2003-12-03  Jan Hubicka  <jh@suse.cz>
+
+       * hashtab.c (htab_expand): Fix warning.
+
+       * hashtab.c (htab_expand): Compute the size of hashtable based
+       on the number of elements actually used.
+       (htab_traverse):  Call htab_expand when table is too empty.
+
+2003-12-03  Jan Hubicka  <jh@suse.cz>
+
+       * hashtab.c (htab_expand): Compute the size of hashtable based
+       on the number of elements actually used.
+       (htab_traverse):  Call htab_expand when table is too empty.
+
+2003-03-11  Carlo Wood  <carlo@gnu.org>
+
+       * cplus-dem.c (demangle_integral_value): Correction to reflect
+       patch of 2002-01-10 in order to also make negative multi-digits
+       without leading underscore work.
+
 2003-03-03  Mark Mitchell  <mark@codesourcery.com>
 
        * cplus-dem.c: Add license exception to copyright notice.
index af35bc1311987b09bc6937c2876d437b662e4f47..59afcd371ba5f4caa5240a1e286235e29d737d1a 100644 (file)
@@ -1797,31 +1797,34 @@ demangle_integral_value (work, mangled, s)
 
       success = 0;
 
-      /* Negative numbers are indicated with a leading `m'.  */
-      if (**mangled == 'm')
-       {
-         string_appendn (s, "-", 1);
-         (*mangled)++;
-       }
-      else if (mangled[0][0] == '_' && mangled[0][1] == 'm')
-       {
-         /* Since consume_count_with_underscores does not handle the
-            `m'-prefix we must do it here, using consume_count and
-            adjusting underscores: we have to consume the underscore
-            matching the prepended one.  */
-         multidigit_without_leading_underscore = 1;
-         string_appendn (s, "-", 1);
-         (*mangled) += 2;
-       }
-      else if (**mangled == '_')
-       {
-         /* Do not consume a following underscore;
-            multidigit_without_leading_underscore will consume what should be
-            consumed.  */
-         leave_following_underscore = 1;
+      if (**mangled == '_')
+        {
+         if (mangled[0][1] == 'm')
+           {
+             /* Since consume_count_with_underscores does not handle the
+                `m'-prefix we must do it here, using consume_count and
+                adjusting underscores: we have to consume the underscore
+                matching the prepended one.  */
+             multidigit_without_leading_underscore = 1;
+             string_appendn (s, "-", 1);
+             (*mangled) += 2;
+           }
+         else
+           {
+             /* Do not consume a following underscore;
+                consume_count_with_underscores will consume what
+                should be consumed.  */
+             leave_following_underscore = 1;
+           }
        }
       else
        {
+         /* Negative numbers are indicated with a leading `m'.  */
+         if (**mangled == 'm')
+         {
+           string_appendn (s, "-", 1);
+           (*mangled)++;
+         }
          /* Since consume_count_with_underscores does not handle
             multi-digit numbers that do not start with an underscore,
             and this number can be an integer template parameter,
@@ -1862,7 +1865,7 @@ demangle_integral_value (work, mangled, s)
          /* All is well.  */
          success = 1;
        }
-    }
+      }
 
   return success;
 }
index 0429936e96146f60486f8c1fc73faaea150b4b94..ebaa43b2c5083072c1cfb7bfb4c4d140885e7afc 100644 (file)
@@ -373,7 +373,14 @@ htab_expand (htab)
   oentries = htab->entries;
   olimit = oentries + htab->size;
 
-  nsize = higher_prime_number (htab->size * 2);
+  /* Resize only when table after removal of unused elements is either
+     too full or too empty.  */
+  if ((htab->n_elements - htab->n_deleted) * 2 > htab->size
+      || ((htab->n_elements - htab->n_deleted) * 8 < htab->size
+         && htab->size > 32))
+    nsize = higher_prime_number ((htab->n_elements - htab->n_deleted) * 2);
+  else
+    nsize = htab->size;
 
   if (htab->alloc_with_arg_f != NULL)
     nentries = (PTR *) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize,
@@ -601,8 +608,14 @@ htab_traverse (htab, callback, info)
      htab_trav callback;
      PTR info;
 {
-  PTR *slot = htab->entries;
-  PTR *limit = slot + htab->size;
+  PTR *slot;
+  PTR *limit;
+
+  if ((htab->n_elements - htab->n_deleted) * 8 < htab->size)
+    htab_expand (htab);
+
+  slot = htab->entries;
+  limit = slot + htab->size;
 
   do
     {
index 42cf2571cf590ee135d0d795afdc6b9721442546..b22d9f61de6a92a17cdbcf5abd41392a846cdf1d 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-14  Daniel Jacobowitz  <drow@mvista.com>
+
+       * ppc-opc.c (powerpc_opcodes): Readd tlbre for PPC403.
+
 2003-02-25  Alan Modra  <amodra@bigpond.net.au>
 
        * hppa-dis.c: Formatting.
index 1b62f87af99ec29fbf6d0c72750003abc46896a1..204c16b371e1888767fefaa7be31eca7cc409374 100644 (file)
@@ -4230,6 +4230,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 
 { "tlbrehi", XTLB(31,946,0), XTLB_MASK,        PPC403,         { RT, RA } },
 { "tlbrelo", XTLB(31,946,1), XTLB_MASK,        PPC403,         { RT, RA } },
+{ "tlbre",   X(31,946),        X_MASK,         PPC403,         { RS, RA, SH } },
 
 { "sraiq",   XRC(31,952,0), X_MASK,    M601,           { RA, RS, SH } },
 { "sraiq.",  XRC(31,952,1), X_MASK,    M601,           { RA, RS, SH } },
index 0e62569d378621e02f5e15d547b3b2c12a6389cf..6526a55c1642a4d9dade70642cc897a98695f84c 100644 (file)
@@ -1,3 +1,12 @@
+2003-03-14  D.Venkatasubramanian <dvenkat@noida.hcltech.com>
+
+       * compile.c (decode): Added code for some more magic traps.
+       * compile.c (sim_resume): Added support for File I/O system
+       calls through callback to host_system.
+       System calls provided support for :
+       open, read, write, lseek, close, stat, fstat
+       Only basic support for stat and fstat.
+
 2003-02-27  Andrew Cagney  <cagney@redhat.com>
 
        * compile.c (sim_open, sim_create_inferior): Rename _bfd to bfd.
index cd60b86beb0fa330555d12198033d2831862b2c9..eb2a03f2f9f1d574733ec2f67ed3300a1ab27e9a 100644 (file)
@@ -35,6 +35,8 @@
 #include "gdb/callback.h"
 #include "gdb/remote-sim.h"
 #include "gdb/sim-h8300.h"
+#include "sys/stat.h"
+#include "sys/types.h"
 
 #ifndef SIGTRAP
 # define SIGTRAP 5
@@ -447,14 +449,36 @@ decode (int addr, unsigned char *data, decoded_inst *dst)
                  dst->opcode = q->how;
                  dst->cycles = q->time;
 
-                 /* And a jsr to 0xc4 is turned into a magic trap.  */
+                 /* And a jsr to these locations are turned into magic
+                    traps.  */
 
                  if (dst->opcode == O (O_JSR, SB))
                    {
-                     if (dst->src.literal == 0xc4)
+                     switch (dst->src.literal)
                        {
-                         dst->opcode = O (O_SYSCALL, SB);
+                       case 0xc5:
+                         dst->opcode = O (O_SYS_OPEN, SB);
+                         break;
+                       case 0xc6:
+                         dst->opcode = O (O_SYS_READ, SB);
+                         break;
+                       case 0xc7:
+                         dst->opcode = O (O_SYS_WRITE, SB);
+                         break;
+                       case 0xc8:
+                         dst->opcode = O (O_SYS_LSEEK, SB);
+                         break;
+                       case 0xc9:
+                         dst->opcode = O (O_SYS_CLOSE, SB);
+                         break;
+                       case 0xca:
+                         dst->opcode = O (O_SYS_STAT, SB);
+                         break;
+                       case 0xcb:
+                         dst->opcode = O (O_SYS_FSTAT, SB);
+                         break;
                        }
+                     /* End of Processing for system calls.  */
                    }
 
                  dst->next_pc = addr + len / 2;
@@ -1386,12 +1410,289 @@ sim_resume (SIM_DESC sd, int step, int siggnal)
            goto condtrue;
          goto next;
 
-       case O (O_SYSCALL, SB):
+         /* System call processing starts.  */
+       case O (O_SYS_OPEN, SB):
          {
-           char c = cpu.regs[2];
-           sim_callback->write_stdout (sim_callback, &c, 1);
+           int len = 0;        /* Length of filename.  */
+           char *filename;     /* Filename would go here.  */
+           char temp_char;     /* Temporary character */
+           int mode = 0;       /* Mode bits for the file.  */
+           int open_return;    /* Return value of open, file descriptor.  */
+           int i;              /* Loop counter */
+           int filename_ptr;   /* Pointer to filename in cpu memory.  */
+
+           /* Setting filename_ptr to first argument of open.  */
+           filename_ptr = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
+
+           /* Trying to get mode.  */
+           if (h8300hmode || h8300smode)
+             {
+               mode = GET_MEMORY_L (cpu.regs[7] + 4);
+             }
+           else
+             {
+               mode = GET_MEMORY_W (cpu.regs[7] + 2);
+             }
+
+           /* Trying to find the length of the filename.  */
+           temp_char = GET_MEMORY_B (cpu.regs[0]);
+
+           len = 1;
+           while (temp_char != '\0')
+             {
+               temp_char = GET_MEMORY_B (filename_ptr + len);
+               len++;
+             }
+
+           /* Allocating space for the filename.  */
+           filename = (char *) malloc (sizeof (char) * len);
+
+           /* String copying the filename from memory.  */
+           for (i = 0; i < len; i++)
+             {
+               temp_char = GET_MEMORY_B (filename_ptr + i);
+               filename[i] = temp_char;
+             }
+
+           /* Callback to open and return the file descriptor.  */
+           open_return = sim_callback->open (sim_callback, filename, mode);
+
+           /* Return value in register 0.  */
+           cpu.regs[0] = open_return;
+
+           /* Freeing memory used for filename. */
+           free (filename);
+         }
+         goto next;
+
+       case O (O_SYS_READ, SB):
+         {
+           char *char_ptr;     /* Where characters read would be stored.  */
+           int fd;             /* File descriptor */
+           int buf_size;       /* BUF_SIZE parameter in read.  */
+           int i = 0;          /* Temporary Loop counter */
+           int read_return = 0;        /* Return value from callback to
+                                          read.  */
+
+           fd = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
+           buf_size = h8300hmode ? GET_L_REG (2) : GET_W_REG (2);
+
+           char_ptr = (char *) malloc (sizeof (char) * buf_size);
+
+           /* Callback to read and return the no. of characters read.  */
+           read_return =
+             sim_callback->read (sim_callback, fd, char_ptr, buf_size);
+
+           /* The characters read are stored in cpu memory.  */
+           for (i = 0; i < buf_size; i++)
+             {
+               SET_MEMORY_B ((cpu.regs[1] + (sizeof (char) * i)),
+                             *(char_ptr + (sizeof (char) * i)));
+             }
+
+           /* Return value in Register 0.  */
+           cpu.regs[0] = read_return;
+
+           /* Freeing memory used as buffer.  */
+           free (char_ptr);
+         }
+         goto next;
+
+       case O (O_SYS_WRITE, SB):
+         {
+           int fd;             /* File descriptor */
+           char temp_char;     /* Temporary character */
+           int len;            /* Length of write, Parameter II to write.  */
+           int char_ptr;       /* Character Pointer, Parameter I of write.  */
+           char *ptr;          /* Where characters to be written are stored. 
+                                */
+           int write_return;   /* Return value from callback to write.  */
+           int i = 0;          /* Loop counter */
+
+           fd = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
+           char_ptr = h8300hmode ? GET_L_REG (1) : GET_W_REG (1);
+           len = h8300hmode ? GET_L_REG (2) : GET_W_REG (2);
+
+           /* Allocating space for the characters to be written.  */
+           ptr = (char *) malloc (sizeof (char) * len);
+
+           /* Fetching the characters from cpu memory.  */
+           for (i = 0; i < len; i++)
+             {
+               temp_char = GET_MEMORY_B (char_ptr + i);
+               ptr[i] = temp_char;
+             }
+
+           /* Callback write and return the no. of characters written.  */
+           write_return = sim_callback->write (sim_callback, fd, ptr, len);
+
+           /* Return value in Register 0.  */
+           cpu.regs[0] = write_return;
+
+           /* Freeing memory used as buffer.  */
+           free (ptr);
+         }
+         goto next;
+
+       case O (O_SYS_LSEEK, SB):
+         {
+           int fd;             /* File descriptor */
+           int offset;         /* Offset */
+           int origin;         /* Origin */
+           int lseek_return;   /* Return value from callback to lseek.  */
+
+           fd = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
+           offset = h8300hmode ? GET_L_REG (1) : GET_W_REG (1);
+           origin = h8300hmode ? GET_L_REG (2) : GET_W_REG (2);
+
+           /* Callback lseek and return offset.  */
+           lseek_return =
+             sim_callback->lseek (sim_callback, fd, offset, origin);
+
+           /* Return value in register 0.  */
+           cpu.regs[0] = lseek_return;
+         }
+         goto next;
+
+       case O (O_SYS_CLOSE, SB):
+         {
+           int fd;             /* File descriptor */
+           int close_return;   /* Return value from callback to close.  */
+
+           fd = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
+
+           /* Callback close and return.  */
+           close_return = sim_callback->close (sim_callback, fd);
+
+           /* Return value in register 0.  */
+           cpu.regs[0] = close_return;
+         }
+         goto next;
+
+       case O (O_SYS_FSTAT, SB):
+         {
+           int fd;             /* File descriptor */
+           struct stat stat_rec;       /* Stat record */
+           int fstat_return;   /* Return value from callback to stat.  */
+           int stat_ptr;       /* Pointer to stat record.  */
+           char *temp_stat_ptr;        /* Temporary stat_rec pointer.  */
+
+           fd = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
+
+           /* Setting stat_ptr to second argument of stat.  */
+           stat_ptr = h8300hmode ? GET_L_REG (1) : GET_W_REG (1);
+
+           /* Callback stat and return.  */
+           fstat_return = sim_callback->fstat (sim_callback, fd, &stat_rec);
+
+           /* Have stat_ptr point to starting of stat_rec.  */
+           temp_stat_ptr = (char *) (&stat_rec);
+
+           /* Setting up the stat structure returned.  */
+           SET_MEMORY_W (stat_ptr, stat_rec.st_dev);
+           stat_ptr += 2;
+           SET_MEMORY_W (stat_ptr, stat_rec.st_ino);
+           stat_ptr += 2;
+           SET_MEMORY_L (stat_ptr, stat_rec.st_mode);
+           stat_ptr += 4;
+           SET_MEMORY_W (stat_ptr, stat_rec.st_nlink);
+           stat_ptr += 2;
+           SET_MEMORY_W (stat_ptr, stat_rec.st_uid);
+           stat_ptr += 2;
+           SET_MEMORY_W (stat_ptr, stat_rec.st_gid);
+           stat_ptr += 2;
+           SET_MEMORY_W (stat_ptr, stat_rec.st_rdev);
+           stat_ptr += 2;
+           SET_MEMORY_L (stat_ptr, stat_rec.st_size);
+           stat_ptr += 4;
+           SET_MEMORY_L (stat_ptr, stat_rec.st_atime);
+           stat_ptr += 8;
+           SET_MEMORY_L (stat_ptr, stat_rec.st_mtime);
+           stat_ptr += 8;
+           SET_MEMORY_L (stat_ptr, stat_rec.st_ctime);
+
+           /* Return value in register 0.  */
+           cpu.regs[0] = fstat_return;
+         }
+         goto next;
+
+       case O (O_SYS_STAT, SB):
+         {
+           int len = 0;        /* Length of filename.  */
+           char *filename;     /* Filename would go here.  */
+           char temp_char;     /* Temporary character */
+           int filename_ptr;   /* Pointer to filename in cpu memory.  */
+           struct stat stat_rec;       /* Stat record */
+           int stat_return;    /* Return value from callback to stat */
+           int stat_ptr;       /* Pointer to stat record.  */
+           char *temp_stat_ptr;        /* Temporary stat_rec pointer.  */
+           int i = 0;          /* Loop Counter */
+
+           /* Setting filename_ptr to first argument of open.  */
+           filename_ptr = h8300hmode ? GET_L_REG (0) : GET_W_REG (0);
+
+           /* Trying to find the length of the filename.  */
+           temp_char = GET_MEMORY_B (cpu.regs[0]);
+
+           len = 1;
+           while (temp_char != '\0')
+             {
+               temp_char = GET_MEMORY_B (filename_ptr + len);
+               len++;
+             }
+
+           /* Allocating space for the filename.  */
+           filename = (char *) malloc (sizeof (char) * len);
+
+           /* String copying the filename from memory.  */
+           for (i = 0; i < len; i++)
+             {
+               temp_char = GET_MEMORY_B (filename_ptr + i);
+               filename[i] = temp_char;
+             }
+
+           /* Setting stat_ptr to second argument of stat.  */
+           /* stat_ptr = cpu.regs[1]; */
+           stat_ptr = h8300hmode ? GET_L_REG (1) : GET_W_REG (1);
+
+           /* Callback stat and return.  */
+           stat_return =
+             sim_callback->stat (sim_callback, filename, &stat_rec);
+
+           /* Have stat_ptr point to starting of stat_rec.  */
+           temp_stat_ptr = (char *) (&stat_rec);
+
+           /* Freeing memory used for filename.  */
+           free (filename);
+
+           /* Setting up the stat structure returned.  */
+           SET_MEMORY_W (stat_ptr, stat_rec.st_dev);
+           stat_ptr += 2;
+           SET_MEMORY_W (stat_ptr, stat_rec.st_ino);
+           stat_ptr += 2;
+           SET_MEMORY_L (stat_ptr, stat_rec.st_mode);
+           stat_ptr += 4;
+           SET_MEMORY_W (stat_ptr, stat_rec.st_nlink);
+           stat_ptr += 2;
+           SET_MEMORY_W (stat_ptr, stat_rec.st_uid);
+           stat_ptr += 2;
+           SET_MEMORY_W (stat_ptr, stat_rec.st_gid);
+           stat_ptr += 2;
+           SET_MEMORY_W (stat_ptr, stat_rec.st_rdev);
+           stat_ptr += 2;
+           SET_MEMORY_L (stat_ptr, stat_rec.st_size);
+           stat_ptr += 4;
+           SET_MEMORY_L (stat_ptr, stat_rec.st_atime);
+           stat_ptr += 8;
+           SET_MEMORY_L (stat_ptr, stat_rec.st_mtime);
+           stat_ptr += 8;
+           SET_MEMORY_L (stat_ptr, stat_rec.st_ctime);
+
+           /* Return value in register 0.  */
+           cpu.regs[0] = stat_return;
          }
          goto next;
+         /* End of system call processing.  */
 
          ONOT (O_NOT, rd = ~rd; v = 0;);
          OSHIFTS (O_SHLL,