diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2008-02-28 05:54:10 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2008-02-28 05:54:10 +0000 |
commit | 9b4b61c8db8afdbf6b08761fc73e766ed9fcfaff (patch) | |
tree | 4a767e059e5054d9e5e09f60e0acc4486c40cd89 | |
parent | 919ed24cbc56717156ee86a754281cc08919d2ba (diff) | |
download | gdb-9b4b61c8db8afdbf6b08761fc73e766ed9fcfaff.zip gdb-9b4b61c8db8afdbf6b08761fc73e766ed9fcfaff.tar.gz gdb-9b4b61c8db8afdbf6b08761fc73e766ed9fcfaff.tar.bz2 |
ChangeLog:
* 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, 147 insertions, 267 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f5afe11..63ca325 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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 diff --git a/gdb/features/Makefile b/gdb/features/Makefile index e795dfe..0b7dd9c 100644 --- a/gdb/features/Makefile +++ b/gdb/features/Makefile @@ -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 - | \ diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index d8e5c7f..9e732f8 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -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 diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 2c7cb75..daf73d6 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -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. diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index 5dad21c..58a0885 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -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 diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index 979c925..33131ad 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -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 diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv index b529c02..9f9bbbf 100644 --- a/gdb/gdbserver/configure.srv +++ b/gdb/gdbserver/configure.srv @@ -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" diff --git a/gdb/gdbserver/linux-i386-low.c b/gdb/gdbserver/linux-i386-low.c index c3cccb6..46138ec 100644 --- a/gdb/gdbserver/linux-i386-low.c +++ b/gdb/gdbserver/linux-i386-low.c @@ -207,5 +207,4 @@ struct linux_target_ops the_low_target = { NULL, NULL, NULL, - "i386" }; diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 1d2b422..da638f5 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -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, }; diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h index ccbeb25..78734e7 100644 --- a/gdb/gdbserver/linux-low.h +++ b/gdb/gdbserver/linux-low.h @@ -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; diff --git a/gdb/gdbserver/linux-x86-64-low.c b/gdb/gdbserver/linux-x86-64-low.c index b4a2f6b..7f15ac0 100644 --- a/gdb/gdbserver/linux-x86-64-low.c +++ b/gdb/gdbserver/linux-x86-64-low.c @@ -181,5 +181,4 @@ struct linux_target_ops the_low_target = { NULL, NULL, NULL, - "i386:x86-64", }; diff --git a/gdb/gdbserver/regcache.h b/gdb/gdbserver/regcache.h index c9c54bd..641f928 100644 --- a/gdb/gdbserver/regcache.h +++ b/gdb/gdbserver/regcache.h @@ -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); diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 31f8a6c..7806bd6 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -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 diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c index f054fe7..b195aba 100644 --- a/gdb/gdbserver/spu-low.c +++ b/gdb/gdbserver/spu-low.c @@ -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, }; diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h index 8bb7a07..9f3b899 100644 --- a/gdb/gdbserver/target.h +++ b/gdb/gdbserver/target.h @@ -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); diff --git a/gdb/gdbserver/win32-arm-low.c b/gdb/gdbserver/win32-arm-low.c index fb64ec4..f10f7e0 100644 --- a/gdb/gdbserver/win32-arm-low.c +++ b/gdb/gdbserver/win32-arm-low.c @@ -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 */ }; diff --git a/gdb/gdbserver/win32-i386-low.c b/gdb/gdbserver/win32-i386-low.c index c21e884..18c60ea 100644 --- a/gdb/gdbserver/win32-i386-low.c +++ b/gdb/gdbserver/win32-i386-low.c @@ -205,5 +205,4 @@ struct win32_target_ops the_low_target = { i386_single_step, NULL, /* breakpoint */ 0, /* breakpoint_len */ - "i386" /* arch_string */ }; diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c index 355a29e..acc6341 100644 --- a/gdb/gdbserver/win32-low.c +++ b/gdb/gdbserver/win32-low.c @@ -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, diff --git a/gdb/gdbserver/win32-low.h b/gdb/gdbserver/win32-low.h index 21c91b5..f56bb8f 100644 --- a/gdb/gdbserver/win32-low.h +++ b/gdb/gdbserver/win32-low.h @@ -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; diff --git a/gdb/regformats/arm-with-iwmmxt.dat b/gdb/regformats/arm-with-iwmmxt.dat index 17bfec2..f4eba4d 100644 --- a/gdb/regformats/arm-with-iwmmxt.dat +++ b/gdb/regformats/arm-with-iwmmxt.dat @@ -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 diff --git a/gdb/regformats/mips-linux.dat b/gdb/regformats/mips-linux.dat index 38c47d4..5371f5e 100644 --- a/gdb/regformats/mips-linux.dat +++ b/gdb/regformats/mips-linux.dat @@ -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 diff --git a/gdb/regformats/mips64-linux.dat b/gdb/regformats/mips64-linux.dat index 0049457..9364def 100644 --- a/gdb/regformats/mips64-linux.dat +++ b/gdb/regformats/mips64-linux.dat @@ -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 diff --git a/gdb/regformats/reg-arm.dat b/gdb/regformats/reg-arm.dat index 5a60025..7d995fb 100644 --- a/gdb/regformats/reg-arm.dat +++ b/gdb/regformats/reg-arm.dat @@ -1,4 +1,5 @@ name:arm +xmlarch:arm expedite:r11,sp,pc 32:r0 32:r1 diff --git a/gdb/regformats/reg-i386-linux.dat b/gdb/regformats/reg-i386-linux.dat index 91baa8f..8ea3d11 100644 --- a/gdb/regformats/reg-i386-linux.dat +++ b/gdb/regformats/reg-i386-linux.dat @@ -1,4 +1,5 @@ name:i386_linux +xmlarch:i386 expedite:ebp,esp,eip 32:eax 32:ecx diff --git a/gdb/regformats/reg-i386.dat b/gdb/regformats/reg-i386.dat index 69c2d90..6e30971 100644 --- a/gdb/regformats/reg-i386.dat +++ b/gdb/regformats/reg-i386.dat @@ -1,4 +1,5 @@ name:i386 +xmlarch:i386 expedite:ebp,esp,eip 32:eax 32:ecx diff --git a/gdb/regformats/reg-spu.dat b/gdb/regformats/reg-spu.dat index 16c18f1..fb69119 100644 --- a/gdb/regformats/reg-spu.dat +++ b/gdb/regformats/reg-spu.dat @@ -1,4 +1,5 @@ name:spu +xmlarch:spu expedite:r0,r1,npc 128:r0 128:r1 diff --git a/gdb/regformats/reg-x86-64-linux.dat b/gdb/regformats/reg-x86-64-linux.dat index 47d324a..656f72a 100644 --- a/gdb/regformats/reg-x86-64-linux.dat +++ b/gdb/regformats/reg-x86-64-linux.dat @@ -1,4 +1,5 @@ name:x86_64_linux +xmlarch:i386:x86-64 expedite:rbp,rsp,rip 64:rax 64:rbx diff --git a/gdb/regformats/regdat.sh b/gdb/regformats/regdat.sh index c035f2b..3eb6818 100755 --- a/gdb/regformats/regdat.sh +++ b/gdb/regformats/regdat.sh @@ -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 diff --git a/gdb/regformats/rs6000/powerpc-32.dat b/gdb/regformats/rs6000/powerpc-32.dat index 80dd9f3..3518b84 100644 --- a/gdb/regformats/rs6000/powerpc-32.dat +++ b/gdb/regformats/rs6000/powerpc-32.dat @@ -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 diff --git a/gdb/regformats/rs6000/powerpc-64.dat b/gdb/regformats/rs6000/powerpc-64.dat index 00573d3..ddd72ba 100644 --- a/gdb/regformats/rs6000/powerpc-64.dat +++ b/gdb/regformats/rs6000/powerpc-64.dat @@ -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 diff --git a/gdb/regformats/rs6000/powerpc-e500.dat b/gdb/regformats/rs6000/powerpc-e500.dat index 5d33c59..d609146 100644 --- a/gdb/regformats/rs6000/powerpc-e500.dat +++ b/gdb/regformats/rs6000/powerpc-e500.dat @@ -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 |