This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
use of aarch64-without-fpu.xml in gdbserver?
- From: Pedro Alves <palves at redhat dot com>
- To: Marcus Shawcroft <marcus dot shawcroft at arm dot com>, GDB Patches <gdb-patches at sourceware dot org>
- Date: Mon, 27 May 2013 21:53:56 +0100
- Subject: use of aarch64-without-fpu.xml in gdbserver?
Hi!
While doing some across-all-targets conversions, I noticed
that the GDBserver Aarch64 port includes the aarch64-without-fpu
description in the build, but, it doesn't appear to use it anywhere.
configure.srv:
case "${target}" in
aarch64*-*-linux*)
srv_regobj="aarch64.o aarch64-without-fpu.o"
...
srv_xmlfiles="aarch64.xml"
...
srv_xmlfiles="${srv_xmlfiles} aarch64-without-fpu.xml"
Makefile.in:
aarch64-without-fpu.c : $(srcdir)/../regformats/aarch64-without-fpu.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/aarch64-without-fpu.dat aarch64-without-fpu.c
Then linux-aarch64-low.c declares the without_fpu function:
/* Defined in auto-generated files. */
void init_registers_aarch64 (void);
/* Defined in auto-generated files. */
void init_registers_aarch64_without_fpu (void);
But doesn't use it anywhere:
static void
aarch64_arch_setup (void)
{
int pid;
struct iovec iov;
struct user_hwdebug_state dreg_state;
init_registers_aarch64 ();
...
gdb/aarch64-linux-nat.c, the equivalent bit for native
debugging, also doesn't ever return the without_fpu description:
static const struct target_desc *
aarch64_linux_read_description (struct target_ops *ops)
{
initialize_tdesc_aarch64 ();
return tdesc_aarch64;
}
Does this mean that Linux always requires an fpu?
Or that there won't be ever really be silicon without an
fpu, perhaps?
Any reason something like this shouldn't be applied?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 715b631..3c48b39 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -316,7 +316,7 @@ clean:
rm -f version.c
rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
rm -f $(IPA_LIB)
- rm -f aarch64.c aarch64-without-fpu.c
+ rm -f aarch64.c
rm -f reg-arm.c reg-bfin.c i386.c reg-ia64.c reg-m32r.c reg-m68k.c
rm -f reg-sh.c reg-sparc.c reg-spu.c amd64.c i386-linux.c
rm -f reg-cris.c reg-crisv32.c amd64-linux.c reg-xtensa.c
@@ -573,8 +573,6 @@ win32_low_h = $(srcdir)/win32-low.h
aarch64.c : $(srcdir)/../regformats/aarch64.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/aarch64.dat aarch64.c
-aarch64-without-fpu.c : $(srcdir)/../regformats/aarch64-without-fpu.dat $(regdat_sh)
- $(SHELL) $(regdat_sh) $(srcdir)/../regformats/aarch64-without-fpu.dat aarch64-without-fpu.c
reg-arm.c : $(srcdir)/../regformats/reg-arm.dat $(regdat_sh)
$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-arm.dat reg-arm.c
arm-with-iwmmxt.c : $(srcdir)/../regformats/arm-with-iwmmxt.dat $(regdat_sh)
diff --git a/gdb/gdbserver/configure.srv b/gdb/gdbserver/configure.srv
index 9344b17..879d0de 100644
--- a/gdb/gdbserver/configure.srv
+++ b/gdb/gdbserver/configure.srv
@@ -43,7 +43,7 @@ srv_amd64_linux_xmlfiles="i386/amd64-linux.xml i386/amd64-avx-linux.xml i386/64b
case "${target}" in
aarch64*-*-linux*)
- srv_regobj="aarch64.o aarch64-without-fpu.o"
+ srv_regobj="aarch64.o"
srv_tgtobj="linux-aarch64-low.o"
srv_tgtobj="${srv_tgtobj} linux-low.o"
srv_tgtobj="${srv_tgtobj} linux-osdata.o"
@@ -52,7 +52,6 @@ case "${target}" in
srv_xmlfiles="aarch64.xml"
srv_xmlfiles="${srv_xmlfiles} aarch64-core.xml"
srv_xmlfiles="${srv_xmlfiles} aarch64-fpu.xml"
- srv_xmlfiles="${srv_xmlfiles} aarch64-without-fpu.xml"
srv_linux_usrregs=yes
srv_linux_regsets=yes
srv_linux_thread_db=yes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Actually, on the GDB side, nothing seems to use the without_fpu
description either, not even for supporting bare metal:
$ grep aarch64-without-fpu *.c
aarch64-tdep.c:#include "features/aarch64-without-fpu.c"
$ grep aarch64_without_fpu *
aarch64-tdep.c: initialize_tdesc_aarch64_without_fpu ();
aarch64-tdep.c:aarch64_gdbarch_init defaults to _with_ fpu:
/* Ensure we always have a target descriptor. */
if (!tdesc_has_registers (tdesc))
tdesc = tdesc_aarch64;
Though it checks for the existence of the .fpu feature:
/* Look for the V registers. */
feature = tdesc_find_feature (tdesc, "org.gnu.gdb.aarch64.fpu");
if (feature)
{
...
}
If the target stub's reported target description doesn't
include the .fpu feature, this returns tdesc_aarch64 anyway...
--
Pedro Alves