This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] [AArch64] Remove all traces of aarch64-without-fpu.xml. (was: Re: 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>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Tue, 28 May 2013 13:05:22 +0100
- Subject: [PATCH] [AArch64] Remove all traces of aarch64-without-fpu.xml. (was: Re: use of aarch64-without-fpu.xml in gdbserver?)
- References: <51A3C7E4 dot 9000005 at redhat dot com> <51A46E37 dot 9050505 at arm dot com>
On 05/28/2013 09:43 AM, Marcus Shawcroft wrote:
>> 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...
>>
I was a bit wrong here. What this is doing is, if the target
doesn't send a target description at all, then GDB assumes
a register set that includes an FPU. But it still supports
an explicit target description that doesn't include an FPU.
>
> .. this code is also unused.
>
> I suggest that until alternative PCS and platform ABI's require otherwise we remove all of the currently unused "without-fpu" fpu code throughout gdb.
Alright. Like this then?
---------
Subject: [PATCH] [AArch64] Remove all traces of aarch64-without-fpu.xml.
The aarch64-without-fpu description is unused.
Linux requires an FPU, so the AArch64 native port always returns the
with-fpu variant:
static const struct target_desc *
aarch64_linux_read_description (struct target_ops *ops)
{
initialize_tdesc_aarch64 ();
return tdesc_aarch64;
}
When the target doesn't report a target description at all, we
fallback to a register set with an FPU:
aarch64_gdbarch_init ()
...
if (!tdesc_has_registers (tdesc))
tdesc = tdesc_aarch64;
This just removes the dead description.
Tested by building on x86_64 Fedora 17 with --enable=targets=all.
gdb/
2013-05-28 Pedro Alves <palves@redhat.com>
* aarch64-tdep.c: Don't include "features/aarch64-without-fpu.c".
(_initialize_aarch64_tdep): Don't call
initialize_tdesc_aarch64_without_fpu.
* features/Makefile (WHICH): Remove reference to
aarch64-without-fpu.
* features/aarch64-without-fpu.c: Delete file.
* regformats/aarch64-without-fpu.dat: Delete file.
---
gdb/aarch64-tdep.c | 2 --
gdb/features/Makefile | 2 +-
gdb/features/aarch64-without-fpu.c | 54 ----------------------------------
gdb/features/aarch64-without-fpu.xml | 13 --------
gdb/regformats/aarch64-without-fpu.dat | 38 ------------------------
5 files changed, 1 insertion(+), 108 deletions(-)
delete mode 100644 gdb/features/aarch64-without-fpu.c
delete mode 100644 gdb/features/aarch64-without-fpu.xml
delete mode 100644 gdb/regformats/aarch64-without-fpu.dat
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 8c38ef3..2d74429 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -53,7 +53,6 @@
#include "vec.h"
#include "features/aarch64.c"
-#include "features/aarch64-without-fpu.c"
/* Pseudo register base numbers. */
#define AARCH64_Q0_REGNUM 0
@@ -2718,7 +2717,6 @@ _initialize_aarch64_tdep (void)
aarch64_dump_tdep);
initialize_tdesc_aarch64 ();
- initialize_tdesc_aarch64_without_fpu ();
/* Debug this file's internals. */
add_setshow_boolean_cmd ("aarch64", class_maintenance, &aarch64_debug, _("\
diff --git a/gdb/features/Makefile b/gdb/features/Makefile
index e3a07e7..aee57d2 100644
--- a/gdb/features/Makefile
+++ b/gdb/features/Makefile
@@ -30,7 +30,7 @@
# in the GDB repository. To generate C files:
# make GDB=/path/to/gdb XMLTOC="xml files" cfiles
-WHICH = aarch64 aarch64-without-fpu \
+WHICH = aarch64 \
arm-with-iwmmxt arm-with-vfpv2 arm-with-vfpv3 arm-with-neon \
arm-with-m arm-with-m-fpa-layout arm-with-m-vfp-d16 \
i386/i386 i386/i386-linux \
diff --git a/gdb/features/aarch64-without-fpu.c b/gdb/features/aarch64-without-fpu.c
deleted file mode 100644
index dd1b029..0000000
--- a/gdb/features/aarch64-without-fpu.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro:
- Original: aarch64-without-fpu.xml */
-
-#include "defs.h"
-#include "osabi.h"
-#include "target-descriptions.h"
-
-struct target_desc *tdesc_aarch64_without_fpu;
-static void
-initialize_tdesc_aarch64_without_fpu (void)
-{
- struct target_desc *result = allocate_target_description ();
- struct tdesc_feature *feature;
-
- set_tdesc_architecture (result, bfd_scan_arch ("aarch64"));
-
- feature = tdesc_create_feature (result, "org.gnu.gdb.aarch64.core");
- tdesc_create_reg (feature, "x0", 0, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x1", 1, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x2", 2, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x3", 3, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x4", 4, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x5", 5, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x6", 6, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x7", 7, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x8", 8, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x9", 9, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x10", 10, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x11", 11, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x12", 12, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x13", 13, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x14", 14, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x15", 15, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x16", 16, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x17", 17, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x18", 18, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x19", 19, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x20", 20, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x21", 21, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x22", 22, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x23", 23, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x24", 24, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x25", 25, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x26", 26, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x27", 27, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x28", 28, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x29", 29, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "x30", 30, 1, NULL, 64, "int");
- tdesc_create_reg (feature, "sp", 31, 1, NULL, 64, "data_ptr");
- tdesc_create_reg (feature, "pc", 32, 1, NULL, 64, "code_ptr");
- tdesc_create_reg (feature, "cpsr", 33, 1, NULL, 32, "int");
-
- tdesc_aarch64_without_fpu = result;
-}
diff --git a/gdb/features/aarch64-without-fpu.xml b/gdb/features/aarch64-without-fpu.xml
deleted file mode 100644
index 33b9145..0000000
--- a/gdb/features/aarch64-without-fpu.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0"?>
-<!-- Copyright (C) 2009-2013 Free Software Foundation, Inc.
- Contributed by ARM Ltd.
-
- Copying and distribution of this file, with or without modification,
- are permitted in any medium without royalty provided the copyright
- notice and this notice are preserved. -->
-
-<!DOCTYPE target SYSTEM "gdb-target.dtd">
-<target>
- <architecture>aarch64</architecture>
- <xi:include href="aarch64-core.xml"/>
-</target>
diff --git a/gdb/regformats/aarch64-without-fpu.dat b/gdb/regformats/aarch64-without-fpu.dat
deleted file mode 100644
index a38ed58..0000000
--- a/gdb/regformats/aarch64-without-fpu.dat
+++ /dev/null
@@ -1,38 +0,0 @@
-# DO NOT EDIT: generated from aarch64-without-fpu.xml
-name:aarch64_without_fpu
-xmltarget:aarch64-without-fpu.xml
-expedite:x29,sp,pc
-64:x0
-64:x1
-64:x2
-64:x3
-64:x4
-64:x5
-64:x6
-64:x7
-64:x8
-64:x9
-64:x10
-64:x11
-64:x12
-64:x13
-64:x14
-64:x15
-64:x16
-64:x17
-64:x18
-64:x19
-64:x20
-64:x21
-64:x22
-64:x23
-64:x24
-64:x25
-64:x26
-64:x27
-64:x28
-64:x29
-64:x30
-64:sp
-64:pc
-32:cpsr
--
1.7.11.7