aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog34
-rw-r--r--gdb/gdbserver/Makefile.in9
-rwxr-xr-xgdb/gdbserver/configure111
-rw-r--r--gdb/gdbserver/configure.ac45
-rw-r--r--gdb/gdbserver/configure.srv69
-rw-r--r--gdb/gdbserver/linux-i386-low.c1
-rw-r--r--gdb/gdbserver/linux-low.c7
-rw-r--r--gdb/gdbserver/linux-low.h4
-rw-r--r--gdb/gdbserver/linux-x86-64-low.c1
-rw-r--r--gdb/gdbserver/regcache.h3
-rw-r--r--gdb/gdbserver/server.c61
-rw-r--r--gdb/gdbserver/spu-low.c7
-rw-r--r--gdb/gdbserver/target.h4
-rw-r--r--gdb/gdbserver/win32-arm-low.c1
-rw-r--r--gdb/gdbserver/win32-i386-low.c1
-rw-r--r--gdb/gdbserver/win32-low.c7
-rw-r--r--gdb/gdbserver/win32-low.h4
17 files changed, 102 insertions, 267 deletions
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;