* 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.
+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
$(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 - | \
+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
# 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@
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
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
$(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.
# 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.
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
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
tmp_xmlfiles=$srv_xmlfiles
- srv_xmlfiles="target.xml"
+ srv_xmlfiles=""
for f in $tmp_xmlfiles; do
srv_xmlfiles="$srv_xmlfiles \$(XML_DIR)/$f"
done
-
ac_config_files="$ac_config_files Makefile"
ac_config_commands="$ac_config_commands default"
cat >confcache <<\_ACEOF
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
#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
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
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
# 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:
# 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"
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"
NULL,
NULL,
NULL,
- "i386"
};
}
#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,
#else
NULL,
#endif
- linux_arch_string,
NULL,
hostio_last_error_from_errno,
};
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;
NULL,
NULL,
NULL,
- "i386:x86-64",
};
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);
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
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
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,
NULL,
NULL,
NULL,
- spu_arch_string,
spu_proc_xfer_spu,
hostio_last_error_from_errno,
};
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);
NULL, /* single_step */
(const unsigned char *) &arm_wince_breakpoint,
arm_wince_breakpoint_len,
- "arm" /* arch_string */
};
i386_single_step,
NULL, /* breakpoint */
0, /* breakpoint_len */
- "i386" /* arch_string */
};
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)
NULL,
NULL,
NULL,
- win32_arch_string,
NULL,
#ifdef _WIN32_WCE
wince_hostio_last_error,
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;
# 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
# DO NOT EDIT: generated from mips-linux.xml
name:mips_linux
+xmltarget:mips-linux.xml
expedite:r29,pc
32:r0
32:r1
# DO NOT EDIT: generated from mips64-linux.xml
name:mips64_linux
+xmltarget:mips64-linux.xml
expedite:r29,pc
64:r0
64:r1
name:arm
+xmlarch:arm
expedite:r11,sp,pc
32:r0
32:r1
name:i386_linux
+xmlarch:i386
expedite:ebp,esp,eip
32:eax
32:ecx
name:i386
+xmlarch:i386
expedite:ebp,esp,eip
32:eax
32:ecx
name:spu
+xmlarch:spu
expedite:r0,r1,npc
128:r0
128:r1
name:x86_64_linux
+xmlarch:i386:x86-64
expedite:rbp,rsp,rip
64:rax
64:rbx
offset=0
i=0
name=x
+xmltarget=x
expedite=x
exec < $1
while do_read
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
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
set_register_cache (regs_${name},
sizeof (regs_${name}) / sizeof (regs_${name}[0]));
gdbserver_expedite_regs = expedite_regs_${name};
+ gdbserver_xmltarget = xmltarget_${name};
}
EOF
# DO NOT EDIT: generated from rs6000/powerpc-32.xml
name:powerpc_32
+xmltarget:rs6000/powerpc-32.xml
expedite:r1,pc
32:r0
32:r1
# DO NOT EDIT: generated from rs6000/powerpc-64.xml
name:powerpc_64
+xmltarget:rs6000/powerpc-64.xml
expedite:r1,pc
64:r0
64:r1
# DO NOT EDIT: generated from rs6000/powerpc-e500.xml
name:powerpc_e500
+xmltarget:rs6000/powerpc-e500.xml
expedite:r1,pc
32:r0
32:r1