ChangeLog:
authorUlrich Weigand <uweigand@de.ibm.com>
Thu, 28 Feb 2008 05:54:10 +0000 (05:54 +0000)
committerUlrich Weigand <uweigand@de.ibm.com>
Thu, 28 Feb 2008 05:54:10 +0000 (05:54 +0000)
* features/Makefile (%.dat): Emit xmltarget statement.

* regformats/regdat.sh: Support xmltarget and xmlarch statments.
Generate code to set gdbserver_xmltarget in init_registers_${name}.

* regformats/arm-with-iwmmxt.dat: Regenerate.
* regformats/mips64-linux.dat: Regenerate.
* regformats/mips-linux.dat: Regenerate.
* regformats/rs6000/powerpc-32.dat: Regenerate.
* regformats/rs6000/powerpc-64.dat: Regenerate.
* regformats/rs6000/powerpc-e500.dat: Regenerate.

* regformats/reg-arm.dat: Add xmlarch statement.
* regformats/reg-i386.dat: Likewise.
* regformats/reg-i386-linux.dat: Likewise.
* regformats/reg-x86-64-linux.dat: Likewise.
* regformats/reg-spu.dat: Likewise.

gdbserver/ChangeLog:

* regcache.h (gdbserver_xmltarget): Add extern declaration.
* server.c (gdbserver_xmltarget): Define.
(get_features_xml): Use it to replace "target.xml" and arch_string.

* configure.srv: Remove srv_xmltarget.  Add XML files that were
mentioned there to srv_xmlfiles instead.  Remove conditional tests
on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
srv_xmlfiles and srv_regobj to include all possible choices.
* configure.ac (srv_xmltarget): Remove.
(srv_xmlfiles): Do not add "target.xml".
(gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
checks for supplementary target information.
* configure: Regenerate.
* Makefile.in (XML_TARGET): Remove.
(target.xml): Remove rule.
(clean): Do not clean up target.xml.
(.PRECIOUS): Do not mention target.xml.

* target.h (struct target_ops): Remove arch_string member.
* linux-low.c (linux_arch_string): Remove.
(linux_target_ops): Remove arch_string initializer.
* linux-low.h (struct linux_target_ops): Remove arch_string member.
* linux-i386-low.c (the_low_target): Remove arch_string initializer.
* linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
* spu-low.c (spu_arch_string): Remove.
(spu_target_ops): Remove arch_string initializer.
* win32-low.c (win32_arch_string): Remove.
(win32_target_ops): Remove arch_string initializer.
* win32-low.h (struct win32_target_ops): Remove arch_string member.
* win32-arm-low.c (the_low_target): Remove arch_string initializer.
* win32-i368-low.c (the_low_target): Remove arch_string initializer.

31 files changed:
gdb/ChangeLog
gdb/features/Makefile
gdb/gdbserver/ChangeLog
gdb/gdbserver/Makefile.in
gdb/gdbserver/configure
gdb/gdbserver/configure.ac
gdb/gdbserver/configure.srv
gdb/gdbserver/linux-i386-low.c
gdb/gdbserver/linux-low.c
gdb/gdbserver/linux-low.h
gdb/gdbserver/linux-x86-64-low.c
gdb/gdbserver/regcache.h
gdb/gdbserver/server.c
gdb/gdbserver/spu-low.c
gdb/gdbserver/target.h
gdb/gdbserver/win32-arm-low.c
gdb/gdbserver/win32-i386-low.c
gdb/gdbserver/win32-low.c
gdb/gdbserver/win32-low.h
gdb/regformats/arm-with-iwmmxt.dat
gdb/regformats/mips-linux.dat
gdb/regformats/mips64-linux.dat
gdb/regformats/reg-arm.dat
gdb/regformats/reg-i386-linux.dat
gdb/regformats/reg-i386.dat
gdb/regformats/reg-spu.dat
gdb/regformats/reg-x86-64-linux.dat
gdb/regformats/regdat.sh
gdb/regformats/rs6000/powerpc-32.dat
gdb/regformats/rs6000/powerpc-64.dat
gdb/regformats/rs6000/powerpc-e500.dat

index f5afe11b74cc2fc7a1c2bb07a1431c1e989b8c42..63ca32550c9ce217f3edacb099f059d4498cc7ac 100644 (file)
@@ -1,3 +1,23 @@
+2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * features/Makefile (%.dat): Emit xmltarget statement.
+
+       * regformats/regdat.sh: Support xmltarget and xmlarch statments.
+       Generate code to set gdbserver_xmltarget in init_registers_${name}.
+
+       * regformats/arm-with-iwmmxt.dat: Regenerate.
+       * regformats/mips64-linux.dat: Regenerate.
+       * regformats/mips-linux.dat: Regenerate.
+       * regformats/rs6000/powerpc-32.dat: Regenerate.
+       * regformats/rs6000/powerpc-64.dat: Regenerate.
+       * regformats/rs6000/powerpc-e500.dat: Regenerate.
+
+       * regformats/reg-arm.dat: Add xmlarch statement.
+       * regformats/reg-i386.dat: Likewise.
+       * regformats/reg-i386-linux.dat: Likewise.
+       * regformats/reg-x86-64-linux.dat: Likewise.
+       * regformats/reg-spu.dat: Likewise.
+
 2008-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * remote.c (remote_wait, remote_async_wait): Stop if we receive
index e795dfe185a62510a65f674fb17de4f36cf8627f..0b7dd9c01a8b519c186389930a1e9b20bce35b2a 100644 (file)
@@ -55,6 +55,7 @@ all: $(OUTPUTS)
 $(outdir)/%.dat: %.xml number-regs.xsl sort-regs.xsl gdbserver-regs.xsl
        echo "# DO NOT EDIT: generated from $<" > $(outdir)/$*.tmp
        echo "name:`echo $(notdir $*) | sed 's/-/_/g'`" >> $(outdir)/$*.tmp
+       echo "xmltarget:$<" >> $(outdir)/$*.tmp
        echo "expedite:$($*-expedite)" >> $(outdir)/$*.tmp
        $(XSLTPROC) --path "$(PWD)" --xinclude number-regs.xsl $< | \
          $(XSLTPROC) sort-regs.xsl - | \
index d8e5c7ff2ae4546c0f4884b1959c577de6582f87..9e732f8d9aaacac59ad881ba619f5ac41f39076c 100644 (file)
@@ -1,3 +1,37 @@
+2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * regcache.h (gdbserver_xmltarget): Add extern declaration.
+       * server.c (gdbserver_xmltarget): Define.
+       (get_features_xml): Use it to replace "target.xml" and arch_string.
+
+       * configure.srv: Remove srv_xmltarget.  Add XML files that were
+       mentioned there to srv_xmlfiles instead.  Remove conditional tests
+       on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
+       srv_xmlfiles and srv_regobj to include all possible choices.
+       * configure.ac (srv_xmltarget): Remove.
+       (srv_xmlfiles): Do not add "target.xml".
+       (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
+       checks for supplementary target information.
+       * configure: Regenerate.
+       * Makefile.in (XML_TARGET): Remove.
+       (target.xml): Remove rule.
+       (clean): Do not clean up target.xml.
+       (.PRECIOUS): Do not mention target.xml.
+
+       * target.h (struct target_ops): Remove arch_string member.
+       * linux-low.c (linux_arch_string): Remove.
+       (linux_target_ops): Remove arch_string initializer.
+       * linux-low.h (struct linux_target_ops): Remove arch_string member.
+       * linux-i386-low.c (the_low_target): Remove arch_string initializer.
+       * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
+       * spu-low.c (spu_arch_string): Remove.
+       (spu_target_ops): Remove arch_string initializer.
+       * win32-low.c (win32_arch_string): Remove.
+       (win32_target_ops): Remove arch_string initializer.
+       * win32-low.h (struct win32_target_ops): Remove arch_string member.
+       * win32-arm-low.c (the_low_target): Remove arch_string initializer.
+       * win32-i368-low.c (the_low_target): Remove arch_string initializer.
+
 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
index 2c7cb75920a9351350283676e7d405f52127897a..daf73d6392b9252a128eb451b5fd58a4d1f94199 100644 (file)
@@ -149,7 +149,6 @@ XM_CLIBS = @LIBS@
 
 # XML files to compile in to gdbserver, if any.
 XML_DIR = $(srcdir)/../features
-XML_TARGET = @srv_xmltarget@
 XML_FILES = @srv_xmlfiles@
 XML_BUILTIN = @srv_xmlbuiltin@
 
@@ -222,7 +221,7 @@ clean:
        rm -f reg-cris.c reg-crisv32.c reg-x86-64-linux.c reg-xtensa.c
        rm -f arm-with-iwmmxt.c mips-linux.c mips64-linux.c
        rm -f powerpc-32.c powerpc-64.c powerpc-e500.c
-       rm -f xml-builtin.c stamp-xml target.xml
+       rm -f xml-builtin.c stamp-xml
 
 maintainer-clean realclean distclean: clean
        rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log
@@ -248,10 +247,6 @@ version.c: Makefile $(srcdir)/../version.in
        mv version.c-tmp version.c
 version.o: version.c $(server_h)
 
-target.xml: $(XML_TARGET)
-       rm -f target.xml
-       cp $(XML_TARGET) target.xml
-
 xml-builtin.c: stamp-xml; @true
 stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
        rm -f xml-builtin.tmp
@@ -259,7 +254,7 @@ stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
        $(SHELL) $(srcdir)/../../move-if-change xml-builtin.tmp xml-builtin.c
        echo stamp > stamp-xml
 
-.PRECIOUS: target.xml xml-builtin.c
+.PRECIOUS: xml-builtin.c
 
 # GNU Make has an annoying habit of putting *all* the Makefile variables
 # into the environment, unless you include this target as a circumvention.
index 5dad21c15f82f2de2ac937e5cba7a41ebc0e186b..58a0885c9bf839e3d4bdc688cf10a340991c3796 100755 (executable)
@@ -309,7 +309,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP RDYNAMIC GDBSERVER_DEPFILES GDBSERVER_LIBS USE_THREAD_DB srv_xmlbuiltin srv_xmlfiles srv_xmltarget LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CPP EGREP RDYNAMIC GDBSERVER_DEPFILES GDBSERVER_LIBS USE_THREAD_DB srv_xmlbuiltin srv_xmlfiles LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -3533,108 +3533,6 @@ _ACEOF
 fi
 
 
-# Check for various supplementary target information (beyond the
-# triplet) which might affect the choices in configure.srv.
-case "${target}" in
-  arm*-*-linux*)
-    echo "$as_me:$LINENO: checking if iWMMXt is selected" >&5
-echo $ECHO_N "checking if iWMMXt is selected... $ECHO_C" >&6
-if test "${gdb_cv_arm_iwmmxt+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  save_CPPFLAGS="$CPPFLAGS"
-                  CPPFLAGS="$CPPFLAGS $CFLAGS"
-                  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#ifdef __IWMMXT__
-got it
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "got it" >/dev/null 2>&1; then
-  gdb_cv_arm_iwmmxt=yes
-else
-  gdb_cv_arm_iwmmxt=no
-fi
-rm -f conftest*
-
-                  CPPFLAGS="$save_CPPFLAGS"
-fi
-echo "$as_me:$LINENO: result: $gdb_cv_arm_iwmmxt" >&5
-echo "${ECHO_T}$gdb_cv_arm_iwmmxt" >&6
-    ;;
-  powerpc*-*-*)
-    echo "$as_me:$LINENO: checking if Altivec is selected" >&5
-echo $ECHO_N "checking if Altivec is selected... $ECHO_C" >&6
-if test "${gdb_cv_ppc_altivec+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  save_CPPFLAGS="$CPPFLAGS"
-                    CPPFLAGS="$CPPFLAGS $CFLAGS"
-                    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#ifdef __ALTIVEC__
-got it
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "got it" >/dev/null 2>&1; then
-  gdb_cv_ppc_altivec=yes
-else
-  gdb_cv_ppc_altivec=no
-fi
-rm -f conftest*
-
-                    CPPFLAGS="$save_CPPFLAGS"
-fi
-echo "$as_me:$LINENO: result: $gdb_cv_ppc_altivec" >&5
-echo "${ECHO_T}$gdb_cv_ppc_altivec" >&6
-    echo "$as_me:$LINENO: checking if SPE is selected" >&5
-echo $ECHO_N "checking if SPE is selected... $ECHO_C" >&6
-if test "${gdb_cv_ppc_spe+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  save_CPPFLAGS="$CPPFLAGS"
-                    CPPFLAGS="$CPPFLAGS $CFLAGS"
-                    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#ifdef __SPE__
-got it
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "got it" >/dev/null 2>&1; then
-  gdb_cv_ppc_spe=yes
-else
-  gdb_cv_ppc_spe=no
-fi
-rm -f conftest*
-
-                    CPPFLAGS="$save_CPPFLAGS"
-fi
-echo "$as_me:$LINENO: result: $gdb_cv_ppc_spe" >&5
-echo "${ECHO_T}$gdb_cv_ppc_spe" >&6
-    ;;
-esac
-
 . ${srcdir}/configure.srv
 
 if test "${srv_mingwce}" = "yes"; then
@@ -4387,8 +4285,7 @@ _ACEOF
   fi
 fi
 
-if test "$srv_xmltarget" != ""; then
-  srv_xmltarget="\$(XML_DIR)/$srv_xmltarget"
+if test "$srv_xmlfiles" != ""; then
   srv_xmlbuiltin="xml-builtin.o"
 
 cat >>confdefs.h <<\_ACEOF
@@ -4397,7 +4294,7 @@ _ACEOF
 
 
   tmp_xmlfiles=$srv_xmlfiles
-  srv_xmlfiles="target.xml"
+  srv_xmlfiles=""
   for f in $tmp_xmlfiles; do
     srv_xmlfiles="$srv_xmlfiles \$(XML_DIR)/$f"
   done
@@ -4412,7 +4309,6 @@ GDBSERVER_LIBS="$srv_libs"
 
 
 
-
           ac_config_files="$ac_config_files Makefile"
           ac_config_commands="$ac_config_commands default"
 cat >confcache <<\_ACEOF
@@ -5061,7 +4957,6 @@ s,@GDBSERVER_LIBS@,$GDBSERVER_LIBS,;t t
 s,@USE_THREAD_DB@,$USE_THREAD_DB,;t t
 s,@srv_xmlbuiltin@,$srv_xmlbuiltin,;t t
 s,@srv_xmlfiles@,$srv_xmlfiles,;t t
-s,@srv_xmltarget@,$srv_xmltarget,;t t
 s,@LIBOBJS@,$LIBOBJS,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 CEOF
index 979c92530edaec30b9c5512b54ed2af8fd6c1c05..33131add3bd7278fa727ce6568b8d6d9eb0907c6 100644 (file)
@@ -66,45 +66,6 @@ AC_CHECK_TYPES(socklen_t, [], [],
 #include <sys/socket.h>
 ])
 
-# Check for various supplementary target information (beyond the
-# triplet) which might affect the choices in configure.srv.
-case "${target}" in
-  arm*-*-linux*)
-    AC_CACHE_CHECK([if iWMMXt is selected], [gdb_cv_arm_iwmmxt],
-                  [save_CPPFLAGS="$CPPFLAGS"
-                  CPPFLAGS="$CPPFLAGS $CFLAGS"
-                  AC_EGREP_CPP([got it], [
-#ifdef __IWMMXT__
-got it
-#endif
-                               ], [gdb_cv_arm_iwmmxt=yes],
-                               [gdb_cv_arm_iwmmxt=no])
-                  CPPFLAGS="$save_CPPFLAGS"])
-    ;;
-  powerpc*-*-*)
-    AC_CACHE_CHECK([if Altivec is selected], [gdb_cv_ppc_altivec],
-                  [save_CPPFLAGS="$CPPFLAGS"
-                    CPPFLAGS="$CPPFLAGS $CFLAGS"
-                    AC_EGREP_CPP([got it], [
-#ifdef __ALTIVEC__
-got it
-#endif
-                 ], [gdb_cv_ppc_altivec=yes],
-                    [gdb_cv_ppc_altivec=no])
-                    CPPFLAGS="$save_CPPFLAGS"])
-    AC_CACHE_CHECK([if SPE is selected], [gdb_cv_ppc_spe],
-                  [save_CPPFLAGS="$CPPFLAGS"
-                    CPPFLAGS="$CPPFLAGS $CFLAGS"
-                    AC_EGREP_CPP([got it], [
-#ifdef __SPE__
-got it
-#endif
-                 ], [gdb_cv_ppc_spe=yes],
-                    [gdb_cv_ppc_spe=no])
-                    CPPFLAGS="$save_CPPFLAGS"])
-    ;;
-esac
-
 . ${srcdir}/configure.srv
 
 if test "${srv_mingwce}" = "yes"; then
@@ -202,13 +163,12 @@ if test "$srv_linux_thread_db" = "yes"; then
   fi
 fi
 
-if test "$srv_xmltarget" != ""; then
-  srv_xmltarget="\$(XML_DIR)/$srv_xmltarget"
+if test "$srv_xmlfiles" != ""; then
   srv_xmlbuiltin="xml-builtin.o"
   AC_DEFINE(USE_XML, 1, [Define if an XML target description is available.])
 
   tmp_xmlfiles=$srv_xmlfiles
-  srv_xmlfiles="target.xml"
+  srv_xmlfiles=""
   for f in $tmp_xmlfiles; do
     srv_xmlfiles="$srv_xmlfiles \$(XML_DIR)/$f"
   done
@@ -222,7 +182,6 @@ AC_SUBST(GDBSERVER_LIBS)
 AC_SUBST(USE_THREAD_DB)
 AC_SUBST(srv_xmlbuiltin)
 AC_SUBST(srv_xmlfiles)
-AC_SUBST(srv_xmltarget)
 
 AC_OUTPUT(Makefile,
 [case x$CONFIG_HEADERS in
index b529c027b133ce460254d6aca1eb0708ccaf24f7..9f9bbbffae2a5b2d47aa2d1ab0ae66c62c729aa7 100644 (file)
@@ -8,8 +8,7 @@
 #                      for this target.
 #   srv_hostio_err     The object implementing the hostio_last_error
 #                      target method.
-#   srv_xmltarget      The XML source file to use for target.xml, if any.
-#   srv_xmlfiles       Any other XML files which should be available for
+#   srv_xmlfiles       All XML files which should be available for
 #                      gdbserver in this configuration.
 #
 # In addition, on GNU/Linux the following shell variables will be set:
@@ -26,17 +25,14 @@ srv_hostio_err_objs="hostio-errno.o"
 # Input is taken from the "${target}" variable.
 
 case "${target}" in
-  arm*-*-linux*)       srv_tgtobj="linux-low.o linux-arm-low.o"
+  arm*-*-linux*)       srv_regobj="reg-arm.o arm-with-iwmmxt.o"
+                       srv_tgtobj="linux-low.o linux-arm-low.o"
+                       srv_xmlfiles="arm-with-iwmmxt.xml"
+                       srv_xmlfiles="${srv_xmlfiles} arm-core.xml"
+                       srv_xmlfiles="${srv_xmlfiles} xscale-iwmmxt.xml"
                        srv_linux_usrregs=yes
                        srv_linux_regsets=yes
                        srv_linux_thread_db=yes
-                       if test $gdb_cv_arm_iwmmxt = yes; then
-                         srv_regobj=arm-with-iwmmxt.o
-                         srv_xmltarget=arm-with-iwmmxt.xml
-                         srv_xmlfiles="arm-core.xml xscale-iwmmxt.xml"
-                       else
-                         srv_regobj=reg-arm.o
-                       fi
                        ;;
   arm*-*-mingw32ce*)   srv_regobj=reg-arm.o
                        srv_tgtobj="win32-low.o win32-arm-low.o"
@@ -91,53 +87,46 @@ case "${target}" in
                        srv_linux_thread_db=yes
                        ;;
   mips*64*-*-linux*)   srv_regobj=mips64-linux.o
-                       srv_xmltarget=mips64-linux.xml
-                       srv_xmlfiles="mips64-cpu.xml mips64-cp0.xml mips64-fpu.xml"
                        srv_tgtobj="linux-low.o linux-mips-low.o"
+                       srv_xmlfiles="mips64-linux.xml"
+                       srv_xmlfiles="${srv_xmlfiles} mips64-cpu.xml"
+                       srv_xmlfiles="${srv_xmlfiles} mips64-cp0.xml"
+                       srv_xmlfiles="${srv_xmlfiles} mips64-fpu.xml"
                        srv_linux_regsets=yes
                        srv_linux_usrregs=yes
                        srv_linux_thread_db=yes
                        ;;
   mips*-*-linux*)      srv_regobj=mips-linux.o
-                       srv_xmltarget=mips-linux.xml
-                       srv_xmlfiles="mips-cpu.xml mips-cp0.xml mips-fpu.xml"
                        srv_tgtobj="linux-low.o linux-mips-low.o"
+                       srv_xmlfiles="mips-linux.xml"
+                       srv_xmlfiles="${srv_xmlfiles} mips-cpu.xml"
+                       srv_xmlfiles="${srv_xmlfiles} mips-cp0.xml"
+                       srv_xmlfiles="${srv_xmlfiles} mips-fpu.xml"
                        srv_linux_regsets=yes
                        srv_linux_usrregs=yes
                        srv_linux_thread_db=yes
                        ;;
-  powerpc64-*-linux*)  srv_tgtobj="linux-low.o linux-ppc64-low.o"
+  powerpc64-*-linux*)  srv_regobj="reg-ppc64.o powerpc-64.o"
+                       srv_tgtobj="linux-low.o linux-ppc64-low.o"
+                       srv_xmlfiles="rs6000/powerpc-64.xml"
+                       srv_xmlfiles="${srv_xmlfiles} rs6000/power-altivec.xml"
+                       srv_xmlfiles="${srv_xmlfiles} rs6000/power64-core.xml"
+                       srv_xmlfiles="${srv_xmlfiles} rs6000/power-fpu.xml"
                        srv_linux_usrregs=yes
                        srv_linux_regsets=yes
                        srv_linux_thread_db=yes
-                       if test $gdb_cv_ppc_altivec = yes; then
-                         srv_regobj=powerpc-64.o
-                         srv_xmltarget=rs6000/powerpc-64.xml
-                         srv_xmlfiles="rs6000/power-altivec.xml"
-                         srv_xmlfiles="$srv_xmlfiles rs6000/power64-core.xml"
-                         srv_xmlfiles="$srv_xmlfiles rs6000/power-fpu.xml"
-                       else
-                         srv_regobj=reg-ppc64.o
-                       fi
-                       ;;
-  powerpc-*-linux*)    srv_tgtobj="linux-low.o linux-ppc-low.o"
+                       ;;
+  powerpc-*-linux*)    srv_regobj="reg-ppc.o powerpc-32.o powerpc-e500.o"
+                       srv_tgtobj="linux-low.o linux-ppc-low.o"
+                       srv_xmlfiles="rs6000/powerpc-32.xml"
+                       srv_xmlfiles="${srv_xmlfiles} rs6000/power-altivec.xml"
+                       srv_xmlfiles="${srv_xmlfiles} rs6000/power-core.xml"
+                       srv_xmlfiles="${srv_xmlfiles} rs6000/power-fpu.xml"
+                       srv_xmlfiles="${srv_xmlfiles} rs6000/powerpc-e500.xml"
+                       srv_xmlfiles="${srv_xmlfiles} rs6000/power-spe.xml"
                        srv_linux_usrregs=yes
                        srv_linux_regsets=yes
                        srv_linux_thread_db=yes
-                       if test $gdb_cv_ppc_altivec = yes; then
-                         srv_regobj=powerpc-32.o
-                         srv_xmltarget=rs6000/powerpc-32.xml
-                         srv_xmlfiles="rs6000/power-altivec.xml"
-                         srv_xmlfiles="$srv_xmlfiles rs6000/power-core.xml"
-                         srv_xmlfiles="$srv_xmlfiles rs6000/power-fpu.xml"
-                       elif test $gdb_cv_ppc_spe = yes; then
-                         srv_regobj=powerpc-e500.o
-                         srv_xmltarget=rs6000/powerpc-e500.xml
-                         srv_xmlfiles="rs6000/power-spe.xml"
-                         srv_xmlfiles="$srv_xmlfiles rs6000/power-core.xml"
-                       else
-                         srv_regobj=reg-ppc.o
-                       fi
                        ;;
   s390-*-linux*)       srv_regobj=reg-s390.o
                        srv_tgtobj="linux-low.o linux-s390-low.o"
index c3cccb663abdd6db658173b11a51a59b58ce3fd8..46138ec013502905bc6bfb1cf54fa7845647c90b 100644 (file)
@@ -207,5 +207,4 @@ struct linux_target_ops the_low_target = {
   NULL,
   NULL,
   NULL,
-  "i386"
 };
index 1d2b422377be05b7527217b9ba2e585efc79f3d2..da638f56751d80d3d71185394d5e6e10ff1b37a0 100644 (file)
@@ -2033,12 +2033,6 @@ linux_read_offsets (CORE_ADDR *text_p, CORE_ADDR *data_p)
 }
 #endif
 
-static const char *
-linux_arch_string (void)
-{
-  return the_low_target.arch_string;
-}
-
 static struct target_ops linux_target_ops = {
   linux_create_inferior,
   linux_attach,
@@ -2069,7 +2063,6 @@ static struct target_ops linux_target_ops = {
 #else
   NULL,
 #endif
-  linux_arch_string,
   NULL,
   hostio_last_error_from_errno,
 };
index ccbeb254f7c8732304ba0f4fb53b36a5ab54feab..78734e76b6973aac3fa0440f8da53d4bc61854a0 100644 (file)
@@ -73,10 +73,6 @@ struct linux_target_ops
      for registers smaller than an xfer unit).  */
   void (*collect_ptrace_register) (int regno, char *buf);
   void (*supply_ptrace_register) (int regno, const char *buf);
-
-  /* What string to report to GDB when it asks for the architecture,
-     or NULL not to answer.  */
-  const char *arch_string;
 };
 
 extern struct linux_target_ops the_low_target;
index b4a2f6be594ddadf3879c73c23dc063df48d5a7e..7f15ac0d13e01896f0890337d817d26012da9e85 100644 (file)
@@ -181,5 +181,4 @@ struct linux_target_ops the_low_target = {
   NULL,
   NULL,
   NULL,
-  "i386:x86-64",
 };
index c9c54bd726adef2755234111c296e351c25c5990..641f928f98cf14859d1d83a999912d676a768f9b 100644 (file)
@@ -55,7 +55,10 @@ int register_size (int n);
 
 int find_regno (const char *name);
 
+/* The following two variables are set by auto-generated
+   code in the init_registers_... routines.  */
 extern const char **gdbserver_expedite_regs;
+extern const char *gdbserver_xmltarget;
 
 void supply_register (int n, const void *buf);
 
index 31f8a6cd155c3d50c4d587c86767b0e0e895fd34..7806bd6bf8b06eeb182511a8680709384387fc72 100644 (file)
@@ -51,6 +51,8 @@ int pass_signals[TARGET_SIGNAL_LAST];
 
 jmp_buf toplevel;
 
+const char *gdbserver_xmltarget;
+
 /* The PID of the originally created or attached inferior.  Used to
    send signals to the process when GDB sends us an asynchronous interrupt
    (user hitting Control-C in the client), and to wait for the child to exit
@@ -220,44 +222,39 @@ handle_general_set (char *own_buf)
 static const char *
 get_features_xml (const char *annex)
 {
-  static int features_supported = -1;
-  static char *document;
-
-#ifdef USE_XML
-  extern const char *const xml_builtin[][2];
-  int i;
-
-  /* Look for the annex.  */
-  for (i = 0; xml_builtin[i][0] != NULL; i++)
-    if (strcmp (annex, xml_builtin[i][0]) == 0)
-      break;
-
-  if (xml_builtin[i][0] != NULL)
-    return xml_builtin[i][1];
-#endif
+  /* gdbserver_xmltarget defines what to return when looking
+     for the "target.xml" file.  Its contents can either be
+     verbatim XML code (prefixed with a '@') or else the name
+     of the actual XML file to be used in place of "target.xml".
 
-  if (strcmp (annex, "target.xml") != 0)
-    return NULL;
+     This variable is set up from the auto-generated
+     init_registers_... routine for the current target.  */
 
-  if (features_supported == -1)
+  if (gdbserver_xmltarget
+      && strcmp (annex, "target.xml") != 0)
     {
-      const char *arch = NULL;
-      if (the_target->arch_string != NULL)
-       arch = (*the_target->arch_string) ();
-
-      if (arch == NULL)
-       features_supported = 0;
+      if (*gdbserver_xmltarget == '@')
+       return gdbserver_xmltarget + 1;
       else
-       {
-         features_supported = 1;
-         document = malloc (64 + strlen (arch));
-         snprintf (document, 64 + strlen (arch),
-                   "<target><architecture>%s</architecture></target>",
-                   arch);
-       }
+       annex = gdbserver_xmltarget;
     }
 
-  return document;
+#ifdef USE_XML
+  {
+    extern const char *const xml_builtin[][2];
+    int i;
+
+    /* Look for the annex.  */
+    for (i = 0; xml_builtin[i][0] != NULL; i++)
+      if (strcmp (annex, xml_builtin[i][0]) == 0)
+       break;
+
+    if (xml_builtin[i][0] != NULL)
+      return xml_builtin[i][1];
+  }
+#endif
+
+  return NULL;
 }
 
 void
index f054fe714f70e9dabc731fe247fdc24ef06bedc6..b195aba5159aef74a30e4406d0ad9882316e9fe7 100644 (file)
@@ -563,12 +563,6 @@ spu_request_interrupt (void)
   syscall (SYS_tkill, current_tid, SIGINT);
 }
 
-static const char *
-spu_arch_string (void)
-{
-  return "spu";
-}
-
 static struct target_ops spu_target_ops = {
   spu_create_inferior,
   spu_attach,
@@ -591,7 +585,6 @@ static struct target_ops spu_target_ops = {
   NULL,
   NULL,
   NULL,
-  spu_arch_string,
   spu_proc_xfer_spu,
   hostio_last_error_from_errno,
 };
index 8bb7a07b3d7ded469ad32e2f239e2e4930e31a3b..9f3b89969dc4fd0a39aa8e5c7ae30233875b0513 100644 (file)
@@ -181,10 +181,6 @@ struct target_ops
   int (*get_tls_address) (struct thread_info *thread, CORE_ADDR offset,
                          CORE_ADDR load_module, CORE_ADDR *address);
 
-  /* Return a string identifying the current architecture, or NULL if
-     this operation is not supported.  */
-  const char *(*arch_string) (void);
-
    /* Read/Write from/to spufs using qXfer packets.  */
   int (*qxfer_spu) (const char *annex, unsigned char *readbuf,
                    unsigned const char *writebuf, CORE_ADDR offset, int len);
index fb64ec411da14121288490ea65f3227a7322f386..f10f7e0d8df870f089aa013f35a4a0d29466c780 100644 (file)
@@ -122,5 +122,4 @@ struct win32_target_ops the_low_target = {
   NULL, /* single_step */
   (const unsigned char *) &arm_wince_breakpoint,
   arm_wince_breakpoint_len,
-  "arm" /* arch_string */
 };
index c21e884173d5976c0776f385ba36699592083d58..18c60eab993a90d82e0cd05d93c3477fcd97f4b5 100644 (file)
@@ -205,5 +205,4 @@ struct win32_target_ops the_low_target = {
   i386_single_step,
   NULL, /* breakpoint */
   0, /* breakpoint_len */
-  "i386" /* arch_string */
 };
index 355a29e2d9dac5dae4ac5ea7d048fe24409be3cb..acc6341c71f5be2450ec7dcafae166cf4eede124 100644 (file)
@@ -1636,12 +1636,6 @@ win32_request_interrupt (void)
   soft_interrupt_requested = 1;
 }
 
-static const char *
-win32_arch_string (void)
-{
-  return the_low_target.arch_string;
-}
-
 #ifdef _WIN32_WCE
 int
 win32_error_to_fileio_error (DWORD err)
@@ -1723,7 +1717,6 @@ static struct target_ops win32_target_ops = {
   NULL,
   NULL,
   NULL,
-  win32_arch_string,
   NULL,
 #ifdef _WIN32_WCE
   wince_hostio_last_error,
index 21c91b5240dc212442903682fff4c441fe7af847..f56bb8ff4517efd480f3452e2483745c5c0e3f46 100644 (file)
@@ -70,10 +70,6 @@ struct win32_target_ops
 
   const unsigned char *breakpoint;
   int breakpoint_len;
-
-  /* What string to report to GDB when it asks for the architecture,
-     or NULL not to answer.  */
-  const char *arch_string;
 };
 
 extern struct win32_target_ops the_low_target;
index 17bfec26c13d9136dab04e3c7188e2ce6e030e51..f4eba4d26c77db40db8ee2c9c4c3e34a8da31270 100644 (file)
@@ -1,5 +1,6 @@
 # DO NOT EDIT: generated from arm-with-iwmmxt.xml
 name:arm_with_iwmmxt
+xmltarget:arm-with-iwmmxt.xml
 expedite:r11,sp,pc
 32:r0
 32:r1
index 38c47d421ab42ba297fca3cf1ed7f44dee8edfae..5371f5e45c61d4c5e72ced7e4078b2847d46a3fd 100644 (file)
@@ -1,5 +1,6 @@
 # DO NOT EDIT: generated from mips-linux.xml
 name:mips_linux
+xmltarget:mips-linux.xml
 expedite:r29,pc
 32:r0
 32:r1
index 00494576a7e159a1e61a9aa62676d19b733cacc7..9364def6715bdd64f9926babbdaa8292ed64235c 100644 (file)
@@ -1,5 +1,6 @@
 # DO NOT EDIT: generated from mips64-linux.xml
 name:mips64_linux
+xmltarget:mips64-linux.xml
 expedite:r29,pc
 64:r0
 64:r1
index 5a600258239325204cc46db56d42ff23bf68e9e4..7d995fbecaf428807a685cbdd66e464f3f869638 100644 (file)
@@ -1,4 +1,5 @@
 name:arm
+xmlarch:arm
 expedite:r11,sp,pc
 32:r0
 32:r1
index 91baa8fc80bcdc4ebe378aa9d082b450c0001e24..8ea3d1167df8f2a460e1abd51ca03f439ab68f13 100644 (file)
@@ -1,4 +1,5 @@
 name:i386_linux
+xmlarch:i386
 expedite:ebp,esp,eip
 32:eax
 32:ecx
index 69c2d90f1fdbbd1d8b9da8c820316e3c7355a039..6e3097143e131011e9c28879b7d0bdf5a3c77245 100644 (file)
@@ -1,4 +1,5 @@
 name:i386
+xmlarch:i386
 expedite:ebp,esp,eip
 32:eax
 32:ecx
index 16c18f18545589635aec375ed876043a337476c3..fb69119cc614d5ea3cddc8902e05cbedb1fadb21 100644 (file)
@@ -1,4 +1,5 @@
 name:spu
+xmlarch:spu
 expedite:r0,r1,npc
 128:r0
 128:r1
index 47d324a986f7477a688171d6dd23dad1a829235d..656f72aba671b0997ac61e5fa8b2e18e094bf640 100644 (file)
@@ -1,4 +1,5 @@
 name:x86_64_linux
+xmlarch:i386:x86-64
 expedite:rbp,rsp,rip
 64:rax
 64:rbx
index c035f2bac5a3a779ca001715b959787c668b7ef0..3eb681801bb7ef11e743460432dbd32b628a8706 100755 (executable)
@@ -127,6 +127,7 @@ echo
 offset=0
 i=0
 name=x
+xmltarget=x
 expedite=x
 exec < $1
 while do_read
@@ -135,6 +136,12 @@ do
     name="${entry}"
     echo "struct reg regs_${name}[] = {"
     continue
+  elif test "${type}" = "xmltarget"; then
+    xmltarget="${entry}"
+    continue
+  elif test "${type}" = "xmlarch"; then
+    xmltarget="@<target><architecture>${entry}</architecture></target>"
+    continue
   elif test "${type}" = "expedite"; then
     expedite="${entry}"
     continue
@@ -151,6 +158,11 @@ done
 echo "};"
 echo
 echo "const char *expedite_regs_${name}[] = { \"`echo ${expedite} | sed 's/,/", "/g'`\", 0 };"
+if test "${xmltarget}" = x; then
+  echo "const char *xmltarget_${name} = 0;"
+else
+  echo "const char *xmltarget_${name} = \"${xmltarget}\";"
+fi
 echo
 
 cat <<EOF
@@ -160,6 +172,7 @@ init_registers_${name} ()
     set_register_cache (regs_${name},
                        sizeof (regs_${name}) / sizeof (regs_${name}[0]));
     gdbserver_expedite_regs = expedite_regs_${name};
+    gdbserver_xmltarget = xmltarget_${name};
 }
 EOF
 
index 80dd9f3e6106ccc01d9b441a6b5ab3cc5f78c687..3518b841061fb22c98488287bb79a6b2b8d70a78 100644 (file)
@@ -1,5 +1,6 @@
 # DO NOT EDIT: generated from rs6000/powerpc-32.xml
 name:powerpc_32
+xmltarget:rs6000/powerpc-32.xml
 expedite:r1,pc
 32:r0
 32:r1
index 00573d325f94cd4d26151cd556ec29a9b99fa4d9..ddd72ba86bc06fdbecde4efe49841889c2f99f86 100644 (file)
@@ -1,5 +1,6 @@
 # DO NOT EDIT: generated from rs6000/powerpc-64.xml
 name:powerpc_64
+xmltarget:rs6000/powerpc-64.xml
 expedite:r1,pc
 64:r0
 64:r1
index 5d33c59337e18d4109ba55f6c822095edaaf85ac..d6091463169b9207c908ca802a725bfd39c38237 100644 (file)
@@ -1,5 +1,6 @@
 # DO NOT EDIT: generated from rs6000/powerpc-e500.xml
 name:powerpc_e500
+xmltarget:rs6000/powerpc-e500.xml
 expedite:r1,pc
 32:r0
 32:r1